o Update to -> 0.2
This commit is contained in:
parent
bfeeb2a543
commit
2996e017a2
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=133250
@ -6,7 +6,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= portell
|
||||
PORTVERSION= 0.1
|
||||
PORTVERSION= 0.2
|
||||
PORTREVISION= 4
|
||||
CATEGORIES= misc
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
@ -19,8 +19,11 @@ COMMENT= Quick display of FreeBSD port descriptions
|
||||
USE_ZIP= YES
|
||||
USE_PYTHON= YES
|
||||
USE_REINPLACE= YES
|
||||
NO_BUILD= YES
|
||||
|
||||
do-build:
|
||||
post-extract:
|
||||
${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//' ${WRKSRC}/portell.py
|
||||
${REINPLACE_CMD} -e 's/free/freebsd/' ${WRKSRC}/portell.py
|
||||
${REINPLACE_CMD} -e 's/portell.py/portell/' ${WRKSRC}/README.txt
|
||||
|
||||
do-install:
|
||||
|
@ -1,2 +1,2 @@
|
||||
MD5 (portell-0.1.zip) = 13121ee620ab27efb0f39267743e1887
|
||||
SIZE (portell-0.1.zip) = 1512
|
||||
MD5 (portell-0.2.zip) = 0473f21d5b1884b40cb2eab183c210ef
|
||||
SIZE (portell-0.2.zip) = 1780
|
||||
|
@ -1,151 +0,0 @@
|
||||
--- portell.py.orig Mon Aug 11 15:23:47 2003
|
||||
+++ portell.py Mon Aug 11 15:34:56 2003
|
||||
@@ -1,70 +1,78 @@
|
||||
-#! /usr/bin/env python
|
||||
-# portell.py
|
||||
-# Description: prints a port's descr-file from whatever directory you're in.
|
||||
-# Author: Ryan "gt3" Kulla
|
||||
-# Email: ambiod@sbcglobal.net
|
||||
-# Version: 0.1
|
||||
-# Usage: portell.py <portname>
|
||||
-
|
||||
-import sys, os, shelve
|
||||
-from string import join
|
||||
-
|
||||
-try:
|
||||
- PORTELL_DB = os.environ['PORTELL_PATH']
|
||||
-except KeyError:
|
||||
- PORTELL_DB = "/var/db/portell.db"
|
||||
-
|
||||
-PORTS_DIR = "/usr/ports/"
|
||||
-
|
||||
-def write_pathname(d, dirname, names):
|
||||
- dirname = join(dirname.split('/')[:5], '/') # chop port path subdirs
|
||||
- d[os.path.basename(dirname)] = dirname
|
||||
-
|
||||
-def update_db():
|
||||
- if os.access(PORTELL_DB, os.F_OK):
|
||||
- os.unlink(PORTELL_DB)
|
||||
- try:
|
||||
- d = shelve.open(PORTELL_DB)
|
||||
- os.chmod(PORTELL_DB, 0666)
|
||||
- except:
|
||||
- print "can't read or write %s. are you root?" % PORTELL_DB
|
||||
- sys.exit(0)
|
||||
- os.path.walk(PORTS_DIR, write_pathname, d)
|
||||
- d.close()
|
||||
-
|
||||
-def main():
|
||||
- if len(sys.argv) != 2:
|
||||
- print "usage: %s <portname>" % sys.argv[0]
|
||||
- sys.exit(0)
|
||||
-
|
||||
- if sys.argv[1] == '-u':
|
||||
- update_db()
|
||||
- sys.exit(0)
|
||||
- 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
|
||||
- print >> sys.stderr, "type: %s -u" % sys.argv[0]
|
||||
- sys.exit(0)
|
||||
-
|
||||
- d = shelve.open(PORTELL_DB)
|
||||
-
|
||||
- if d.has_key(portname):
|
||||
- descr_path = d[portname] + "/pkg-descr"
|
||||
- match = descr_path
|
||||
- try:
|
||||
- descr_file = open(match, 'r').readlines()
|
||||
- print "%s reads:\n" % descr_path
|
||||
- for line in descr_file:
|
||||
- print line,
|
||||
- except IOError, errmsg:
|
||||
- print errmsg
|
||||
- else:
|
||||
- print >> sys.stderr, "can't find %s" % portname
|
||||
-
|
||||
- d.close()
|
||||
-
|
||||
-
|
||||
-if __name__=='__main__':
|
||||
- main()
|
||||
+#! /usr/bin/env python
|
||||
+# portell.py
|
||||
+# Description: prints a port's descr-file from whatever directory you're in.
|
||||
+# Author: Ryan "gt3" Kulla
|
||||
+# Email: ambiod@sbcglobal.net
|
||||
+# Version: 0.1
|
||||
+# Usage: portell.py <portname>
|
||||
+
|
||||
+import sys, os, shelve
|
||||
+from string import join
|
||||
+
|
||||
+try:
|
||||
+ PORTELL_DB = os.environ['PORTELL_PATH']
|
||||
+ if sys.version[:3] == '2.2':
|
||||
+ PORTELL_DB = PORTELL_DB + ".db"
|
||||
+
|
||||
+ PORTELL_DB_FILE = PORTELL_DB + ".db"
|
||||
+except KeyError:
|
||||
+ if sys.version[:3] == '2.2':
|
||||
+ PORTELL_DB = "/var/db/portell.db"
|
||||
+ else:
|
||||
+ PORTELL_DB = "/var/db/portell"
|
||||
+ PORTELL_DB_FILE = "/var/db/portell.db"
|
||||
+
|
||||
+PORTS_DIR = "/usr/ports/"
|
||||
+
|
||||
+def write_pathname(d, dirname, names):
|
||||
+ dirname = join(dirname.split('/')[:5], '/') # chop port path subdirs
|
||||
+ d[os.path.basename(dirname)] = dirname
|
||||
+
|
||||
+def update_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_FILE, 0666)
|
||||
+ except:
|
||||
+ 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()
|
||||
+
|
||||
+def main():
|
||||
+ if len(sys.argv) != 2:
|
||||
+ print "usage: %s <portname>" % sys.argv[0]
|
||||
+ sys.exit(0)
|
||||
+
|
||||
+ if sys.argv[1] == '-u':
|
||||
+ update_db()
|
||||
+ sys.exit(0)
|
||||
+ else:
|
||||
+ portname = sys.argv[1]
|
||||
+
|
||||
+ 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)
|
||||
+
|
||||
+ if d.has_key(portname):
|
||||
+ descr_path = d[portname] + "/pkg-descr"
|
||||
+ match = descr_path
|
||||
+ try:
|
||||
+ descr_file = open(match, 'r').readlines()
|
||||
+ print "%s reads:\n" % descr_path
|
||||
+ for line in descr_file:
|
||||
+ print line,
|
||||
+ except IOError, errmsg:
|
||||
+ print errmsg
|
||||
+ else:
|
||||
+ print >> sys.stderr, "can't find %s" % portname
|
||||
+
|
||||
+ d.close()
|
||||
+
|
||||
+
|
||||
+if __name__=='__main__':
|
||||
+ main()
|
@ -1,47 +0,0 @@
|
||||
--- 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()
|
||||
|
@ -6,7 +6,7 @@
|
||||
#
|
||||
|
||||
PORTNAME= portell
|
||||
PORTVERSION= 0.1
|
||||
PORTVERSION= 0.2
|
||||
PORTREVISION= 4
|
||||
CATEGORIES= misc
|
||||
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
|
||||
@ -19,8 +19,11 @@ COMMENT= Quick display of FreeBSD port descriptions
|
||||
USE_ZIP= YES
|
||||
USE_PYTHON= YES
|
||||
USE_REINPLACE= YES
|
||||
NO_BUILD= YES
|
||||
|
||||
do-build:
|
||||
post-extract:
|
||||
${REINPLACE_CMD} -e 's/[[:cntrl:]]*$$//' ${WRKSRC}/portell.py
|
||||
${REINPLACE_CMD} -e 's/free/freebsd/' ${WRKSRC}/portell.py
|
||||
${REINPLACE_CMD} -e 's/portell.py/portell/' ${WRKSRC}/README.txt
|
||||
|
||||
do-install:
|
||||
|
@ -1,2 +1,2 @@
|
||||
MD5 (portell-0.1.zip) = 13121ee620ab27efb0f39267743e1887
|
||||
SIZE (portell-0.1.zip) = 1512
|
||||
MD5 (portell-0.2.zip) = 0473f21d5b1884b40cb2eab183c210ef
|
||||
SIZE (portell-0.2.zip) = 1780
|
||||
|
@ -1,151 +0,0 @@
|
||||
--- portell.py.orig Mon Aug 11 15:23:47 2003
|
||||
+++ portell.py Mon Aug 11 15:34:56 2003
|
||||
@@ -1,70 +1,78 @@
|
||||
-#! /usr/bin/env python
|
||||
-# portell.py
|
||||
-# Description: prints a port's descr-file from whatever directory you're in.
|
||||
-# Author: Ryan "gt3" Kulla
|
||||
-# Email: ambiod@sbcglobal.net
|
||||
-# Version: 0.1
|
||||
-# Usage: portell.py <portname>
|
||||
-
|
||||
-import sys, os, shelve
|
||||
-from string import join
|
||||
-
|
||||
-try:
|
||||
- PORTELL_DB = os.environ['PORTELL_PATH']
|
||||
-except KeyError:
|
||||
- PORTELL_DB = "/var/db/portell.db"
|
||||
-
|
||||
-PORTS_DIR = "/usr/ports/"
|
||||
-
|
||||
-def write_pathname(d, dirname, names):
|
||||
- dirname = join(dirname.split('/')[:5], '/') # chop port path subdirs
|
||||
- d[os.path.basename(dirname)] = dirname
|
||||
-
|
||||
-def update_db():
|
||||
- if os.access(PORTELL_DB, os.F_OK):
|
||||
- os.unlink(PORTELL_DB)
|
||||
- try:
|
||||
- d = shelve.open(PORTELL_DB)
|
||||
- os.chmod(PORTELL_DB, 0666)
|
||||
- except:
|
||||
- print "can't read or write %s. are you root?" % PORTELL_DB
|
||||
- sys.exit(0)
|
||||
- os.path.walk(PORTS_DIR, write_pathname, d)
|
||||
- d.close()
|
||||
-
|
||||
-def main():
|
||||
- if len(sys.argv) != 2:
|
||||
- print "usage: %s <portname>" % sys.argv[0]
|
||||
- sys.exit(0)
|
||||
-
|
||||
- if sys.argv[1] == '-u':
|
||||
- update_db()
|
||||
- sys.exit(0)
|
||||
- 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
|
||||
- print >> sys.stderr, "type: %s -u" % sys.argv[0]
|
||||
- sys.exit(0)
|
||||
-
|
||||
- d = shelve.open(PORTELL_DB)
|
||||
-
|
||||
- if d.has_key(portname):
|
||||
- descr_path = d[portname] + "/pkg-descr"
|
||||
- match = descr_path
|
||||
- try:
|
||||
- descr_file = open(match, 'r').readlines()
|
||||
- print "%s reads:\n" % descr_path
|
||||
- for line in descr_file:
|
||||
- print line,
|
||||
- except IOError, errmsg:
|
||||
- print errmsg
|
||||
- else:
|
||||
- print >> sys.stderr, "can't find %s" % portname
|
||||
-
|
||||
- d.close()
|
||||
-
|
||||
-
|
||||
-if __name__=='__main__':
|
||||
- main()
|
||||
+#! /usr/bin/env python
|
||||
+# portell.py
|
||||
+# Description: prints a port's descr-file from whatever directory you're in.
|
||||
+# Author: Ryan "gt3" Kulla
|
||||
+# Email: ambiod@sbcglobal.net
|
||||
+# Version: 0.1
|
||||
+# Usage: portell.py <portname>
|
||||
+
|
||||
+import sys, os, shelve
|
||||
+from string import join
|
||||
+
|
||||
+try:
|
||||
+ PORTELL_DB = os.environ['PORTELL_PATH']
|
||||
+ if sys.version[:3] == '2.2':
|
||||
+ PORTELL_DB = PORTELL_DB + ".db"
|
||||
+
|
||||
+ PORTELL_DB_FILE = PORTELL_DB + ".db"
|
||||
+except KeyError:
|
||||
+ if sys.version[:3] == '2.2':
|
||||
+ PORTELL_DB = "/var/db/portell.db"
|
||||
+ else:
|
||||
+ PORTELL_DB = "/var/db/portell"
|
||||
+ PORTELL_DB_FILE = "/var/db/portell.db"
|
||||
+
|
||||
+PORTS_DIR = "/usr/ports/"
|
||||
+
|
||||
+def write_pathname(d, dirname, names):
|
||||
+ dirname = join(dirname.split('/')[:5], '/') # chop port path subdirs
|
||||
+ d[os.path.basename(dirname)] = dirname
|
||||
+
|
||||
+def update_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_FILE, 0666)
|
||||
+ except:
|
||||
+ 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()
|
||||
+
|
||||
+def main():
|
||||
+ if len(sys.argv) != 2:
|
||||
+ print "usage: %s <portname>" % sys.argv[0]
|
||||
+ sys.exit(0)
|
||||
+
|
||||
+ if sys.argv[1] == '-u':
|
||||
+ update_db()
|
||||
+ sys.exit(0)
|
||||
+ else:
|
||||
+ portname = sys.argv[1]
|
||||
+
|
||||
+ 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)
|
||||
+
|
||||
+ if d.has_key(portname):
|
||||
+ descr_path = d[portname] + "/pkg-descr"
|
||||
+ match = descr_path
|
||||
+ try:
|
||||
+ descr_file = open(match, 'r').readlines()
|
||||
+ print "%s reads:\n" % descr_path
|
||||
+ for line in descr_file:
|
||||
+ print line,
|
||||
+ except IOError, errmsg:
|
||||
+ print errmsg
|
||||
+ else:
|
||||
+ print >> sys.stderr, "can't find %s" % portname
|
||||
+
|
||||
+ d.close()
|
||||
+
|
||||
+
|
||||
+if __name__=='__main__':
|
||||
+ main()
|
@ -1,47 +0,0 @@
|
||||
--- 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()
|
||||
|
Loading…
Reference in New Issue
Block a user