clean up old versions of primary, filelists and other that are lingering in
authorSeth Vidal <skvidal@fedoraproject.org>
Tue, 29 Jan 2008 02:48:34 +0000 (21:48 -0500)
committerSeth Vidal <skvidal@fedoraproject.org>
Tue, 29 Jan 2008 02:48:34 +0000 (21:48 -0500)
the repodata dir due to sha1-addition

createrepo/__init__.py

index 3efad56d966b931c5085866a837853115fadc806..34cbeb98dded2ffd238e9c01f2eca0ce48f0a1b6 100644 (file)
@@ -661,6 +661,12 @@ class MetaDataGenerator:
         for f in os.listdir(output_old_dir):
             oldfile = os.path.join(output_old_dir, f)
             finalfile = os.path.join(output_final_dir, f)
+            if f.find('-') != -1 and f.split('-')[1] in ('primary.sqlite.bz2',
+                    'filelists.sqlite.bz2', 'primary.xml.gz','other.sqlite.bz2',
+                    'other.xml.gz','filelists.xml.gz'):
+                os.remove(oldfile) # kill off the old ones
+                continue
+                
             if os.path.exists(finalfile):
                 # Hmph?  Just leave it alone, then.
                 try: