[yum-commits] Branch 'yum-3_2_X' - 3 commits - cli.py docs/yum.8 yum/__init__.py
James Antill
james at osuosl.org
Tue Mar 29 15:52:07 UTC 2011
cli.py | 32 +++++++++++++++++++++++++++++++-
docs/yum.8 | 5 +++++
yum/__init__.py | 10 +++++++---
3 files changed, 43 insertions(+), 4 deletions(-)
New commits:
commit b0cfb31118d35db42c8d6be305a79f5d376be579
Author: James Antill <james at and.org>
Date: Tue Mar 29 10:29:03 2011 -0400
Tweak "group X has no pkgs." warning, try to deal with cond. pkgs. BZ 655281
diff --git a/yum/__init__.py b/yum/__init__.py
index 36fc203..d1f07d0 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -2830,9 +2830,7 @@ class YumBase(depsolve.Depsolve):
if 'optional' in package_types:
pkgs.extend(thisgroup.optional_packages)
- if not pkgs:
- self.logger.critical(_('Warning: Group %s does not have any packages.'), thisgroup.groupid)
-
+ old_txmbrs = len(txmbrs_used)
for pkg in pkgs:
self.verbose_logger.log(logginglevels.DEBUG_2,
_('Adding package %s from group %s'), pkg, thisgroup.groupid)
@@ -2850,6 +2848,7 @@ class YumBase(depsolve.Depsolve):
if enable_group_conditionals is not None: # has to be this way so we can set it to False
group_conditionals = enable_group_conditionals
+ count_cond_test = 0
if group_conditionals:
for condreq, cond in thisgroup.conditional_packages.iteritems():
if self.isPackageInstalled(cond):
@@ -2882,10 +2881,15 @@ class YumBase(depsolve.Depsolve):
pkgs = use
pkgs = packagesNewestByName(pkgs)
+ count_cond_test += len(pkgs)
if cond not in self.tsInfo.conditionals:
self.tsInfo.conditionals[cond] = []
self.tsInfo.conditionals[cond].extend(pkgs)
+ if len(txmbrs_used) == old_txmbrs:
+ self.logger.critical(_('Warning: Group %s does not have any packages.'), thisgroup.groupid)
+ if count_cond_test:
+ self.logger.critical(_('Group %s does have %u conditional packages, which may get installed.'), count_cond_test)
return txmbrs_used
def deselectGroup(self, grpid, force=False):
commit a6b1bbdd2b418df060c2183c599908eb7cf331fa
Author: James Antill <james at and.org>
Date: Fri Mar 25 16:10:38 2011 -0400
Add "distro-sync full", docs.
diff --git a/docs/yum.8 b/docs/yum.8
index 360a976..0f1b1ba 100644
--- a/docs/yum.8
+++ b/docs/yum.8
@@ -132,6 +132,11 @@ is done by either obsoleting, upgrading or downgrading as appropriate. This will
package FOO installed at version 4, and the latest available is only
version 3, then this command will \fBdowngrade\fP FOO to version 3.
+If you give the optional argument "full", then the command will also reinstall
+packages where the install checksum and the available checksum do not match. And
+remove old packages (can be used to sync. rpmdb versions). The optional argument
+"different" can be used to specify the default operation.
+
This command does not perform operations on groups, local packages or negative
selections.
.IP
commit 1972be85d2fab2b9862ed8779b81a0eb0c1d7064
Author: James Antill <james at and.org>
Date: Fri Mar 25 15:35:35 2011 -0400
Add "distro-sync full", which will reinstall packages due to checksums.
diff --git a/cli.py b/cli.py
index 2267b86..eca1812 100644
--- a/cli.py
+++ b/cli.py
@@ -757,6 +757,13 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
installed version is older or newer. We allow "selection" but not
local packages (use tmprepo, or something). """
+ level = 'diff'
+ if userlist and userlist[0] in ('full', 'diff', 'different'):
+ level = userlist[0]
+ userlist = userlist[1:]
+ if level == 'different':
+ level = 'diff'
+
dupdates = []
ipkgs = {}
for pkg in sorted(self.rpmdb.returnPackages(patterns=userlist)):
@@ -794,8 +801,31 @@ class YumBaseCli(yum.YumBase, output.YumOutput):
ipkg = ipkgs[ipkgname]
apkg = apkgs[ipkgname]
- if ipkg.verEQ(apkg):
+ if ipkg.verEQ(apkg): # Latest installed == Latest avail.
+ if level == 'diff':
+ continue
+
+ # level == full: do reinstalls if checksum doesn't match.
+ # do removals, if older installed versions.
+ for napkg in self.rpmdb.searchNames([ipkgname]):
+ if (not self.allowedMultipleInstalls(apkg) and
+ not napkg.verEQ(ipkg)):
+ dupdates.extend(self.remove(po=napkg))
+ continue
+
+ nayi = napkg.yumdb_info
+ for apkg in self.pkgSack.searchPkgTuple(napkg.pkgtup):
+ if ('checksum_type' in nayi and
+ 'checksum_data' in nayi and
+ nayi.checksum_type == apkg.checksum_type and
+ nayi.checksum_data == apkg.pkgId):
+ found = True
+ break
+ if found:
+ continue
+ dupdates.extend(self.reinstall(pkgtup=napkg.pkgtup))
continue
+
if self.allowedMultipleInstalls(apkg):
found = False
for napkg in self.rpmdb.searchNames([apkg.name]):
More information about the Yum-commits
mailing list