Date: Mon, 09 May 2005 11:52:14 +0200 From: Radim Kolar <hsn@netmag.cz> To: FreeBSD-gnats-submit@FreeBSD.org Cc: perky@FreeBSD.org Subject: ports/80831: [PATCH] sysutils/pkg_trackinst: backport to python 2.3 Message-ID: <E1DV4vu-0004b3-SF@sanatana.dharma> Resent-Message-ID: <200505091730.j49HU27D054423@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 80831 >Category: ports >Synopsis: [PATCH] sysutils/pkg_trackinst: backport to python 2.3 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Mon May 09 17:30:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Radim Kolar >Release: FreeBSD 5.4-STABLE i386 >Organization: Sanatana Dharma >Environment: System: FreeBSD sanatana.dharma 5.4-STABLE FreeBSD 5.4-STABLE #7: Sun May 8 12:50:59 CEST >Description: Rationale: Some software do not works with python2.4 yet. Fix: backport this software to work with Python2.3 Note: python2.2 can possibly work also Added file(s): - files/patch-python23 - files/patch-sortfix Port maintainer (perky@FreeBSD.org) is cc'd. Generated with FreeBSD Port Tools 0.63 >How-To-Repeat: >Fix: --- pkg_trackinst-1.1_1.patch begins here --- diff -ruN --exclude=CVS /usr/ports/sysutils/pkg_trackinst/Makefile /home/hsn/hacked/pkg_trackinst/Makefile --- /usr/ports/sysutils/pkg_trackinst/Makefile Sun May 8 21:05:46 2005 +++ /home/hsn/hacked/pkg_trackinst/Makefile Sun May 8 23:19:15 2005 @@ -6,13 +6,14 @@ PORTNAME= pkg_trackinst PORTVERSION= 1.1 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= http://people.freebsd.org/~perky/distfiles/ MAINTAINER= perky@FreeBSD.org COMMENT= PkgDB/pkg-plist generator by tracking installation -USE_PYTHON= 2.4+ +USE_PYTHON= 2.3+ USE_REINPLACE= yes MAKE_ENV= PYTHON_CMD=${PYTHON_CMD} diff -ruN --exclude=CVS /usr/ports/sysutils/pkg_trackinst/files/patch-python23 /home/hsn/hacked/pkg_trackinst/files/patch-python23 --- /usr/ports/sysutils/pkg_trackinst/files/patch-python23 Thu Jan 1 01:00:00 1970 +++ /home/hsn/hacked/pkg_trackinst/files/patch-python23 Sun May 8 23:17:03 2005 @@ -0,0 +1,28 @@ +--- PkgTrackInst/Trackers.py.orig Sun May 8 23:10:35 2005 ++++ PkgTrackInst/Trackers.py Sun May 8 23:14:08 2005 +@@ -29,11 +29,11 @@ + def __init__(self, created=False): + self.created = created + +- @staticmethod + def create_root(): + InstEntry.root = InstDirectory() + InstEntry.root.abspath = '/' + return InstEntry.root ++ create_root=staticmethod(create_root) + + def traverse(self, depth=0): + print ' ' * depth + repr(self) +--- PkgTrackInst/InstallSession.py.orig Sun May 8 04:28:29 2005 ++++ PkgTrackInst/InstallSession.py Sun May 8 23:09:45 2005 +@@ -17,8 +17,8 @@ + import os, sys + from PkgTrackInst import options + from PkgTrackInst.cmd_support import errx +-from PkgTrackInst.Trackers import ( +- InstFile, InstDirectory, InstSymbolicLink, TrackRoot) ++from PkgTrackInst.Trackers import InstFile, InstDirectory, \ ++ InstSymbolicLink, TrackRoot + + DELIM = '\x01' + diff -ruN --exclude=CVS /usr/ports/sysutils/pkg_trackinst/files/patch-sortfix /home/hsn/hacked/pkg_trackinst/files/patch-sortfix --- /usr/ports/sysutils/pkg_trackinst/files/patch-sortfix Thu Jan 1 01:00:00 1970 +++ /home/hsn/hacked/pkg_trackinst/files/patch-sortfix Mon May 9 11:29:34 2005 @@ -0,0 +1,59 @@ +--- PkgTrackInst/PlistWriter.py.orig Sat May 7 02:08:20 2005 ++++ PkgTrackInst/PlistWriter.py Mon May 9 11:27:29 2005 +@@ -52,7 +52,7 @@ + for var, raw, stripped in pat_subst.findall(substlist): + if var not in SUBST_IGNORE: + self.plist_subst.append((stripped or raw, var)) +- self.plist_subst.sort(reverse=True) ++ self.plist_subst.sort(lambda x,y:-cmp(x,y)) + + def write(self): + if os.path.exists(options.output): +@@ -111,7 +111,9 @@ + f = self.open_manlist_output() + for cate, pages in manpages.iteritems(): + out = [''] +- for page in sorted(pages): ++ tmp=pages[:] ++ tmp.sort() ++ for page in tmp: + item = page + '.' + cate + if (len(item) + len(out[-1]) > MANPAGELIST_LINEWIDTH and + out[-1]): # put 1 at least +@@ -136,8 +138,8 @@ + fileents.append(ent) + TrackRoot.walk(gather_entries) + +- fileents.sort(key=lambda ent: ent.abspath) +- dirents.sort(key=lambda ent: ent.abspath) ++ fileents.sort(lambda ent,ent2: cmp(ent.abspath,ent2.abspath)) ++ dirents.sort(lambda ent,ent2: cmp(ent.abspath,ent2.abspath)) + + if relsub: + translatepath = self.relpath +@@ -146,7 +148,9 @@ + + for ent in fileents: + print >> out, translatepath(ent.abspath) +- for ent in reversed(dirents): ++ tmp=dirents[:] ++ tmp.sort(lambda x,y:-cmp(x,y)) ++ for ent in tmp: + print >> out, '@dirrm ' + translatepath(ent.abspath) + + +@@ -236,8 +240,13 @@ + def print_listing(self, content, title, isdir, relsub): + print + print "=== %s ===" % title ++ tmp=content[:] ++ if isdir: ++ tmp.sort(lambda x,y:-cmp(x,y)) ++ else: ++ tmp.sort() + +- for entry in sorted(content, reverse=isdir): ++ for entry in tmp: + if relsub: + outname = self.relpath(entry) + else: --- pkg_trackinst-1.1_1.patch ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E1DV4vu-0004b3-SF>