/[gentoo-x86]/scripts/sortpkglist.py
Gentoo

Contents of /scripts/sortpkglist.py

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download) (as text)
Mon Sep 27 20:09:28 2004 UTC (15 years ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.3: +0 -0 lines
File MIME type: text/x-python
FILE REMOVED
old stuff; use catalyst

1 #!/usr/bin/env spython
2
3 # This script will take a list of ebuild files, sort them in the order
4 # of their dependencies, then print them back out. (That is, for any
5 # given package, its dependencies will be printed out *before* the
6 # package itself.) Needed for the autodist.sh script.
7
8 import portage
9 import sys
10 import os
11
12 class depgraph:
13 pass
14
15 class depgraph_node:
16 def __init__(self, info):
17 self.__info = info
18
19 class packagelisttree(portage.packagetree):
20 def __init__(self, listfile, virtual=None):
21 portage.packagetree.__init__(self, virtual)
22 self.listfile = listfile
23
24 class ebuildinfo:
25 def __init__(self, ebuildfile):
26 if not os.path.exists(ebuildfile):
27 print "!!! %s is an invalid ebuild file name!" % (ebuildfile)
28 sys.exit(1)
29 if ebuildfile[0:2] == './':
30 ebuildfile = ebuildfile[2:]
31 self.filename = ebuildfile
32 self.category = os.path.basename(os.path.normpath(os.path.dirname(ebuildfile) + "/.."))
33 self.pf = os.path.basename(ebuildfile[:-7])
34 pkgsplit = portage.pkgsplit(self.pf, 0)
35 if pkgsplit == None:
36 print "!!! %s is an invalid ebuild file name!" % (ebuildfile)
37 sys.exit(1)
38 self.pn = pkgsplit[0]
39 self.pv = pkgsplit[1]
40 self.p = "%s-%s" % (self.pn, self.pv)
41 if pkgsplit[2] == "0":
42 self.pvr = self.pv
43 else:
44 self.pvr = "%s-r%s" % (self.pv, pkgsplit[2])
45

  ViewVC Help
Powered by ViewVC 1.1.20