extras-buildsys/utils/pushscript Utils.py,1.30,1.31

Michael Schwendt mschwendt at fedoraproject.org
Tue May 12 14:00:35 UTC 2009


Author: mschwendt

Update of /cvs/fedora/extras-buildsys/utils/pushscript
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv31601

Modified Files:
	Utils.py 
Log Message:
Only backup'n'restore two specific repoview files in repodata directories
(only index.html is still used though), so old metadata files don't
pile up when using "createrepo --unique-md-filenames".




Index: Utils.py
===================================================================
RCS file: /cvs/fedora/extras-buildsys/utils/pushscript/Utils.py,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- Utils.py	10 May 2009 09:28:06 -0000	1.30
+++ Utils.py	12 May 2009 14:00:34 -0000	1.31
@@ -169,14 +169,11 @@
 
 def _restore_repodata_dir(tmpdir,targetdir):  # helper function
     for f in os.listdir(tmpdir):
-        sourcefile = os.path.join(tmpdir,f)
+        if f not in ['index.html','repoview']:
+            continue
         targetfile = os.path.join(targetdir,f)
-        if os.path.exists(targetfile):  # don't overwrite new files
-            if os.path.isdir(targetfile):
-                shutil.rmtree(sourcefile)
-            else:
-                os.remove(sourcefile)
-        else:
+        if not os.path.exists(targetfile):  # don't overwrite new files
+            sourcefile = os.path.join(tmpdir,f)
             shutil.move(sourcefile,targetfile)
 
 




More information about the fedora-extras-commits mailing list