[yum-commits] 4 commits - docs/yum.conf.5 yumcommands.py yum/__init__.py
James Antill
james at osuosl.org
Wed Jun 19 20:18:01 UTC 2013
docs/yum.conf.5 | 8 +++-----
yum/__init__.py | 17 ++++++++++++-----
yumcommands.py | 38 +++++++++++++++++++++++++++++++++++---
3 files changed, 50 insertions(+), 13 deletions(-)
New commits:
commit 587b4d0f0aad4c38e0c69fadab1407171e274ce6
Author: James Antill <james at and.org>
Date: Wed Jun 19 16:11:27 2013 -0400
Add simple way to specify a group of pkgs. for version. BZ 913461.
diff --git a/yumcommands.py b/yumcommands.py
index d02beb6..1341f23 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -2644,6 +2644,14 @@ class VersionCommand(YumCommand):
vcmd = 'installed'
if extcmds:
vcmd = extcmds[0]
+ if vcmd in ('grouplist', 'groupinfo',
+ 'nogroups', 'nogroups-installed', 'nogroups-available',
+ 'nogroups-all',
+ 'installed', 'all', 'group-installed', 'group-all',
+ 'available', 'all', 'group-available', 'group-all'):
+ extcmds = extcmds[1:]
+ else:
+ vcmd = 'installed'
def _append_repos(cols, repo_data):
for repoid in sorted(repo_data):
@@ -2685,7 +2693,7 @@ class VersionCommand(YumCommand):
if vcmd == 'groupinfo':
for group in groups:
- if group not in extcmds[1:]:
+ if group not in extcmds:
continue
print _(" Group :"), group
print _(" Packages:")
@@ -2705,6 +2713,30 @@ class VersionCommand(YumCommand):
return 0, ['version groupinfo']
+ # Have a way to manually specify a dynamic group of packages, whee.
+ if not vcmd.startswith("group-") and extcmds:
+ for dgrp in extcmds:
+ if '/' not in dgrp:
+ # It's a package name, add it to the cmd line group...
+ if '<cmd line>' not in groups:
+ groups['<cmd line>'] = set()
+ groups['<cmd line>'].add(dgrp)
+ else: # It's a file containing a list of packages...
+ if not os.path.exists(dgrp):
+ base.logger.warn(_(" File doesn't exist: %s"), dgrp)
+ else:
+ pkg_names = open(dgrp).readlines()
+ pkg_names = set(n.strip() for n in pkg_names)
+ dgrp = os.path.basename(dgrp)
+ if dgrp in groups:
+ for num in range(1, 100):
+ ndgrp = dgrp + str(num)
+ if ndgrp in groups:
+ continue
+ dgrp = ndgrp
+ break
+ groups[dgrp] = pkg_names
+
rel = base.conf.yumvar['releasever']
ba = base.conf.yumvar['basearch']
cols = []
@@ -2723,7 +2755,7 @@ class VersionCommand(YumCommand):
if groups:
for grp in sorted(data[2]):
if (vcmd.startswith("group-") and
- len(extcmds) > 1 and grp not in extcmds[1:]):
+ extcmds and grp not in extcmds):
continue
cols.append(("%s %s" % (_("Group-Installed:"), grp),
str(data[2][grp])))
@@ -2740,7 +2772,7 @@ class VersionCommand(YumCommand):
if groups:
for grp in sorted(data[2]):
if (vcmd.startswith("group-") and
- len(extcmds) > 1 and grp not in extcmds[1:]):
+ extcmds and grp not in extcmds):
continue
cols.append(("%s %s" % (_("Group-Available:"), grp),
str(data[2][grp])))
commit 6e5bf545b84ae5bec009b7bc9fe14126ce116df8
Author: James Antill <james at and.org>
Date: Wed Jun 19 15:40:59 2013 -0400
Change group install => group upgrade for installed groups. BZ 833087.
diff --git a/yum/__init__.py b/yum/__init__.py
index 8507edb..00db8ed 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -3775,6 +3775,9 @@ much more problems).
thisgroup.selected = True
+ # Can move to upgrade, if installed and calling install
+ lupgrade = upgrade
+
pkgs = []
if 'mandatory' in package_types:
pkgs.extend(thisgroup.mandatory_packages)
@@ -3788,6 +3791,7 @@ much more problems).
if igroup_data:
if thisgroup.groupid in self.igroups.groups:
igrp = self.igroups.groups[thisgroup.groupid]
+ lupgrade = True
else:
self.igroups.add_group(thisgroup.groupid,
thisgroup.packages, ievgrp)
@@ -3801,7 +3805,7 @@ much more problems).
assert pkg in igroup_data
if (pkg not in igroup_data or
igroup_data[pkg].startswith('blacklisted')):
- # (upgrade and igroup_data[pkg] == 'available')):
+ # (lupgrade and igroup_data[pkg] == 'available')):
msg = _('Skipping package %s from group %s')
self.verbose_logger.log(logginglevels.DEBUG_2,
msg, pkg, thisgroup.groupid)
@@ -3816,7 +3820,7 @@ much more problems).
txmbrs = []
try:
- if (upgrade and
+ if (lupgrade and
(self.conf.group_command == 'simple' or
(igroup_data and igroup_data[pkg] == 'installed'))):
txmbrs = self.update(name = pkg,
@@ -3843,7 +3847,7 @@ much more problems).
count_cond_test = 0
# FIXME: What do we do about group conditionals when group==objects
# or group upgrade for group_command=simple?
- if not upgrade and group_conditionals:
+ if not lupgrade and group_conditionals:
for condreq, cond in thisgroup.conditional_packages.iteritems():
if self.isPackageInstalled(cond):
try:
@@ -3881,7 +3885,7 @@ much more problems).
self.tsInfo.conditionals[cond] = []
self.tsInfo.conditionals[cond].extend(pkgs)
- if not upgrade and len(txmbrs_used) == old_txmbrs:
+ if not lupgrade and len(txmbrs_used) == old_txmbrs:
self.logger.critical(_('Warning: Group %s does not have any packages to install.'), thisgroup.groupid)
if count_cond_test:
self.logger.critical(_('Group %s does have %u conditional packages, which may get installed.'),
commit 94c6b73fa397c6189c498714af25ec28cf3eb4d4
Author: James Antill <james at and.org>
Date: Wed Jun 19 15:33:31 2013 -0400
Give more text when telling user about y-c-t, mention history. BZ 974576.
diff --git a/yum/__init__.py b/yum/__init__.py
index 9b082c1..8507edb 100644
--- a/yum/__init__.py
+++ b/yum/__init__.py
@@ -1154,7 +1154,10 @@ class YumBase(depsolve.Depsolve):
if (unfinished_transactions_check and
misc.find_unfinished_transactions(yumlibpath=self.conf.persistdir)):
msg = _('There are unfinished transactions remaining. You might ' \
- 'consider running yum-complete-transaction first to finish them.' )
+ 'consider running yum-complete-transaction, or' \
+ ' "yum history redo last", first to finish them. If that' \
+ ' doesn\'t work you\'ll have to try removing/installing' \
+ ' packages by hand (maybe package-cleanup can help).')
self.logger.critical(msg)
self.yumUtilsMsg(self.logger.critical, "yum-complete-transaction")
time.sleep(3)
commit 38b896310a551e0012300393ff5264f4fc1e8052
Author: James Antill <james at and.org>
Date: Wed Jun 19 10:42:10 2013 -0400
Fix the tolerant yum.conf text.
diff --git a/docs/yum.conf.5 b/docs/yum.conf.5
index 0ae7f5c..5b626b9 100644
--- a/docs/yum.conf.5
+++ b/docs/yum.conf.5
@@ -139,11 +139,9 @@ Default is `1'.
.IP
\fBtolerant\fR
-Either `1' or `0'. If enabled, then yum will be tolerant of errors on the
-command line with regard to packages. For example: if you request to install
-foo, bar and baz and baz is installed; yum won't error out complaining that baz
-is already installed. Default to `0' (not tolerant).
-Note: This option currently does nothing.
+Either `1' or `0'. If enabled, yum will go slower, checking for things that
+shouldn't be possible making it more tolerant of external errors.
+Default to `0' (not tolerant).
.br
Command-line option: \fB\-t\fP
More information about the Yum-commits
mailing list