[yum-cvs] yum-utils yumdownloader.py,1.6,1.7
Panu Matilainen
pmatilai at linux.duke.edu
Thu Feb 16 23:24:17 UTC 2006
Update of /home/groups/yum/cvs/yum-utils
In directory login1.linux.duke.edu:/tmp/cvs-serv11705
Modified Files:
yumdownloader.py
Log Message:
- apply patch by Ville Skytta to make yumdownloader compatible with yum-2.5.x
(https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=175335)
Index: yumdownloader.py
===================================================================
RCS file: /home/groups/yum/cvs/yum-utils/yumdownloader.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- yumdownloader.py 28 Nov 2005 16:45:18 -0000 1.6
+++ yumdownloader.py 16 Feb 2006 23:24:15 -0000 1.7
@@ -24,7 +24,7 @@
import output
from urlgrabber.progress import TextMeter
from yum.logger import Logger
-from yum.packages import parsePackages, returnBestPackages
+from yum.packages import parsePackages
from yum.misc import getCacheDir
from optparse import OptionParser
from urlparse import urljoin
@@ -74,7 +74,7 @@
(opts, args) = parseArgs()
my = initYum(opts.source)
avail = my.pkgSack.returnPackages()
- toDownload = {}
+ toDownload = []
packages = args
for pkg in packages:
@@ -84,12 +84,12 @@
my.errorlog(0, 'No Match for argument %s' % pkg)
continue
for newpkg in installable:
- toDownload.setdefault(newpkg.name,[]).append(newpkg.pkgtup)
+ toDownload.append(newpkg)
if opts.source:
- toDownload = returnBestPackages(toDownload, 'src')
+ toDownload = my.bestPackagesFromList(toDownload, 'src')
else:
- toDownload = returnBestPackages(toDownload)
+ toDownload = my.bestPackagesFromList(toDownload)
# If the user supplies to --resolve flag, resolve dependencies for
# all packages
@@ -99,20 +99,18 @@
my.doTsSetup()
my.localPackages = []
# Act as if we were to install the packages in toDownload
- for x in toDownload:
- po = my.getPackageObject(x)
+ for po in toDownload:
my.tsInfo.addInstall(po)
my.localPackages.append(po)
# Resolve dependencies
my.resolveDeps()
# Add newly added packages to the toDownload list
- for x in my.tsInfo.getMembers():
- pkgtup = x.pkgtup
- if not pkgtup in toDownload:
- toDownload.append(pkgtup)
+ for pkg in my.tsInfo.getMembers():
+ if not pkg in toDownload:
+ toDownload.append(pkg)
for pkg in toDownload:
- n,a,e,v,r = pkg
+ n,a,e,v,r = pkg.pkgtup
packages = my.pkgSack.searchNevra(n,e,v,r,a)
for download in packages:
repo = my.repos.getRepo(download.repoid)
More information about the Yum-cvs-commits
mailing list