diff options
author | Peter Gavin <pete@gentoo.org> | 2001-08-07 22:59:56 +0000 |
---|---|---|
committer | Peter Gavin <pete@gentoo.org> | 2001-08-07 22:59:56 +0000 |
commit | eddeb2dc337ec6a58902c4cf62d41013c25c547b (patch) | |
tree | e1261ba5b71b95cc0db74f883ecdf72f974a316f /scripts/sortpkglist.py | |
parent | fixed header (diff) | |
download | gentoo-2-eddeb2dc337ec6a58902c4cf62d41013c25c547b.tar.gz gentoo-2-eddeb2dc337ec6a58902c4cf62d41013c25c547b.tar.bz2 gentoo-2-eddeb2dc337ec6a58902c4cf62d41013c25c547b.zip |
*** empty log message ***
Diffstat (limited to 'scripts/sortpkglist.py')
-rw-r--r-- | scripts/sortpkglist.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/scripts/sortpkglist.py b/scripts/sortpkglist.py index c589046e7476..673b5de9de99 100644 --- a/scripts/sortpkglist.py +++ b/scripts/sortpkglist.py @@ -7,4 +7,39 @@ import portage import sys +import os + +class depgraph: + pass + +class depgraph_node: + def __init__(self, info): + self.__info = info + +class packagelisttree(portage.packagetree): + def __init__(self, listfile, virtual=None): + portage.packagetree.__init__(self, virtual) + self.listfile = listfile + +class ebuildinfo: + def __init__(self, ebuildfile): + if not os.path.exists(ebuildfile): + print "!!! %s is an invalid ebuild file name!" % (ebuildfile) + sys.exit(1) + if ebuildfile[0:2] == './': + ebuildfile = ebuildfile[2:] + self.filename = ebuildfile + self.category = os.path.basename(os.path.normpath(os.path.dirname(ebuildfile) + "/..")) + self.pf = os.path.basename(ebuildfile[:-7]) + pkgsplit = portage.pkgsplit(self.pf, 0) + if pkgsplit == None: + print "!!! %s is an invalid ebuild file name!" % (ebuildfile) + sys.exit(1) + self.pn = pkgsplit[0] + self.pv = pkgsplit[1] + self.p = "%s-%s" % (self.pn, self.pv) + if pkgsplit[2] == "0": + self.pvr = self.pv + else: + self.pvr = "%s-r%s" % (self.pv, pkgsplit[2]) |