Hi,
While pkgorder does force the kernel-* and iscsi-* packages to be on the
first (possible) disc, it does not resolve dependencies for these
packages which then of course might end up on another disc;
Attached is a patch of which I could not remove the whitespace changes
or it wouldn't 'apply --check' properly, so it'll look a little bloated;
It makes pkgorder do "addPackages" like pkgorder already does
"addGroups", for the packages we now do "printMatchingPkgs".
I hope you like it ;-)
Kind regards,
Jeroen van Meeuwen
-kanarip
diff --git a/scripts/pkgorder b/scripts/pkgorder
index f72249c..9ff3a33 100755
--- a/scripts/pkgorder
+++ b/scripts/pkgorder
@@ -66,8 +66,8 @@ class PackageOrderer(yum.YumBase):
exclude.extend(excludes)
self.conf.exclude = exclude
cachedir = yum.misc.getCacheDir()
- self.repos.setCacheDir(cachedir)
- self.repos.setCache(0)
+ self.repos.setCacheDir(cachedir)
+ self.repos.setCache(0)
self.doRepoSetup()
self.doSackSetup(rpmUtils.arch.getArchList(self.arch))
@@ -113,6 +113,17 @@ def addGroups(ds, groupLst):
ds.resolveDeps()
processTransaction(ds)
+def addPackages(ds, packageLst):
+ ds.initActionTs()
+
+ (exactmatched, matched, unmatched) = yum.packages.parsePackages(ds.pkgSack.returnPackages(), packageLst, casematch=0)
+ matches = exactmatched + matched
+
+ map(ds.install, filter(lambda x: ds.pkgSack.returnNewestByName(), matches))
+
+ ds.resolveDeps()
+ processTransaction(ds)
+
def createConfig(toppath):
yumconfstr = """
[main]
@@ -126,7 +137,7 @@ name=Anaconda
baseurl=file://%s
enabled=1
""" % (toppath)
-
+
try:
(fd, path) = tempfile.mkstemp("", "yum-conf-", toppath)
except (OSError, IOError), e:
@@ -150,7 +161,7 @@ if __name__ == "__main__":
default=[])
(options, args) = parser.parse_args()
-
+
if len(args) != 3:
usage()
sys.exit(1)
@@ -162,26 +173,25 @@ if __name__ == "__main__":
if arch == "i386":
arch = "i686"
- # print out kernel related packages first
- printMatchingPkgs("kernel-*")
-
if os.environ.has_key('TMPDIR'):
testpath = "%s/pkgorder-%d" %(os.environ['TMPDIR'],os.getpid(),)
else:
testpath = "/tmp/pkgorder-%d" %(os.getpid(),)
os.system("mkdir -p %s/var/lib/rpm" %(testpath,))
-
+
ds = PackageOrderer(arch=arch)
ds.setup(fn=config, excludes=options.excludeList, root = testpath)
- addGroups(ds, ["core", "base", "text-internet"])
+ # print out some of the most essential packages first
+ # - kernel (# doh)
+ # - iscsi (#208832)
+ addPackages(ds, [ "kernel-*", "iscsi-*", "*firmware*" ])
- # hack, hack, hack... make sure iscsi ends up on disc1 (#208832)
- printMatchingPkgs("iscsi-*")
+ addGroups(ds, ["core", "base", "text-internet"])
addGroups(ds, ["base-x", "dial-up",
- "graphical-internet", "editors",
+ "graphical-internet", "editors",
"gnome-desktop", "sound-and-video", "printing",
"fonts", "hardware-support", "admin-tools",
"java", "legacy-fonts"])
@@ -198,7 +208,7 @@ if __name__ == "__main__":
"java-development", "kde-software-development",
"mail-server", "network-server", "legacy-network-server"])
- addGroups(ds, ["news-server", "legacy-software-development",
+ addGroups(ds, ["news-server", "legacy-software-development",
"engineering-and-scientific"])
#Everthing else but kernels
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list