[Rpm-metadata] modifyrepo.py

skvidal at osuosl.org skvidal at osuosl.org
Wed Oct 29 03:27:34 UTC 2008


 modifyrepo.py |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

New commits:
commit 04234b2400e3986b8694b175552926bb785f43c7
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Tue Oct 28 23:27:03 2008 -0400

    try/excepts on modifyrepo so we don't smack the user with a traceback

diff --git a/modifyrepo.py b/modifyrepo.py
index 558ec08..632d824 100755
--- a/modifyrepo.py
+++ b/modifyrepo.py
@@ -135,6 +135,14 @@ if __name__ == '__main__':
     if len(sys.argv) != 3 or '-h' in sys.argv:
         print "Usage: %s <input metadata> <output repodata>" % sys.argv[0]
         sys.exit()
+    try:
+        repomd = RepoMetadata(sys.argv[2])
+    except Exception, e:
+        print "Could not access repository: %s" % str(e)
+        sys.exit(1)
+    try:
+        repomd.add(sys.argv[1])
+    except Exception, e:
+        print "Could not add metadata from file %s: %s" % (sys.argv[1], str(e))
+        sys.exit(1)
 
-    repomd = RepoMetadata(sys.argv[2])
-    repomd.add(sys.argv[1])


More information about the Rpm-metadata mailing list