From: Seth Vidal Date: Mon, 8 Feb 2010 17:11:17 +0000 (-0500) Subject: - make --unique-md-filenames the default X-Git-Tag: upstream/0.9.9~32 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b86b9e66b5f9fee25b529bc54348e0e47824ce25;p=tools%2Fcreaterepo.git - make --unique-md-filenames the default - add simple-md-filenames to be able to disable the above if desired --- diff --git a/createrepo/__init__.py b/createrepo/__init__.py index 0ffe6cb..4ec2d51 100644 --- a/createrepo/__init__.py +++ b/createrepo/__init__.py @@ -95,7 +95,7 @@ class MetaDataConfig(object): self.directory = None self.directories = [] self.changelog_limit = None # needs to be an int or None - self.unique_md_filenames = False + self.unique_md_filenames = True self.additional_metadata = {} # dict of 'type':'filename' self.revision = str(int(time.time())) self.content_tags = [] # flat list of strings (like web 2.0 tags) diff --git a/docs/createrepo.8 b/docs/createrepo.8 index 80c4464..ff1aab0 100644 --- a/docs/createrepo.8 +++ b/docs/createrepo.8 @@ -81,7 +81,11 @@ Output time based profiling information. .IP "\fB\--changelog-limit\fP CHANGELOG_LIMIT" Only import the last N changelog entries, from each rpm, into the metadata .IP "\fB\--unique-md-filenames\fP" -Include the file's checksum in the metadata filename, helps HTTP caching +Include the file's checksum in the metadata filename, helps HTTP caching (default) + +.IP "\fB\--simple-md-filenames\fP" +Do not include the file's checksum in the metadata filename. + .IP "\fB\--distro\fP" Specify distro tags. Can be specified more than once. Optional syntax specifying a cpeid(http://cpe.mitre.org/) --distro=cpeid,distrotag diff --git a/genpkgmetadata.py b/genpkgmetadata.py index cf3dcd9..8923841 100755 --- a/genpkgmetadata.py +++ b/genpkgmetadata.py @@ -94,6 +94,9 @@ def parse_args(args, conf): default=None, help="only import the last N changelog entries") parser.add_option("--unique-md-filenames", dest="unique_md_filenames", help="include the file's checksum in the filename,helps with proxies", + default=True, action="store_true") + parser.add_option("--simple-md-filenames", dest="simple_md_filenames", + help="do not include the file's checksum in the filename,helps with proxies", default=False, action="store_true") parser.add_option("--distro", default=[], action="append", help="distro tag and optional cpeid: --distro" "'cpeid,textname'") @@ -135,7 +138,9 @@ def parse_args(args, conf): errorprint(_('--split and --checkts options are mutually exclusive')) sys.exit(1) - + if opts.simple_md_filenames: + opts.unique_md_filenames = False + # let's switch over to using the conf object - put all the opts into it for opt in parser.option_list: if opt.dest is None: # this is fairly silly