make the sqlite file names not look stupid
authorSeth Vidal <skvidal@linux.duke.edu>
Sat, 3 Feb 2007 20:40:58 +0000 (20:40 +0000)
committerSeth Vidal <skvidal@linux.duke.edu>
Sat, 3 Feb 2007 20:40:58 +0000 (20:40 +0000)
dumpMetadata.py

index 02abab957cc8d529cac6eef25d397c64a6220d9c..f9a3aea8635dbf2ddadb1e160f4461766de82db6 100644 (file)
@@ -785,22 +785,25 @@ def repoXML(node, cmds):
         if cmds['database']:
             if ftype == 'primary':
                 rp.getPrimary(complete_path, csum)
-                resultname = 'primary.xml.gz.sqlite'
-                compressed_name = 'primary.xml.gz.sqlite.bz2'
                             
             elif ftype == 'filelists':
                 rp.getFilelists(complete_path, csum)
-                resultname = 'filelists.xml.gz.sqlite'
-                compressed_name = 'filelists.xml.gz.sqlite.bz2'
                 
             elif ftype == 'other':
                 rp.getOtherdata(complete_path, csum)
-                resultname = 'other.xml.gz.sqlite'
-                compressed_name = 'other.xml.gz.sqlite.bz2'
-                
-            resultpath = os.path.join(repopath, resultname)
+            
+
+            tmp_result_name = '%s.xml.gz.sqlite' % ftype
+            tmp_result_path = os.path.join(repopath, tmp_result_name)
+            good_name = '%s.sqlite' % ftype
+            resultpath = os.path.join(repopath, good_name)
+            
+            # rename from silly name to not silly name
+            os.rename(tmp_result_path, resultpath)
+            compressed_name = '%s.bz2' % good_name
             result_compressed = os.path.join(repopath, compressed_name)
             db_csums[ftype] = getChecksum(sumtype, resultpath)
+            
             # compress the files
             bzipFile(resultpath, result_compressed)
             # csum the compressed file