Discussion:
modifyrepo patch: automatic option defaults
Michael Schroeder
2013-09-16 15:25:54 UTC
Permalink
Hi rpmmd folks,

attached is a patch that makes modifyrepo take the defaults of the
checksum and unique-md-filenames options from the 'primary' entry
in the repomd.xml file.

Detecting the compression type is left as an exercise to the reader ;)

Cheers,
Michael.
--
Michael Schroeder ***@suse.de
SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
Zdenek Pavlas
2013-09-26 11:28:24 UTC
Permalink
Hi!
parser.add_option("--unique-md-filenames", dest="unique_md_filenames",
- help="include the file's checksum in the filename, helps with proxies (default)",
- default=True, action="store_true")
- parser.add_option("--simple-md-filenames", dest="unique_md_filenames",
+ help="include the file's checksum in the filename, helps with proxies",
+ action="store_true")
+ parser.add_option("--simple-md-filenames", dest="simple_md_filenames",
help="do not include the file's checksum in the filename",
- action="store_false")
+ action="store_true")
Are two different names necessary? I'd just drop the default=True part,
and run the autodetection when unique_md_filenames==None.
Detecting the compression type is left as an exercise to the reader
np
Michael Schroeder
2013-09-26 15:35:13 UTC
Permalink
Post by Zdenek Pavlas
parser.add_option("--unique-md-filenames", dest="unique_md_filenames",
- help="include the file's checksum in the filename, helps with proxies (default)",
- default=True, action="store_true")
- parser.add_option("--simple-md-filenames", dest="unique_md_filenames",
+ help="include the file's checksum in the filename, helps with proxies",
+ action="store_true")
+ parser.add_option("--simple-md-filenames", dest="simple_md_filenames",
help="do not include the file's checksum in the filename",
- action="store_false")
+ action="store_true")
Are two different names necessary? I'd just drop the default=True part,
and run the autodetection when unique_md_filenames==None.
Sure, feel free to improve the patch ;-)

Cheers,
Michael.
--
Michael Schroeder ***@suse.de
SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg
main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);}
Loading...