summaryrefslogtreecommitdiffstats
path: root/scripts/pkgorder
diff options
context:
space:
mode:
authorMatt Wilson <msw@redhat.com>2001-01-17 20:21:24 +0000
committerMatt Wilson <msw@redhat.com>2001-01-17 20:21:24 +0000
commit29cda3d82b4443cb65cb7a5a502f989d199f1214 (patch)
treec927bda43302de6292113b163e7e9ef465ef2bdb /scripts/pkgorder
parente48f2018e00d67c62c952ff44ca9bf18e0c2f8bf (diff)
downloadanaconda-29cda3d82b4443cb65cb7a5a502f989d199f1214.tar.gz
anaconda-29cda3d82b4443cb65cb7a5a502f989d199f1214.tar.xz
anaconda-29cda3d82b4443cb65cb7a5a502f989d199f1214.zip
go for better distribution of discs
Diffstat (limited to 'scripts/pkgorder')
-rwxr-xr-xscripts/pkgorder51
1 files changed, 37 insertions, 14 deletions
diff --git a/scripts/pkgorder b/scripts/pkgorder
index a3c6dd76c..84bb48f9c 100755
--- a/scripts/pkgorder
+++ b/scripts/pkgorder
@@ -40,31 +40,53 @@ hdlist = comps.HeaderListFromFile(distDir + "/RedHat/base/hdlist", noscore = 1)
comps = comps.ComponentSet(distDir + "/RedHat/base/comps", hdlist,
arch = arch, matchAllLang = 1)
-for comp in comps:
- if comp.name != 'Everything':
- comp.select(1)
+filenamesByPkgName = {}
+for p in hdlist.hdlist:
+ n = p[rpm.RPMTAG_NAME]
+ if filenamesByPkgName.has_key(n):
+ filenamesByPkgName[n].append(p[1000000] )
+ else:
+ filenamesByPkgName[n] = [ p[1000000] ]
+
+# work out the order we'd like to install everything in
+pkgOrder = []
+list = []
+pkgHash = {}
for package in hdlist.keys():
- if len(package) >= 7 and package[:7] == "kernel-":
+ if ((len(package) >= 7 and package[:7] == "kernel-")
+ and not (len(package) >= 10 and package[:10] == "kernel-doc")
+ and not (len(package) >= 13 and package[:13] == "kernel-source")
+ and not (len(package) >= 11 and package[:11] == "kernel-BOOT")):
hdlist[package].selected = 1
+ pkgOrder.append(hdlist[package].h)
+ pkgHash[hdlist[package].h] = None
-# work out the order we'd like to install everything in
-pkgOrder = []
+# for each comp, staring with base, list the packages
+# in alphabetical order.
+for comp in comps:
+ list = []
+ if comp.name != 'Everything':
+ comp.select(1)
+ for p in hdlist.selected():
+ list.append(p.h)
-list = []
-for p in hdlist.selected():
- list.append(p.h)
-list.sort(cmpHeaderByName)
+ list.sort(cmpHeaderByName)
-for item in list:
- pkgOrder.append(item)
+ for item in list:
+ if not pkgHash.has_key (item):
+ pkgOrder.append(item)
+ pkgHash[item] = None
+
+ comp.unselect(1)
list = []
for p in hdlist.packages.values():
- if not p.selected:
- list.append(p.h)
+ if not pkgHash.has_key (p.h):
+ list.append(p.h)
list.sort(cmpHeaderByName)
+
for item in list:
pkgOrder.append(item)
@@ -75,6 +97,7 @@ db = rpm.opendb(1, testpath)
ts = rpm.TransactionSet(testpath, db)
for h in pkgOrder:
+ #print h[1000000]
ts.add(h, h, 'i')
pkgOrder = []