- Now use a manifest to determine what to pull in, not comps itself

- Add a minimal-manifest for test composes
- Add current F7 comps file for test composes
- Use some anaconda code to depsolve, gets better (and more common) results
This commit is contained in:
jkeating@reducto.boston.redhat.com 2007-01-23 18:03:52 -05:00 committed by Jesse Keating
parent 5e762d8c15
commit c6851db291
7 changed files with 13270 additions and 51 deletions

View File

@ -1,3 +1,9 @@
* Tue Jan 23 2007 Jesse Keating <jkeating@redhat.com>
- Now use a manifest to determine what to pull in, not comps itself
- Add a minimal-manifest for test composes
- Add current F7 comps file for test composes
- Use some anaconda code to depsolve, gets better (and more common) results
* Wed Jan 17 2007 Jesse Keating <jkeating@redhat.com>
- Move splittree workdirs into work/ at the end of the run

13204
config/comps-fc7.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE newcomps PUBLIC "-//Red Hat, Inc.//DTD Comps info//EN" "comps.dtd">
<comps>
<group>
<id>base</id>
<name>Base</name>
<description>This is the base group.</description>
<default>true</default>
<uservisible>true</uservisible>
<packagelist>
<packagereq type="optional">anaconda-runtime</packagereq>
<packagereq type="mandatory">authconfig</packagereq>
<packagereq type="optional">busybox-anaconda</packagereq>
<packagereq type="optional">dejavu-lgc-fonts</packagereq>
<packagereq type="optional">firstboot</packagereq>
<packagereq type="optional">gnome-python2-gtkhtml2</packagereq>
<packagereq type="default">grub</packagereq>
<packagereq type="default">joe</packagereq>
<packagereq type="optional">kernel</packagereq>
<packagereq type="optional">kernel-xen</packagereq>
<packagereq type="optional">libuser</packagereq>
<packagereq type="optional">man</packagereq>
<packagereq type="optional">memtest86+</packagereq>
<packagereq type="optional">policycoreutils</packagereq>
<packagereq type="optional">selinux-policy</packagereq>
<packagereq type="optional">selinux-policy-targeted</packagereq>
<packagereq type="optional">system-config-keyboard</packagereq>
<packagereq type="optional">xen</packagereq>
<packagereq type="optional">xorg-x11-drivers</packagereq>
<packagereq type="optional">xorg-x11-fonts-base</packagereq>
<packagereq type="optional">xorg-x11-fonts-ISO8859-1-75dpi</packagereq>
<packagereq type="mandatory">yum</packagereq>
</packagelist>
</group>
</comps>

14
config/minimal-manifest Normal file
View File

@ -0,0 +1,14 @@
kernel
xorg-x11-fonts-ISO8859-1-75dpi
busybox-anaconda
dejavu-lgc-fonts
xen
xorg-x11-fonts-base
memtest86+
xorg-x11-drivers
selinux-policy-targeted
kernel-xen
anaconda-runtime
man
joe
grub

View File

@ -5,7 +5,8 @@
product_name = Fedora Core
product_path = Fedora
iso_basename = FC
comps = /etc/pungi/comps.xml
comps = /etc/pungi/comps-fc7.xml
manifest = /etc/pungi/minimal-manifest
yumconf = /etc/pungi/yum.conf.x86_64
destdir = /srv/pungi
cachedir = /srv/pungi/cache

14
pungi
View File

@ -64,7 +64,7 @@ def main():
if not config.has_option('default', 'iso_basename'):
config.set('default', 'iso_basename', config.get('default', 'product_name'))
pkglist = get_packagelist(config.get('default', 'comps'))
pkglist = get_packagelist(config.get('default', 'manifest'))
destdir = config.get('default', 'destdir')
@ -146,19 +146,17 @@ if __name__ == '__main__':
# sys.exit(0)
return (opts, args)
def get_packagelist(myComps):
def get_packagelist(manifest):
# Get the list of packages from the comps file
try:
compsobj = yum.comps.Comps()
compsobj.add(myComps)
manifestfile = open(manifest, 'r')
except IOError:
print >> sys.stderr, "pungi: No such file:\'%s\'" % opts.comps
print >> sys.stderr, "pungi: No such file:\'%s\'" % manifest
sys.exit(1)
pkglist = []
for group in compsobj.groups:
pkglist += group.packages
pkglist = [l.strip() for l in manifestfile.readlines()]
manifestfile.close()
return pkglist
main()

View File

@ -21,10 +21,12 @@ class Gather(yum.YumBase):
def __init__(self, config, pkglist):
# Create a yum object to use
yum.YumBase.__init__(self)
self.doConfigSetup(fn=config.get('default', 'yumconf'))
self.doConfigSetup(fn=config.get('default', 'yumconf'), debuglevel=6, errorlevel=6, root="/tmp")
self.cleanMetadata() # clean metadata that might be in the cache from previous runs
self.cleanSqlite() # clean metadata that might be in the cache from previous runs
self.doRepoSetup()
self.doTsSetup()
self.doRpmDBSetup()
if config.get('default', 'arch') == 'i386':
arches = yum.rpmUtils.arch.getArchList('i686')
elif config.get('default', 'arch') == 'ppc':
@ -32,12 +34,33 @@ class Gather(yum.YumBase):
else:
arches = yum.rpmUtils.arch.getArchList(config.get('default', 'arch'))
self.doSackSetup(arches)
self.doSackFilelistPopulate()
self.logger = yum.logging.getLogger("yum.verbose.pungi")
self.config = config
self.pkglist = pkglist
self.polist = []
self.srpmlist = []
def _provideToPkg(self, req): #this is stolen from Anaconda
best = None
(r, f, v) = req
satisfiers = []
for po in self.whatProvides(r, f, v):
# if we already have something installed which does the provide
# then that's obviously the one we want to use. this takes
# care of the case that we select, eg, kernel-smp and then
# have something which requires kernel
if self.tsInfo.getMembers(po.pkgtup):
return po
if po not in satisfiers:
satisfiers.append(po)
if satisfiers:
best = self.bestPackagesFromList(satisfiers)[0]
return best
return None
def getPackageDeps(self, po):
"""Return the dependencies for a given package, as well
possible solutions for those dependencies.
@ -48,18 +71,25 @@ class Gather(yum.YumBase):
if not self.config.has_option('default', 'quiet'):
self.logger.info('Checking deps of %s.%s' % (po.name, po.arch))
reqs = po.requires;
reqs = po.requires
provs = po.provides
pkgresults = {}
for req in reqs:
(r,f,v) = req
if r.startswith('rpmlib('):
if r.startswith('rpmlib(') or r.startswith('config('):
continue
if req in provs:
continue
provides = self.whatProvides(r, f, v)
for provide in provides.returnNewestByNameArch():
if not pkgresults.has_key(provide):
pkgresults[provide] = None
dep = self._provideToPkg(req)
if dep is None:
self.logger.warning("Unresolvable dependency %s in %s" % (r, po.name))
continue
if not pkgresults.has_key(dep):
pkgresults[dep] = None
self.tsInfo.addInstall(dep)
return pkgresults.keys()
@ -79,6 +109,7 @@ class Gather(yum.YumBase):
for match in mysack.returnNewestByNameArch():
unprocessed_pkgs[match] = None
self.tsInfo.addInstall(match)
if not self.config.has_option('default', 'quiet'):
for pkg in unprocessed_pkgs.keys():