[Rpm-metadata] 2 commits - createrepo/__init__.py

Seth Vidal skvidal at linux.duke.edu
Tue Jan 29 02:52:47 UTC 2008


 createrepo/__init__.py |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit 1521473f548e6f8006b3d5d5ef999a5574f334d2
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Mon Jan 28 21:50:58 2008 -0500

    make sure non-unique-md-filenanmes-repos cleanup sqlite files
    if we switch to unique-md-filenames

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 34cbeb9..7a851da 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -666,7 +666,10 @@ class MetaDataGenerator:
                     'other.xml.gz','filelists.xml.gz'):
                 os.remove(oldfile) # kill off the old ones
                 continue
-                
+            if f in ('filelists.sqlite.bz2', 'other.sqlite.bz2', 'primary.sqlite.bz2'):
+                os.remove(oldfile)
+                continue
+                    
             if os.path.exists(finalfile):
                 # Hmph?  Just leave it alone, then.
                 try:
commit 7e1db817a2adf44c87ec18f17d859739c0a8f569
Author: Seth Vidal <skvidal at fedoraproject.org>
Date:   Mon Jan 28 21:48:34 2008 -0500

    clean up old versions of primary, filelists and other that are lingering in
    the repodata dir due to sha1-addition

diff --git a/createrepo/__init__.py b/createrepo/__init__.py
index 3efad56..34cbeb9 100644
--- a/createrepo/__init__.py
+++ b/createrepo/__init__.py
@@ -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:



More information about the Rpm-metadata mailing list