From: Seth Vidal Date: Wed, 17 Dec 2008 21:49:01 +0000 (-0500) Subject: allow alternative path for --update via --update-md-path, So your old repodata X-Git-Tag: upstream/0.9.9~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8053af86adff0fd3b61a503327363ccfa988e351;p=tools%2Fcreaterepo.git allow alternative path for --update via --update-md-path, So your old repodata does not have to be in the path you want to look through. --- diff --git a/createrepo/__init__.py b/createrepo/__init__.py index 744bb67..3e65a6d 100644 --- a/createrepo/__init__.py +++ b/createrepo/__init__.py @@ -63,6 +63,7 @@ class MetaDataConfig(object): self.checkts = False self.split = False self.update = False + self.update_md_path = None self.skip_stat = False self.database = False self.outputdir = None @@ -300,11 +301,17 @@ class MetaDataGenerator: 'verbose' : self.conf.verbose, 'pkgdir' : os.path.normpath(self.package_dir) } + if self.conf.skip_stat: opts['do_stat'] = False + if self.conf.update_md_path: + old_repo_path = os.path.normpath(self.conf.update_md_path) + else: + old_repo_path = self.conf.outputdir + #and scan the old repo - self.oldData = readMetadata.MetadataIndex(self.conf.outputdir, opts) + self.oldData = readMetadata.MetadataIndex(old_repo_path, opts) def _setup_grabber(self): if not hasattr(self, '_grabber'): diff --git a/genpkgmetadata.py b/genpkgmetadata.py index 77b4095..a98c623 100755 --- a/genpkgmetadata.py +++ b/genpkgmetadata.py @@ -64,6 +64,8 @@ def parseArgs(args, conf): # help="Only make the sqlite databases - does not work with --update, yet") parser.add_option("--update", default=False, action="store_true", help="use the existing repodata to speed up creation of new") + parser.add_option("--update-md-path", default=None, dest='update_md_path', + help="use the existing repodata for --update from this path") parser.add_option("--skip-stat", dest='skip_stat', default=False, action="store_true", help="skip the stat() call on a --update, assumes if the file" \ "name is the same then the file is still the same" \