diff options
author | Jeremy Katz <katzj@redhat.com> | 2002-10-14 21:29:29 +0000 |
---|---|---|
committer | Jeremy Katz <katzj@redhat.com> | 2002-10-14 21:29:29 +0000 |
commit | c94c7f92ad151083038fc741368017a7a148d82b (patch) | |
tree | c71a0472e9265fb19c39c649672145703cae8aaf | |
parent | 8a16c4a5cc849e056a2a979ab2b980f03b32b973 (diff) | |
download | anaconda-c94c7f92ad151083038fc741368017a7a148d82b.tar.gz anaconda-c94c7f92ad151083038fc741368017a7a148d82b.tar.xz anaconda-c94c7f92ad151083038fc741368017a7a148d82b.zip |
pkgorder works now with rpm 4.1
-rwxr-xr-x | scripts/pkgorder | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/scripts/pkgorder b/scripts/pkgorder index 9e65458a5..7eb688bde 100755 --- a/scripts/pkgorder +++ b/scripts/pkgorder @@ -46,6 +46,10 @@ def selectComp(comp): if comp.parent: selectComp(comp.parent) +# set PKGORDER_DEBUG to get rpm debugging +if os.environ.has_key("PKGORDER_DEBUG"): + rpm.setVerbosity(rpm.RPMLOG_DEBUG) + if len(sys.argv) != 3: print "pkgorder <toppath> <arch>" sys.exit(1) @@ -65,6 +69,7 @@ disc2Dir = distDir + "-disc2" f = distDir + "/RedHat/base/hdlist" try: hdlist = comps.HeaderListFromFile(f, noscore = 1) + hdlist.mergeFullHeaders(distDir + "/RedHat/base/hdlist2") except rpm.error: print "Failed to read header list", f sys.exit(1) @@ -165,14 +170,17 @@ for item in list: testpath = '/tmp/pkgorder-' + str (os.getpid ()) os.system ("mkdir -p " + testpath + "/var/lib/rpm") -db = rpm.opendb(1, testpath) - -ts = rpm.TransactionSet(testpath, db) +ts = rpm.TransactionSet(testpath) +ts.setVSFlags(~rpm.RPMVSF_NORSA|~rpm.RPMVSF_NODSA) +ts.setFlags(rpm.RPMTRANS_FLAG_NOMD5|~rpm.RPMTRANS_FLAG_CHAINSAW) for h in pkgOrder: #print "in:", h[1000000] - ts.add(h, h, 'i') + ts.addInstall(h, h, 'i') pkgOrder = [] +# we have to run ts.check() before ts.order() now to set up the +# alIndex. +ts.check() ts.order() # Get the order back out... @@ -180,6 +188,7 @@ try: pkgOrder = ts.getKeys() except AttributeError: print "you don't have the latest RPM!" + sys.exit(1) # print the results. for p in pkgOrder: |