Blame SOURCES/BZ-1060702-reposync-nonexistent-repo.patch

085af2
commit fbdc19f411ee31bf18af242e7b3b39947ed28f2d
085af2
Author: Valentina Mukhamedzhanova <vmukhame@redhat.com>
085af2
Date:   Thu Feb 13 15:30:23 2014 +0100
085af2
085af2
     Fix 'reposync -r nosuchrepo' behaviour. BZ 1060702
085af2
    
085af2
    Show a warning if user-provided repoid was not found and
085af2
    exit(1) if none of user-provided repoids were found.
085af2
085af2
diff --git a/reposync.py b/reposync.py
085af2
index b1ee285..e7c98a3 100755
085af2
--- a/reposync.py
085af2
+++ b/reposync.py
085af2
@@ -179,7 +179,15 @@ def main():
085af2
         
085af2
         # find the ones we want
085af2
         for glob in opts.repoid:
085af2
-            myrepos.extend(my.repos.findRepos(glob))
085af2
+            add_repos = my.repos.findRepos(glob)
085af2
+            if not add_repos:
085af2
+                print >> sys.stderr, "Warning: cannot find repository %s" % glob
085af2
+                continue
085af2
+            myrepos.extend(add_repos)
085af2
+
085af2
+        if not myrepos:
085af2
+            print >> sys.stderr, "No repositories found"
085af2
+            sys.exit(1)
085af2
         
085af2
         # disable them all
085af2
         for repo in my.repos.repos.values():