[yum] update to latest HEAD.
James Antill
james at fedoraproject.org
Fri Sep 7 19:46:53 UTC 2012
commit cc5b95c12fd10d3e79e0cabc74d3347cfc81e897
Author: James Antill <james at and.org>
Date: Fri Sep 7 15:46:01 2012 -0400
update to latest HEAD.
- Use .ui_id explicitly for backcompat. on strings, *sigh*.
yum-HEAD.patch | 328 ++++++++++++++++++++++++++++++++++++++++----------------
yum.spec | 6 +-
2 files changed, 240 insertions(+), 94 deletions(-)
---
diff --git a/yum-HEAD.patch b/yum-HEAD.patch
index 96760d5..e4c51b8 100644
--- a/yum-HEAD.patch
+++ b/yum-HEAD.patch
@@ -2293,7 +2293,7 @@ index 0000000..d2a0ed1
+if __name__ == "__main__":
+ generateAll(os.getcwd(), os.getcwd())
diff --git a/docs/yum.8 b/docs/yum.8
-index 1a8202a..15a8345 100644
+index 1a8202a..dab01f6 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -52,6 +52,7 @@ gnome\-packagekit application\&.
@@ -2304,8 +2304,12 @@ index 1a8202a..15a8345 100644
.br
.I \fR * localinstall rpmfile1 [rpmfile2] [\&.\&.\&.]
(maintained for legacy reasons only - use install)
-@@ -69,7 +70,9 @@ gnome\-packagekit application\&.
+@@ -67,9 +68,13 @@ gnome\-packagekit application\&.
.br
+ .I \fR * repolist [all|enabled|disabled]
+ .br
++.I \fR * repoinfo [all|enabled|disabled]
++.br
.I \fR * version [ all | installed | available | group-* | nogroups* | grouplist | groupinfo ]
.br
-.I \fR * history [info|list|packages-list|summary|addon-info|redo|undo|rollback|new]
@@ -2315,7 +2319,7 @@ index 1a8202a..15a8345 100644
.br
.I \fR * check
.br
-@@ -86,14 +89,20 @@ Is used to install the latest version of a package or
+@@ -86,14 +91,20 @@ Is used to install the latest version of a package or
group of packages while ensuring that all dependencies are
satisfied\&. (See \fBSpecifying package names\fP for more information)
If no package matches the given package name(s), they are assumed to be a shell
@@ -2340,7 +2344,7 @@ index 1a8202a..15a8345 100644
.IP
.IP "\fBupdate\fP"
If run without any packages, update will update every currently
-@@ -111,7 +120,7 @@ changes, for example: upgrading from somelinux 8.0 to somelinux 9.
+@@ -111,7 +122,7 @@ changes, for example: upgrading from somelinux 8.0 to somelinux 9.
Note that "\fBupdate\fP" works on installed packages first, and only if there
are no matches does it look for available packages. The difference is most
@@ -2349,7 +2353,7 @@ index 1a8202a..15a8345 100644
"\fBupdate\fP foo" if foo-1-2 is installed. You can use the "\fBupdate-to\fP"
if you'd prefer that nothing happen in the above case.
.IP
-@@ -158,6 +167,11 @@ the "install" command\&.(See \fBSpecifying package names\fP for more information
+@@ -158,6 +169,11 @@ the "install" command\&.(See \fBSpecifying package names\fP for more information
Note that "yum" is included in the protected_packages configuration, by default.
So you can't accidentally remove yum itself.
@@ -2361,7 +2365,7 @@ index 1a8202a..15a8345 100644
.IP
.IP "\fBlist\fP"
Is used to list various information about available
-@@ -209,10 +223,12 @@ installed.
+@@ -209,10 +225,12 @@ installed.
"\fBgroup list\fP" is used to list the available groups from all \fByum\fP repos. Groups are marked
as "installed" if all mandatory packages are installed, or if a group doesn't
have any mandatory packages then it is installed if any of the optional or
@@ -2378,7 +2382,7 @@ index 1a8202a..15a8345 100644
"\fBgroup remove\fP" is used to remove all of the packages in a group, unlike "groupinstall" this
will remove everything regardless of group_package_types. It is worth pointing
-@@ -224,10 +240,37 @@ to only remove packages which aren't required by something else.
+@@ -224,10 +242,37 @@ to only remove packages which aren't required by something else.
"\fBgroup info\fP" is used to give the description and package list of a group (and which type
those packages are marked as). Note that you can use the yum-filter-data and
@@ -2417,7 +2421,7 @@ index 1a8202a..15a8345 100644
.IP
.IP "\fBshell\fP"
Is used to enter the 'yum shell', when a filename is specified the contents of
-@@ -235,12 +278,13 @@ that file is executed in yum shell mode. See \fIyum-shell(8)\fP for more info
+@@ -235,12 +280,13 @@ that file is executed in yum shell mode. See \fIyum-shell(8)\fP for more info
.IP
.IP "\fBresolvedep\fP"
Is used to list packages providing the specified dependencies, at most one
@@ -2433,7 +2437,7 @@ index 1a8202a..15a8345 100644
reasons only.
.IP
.IP "\fBlocalupdate\fP"
-@@ -248,7 +292,7 @@ Is used to update the system by specifying local rpm files. Only the specified
+@@ -248,7 +294,7 @@ Is used to update the system by specifying local rpm files. Only the specified
rpm files of which an older version is already installed will be installed,
the remaining specified packages will be ignored.
If required the enabled repositories will be used to resolve dependencies. Note
@@ -2442,7 +2446,7 @@ index 1a8202a..15a8345 100644
legacy reasons only.
.IP
.IP "\fBreinstall\fP"
-@@ -260,7 +304,7 @@ on groups, files, provides and filelists just like the "install" command\&.
+@@ -260,7 +306,7 @@ on groups, files, provides and filelists just like the "install" command\&.
Will try and downgrade a package from the version currently installed to the
previously highest version (or the specified version).
The depsolver will not necessarily work, but if you specify all the packages it
@@ -2451,7 +2455,14 @@ index 1a8202a..15a8345 100644
work for "installonly" packages, like Kernels. downgrade operates
on groups, files, provides, filelists and rpm files just like the "install" command\&.
.IP
-@@ -294,8 +338,8 @@ package counts/etc. will be zeroed out).
+@@ -291,11 +337,15 @@ then yum will ignore any repo errors and output the information it can get
+ (Eg. "yum clean all; yum -C repolist" will output something, although the
+ package counts/etc. will be zeroed out).
+ .IP
++.IP "\fBrepoinfo\fP"
++.IP
++This ocmmand works exactly like repolist -v.
++.IP
.IP "\fBversion\fP"
Produces a "version" of the rpmdb, and of the enabled repositories if "all" is
given as the first argument. You can also specify version groups in the
@@ -2462,7 +2473,7 @@ index 1a8202a..15a8345 100644
packages (in sorted order), and the checksum_type/checksum_data entries from
the yumdb. Note that this rpmdb version is now also used significantly within
yum (esp. in yum history).
-@@ -321,26 +365,33 @@ and so takes sub-commands:
+@@ -321,26 +371,33 @@ and so takes sub-commands:
.IP "\fBhistory\fP"
The history command allows the user to view what has happened in past
transactions (assuming the history_record config. option is set). You can use
@@ -2502,7 +2513,7 @@ index 1a8202a..15a8345 100644
A (if it is not still installed), and "rollback 1" will try to remove packages
B and C. Note that after a "rollback 1" you will have a fourth transaction,
although the ending rpmdb version (see: yum version) should be the same in
-@@ -349,6 +400,12 @@ transactions 1 and 4.
+@@ -349,6 +406,12 @@ transactions 1 and 4.
The addon-info command takes a transaction ID, and the packages-list command
takes a package (with wildcards).
@@ -2515,7 +2526,7 @@ index 1a8202a..15a8345 100644
In "history list" you can change the behaviour of the 2nd column via. the
configuration option history_list_view.
-@@ -371,6 +428,15 @@ end of the package column in the packages-list command).
+@@ -371,6 +434,15 @@ end of the package column in the packages-list command).
.I \fBs\fR - The transaction completed fine, but --skip-broken was enabled and had to skip some packages.
.br
@@ -2531,7 +2542,7 @@ index 1a8202a..15a8345 100644
.IP
.IP "\fBcheck\fP"
Checks the local rpmdb and produces information on any problems it finds. You
-@@ -401,6 +467,11 @@ Assume yes; assume that the answer to any question which would be asked
+@@ -401,6 +473,11 @@ Assume yes; assume that the answer to any question which would be asked
is yes\&.
.br
Configuration Option: \fBassumeyes\fP
@@ -2543,7 +2554,7 @@ index 1a8202a..15a8345 100644
.IP "\fB\-c, \-\-config=[config file]\fP"
Specifies the config file location - can take HTTP and FTP URLs and local file
paths\&.
-@@ -420,7 +491,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri
+@@ -420,7 +497,7 @@ Sets the error level to [number] Practical range 0 \- 10. 0 means print only cri
.br
Configuration Option: \fBerrorlevel\fP
.IP "\fB\-\-rpmverbosity=[name]\fP"
@@ -2552,7 +2563,7 @@ index 1a8202a..15a8345 100644
options are: 'critical', 'emergency', 'error', 'warn' and 'debug'.
.br
Configuration Option: \fBrpmverbosity\fP
-@@ -506,7 +577,8 @@ option will corrupt your cache (and you can use $releasever in your cachedir
+@@ -506,7 +583,8 @@ option will corrupt your cache (and you can use $releasever in your cachedir
configuration to stop this).
.PP
.IP "\fB\-t, \-\-tolerant\fP"
@@ -3471,7 +3482,7 @@ index f1e06e8..b21c594 100644
complete -F _yum -o filenames yum yummain.py
diff --git a/output.py b/output.py
-index b6aa277..caac21a 100755
+index b6aa277..05b255e 100755
--- a/output.py
+++ b/output.py
@@ -1,6 +1,6 @@
@@ -3901,6 +3912,15 @@ index b6aa277..caac21a 100755
(hibeg, hiend) = self._highlight(highlight)
print _("Name : %s%s%s") % (hibeg, to_unicode(pkg.name), hiend)
print _("Arch : %s") % to_unicode(pkg.arch)
+@@ -585,7 +820,7 @@ class YumOutput:
+ print _("Version : %s") % to_unicode(pkg.version)
+ print _("Release : %s") % to_unicode(pkg.release)
+ print _("Size : %s") % self.format_number(float(pkg.size))
+- print _("Repo : %s") % to_unicode(pkg.repoid)
++ print _("Repo : %s") % to_unicode(pkg.repo.ui_id)
+ if pkg.repoid == 'installed' and 'from_repo' in pkg.yumdb_info:
+ print _("From repo : %s") % to_unicode(pkg.yumdb_info.from_repo)
+ if self.verbose_logger.isEnabledFor(logginglevels.DEBUG_3):
@@ -617,9 +852,22 @@ class YumOutput:
print ""
@@ -157874,7 +157894,7 @@ index 4af563a..47832fc 100644
self.obsoletes = {} #obs[obsoletename] = [pkg1, pkg2, pkg3]
#the package lists are packages that obsolete the key name
diff --git a/yum/packages.py b/yum/packages.py
-index 5ef9951..f67169f 100644
+index 5ef9951..07c555c 100644
--- a/yum/packages.py
+++ b/yum/packages.py
@@ -106,14 +106,16 @@ def buildPkgRefDict(pkgs, casematch=True):
@@ -157896,7 +157916,18 @@ index 5ef9951..f67169f 100644
exactmatch = []
matched = []
unmatched = []
-@@ -243,34 +245,87 @@ class PackageObject(object):
+@@ -223,6 +225,10 @@ class FakeRepository:
+ def __str__(self):
+ return self.id
+
++ def _ui_id(self):
++ return self.id
++ ui_id = property(fget=lambda self: self._ui_id())
++
+
+ # Goal for the below is to have a packageobject that can be used by generic
+ # functions independent of the type of package - ie: installed or available
+@@ -243,34 +249,87 @@ class PackageObject(object):
def _ui_envra(self):
if self.epoch == '0':
@@ -158004,7 +158035,7 @@ index 5ef9951..f67169f 100644
def __str__(self):
return self.ui_envra
-@@ -481,15 +536,14 @@ class RpmBase(object):
+@@ -481,15 +540,14 @@ class RpmBase(object):
if prcotuple in self._prco_lookup[prcotype]:
return 1
@@ -158028,7 +158059,7 @@ index 5ef9951..f67169f 100644
return 0
-@@ -611,15 +665,18 @@ class RpmBase(object):
+@@ -611,15 +669,18 @@ class RpmBase(object):
dirlist = property(fget=lambda self: self.returnFileEntries(ftype='dir'))
ghostlist = property(fget=lambda self: self.returnFileEntries(ftype='ghost'))
requires = property(fget=lambda self: self.returnPrco('requires'))
@@ -158047,7 +158078,7 @@ index 5ef9951..f67169f 100644
conflicts_print = property(fget=lambda self: self.returnPrco('conflicts', True))
obsoletes_print = property(fget=lambda self: self.returnPrco('obsoletes', True))
changelog = property(fget=lambda self: self.returnChangelog())
-@@ -1083,7 +1140,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1083,7 +1144,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
misc.to_unicode(misc.to_xml(self.summary)),
misc.to_unicode(misc.to_xml(self.description)),
packager, url, self.filetime,
@@ -158056,7 +158087,7 @@ index 5ef9951..f67169f 100644
msg += self._return_remote_location()
return msg
-@@ -1133,7 +1190,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1133,7 +1194,7 @@ class YumAvailablePackage(PackageObject, RpmBase):
msg = ""
mylist = getattr(self, pcotype)
if mylist: msg = "\n <rpm:%s>\n" % pcotype
@@ -158065,7 +158096,7 @@ index 5ef9951..f67169f 100644
pcostring = ''' <rpm:entry name="%s"''' % misc.to_xml(name, attrib=True)
if flags:
pcostring += ''' flags="%s"''' % misc.to_xml(flags, attrib=True)
-@@ -1161,11 +1218,11 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1161,11 +1222,11 @@ class YumAvailablePackage(PackageObject, RpmBase):
dirs = self.returnFileEntries('dir', primary_only=True)
ghosts = self.returnFileEntries('ghost', primary_only=True)
@@ -158080,7 +158111,7 @@ index 5ef9951..f67169f 100644
msg += """ <file type="ghost">%s</file>\n""" % misc.to_xml(fn)
return msg
-@@ -1194,8 +1251,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1194,8 +1255,8 @@ class YumAvailablePackage(PackageObject, RpmBase):
continue
newlist.append(i)
mylist = newlist
@@ -158091,7 +158122,7 @@ index 5ef9951..f67169f 100644
if name.startswith('rpmlib('):
continue
# this drops out requires that the pkg provides for itself.
-@@ -1217,13 +1274,16 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1217,13 +1278,16 @@ class YumAvailablePackage(PackageObject, RpmBase):
prcostring += ''' ver="%s"''' % misc.to_xml(v, attrib=True)
if r:
prcostring += ''' rel="%s"''' % misc.to_xml(r, attrib=True)
@@ -158110,7 +158141,7 @@ index 5ef9951..f67169f 100644
return msg
def _dump_changelog(self, clog_limit):
-@@ -1272,6 +1332,13 @@ class YumAvailablePackage(PackageObject, RpmBase):
+@@ -1272,6 +1336,13 @@ class YumAvailablePackage(PackageObject, RpmBase):
return misc.to_utf8(msg)
@@ -158124,7 +158155,7 @@ index 5ef9951..f67169f 100644
# This is a tweak on YumAvailablePackage() and is a base class for packages
# which are actual rpms.
-@@ -1299,7 +1366,8 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1299,7 +1370,8 @@ class YumHeaderPackage(YumAvailablePackage):
self.pkgid = self.hdr[rpm.RPMTAG_SHA1HEADER]
if not self.pkgid:
self.pkgid = "%s.%s" %(self.hdr['name'], self.hdr['buildtime'])
@@ -158134,7 +158165,7 @@ index 5ef9951..f67169f 100644
self.__mode_cache = {}
self.__prcoPopulated = False
-@@ -1353,6 +1421,12 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1353,6 +1425,12 @@ class YumHeaderPackage(YumAvailablePackage):
continue
lst = hdr[getattr(rpm, 'RPMTAG_%sFLAGS' % tag)]
@@ -158147,7 +158178,7 @@ index 5ef9951..f67169f 100644
flag = map(rpmUtils.miscutils.flagToString, lst)
flag = map(misc.share_data, flag)
-@@ -1363,6 +1437,10 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1363,6 +1441,10 @@ class YumHeaderPackage(YumAvailablePackage):
prcotype = tag2prco[tag]
self.prco[prcotype] = map(misc.share_data, zip(name,flag,vers))
@@ -158158,7 +158189,7 @@ index 5ef9951..f67169f 100644
def tagByName(self, tag):
warnings.warn("tagByName() will go away in a furture version of Yum.\n",
-@@ -1447,7 +1525,7 @@ class YumHeaderPackage(YumAvailablePackage):
+@@ -1447,7 +1529,7 @@ class YumHeaderPackage(YumAvailablePackage):
raise NotImplementedError()
def _size(self):
@@ -159078,9 +159109,27 @@ index 9b265f9..61c9a0e 100644
+
+ self.display.verify_txmbr(self.base, txmbr, count)
diff --git a/yum/sqlitesack.py b/yum/sqlitesack.py
-index 8a6f6f3..ba929de 100644
+index 8a6f6f3..ed57408 100644
--- a/yum/sqlitesack.py
+++ b/yum/sqlitesack.py
+@@ -69,7 +69,7 @@ def _parse_pkg_n(match, regexp_match, n):
+ if not regexp_match:
+ return False
+
+- if (match and n and match[0] not in ('?', '*') and match[0] != n[0]):
++ if (match and n and match[0] not in ('?', '*', '[') and match[0] != n[0]):
+ return False
+ if regexp_match(n):
+ return True
+@@ -82,7 +82,7 @@ def _parse_pkg(match, regexp_match, data, e,v,r,a):
+ # Worthless speed hacks?
+ if match == n:
+ return True
+- if (match and n and match[0] not in ('?', '*') and
++ if (match and n and match[0] not in ('?', '*', '[') and
+ match[0] != n[0] and match[0] != e[0]):
+ return False
+
@@ -382,6 +382,10 @@ class YumAvailablePackageSqlite(YumAvailablePackage, PackageObject, RpmBase):
def returnPrco(self, prcotype, printable=False):
@@ -159344,7 +159393,7 @@ index 2cb1acb..0586c1c 100644
for pkg in un['pkglist']:
for filedata in pkg['packages']:
diff --git a/yum/yumRepo.py b/yum/yumRepo.py
-index e5e9ece..876dc12 100644
+index e5e9ece..21f65f7 100644
--- a/yum/yumRepo.py
+++ b/yum/yumRepo.py
@@ -20,10 +20,12 @@ import time
@@ -159368,6 +159417,15 @@ index e5e9ece..876dc12 100644
from constants import *
import metalink
+@@ -104,7 +107,7 @@ class YumPackageSack(packageSack.PackageSack):
+ if repo in self.added:
+ if 'metadata' not in self.added[repo]:
+ raise Errors.RepoError, '%s md for %s imported before primary' \
+- % (datatype, repo.id)
++ % (datatype, repo.ui_id)
+ current = 0
+ for pkgid in dataobj:
+ current += 1
@@ -121,6 +124,25 @@ class YumPackageSack(packageSack.PackageSack):
# umm, wtf?
pass
@@ -159545,16 +159603,18 @@ index e5e9ece..876dc12 100644
def close(self):
if self._sack is not None:
self.sack.close()
-@@ -350,7 +434,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -350,6 +434,10 @@ class YumRepository(Repository, config.RepoConf):
return thisdata.location
def __str__(self):
-- return self.id
-+ return self.ui_id
++ # Note: You might expect this to be .ui_id, except people got used to
++ # the fact that str(repo) == repo.id and used the former instead of
++ # the later when they wanted just the .id. So we have to live with it
++ # and use .ui_id explicitly.
+ return self.id
def _checksum(self, sumtype, file, CHUNK=2**16, checksum_can_fail=False,
- datasize=None):
-@@ -378,7 +462,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -378,7 +466,7 @@ class YumRepository(Repository, config.RepoConf):
'basecachedir', 'http_headers', 'metadata_cookie',
'metadata_cookie_fn', 'quick_enable_disable',
'repoMDFile', 'timestamp_check', 'urls', 'mirrorurls',
@@ -159563,7 +159623,16 @@ index e5e9ece..876dc12 100644
for attr in dir(self):
if attr.startswith('_'):
continue
-@@ -431,25 +515,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -422,7 +510,7 @@ class YumRepository(Repository, config.RepoConf):
+ on then raise a repo error"""
+ if len(self._urls) < 1 and not self.mediaid:
+ raise Errors.RepoError, \
+- 'Cannot find a valid baseurl for repo: %s' % self.id
++ 'Cannot find a valid baseurl for repo: %s' % self.ui_id
+
+ def doProxyDict(self):
+ if self._proxy_dict:
+@@ -431,25 +519,18 @@ class YumRepository(Repository, config.RepoConf):
self._proxy_dict = {} # zap it
proxy_string = None
empty = (None, '_none_', '')
@@ -159597,7 +159666,7 @@ index e5e9ece..876dc12 100644
if proxy_string is not None:
self._proxy_dict['http'] = proxy_string
-@@ -483,13 +560,30 @@ class YumRepository(Repository, config.RepoConf):
+@@ -483,13 +564,30 @@ class YumRepository(Repository, config.RepoConf):
ugopts = self._default_grabopts()
self._grabfunc = URLGrabber(progress_obj=self.callback,
@@ -159629,7 +159698,7 @@ index e5e9ece..876dc12 100644
failure_callback=self.mirror_failure_obj)
def _default_grabopts(self, cache=True):
-@@ -499,6 +593,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -499,6 +597,7 @@ class YumRepository(Repository, config.RepoConf):
'throttle': self.throttle,
'proxies': self.proxy_dict,
'timeout': self.timeout,
@@ -159637,7 +159706,7 @@ index e5e9ece..876dc12 100644
'http_headers': tuple(self.__headersListFromDict(cache=cache)),
'ssl_verify_peer': self.sslverify,
'ssl_verify_host': self.sslverify,
-@@ -714,10 +809,10 @@ class YumRepository(Repository, config.RepoConf):
+@@ -714,15 +813,15 @@ class YumRepository(Repository, config.RepoConf):
local = self.metalink_filename + '.tmp'
if not self._metalinkCurrent():
url = misc.to_utf8(self.metalink)
@@ -159646,11 +159715,17 @@ index e5e9ece..876dc12 100644
try:
ug = URLGrabber(progress_obj = self.callback, **ugopts)
- result = ug.urlgrab(url, local, text=self.id + "/metalink")
-+ result = ug.urlgrab(url, local, text="%s/metalink" % self)
++ result = ug.urlgrab(url, local, text="%s/metalink" % self.ui_id)
except urlgrabber.grabber.URLGrabError, e:
if not os.path.exists(self.metalink_filename):
-@@ -749,9 +844,22 @@ class YumRepository(Repository, config.RepoConf):
+ msg = ("Cannot retrieve metalink for repository: %s. "
+- "Please verify its path and try again" % self )
++ "Please verify its path and try again" % self.ui_id )
+ raise Errors.RepoError, msg
+ # Now, we have an old usable metalink, so we can't move to
+ # a newer repomd.xml ... or checksums won't match.
+@@ -749,9 +848,22 @@ class YumRepository(Repository, config.RepoConf):
value),
fdel=lambda self: setattr(self, "_metalink", None))
@@ -159674,16 +159749,25 @@ index e5e9ece..876dc12 100644
"""retrieve file from the mirrorgroup for the repo
relative to local, optionally get range from
start to end, also optionally retrieve from a specific baseurl"""
-@@ -768,7 +876,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -768,7 +880,7 @@ class YumRepository(Repository, config.RepoConf):
if local is None or relative is None:
raise Errors.RepoError, \
- "get request for Repo %s, gave no source or dest" % self.id
-+ "get request for Repo %s, gave no source or dest" % self
++ "get request for Repo %s, gave no source or dest" % self.ui_id
if self.cache == 1:
if os.path.exists(local): # FIXME - we should figure out a way
-@@ -796,6 +904,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -778,7 +890,7 @@ class YumRepository(Repository, config.RepoConf):
+ raise Errors.RepoError, \
+ "Caching enabled but no local cache of %s from %s" % (local,
+
+- self)
++ self.ui_id)
+
+ if url:
+ (scheme, netloc, path, query, fragid) = urlparse.urlsplit(url)
+@@ -796,6 +908,16 @@ class YumRepository(Repository, config.RepoConf):
except Errors.MediaError, e:
verbose_logger.log(logginglevels.DEBUG_2, "Error getting package from media; falling back to url %s" %(e,))
@@ -159700,7 +159784,7 @@ index e5e9ece..876dc12 100644
if url and scheme != "media":
ugopts = self._default_grabopts(cache=cache)
ug = URLGrabber(progress_obj = self.callback,
-@@ -815,14 +933,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -815,14 +937,11 @@ class YumRepository(Repository, config.RepoConf):
range=(start, end),
)
except URLGrabError, e:
@@ -159717,7 +159801,7 @@ index e5e9ece..876dc12 100644
else:
-@@ -835,19 +950,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -835,19 +954,18 @@ class YumRepository(Repository, config.RepoConf):
reget = reget,
checkfunc=checkfunc,
http_headers=headers,
@@ -159743,7 +159827,7 @@ index e5e9ece..876dc12 100644
remote = package.relativepath
local = package.localPkg()
basepath = package.basepath
-@@ -857,15 +971,26 @@ class YumRepository(Repository, config.RepoConf):
+@@ -857,15 +975,26 @@ class YumRepository(Repository, config.RepoConf):
return local
misc.unlink_f(local)
@@ -159771,7 +159855,16 @@ index e5e9ece..876dc12 100644
def getHeader(self, package, checkfunc = None, reget = 'simple',
cache = True):
-@@ -1020,7 +1145,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -991,7 +1120,7 @@ class YumRepository(Repository, config.RepoConf):
+ def _cachingRepoXML(self, local):
+ """ Should we cache the current repomd.xml """
+ if self.cache and not os.path.exists(local):
+- raise Errors.RepoError, 'Cannot find repomd.xml file for %s' % self
++ raise Errors.RepoError, 'Cannot find repomd.xml file for %s' % self.ui_id
+ if self.cache or self.metadataCurrent():
+ return True
+ return False
+@@ -1020,7 +1149,7 @@ class YumRepository(Repository, config.RepoConf):
if grab_can_fail:
return None
raise Errors.RepoError, 'Error downloading file %s: %s' % (local, e)
@@ -159780,7 +159873,25 @@ index e5e9ece..876dc12 100644
misc.unlink_f(tfname)
if grab_can_fail:
return None
-@@ -1260,6 +1385,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1047,7 +1176,7 @@ class YumRepository(Repository, config.RepoConf):
+ parse_can_fail = 'old_repo_XML' in self._oldRepoMDData
+ if parse_can_fail:
+ return None
+- raise Errors.RepoError, 'Error importing repomd.xml from %s: %s' % (self, e)
++ raise Errors.RepoError, 'Error importing repomd.xml from %s: %s' % (self.ui_id, e)
+
+ def _saveOldRepoXML(self, local):
+ """ If we have an older repomd.xml file available, save it out. """
+@@ -1074,7 +1203,7 @@ class YumRepository(Repository, config.RepoConf):
+ # We still want the old data, so we don't download twice. So we
+ # pretend everything is good until the revert.
+ if not self.timestamp_check:
+- raise Errors.RepoError, "Can't download or revert repomd.xml"
++ raise Errors.RepoError, "Can't download or revert repomd.xml for:" % self.ui_id
+
+ if 'old_repo_XML' not in self._oldRepoMDData:
+ self._oldRepoMDData = {}
+@@ -1260,6 +1389,9 @@ class YumRepository(Repository, config.RepoConf):
return True
def _check_db_version(self, mdtype, repoXML=None):
@@ -159790,7 +159901,7 @@ index e5e9ece..876dc12 100644
if repoXML is None:
repoXML = self.repoXML
if mdtype in repoXML.repoData:
-@@ -1277,11 +1405,11 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1277,11 +1409,11 @@ class YumRepository(Repository, config.RepoConf):
return None
if not file_check:
@@ -159805,7 +159916,7 @@ index e5e9ece..876dc12 100644
if not os.path.exists(local):
local = misc.decompress(local, fn_only=True)
compressed = True
-@@ -1302,6 +1430,17 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1302,6 +1434,17 @@ class YumRepository(Repository, config.RepoConf):
into the delete list, this means metadata can change filename
without us leaking it. """
@@ -159823,7 +159934,7 @@ index e5e9ece..876dc12 100644
def _mdtype_eq(omdtype, odata, nmdtype, ndata):
""" Check if two returns from _get_mdtype_data() are equal. """
if ndata is None:
-@@ -1321,6 +1460,14 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1321,6 +1464,14 @@ class YumRepository(Repository, config.RepoConf):
return True
all_mdtypes = self.retrieved.keys()
@@ -159838,7 +159949,7 @@ index e5e9ece..876dc12 100644
if mdtypes is None:
mdtypes = all_mdtypes
-@@ -1333,8 +1480,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1333,8 +1484,7 @@ class YumRepository(Repository, config.RepoConf):
# Inited twice atm. ... sue me
self._oldRepoMDData['new_MD_files'] = []
@@ -159848,7 +159959,7 @@ index e5e9ece..876dc12 100644
for mdtype in all_mdtypes:
(nmdtype, ndata) = self._get_mdtype_data(mdtype)
-@@ -1371,43 +1517,16 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1371,43 +1521,16 @@ class YumRepository(Repository, config.RepoConf):
# No old repomd data, but we might still have uncompressed MD
if self._groupCheckDataMDValid(ndata, nmdtype, mdtype):
continue
@@ -159897,7 +160008,7 @@ index e5e9ece..876dc12 100644
def _groupLoadRepoXML(self, text=None, mdtypes=None):
""" Retrieve the new repomd.xml from the repository, then check it
-@@ -1421,7 +1540,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1421,7 +1544,7 @@ class YumRepository(Repository, config.RepoConf):
self._commonRetrieveDataMD(mdtypes)
def _mdpolicy2mdtypes(self):
@@ -159906,7 +160017,7 @@ index e5e9ece..876dc12 100644
'group:primary' : ['primary'],
'group:small' : ["primary", "updateinfo"],
'group:main' : ["primary", "group", "filelists",
-@@ -1436,6 +1555,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1436,6 +1559,7 @@ class YumRepository(Repository, config.RepoConf):
if not mdtypes or 'group:all' in mdtypes:
mdtypes = None
else:
@@ -159914,7 +160025,13 @@ index e5e9ece..876dc12 100644
mdtypes = sorted(list(mdtypes))
return mdtypes
-@@ -1451,12 +1571,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1446,17 +1570,12 @@ class YumRepository(Repository, config.RepoConf):
+ except KeyboardInterrupt:
+ self._revertOldRepoXML() # Undo metadata cookie?
+ raise
+- raise Errors.RepoError, 'Bad loadRepoXML policy: %s' % (self.mdpolicy)
++ raise Errors.RepoError, 'Bad loadRepoXML policy (for %s): %s' % (self.ui_id, self.mdpolicy)
+
def _getRepoXML(self):
if self._repoXML:
return self._repoXML
@@ -159924,20 +160041,20 @@ index e5e9ece..876dc12 100644
- msg = ("Cannot retrieve repository metadata (repomd.xml) for repository: %s. "
- "Please verify its path and try again" % self )
- raise Errors.RepoError, msg
-+ self._loadRepoXML(text=self)
++ self._loadRepoXML(text=self.ui_id)
return self._repoXML
-@@ -1480,7 +1595,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1480,7 +1599,7 @@ class YumRepository(Repository, config.RepoConf):
result = self._getFile(relative='repodata/repomd.xml.asc',
copy_local=1,
local = sigfile,
- text='%s/signature' % self.id,
-+ text='%s/signature' % self,
++ text='%s/signature' % self.ui_id,
reget=None,
checkfunc=None,
cache=self.http_caching == 'all',
-@@ -1514,7 +1629,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1514,7 +1633,7 @@ class YumRepository(Repository, config.RepoConf):
return self._checkMD(fn, mdtype, openchecksum)
def _checkMD(self, fn, mdtype, openchecksum=False,
@@ -159946,7 +160063,7 @@ index e5e9ece..876dc12 100644
""" Internal function, use .checkMD() from outside yum. """
thisdata = data # So the argument name is nicer
-@@ -1537,6 +1652,18 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1537,6 +1656,18 @@ class YumRepository(Repository, config.RepoConf):
if size is not None:
size = int(size)
@@ -159965,7 +160082,7 @@ index e5e9ece..876dc12 100644
try: # get the local checksum
l_csum = self._checksum(r_ctype, file, datasize=size)
except Errors.RepoError, e:
-@@ -1551,15 +1678,13 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1551,15 +1682,13 @@ class YumRepository(Repository, config.RepoConf):
return None
raise URLGrabError(-1, 'Metadata file does not match checksum')
@@ -159982,7 +160099,16 @@ index e5e9ece..876dc12 100644
""" Internal function, use .retrieveMD() from outside yum. """
# Note that this can raise Errors.RepoMDError if mdtype doesn't exist
# for this repo.
-@@ -1597,8 +1722,10 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1588,7 +1717,7 @@ class YumRepository(Repository, config.RepoConf):
+ else: # ain't there - raise
+ raise Errors.RepoError, \
+ "Caching enabled but no local cache of %s from %s" % (local,
+- self)
++ self.ui_id)
+
+ if (os.path.exists(local) or
+ self._preload_md_from_system_cache(os.path.basename(local))):
+@@ -1597,8 +1726,10 @@ class YumRepository(Repository, config.RepoConf):
return local # it's the same return the local one
try:
@@ -159995,7 +160121,7 @@ index e5e9ece..876dc12 100644
if thisdata.size is None:
reget = None
else:
-@@ -1613,8 +1740,9 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1613,8 +1744,9 @@ class YumRepository(Repository, config.RepoConf):
checkfunc=checkfunc,
text=text,
cache=self.http_caching == 'all',
@@ -160007,15 +160133,18 @@ index e5e9ece..876dc12 100644
if retrieve_can_fail:
return None
raise
-@@ -1624,7 +1752,6 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1622,9 +1754,8 @@ class YumRepository(Repository, config.RepoConf):
+ if retrieve_can_fail:
+ return None
raise Errors.RepoError, \
- "Could not retrieve %s matching remote checksum from %s" % (local, self)
+- "Could not retrieve %s matching remote checksum from %s" % (local, self)
++ "Could not retrieve %s matching remote checksum from %s" % (local, self.ui_id)
else:
- self.retrieved[mdtype] = 1
return local
-@@ -1646,13 +1773,21 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1646,13 +1777,21 @@ class YumRepository(Repository, config.RepoConf):
def getGroups(self):
"""gets groups and returns group file path for the repository, if there
@@ -160040,7 +160169,7 @@ index e5e9ece..876dc12 100644
self._callbacks_changed = True
def setFailureObj(self, failure_obj):
-@@ -1681,7 +1816,7 @@ class YumRepository(Repository, config.RepoConf):
+@@ -1681,7 +1820,7 @@ class YumRepository(Repository, config.RepoConf):
print "Could not read mirrorlist %s, error was \n%s" %(url, e)
content = []
for line in content:
@@ -160050,7 +160179,7 @@ index e5e9ece..876dc12 100644
mirror = line.rstrip() # no more trailing \n's
mirror = mirror.replace('$ARCH', '$BASEARCH')
diff --git a/yumcommands.py b/yumcommands.py
-index 4dcbea7..52c3127 100644
+index 4dcbea7..a2e0b1b 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -29,7 +29,7 @@ import operator
@@ -161742,12 +161871,13 @@ index 4dcbea7..52c3127 100644
+ """
def getNames(self):
+- return ('repolist',)
+ """Return a list containing the names of this command. This
+ command can be called from the command line by using any of these names.
+
+ :return: a list containing the names of this command
+ """
- return ('repolist',)
++ return ('repolist', 'repoinfo')
def getUsage(self):
+ """Return a usage string for this command.
@@ -161780,7 +161910,19 @@ index 4dcbea7..52c3127 100644
def _repo_size(repo):
ret = 0
for pkg in repo.sack.returnPackages():
-@@ -866,6 +1902,13 @@ class RepoListCommand(YumCommand):
+@@ -857,7 +1893,10 @@ class RepoListCommand(YumCommand):
+ arg = 'enabled'
+ extcmds = map(lambda x: x.lower(), extcmds)
+
+- verbose = base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)
++ if basecmd == 'repoinfo':
++ verbose = True
++ else:
++ verbose = base.verbose_logger.isEnabledFor(logginglevels.DEBUG_3)
+ if arg != 'disabled' or extcmds:
+ try:
+ # Setup so len(repo.sack) is correct
+@@ -866,6 +1905,13 @@ class RepoListCommand(YumCommand):
except yum.Errors.RepoError:
if verbose:
raise
@@ -161794,7 +161936,7 @@ index 4dcbea7..52c3127 100644
repos = base.repos.repos.values()
repos.sort()
-@@ -924,111 +1967,108 @@ class RepoListCommand(YumCommand):
+@@ -924,111 +1970,108 @@ class RepoListCommand(YumCommand):
ui_enabled = dhibeg + _('disabled') + hiend
ui_endis_wid = utf8_width(_('disabled'))
@@ -161808,7 +161950,7 @@ index 4dcbea7..52c3127 100644
- cols.append((rid, repo.name,
- (ui_enabled, ui_endis_wid), ui_num))
+ if not verbose:
-+ rid = str(repo)
++ rid = repo.ui_id # can't use str()
+ if enabled and repo.metalink:
+ mdts = repo.metalink_data.repomd.timestamp
+ if mdts > repo.repoXML.timestamp:
@@ -161820,7 +161962,7 @@ index 4dcbea7..52c3127 100644
+ md = repo.repoXML
else:
+ md = None
-+ out = [base.fmtKeyValFill(_("Repo-id : "), repo),
++ out = [base.fmtKeyValFill(_("Repo-id : "), repo.ui_id),
+ base.fmtKeyValFill(_("Repo-name : "), repo.name)]
+
+ if force_show or extcmds:
@@ -161994,12 +162136,12 @@ index 4dcbea7..52c3127 100644
- base.verbose_logger.log(logginglevels.DEBUG_3,
- "%s\n",
- "\n".join(map(misc.to_unicode, out)))
-+ base.verbose_logger.log(logginglevels.DEBUG_3, "%s\n",
++ base.verbose_logger.info("%s\n",
+ "\n".join(map(misc.to_unicode, out)))
if not verbose and cols:
# Work out the first (id) and last (enabled/disalbed/count),
-@@ -1088,21 +2128,54 @@ class RepoListCommand(YumCommand):
+@@ -1088,21 +2131,54 @@ class RepoListCommand(YumCommand):
return 0, ['repolist: ' +to_unicode(locale.format("%d", tot_num, True))]
def needTs(self, base, basecmd, extcmds):
@@ -162054,7 +162196,7 @@ index 4dcbea7..52c3127 100644
if len(extcmds) == 0:
base.usage()
raise cli.CliError
-@@ -1147,28 +2220,85 @@ class HelpCommand(YumCommand):
+@@ -1147,28 +2223,85 @@ class HelpCommand(YumCommand):
return help_output
def doCommand(self, base, basecmd, extcmds):
@@ -162140,7 +162282,7 @@ index 4dcbea7..52c3127 100644
self.doneCommand(base, _("Setting up Reinstall Process"))
try:
return base.reinstallPkgs(extcmds)
-@@ -1177,49 +2307,139 @@ class ReInstallCommand(YumCommand):
+@@ -1177,49 +2310,139 @@ class ReInstallCommand(YumCommand):
return 1, [to_unicode(e)]
def getSummary(self):
@@ -162281,7 +162423,7 @@ index 4dcbea7..52c3127 100644
vcmd = 'installed'
if extcmds:
vcmd = extcmds[0]
-@@ -1308,7 +2528,7 @@ class VersionCommand(YumCommand):
+@@ -1308,7 +2531,7 @@ class VersionCommand(YumCommand):
str(data[2][grp])))
_append_repos(cols, data[3][grp])
except yum.Errors.YumBaseError, e:
@@ -162290,7 +162432,7 @@ index 4dcbea7..52c3127 100644
if vcmd in ('available', 'all', 'group-available', 'group-all'):
try:
data = base.pkgSack.simpleVersion(not verbose, groups=groups)
-@@ -1327,7 +2547,7 @@ class VersionCommand(YumCommand):
+@@ -1327,7 +2550,7 @@ class VersionCommand(YumCommand):
if verbose:
_append_repos(cols, data[3][grp])
except yum.Errors.YumBaseError, e:
@@ -162299,7 +162441,7 @@ index 4dcbea7..52c3127 100644
data = {'rid' : {}, 'ver' : {}}
for (rid, ver) in cols:
-@@ -1344,6 +2564,14 @@ class VersionCommand(YumCommand):
+@@ -1344,6 +2567,14 @@ class VersionCommand(YumCommand):
return 0, ['version']
def needTs(self, base, basecmd, extcmds):
@@ -162314,7 +162456,7 @@ index 4dcbea7..52c3127 100644
vcmd = 'installed'
if extcmds:
vcmd = extcmds[0]
-@@ -1354,23 +2582,62 @@ class VersionCommand(YumCommand):
+@@ -1354,23 +2585,62 @@ class VersionCommand(YumCommand):
class HistoryCommand(YumCommand):
@@ -162378,7 +162520,7 @@ index 4dcbea7..52c3127 100644
return 2, ["Repeating transaction %u" % (old.tid,)]
def _hcmd_undo(self, base, extcmds):
-@@ -1426,12 +2693,57 @@ class HistoryCommand(YumCommand):
+@@ -1426,12 +2696,57 @@ class HistoryCommand(YumCommand):
def _hcmd_new(self, base, extcmds):
base.history._create_db_file()
@@ -162437,7 +162579,7 @@ index 4dcbea7..52c3127 100644
if extcmds and extcmds[0] not in cmds:
base.logger.critical(_('Invalid history sub-command, use: %s.'),
", ".join(cmds))
-@@ -1444,6 +2756,19 @@ class HistoryCommand(YumCommand):
+@@ -1444,6 +2759,19 @@ class HistoryCommand(YumCommand):
raise cli.CliError
def doCommand(self, base, basecmd, extcmds):
@@ -162457,7 +162599,7 @@ index 4dcbea7..52c3127 100644
vcmd = 'list'
if extcmds:
vcmd = extcmds[0]
-@@ -1468,12 +2793,26 @@ class HistoryCommand(YumCommand):
+@@ -1468,12 +2796,26 @@ class HistoryCommand(YumCommand):
ret = self._hcmd_rollback(base, extcmds)
elif vcmd == 'new':
ret = self._hcmd_new(base, extcmds)
@@ -162484,7 +162626,7 @@ index 4dcbea7..52c3127 100644
vcmd = 'list'
if extcmds:
vcmd = extcmds[0]
-@@ -1481,16 +2820,46 @@ class HistoryCommand(YumCommand):
+@@ -1481,16 +2823,46 @@ class HistoryCommand(YumCommand):
class CheckRpmdbCommand(YumCommand):
@@ -162531,7 +162673,7 @@ index 4dcbea7..52c3127 100644
chkcmd = 'all'
if extcmds:
chkcmd = extcmds
-@@ -1505,19 +2874,57 @@ class CheckRpmdbCommand(YumCommand):
+@@ -1505,19 +2877,57 @@ class CheckRpmdbCommand(YumCommand):
return rc, ['%s %s' % (basecmd, chkcmd)]
def needTs(self, base, basecmd, extcmds):
@@ -162589,7 +162731,7 @@ index 4dcbea7..52c3127 100644
if not extcmds:
base.logger.critical(_("No saved transaction file specified."))
raise cli.CliError
-@@ -1533,5 +2940,13 @@ class LoadTransactionCommand(YumCommand):
+@@ -1533,5 +2943,13 @@ class LoadTransactionCommand(YumCommand):
def needTs(self, base, basecmd, extcmds):
diff --git a/yum.spec b/yum.spec
index ecbe5eb..2d4321e 100644
--- a/yum.spec
+++ b/yum.spec
@@ -18,7 +18,7 @@
Summary: RPM package installer/updater/manager
Name: yum
Version: 3.4.3
-Release: 42%{?dist}
+Release: 43%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://yum.baseurl.org/download/3.4/%{name}-%{version}.tar.gz
@@ -315,6 +315,10 @@ exit 0
%endif
%changelog
+* Fri Sep 7 2012 James Antill <james at fedoraproject.org> - 3.4.3-43
+- update to latest HEAD.
+- Use .ui_id explicitly for backcompat. on strings, *sigh*.
+
* Sat Sep 1 2012 James Antill <james at fedoraproject.org> - 3.4.3-42
- update to latest HEAD.
- Fix missing self. on last patch.
More information about the scm-commits
mailing list