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

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