make --update and --split mostly work again
authorSeth Vidal <skvidal@fedoraproject.org>
Thu, 17 Jan 2008 17:52:36 +0000 (12:52 -0500)
committerSeth Vidal <skvidal@fedoraproject.org>
Thu, 17 Jan 2008 17:52:36 +0000 (12:52 -0500)
createrepo/__init__.py

index 32e3b6c2202c59c5a8425c3cfdd7199543c98c69..5381fe9d97f2a13eb41514eabcc10a5d1bdf63f9 100644 (file)
@@ -670,10 +670,25 @@ class SplitMetaDataGenerator(MetaDataGenerator):
 
     def doPkgMetadata(self):
         """all the heavy lifting for the package metadata"""
-        import types
         if len(self.conf.directories) == 1:
             MetaDataGenerator.doPkgMetadata(self)
             return
+
+        if self.conf.update:
+            #build the paths
+            primaryfile = os.path.join(self.conf.outputdir, self.conf.finaldir, self.conf.primaryfile)
+            flfile = os.path.join(self.conf.outputdir, self.conf.finaldir, self.conf.filelistsfile)
+            otherfile = os.path.join(self.conf.outputdir, self.conf.finaldir, self.conf.otherfile)
+            opts = {
+                'verbose' : self.conf.verbose,
+                'pkgdir' : os.path.normpath(self.package_dir)
+            }
+            if self.conf.skip_stat:
+                opts['do_stat'] = False
+                
+            #and scan the old repo
+            self.oldData = readMetadata.MetadataIndex(self.conf.outputdir,
+                                                      primaryfile, flfile, otherfile, opts)
             
         filematrix = {}
         for mydir in self.conf.directories: