[Rpm-metadata] createrepo/__init__.py genpkgmetadata.py

skvidal at osuosl.org skvidal at osuosl.org
Wed Dec 17 22:19:20 UTC 2008


 createrepo/__init__.py |    9 ++++++++-
 genpkgmetadata.py      |    2 ++
 2 files changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 8053af86adff0fd3b61a503327363ccfa988e351
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Wed Dec 17 16:49:01 2008 -0500

    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" \


More information about the Rpm-metadata mailing list