[Rpm-metadata] modifyrepo.py

James Antill james at osuosl.org
Tue Apr 16 20:15:35 UTC 2013


 modifyrepo.py |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit d10d518d16d97fdce00676d57461e089982d613d
Author: James Antill <james at and.org>
Date:   Tue Apr 16 16:15:19 2013 -0400

    Fail for bad compress-type options to modifyrepo, like createrepo. BZ 886589.

diff --git a/modifyrepo.py b/modifyrepo.py
index e7c34c0..bffe99a 100755
--- a/modifyrepo.py
+++ b/modifyrepo.py
@@ -208,8 +208,10 @@ def main(args):
     repomd.checksum_type = opts.sumtype
     repomd.unique_md_filenames = opts.unique_md_filenames
     repomd.compress = opts.compress
-    if opts.compress_type in _available_compression:
-        repomd.compress_type = opts.compress_type
+    if opts.compress_type not in _available_compression:
+        print "Compression %s not available: Please choose from: %s" % (opts.compress_type, ', '.join(_available_compression))
+        return 1
+    repomd.compress_type = opts.compress_type
 
     # remove
     if opts.remove:


More information about the Rpm-metadata mailing list