rpms/createrepo/devel atomic-cache-checksum.patch,1.2,1.3
James Antill
james at fedoraproject.org
Thu Oct 9 17:53:06 UTC 2008
Author: james
Update of /cvs/pkgs/rpms/createrepo/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13336
Modified Files:
atomic-cache-checksum.patch
Log Message:
* Thu Oct 9 2008 James Antill <james at fedoraproject.org> - 0.9.5-4
- Do atomic updates to the cachedir, for parallel runs
- Fix the patch
atomic-cache-checksum.patch:
Index: atomic-cache-checksum.patch
===================================================================
RCS file: /cvs/pkgs/rpms/createrepo/devel/atomic-cache-checksum.patch,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- atomic-cache-checksum.patch 9 Oct 2008 17:45:34 -0000 1.2
+++ atomic-cache-checksum.patch 9 Oct 2008 17:52:36 -0000 1.3
@@ -1,54 +1,24 @@
-commit d88de04e301cbe5383e88505ea133f07a659fcbd
-Author: James Antill <james at and.org>
-Date: Wed Oct 8 12:42:24 2008 -0400
-
- Fix parallel updates to the cachedir, thx to Michael Schwendt for spotting it
-
-diff --git a/createrepo/yumbased.py b/createrepo/yumbased.py
-index adb6017..3cd0cfe 100644
---- a/createrepo/yumbased.py
-+++ b/createrepo/yumbased.py
-@@ -28,6 +28,7 @@ from yum.sqlutils import executeSQL
- from rpmUtils.transaction import initReadOnlyTransaction
+diff -rup createrepo-0.9.5-orig/createrepo/yumbased.py createrepo-0.9.5/createrepo/yumbased.py
+--- createrepo-0.9.5-orig/createrepo/yumbased.py 2008-02-18 15:30:13.000000000 -0500
++++ createrepo-0.9.5/createrepo/yumbased.py 2008-10-09 13:51:48.000000000 -0400
+@@ -30,6 +30,7 @@ from rpmUtils.transaction import initRea
from rpmUtils.miscutils import flagToString, stringToVersion
+ import libxml2
import utils
+import tempfile
- class CreateRepoPackage(YumLocalPackage):
- def __init__(self, ts, package):
-@@ -72,9 +73,13 @@ class CreateRepoPackage(YumLocalPackage):
+ #FIXME - merge into class with config stuff
+ fileglobs = ['.*bin\/.*', '^\/etc\/.*', '^\/usr\/lib\/sendmail$']
+@@ -106,9 +107,17 @@ class CreateRepoPackage(YumLocalPackage)
else:
checksum = misc.checksum('sha', self.localpath)
- csumo = open(csumfile, 'w')
+- csumo.write(checksum)
+- csumo.close()
+
+ # This is atomic cache creation via. rename, so we can have two
+ # tasks using the same cachedir ... mash does this.
-+ csumo = tempfile.NamedTemporaryFile(mode='w', dir=self.crp_cachedir)
- csumo.write(checksum)
- csumo.close()
-+ os.rename(csumo.name, csumfile)
-
- self._checksum = checksum
-
-commit e4edc4aa4d6446686c9c796c8d1996c6122b9a71
-Author: James Antill <james at and.org>
-Date: Thu Oct 9 13:42:39 2008 -0400
-
- Change the NamedTemporaryFile() usage to mkstemp(), stupid API
-
-diff --git a/createrepo/yumbased.py b/createrepo/yumbased.py
-index 3cd0cfe..60568e3 100644
---- a/createrepo/yumbased.py
-+++ b/createrepo/yumbased.py
-@@ -76,10 +76,14 @@ class CreateRepoPackage(YumLocalPackage):
-
- # This is atomic cache creation via. rename, so we can have two
- # tasks using the same cachedir ... mash does this.
-- csumo = tempfile.NamedTemporaryFile(mode='w', dir=self.crp_cachedir)
-- csumo.write(checksum)
-- csumo.close()
-- os.rename(csumo.name, csumfile)
+ try:
+ (csumo, tmpfilename) = tempfile.mkstemp(dir=self.crp_cachedir)
+ csumo = os.fdopen(csumo, 'w', -1)
@@ -60,3 +30,4 @@
self._checksum = checksum
+Only in createrepo-0.9.5/createrepo: yumbased.py.orig
More information about the scm-commits
mailing list