- Create a new yum object for source downloads as yum

Fixes a problem where yum object resetting is not currently working
This commit is contained in:
Jesse Keating 2007-08-01 16:38:57 -04:00 committed by Jesse Keating
parent eee5556f50
commit 1b1a81b2c7
5 changed files with 27 additions and 14 deletions

View File

@ -1,3 +1,6 @@
* Wed Aug 01 2007 Jesse Keating <jkeating@redhat.com>
- Create a new yum object for source downloads as yum
* Sat Jul 28 2007 Jesse Keating <jkeating@redhat.com>
- Split the createrepo call into it's own function
- When raising an error, print the error too.

2
pungi
View File

@ -147,7 +147,7 @@ if __name__ == '__main__':
import sys
def get_arguments():
parser = OptionParser(version="%prog 0.4.0")
parser = OptionParser(version="%prog 0.4.1")
parser.add_option("--destdir", default="*CONFFILE*", dest="destdir",
help='destination directory (defaults to current directory)')
parser.add_option("-c", "--conf", default='/etc/pungi/pungi.conf', dest="config",

View File

@ -1,7 +1,7 @@
%{!?python_sitelib: %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
Name: pungi
Version: 0.4.0
Version: 0.4.1
Release: 1%{?dist}
Summary: Distribution compose tool
@ -46,6 +46,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Wed Aug 01 2007 Jesse Keating <jkeating@redhat.com> - 0.4.1-1
- Create a new yum object for source downloads as yum
* Sat Jul 28 2007 Jesse Keating <jkeating@redhat.com> - 0.4.0-1
- split createrepo call to it's own function. This enables rawhide
composes to happen once again. Also breaks API.

View File

@ -335,23 +335,30 @@ class Gather(yum.YumBase):
srpmpolist = []
# Work around for yum bug
for sack in self.pkgSack.sacks.values():
sack.added = {}
sack.excludes = {}
## Work around for yum bug
#for sack in self.pkgSack.sacks.values():
# sack.added = {}
# sack.excludes = {}
self.pkgSack.excludes = {}
#self.pkgSack.excludes = {}
# We need to reset the yum object
self.pkgSack = None
## We need to reset the yum object
#self.pkgSack = None
# Setup the sack with just src arch
self.doSackSetup(archlist=['src'])
## Setup the sack with just src arch
#self.doSackSetup(archlist=['src'])
# Make a new yum object
ayum = yum.YumBase()
ayum.doConfigSetup(fn=self.config.get('default', 'yumconf'), debuglevel=6, errorlevel=6, root=os.path.join(self.workdir, 'yumroot'))
ayum.doRepoSetup()
ayum._getSacks(archlist=['src'])
for srpm in self.srpmlist:
(sname, sver, srel) = srpm.rsplit('-', 2)
try:
srpmpo = self.pkgSack.searchNevra(name=sname, ver=sver, rel=srel)[0]
srpmpo = ayum.pkgSack.searchNevra(name=sname, ver=sver, rel=srel)[0]
if not srpmpo in srpmpolist:
srpmpolist.append(srpmpo)
except IndexError:
@ -366,7 +373,7 @@ class Gather(yum.YumBase):
os.makedirs(pkgdir)
for pkg in srpmpolist:
repo = self.repos.getRepo(pkg.repoid)
repo = ayum.repos.getRepo(pkg.repoid)
remote = pkg.relativepath
local = os.path.basename(remote)
local = os.path.join(self.config.get('default', 'cachedir'), local)

View File

@ -2,7 +2,7 @@ from distutils.core import setup
import glob
setup(name='pungi',
version='0.4.0',
version='0.4.1',
description='Distribution compose tool',
author='Jesse Keating',
author_email='jkeating@redhat.com',