[Yum-devel] [PATCH] Adjust logic for source repos in CDN. BZ 710469, BZ 732649.

Zdeněk Pavlas zpavlas at redhat.com
Tue Sep 13 10:13:39 UTC 2011


We're not sure which of the two source repo naming conventions
is used, so search for both.
---
 yum-builddep.py  |    2 +-
 yumdownloader.py |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/yum-builddep.py b/yum-builddep.py
index 642c66c..f24bfce 100755
--- a/yum-builddep.py
+++ b/yum-builddep.py
@@ -128,7 +128,7 @@ class YumBuildDep(YumUtilBase):
                 issource_repo = True
             if rhn_source_repos and (not repo.id.endswith('-source-rpms') and
                                      repo.id.endswith('-rpms')):
-                srcrepo = repo.id.replace('-rpms', '-source-rpms')
+                srcrepo = '%s-source,%s-source-rpms' % (repo.id, repo.id[:-5])
             elif not issource_repo:
                 srcrepo = '%s-source' % repo.id
             else:
diff --git a/yumdownloader.py b/yumdownloader.py
index 95144f1..d77c401 100755
--- a/yumdownloader.py
+++ b/yumdownloader.py
@@ -114,9 +114,9 @@ class YumDownloader(YumUtilBase):
 
         # Get all src repos.
         src_repos = {}
+        repos_source = self.repos.findRepos('*-source')
         if rhn_source_repos: # RHN
             repos_source += self.repos.findRepos('*-source-rpms')
-        repos_source = self.repos.findRepos('*-source')
         for repo in repos_source:
             src_repos[repo.id] = False
 
@@ -131,7 +131,7 @@ class YumDownloader(YumUtilBase):
                     continue
                 if not repo.id.endswith("-rpms"):
                     continue
-                srcrepo = repo.id.replace('-rpms', '-source-rpms')
+                srcrepo = repo.id[:-5] + '-source-rpms'
                 if srcrepo in src_repos:
                     src_repos[srcrepo] = True
 
-- 
1.7.4.4



More information about the Yum-devel mailing list