[PATCH] repo-pkgs: Fix repoid parsing. BZ 1055132.

Zdenek Pavlas zpavlas at redhat.com
Mon Jan 20 08:56:40 UTC 2014


checkRepoPackageArg() is relaxed but doCommand() assumes a repoid.
Make these use the same repo. When matching names, match ui_id too.
---
 yum/repos.py   | 2 +-
 yumcommands.py | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/yum/repos.py b/yum/repos.py
index 67ef1e4..f32ffac 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -217,7 +217,7 @@ class RepoStorage:
                 assert name == repo.id
                 if match(name):
                     result.append(repo)
-                elif name_match and match(repo.name):
+                elif name_match and (match(repo.name) or match(repo.ui_id)):
                     result.append(repo)
 
         return result
diff --git a/yumcommands.py b/yumcommands.py
index 291eae5..e4fb403 100644
--- a/yumcommands.py
+++ b/yumcommands.py
@@ -155,6 +155,7 @@ def checkRepoPackageArg(base, basecmd, extcmds):
         base.repos.enableRepo(repos[0].id)
         base.verbose_logger.info(
                 _('Repo %s has been automatically enabled.') % repos[0].ui_id)
+    return repos[0].id
 
 
 def checkItemArg(base, basecmd, extcmds):
@@ -3501,8 +3502,7 @@ class RepoPkgsCommand(YumCommand):
         """
         checkRootUID(base)
         checkGPGKey(base)
-        checkRepoPackageArg(base, basecmd, extcmds)
-        checkEnabledRepo(base, extcmds)
+        self.repoid = checkRepoPackageArg(base, basecmd, extcmds)
 
     def doCommand(self, base, basecmd, extcmds):
         """Execute this command.
@@ -3523,7 +3523,7 @@ class RepoPkgsCommand(YumCommand):
             for txmbr in txmbrs:
                 txmbr.repopkg = repoid
 
-        repoid = extcmds[0]
+        repoid = self.repoid
         cmd = extcmds[1]
         args = extcmds[2:]
         noargs = False
-- 
1.7.11.7



More information about the Yum-devel mailing list