From 54c4af6fc6fc9167dec51b0560e89cd2207aa15b Mon Sep 17 00:00:00 2001 From: Michael Landin Date: Wed, 6 Aug 2003 14:13:20 +0000 Subject: Add patch that enables portell to run correctly with Python 2.3 Approved by: roberto (mentor) Submitted by: marcus --- misc/portell/Makefile | 1 + misc/portell/files/patch-aa | 49 +++++++++++++++++++++++++++++++++++++++ ports-mgmt/portell/Makefile | 1 + ports-mgmt/portell/files/patch-aa | 49 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100644 misc/portell/files/patch-aa create mode 100644 ports-mgmt/portell/files/patch-aa diff --git a/misc/portell/Makefile b/misc/portell/Makefile index 93624fc1cba4..f736c6180e0c 100644 --- a/misc/portell/Makefile +++ b/misc/portell/Makefile @@ -16,6 +16,7 @@ DIST_SUBDIR= ${PORTNAME}-${PORTVERSION} MAINTAINER= mich@FreeBSD.org COMMENT= Quick display of FreeBSD port descriptions +PATCH_WRKSRC= ${WRKDIR} USE_PYTHON= YES USE_REINPLACE= YES diff --git a/misc/portell/files/patch-aa b/misc/portell/files/patch-aa new file mode 100644 index 000000000000..cb19eaa06143 --- /dev/null +++ b/misc/portell/files/patch-aa @@ -0,0 +1,49 @@ +--- portell.py.orig Mon Oct 22 07:18:32 2001 ++++ portell.py Mon Aug 4 16:34:27 2003 +@@ -11,8 +11,10 @@ + + try: + PORTELL_DB = os.environ['PORTELL_PATH'] ++ PORTELL_DB_FILE = PORTELL_DB + ".db" + except KeyError: +- PORTELL_DB = "/var/db/portell.db" ++ PORTELL_DB = "/var/db/portell" ++ PORTELL_DB_FILE = "/var/db/portell.db" + + PORTS_DIR = "/usr/ports/" + +@@ -23,13 +25,13 @@ + + + def update_db(): +- if os.access(PORTELL_DB, os.F_OK): +- os.unlink(PORTELL_DB) ++ if os.access(PORTELL_DB_FILE, os.F_OK): ++ os.unlink(PORTELL_DB_FILE) + try: +- d = shelve.open(PORTELL_DB) +- os.chmod(PORTELL_DB, 0666) ++ d = shelve.open(PORTELL_DB_FILE) ++ os.chmod(PORTELL_DB_FILE, 0666) + except: +- print "can't read or write %s. are you root?" % PORTELL_DB ++ print "can't read or write %s. are you root?" % PORTELL_DB_FILE + sys.exit(0) + os.path.walk(PORTS_DIR, write_pathname, d) + d.close() +@@ -46,12 +48,12 @@ + else: + portname = sys.argv[1] + +- if not os.access(PORTELL_DB, os.F_OK): +- print >> sys.stderr, "you need to create %s first." % PORTELL_DB ++ if not os.access(PORTELL_DB_FILE, os.F_OK): ++ print >> sys.stderr, "you need to create %s first." % PORTELL_DB_FILE + print >> sys.stderr, "type: %s -u" % sys.argv[0] + sys.exit(0) + +- d = shelve.open(PORTELL_DB) ++ d = shelve.open(PORTELL_DB_FILE) + + if d.has_key(portname): + descr_path = d[portname] + "/pkg-descr" diff --git a/ports-mgmt/portell/Makefile b/ports-mgmt/portell/Makefile index 93624fc1cba4..f736c6180e0c 100644 --- a/ports-mgmt/portell/Makefile +++ b/ports-mgmt/portell/Makefile @@ -16,6 +16,7 @@ DIST_SUBDIR= ${PORTNAME}-${PORTVERSION} MAINTAINER= mich@FreeBSD.org COMMENT= Quick display of FreeBSD port descriptions +PATCH_WRKSRC= ${WRKDIR} USE_PYTHON= YES USE_REINPLACE= YES diff --git a/ports-mgmt/portell/files/patch-aa b/ports-mgmt/portell/files/patch-aa new file mode 100644 index 000000000000..cb19eaa06143 --- /dev/null +++ b/ports-mgmt/portell/files/patch-aa @@ -0,0 +1,49 @@ +--- portell.py.orig Mon Oct 22 07:18:32 2001 ++++ portell.py Mon Aug 4 16:34:27 2003 +@@ -11,8 +11,10 @@ + + try: + PORTELL_DB = os.environ['PORTELL_PATH'] ++ PORTELL_DB_FILE = PORTELL_DB + ".db" + except KeyError: +- PORTELL_DB = "/var/db/portell.db" ++ PORTELL_DB = "/var/db/portell" ++ PORTELL_DB_FILE = "/var/db/portell.db" + + PORTS_DIR = "/usr/ports/" + +@@ -23,13 +25,13 @@ + + + def update_db(): +- if os.access(PORTELL_DB, os.F_OK): +- os.unlink(PORTELL_DB) ++ if os.access(PORTELL_DB_FILE, os.F_OK): ++ os.unlink(PORTELL_DB_FILE) + try: +- d = shelve.open(PORTELL_DB) +- os.chmod(PORTELL_DB, 0666) ++ d = shelve.open(PORTELL_DB_FILE) ++ os.chmod(PORTELL_DB_FILE, 0666) + except: +- print "can't read or write %s. are you root?" % PORTELL_DB ++ print "can't read or write %s. are you root?" % PORTELL_DB_FILE + sys.exit(0) + os.path.walk(PORTS_DIR, write_pathname, d) + d.close() +@@ -46,12 +48,12 @@ + else: + portname = sys.argv[1] + +- if not os.access(PORTELL_DB, os.F_OK): +- print >> sys.stderr, "you need to create %s first." % PORTELL_DB ++ if not os.access(PORTELL_DB_FILE, os.F_OK): ++ print >> sys.stderr, "you need to create %s first." % PORTELL_DB_FILE + print >> sys.stderr, "type: %s -u" % sys.argv[0] + sys.exit(0) + +- d = shelve.open(PORTELL_DB) ++ d = shelve.open(PORTELL_DB_FILE) + + if d.has_key(portname): + descr_path = d[portname] + "/pkg-descr" -- cgit