allow alternative path for --update via --update-md-path, So your old repodata
authorSeth Vidal <skvidal@fedoraproject.org>
Wed, 17 Dec 2008 21:49:01 +0000 (16:49 -0500)
committerSeth Vidal <skvidal@fedoraproject.org>
Wed, 17 Dec 2008 21:49:01 +0000 (16:49 -0500)
does not have to be in the path you want to look through.

createrepo/__init__.py
genpkgmetadata.py

index 744bb6737cb014f39740e0b865df4da764feba66..3e65a6d1eae084691a0b3960d2fffa7a779add2e 100644 (file)
@@ -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'):
index 77b4095474c1936c4e0dfc4179d196b72b51ed81..a98c6235df7354056e6168bfaff74fbbf238d95e 100755 (executable)
@@ -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" \