From a9c369d7ef766bfcbff9a7439f7f687258d85599 Mon Sep 17 00:00:00 2001
From: Michael Landin <mich@FreeBSD.org>
Date: Fri, 25 Jun 2004 13:11:30 +0000
Subject: Add patch with bugfixes. 	- Fix chmod behavior 	- Ignore
 irrelevant directories 	- Index creation speedup

Bump PORTREVISION.

Submitted by:		Radim Kolar <hsn@netmag.cz>
---
 misc/portell/Makefile             |  2 +-
 misc/portell/files/patch-ab       | 47 +++++++++++++++++++++++++++++++++++++++
 ports-mgmt/portell/Makefile       |  2 +-
 ports-mgmt/portell/files/patch-ab | 47 +++++++++++++++++++++++++++++++++++++++
 4 files changed, 96 insertions(+), 2 deletions(-)
 create mode 100644 misc/portell/files/patch-ab
 create mode 100644 ports-mgmt/portell/files/patch-ab

diff --git a/misc/portell/Makefile b/misc/portell/Makefile
index c334a6acfcfd..2731d01aa623 100644
--- a/misc/portell/Makefile
+++ b/misc/portell/Makefile
@@ -7,7 +7,7 @@
 
 PORTNAME=	portell
 PORTVERSION=	0.1
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	misc
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
diff --git a/misc/portell/files/patch-ab b/misc/portell/files/patch-ab
new file mode 100644
index 000000000000..47db5c2cf69d
--- /dev/null
+++ b/misc/portell/files/patch-ab
@@ -0,0 +1,47 @@
+--- portell.py.orig	Thu Jun 24 07:41:00 2004
++++ portell.py	Thu Jun 24 07:42:12 2004
+@@ -2,6 +2,7 @@
+ # portell.py
+ # Description: prints a port's descr-file from whatever directory you're in.
+ # Author: Ryan "gt3" Kulla
++# Bugfixes: Radim "HSN" Kolar
+ # Email: ambiod@sbcglobal.net
+ # Version: 0.1
+ # Usage: portell.py <portname>
+@@ -23,20 +24,31 @@
+ 	PORTELL_DB_FILE = "/var/db/portell.db"
+ 
+ PORTS_DIR = "/usr/ports/"
++IGNORE_DIRS = { "distfiles":None, "Tools":None, "packages":None }
+ 
+ def write_pathname(d, dirname, names):
+-	dirname = join(dirname.split('/')[:5], '/') # chop port path subdirs
+-	d[os.path.basename(dirname)] = dirname
++	dirs=dirname.split('/')
++	if len(dirs)==4:
++	    if IGNORE_DIRS.has_key(dirs[3]):
++		del names[:]
++	elif len(dirs)==5:
++	    d[dirs[4]] = dirname
++	    del names[:]
+ 
+ def update_db():
+-	if os.access(PORTELL_DB_FILE, os.F_OK):
+-		os.unlink(PORTELL_DB_FILE) 
++        try:
++		os.unlink(PORTELL_DB_FILE)
++	except:
++	        pass	
+ 	try:
+ 		d = shelve.open(PORTELL_DB)
+-		os.chmod(PORTELL_DB_FILE, 0666) 
+ 	except:
+ 		print "can't read or write %s. are you root?" % PORTELL_DB_FILE
+ 		sys.exit(0)
++	try:	
++		os.chmod(PORTELL_DB_FILE, 0666) 
++	except:
++	        pass	
+ 	os.path.walk(PORTS_DIR, write_pathname, d)
+ 	d.close()
+ 
diff --git a/ports-mgmt/portell/Makefile b/ports-mgmt/portell/Makefile
index c334a6acfcfd..2731d01aa623 100644
--- a/ports-mgmt/portell/Makefile
+++ b/ports-mgmt/portell/Makefile
@@ -7,7 +7,7 @@
 
 PORTNAME=	portell
 PORTVERSION=	0.1
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	misc
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	${PORTNAME}
diff --git a/ports-mgmt/portell/files/patch-ab b/ports-mgmt/portell/files/patch-ab
new file mode 100644
index 000000000000..47db5c2cf69d
--- /dev/null
+++ b/ports-mgmt/portell/files/patch-ab
@@ -0,0 +1,47 @@
+--- portell.py.orig	Thu Jun 24 07:41:00 2004
++++ portell.py	Thu Jun 24 07:42:12 2004
+@@ -2,6 +2,7 @@
+ # portell.py
+ # Description: prints a port's descr-file from whatever directory you're in.
+ # Author: Ryan "gt3" Kulla
++# Bugfixes: Radim "HSN" Kolar
+ # Email: ambiod@sbcglobal.net
+ # Version: 0.1
+ # Usage: portell.py <portname>
+@@ -23,20 +24,31 @@
+ 	PORTELL_DB_FILE = "/var/db/portell.db"
+ 
+ PORTS_DIR = "/usr/ports/"
++IGNORE_DIRS = { "distfiles":None, "Tools":None, "packages":None }
+ 
+ def write_pathname(d, dirname, names):
+-	dirname = join(dirname.split('/')[:5], '/') # chop port path subdirs
+-	d[os.path.basename(dirname)] = dirname
++	dirs=dirname.split('/')
++	if len(dirs)==4:
++	    if IGNORE_DIRS.has_key(dirs[3]):
++		del names[:]
++	elif len(dirs)==5:
++	    d[dirs[4]] = dirname
++	    del names[:]
+ 
+ def update_db():
+-	if os.access(PORTELL_DB_FILE, os.F_OK):
+-		os.unlink(PORTELL_DB_FILE) 
++        try:
++		os.unlink(PORTELL_DB_FILE)
++	except:
++	        pass	
+ 	try:
+ 		d = shelve.open(PORTELL_DB)
+-		os.chmod(PORTELL_DB_FILE, 0666) 
+ 	except:
+ 		print "can't read or write %s. are you root?" % PORTELL_DB_FILE
+ 		sys.exit(0)
++	try:	
++		os.chmod(PORTELL_DB_FILE, 0666) 
++	except:
++	        pass	
+ 	os.path.walk(PORTS_DIR, write_pathname, d)
+ 	d.close()
+ 
-- 
cgit debian/1.2.3+git2.25.1-1-2-gaceb0