rpms/createrepo/devel atomic-cache-checksum.patch, 1.1, 1.2 createrepo.spec, 1.43, 1.44

James Antill james at fedoraproject.org
Thu Oct 9 17:46:04 UTC 2008


Author: james

Update of /cvs/pkgs/rpms/createrepo/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv12008

Modified Files:
	atomic-cache-checksum.patch createrepo.spec 
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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- atomic-cache-checksum.patch	8 Oct 2008 16:38:36 -0000	1.1
+++ atomic-cache-checksum.patch	9 Oct 2008 17:45:34 -0000	1.2
@@ -1,15 +1,22 @@
-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-08 12:36:14.000000000 -0400
-@@ -30,6 +30,7 @@ from rpmUtils.transaction import initRea
+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
  from rpmUtils.miscutils import flagToString, stringToVersion
- import libxml2
  import utils
 +import tempfile
  
- #FIXME - merge into class with config stuff
- fileglobs = ['.*bin\/.*', '^\/etc\/.*', '^\/usr\/lib\/sendmail$']
-@@ -106,9 +107,13 @@ class CreateRepoPackage(YumLocalPackage)
+ class CreateRepoPackage(YumLocalPackage):
+     def __init__(self, ts, package):
+@@ -72,9 +73,13 @@ class CreateRepoPackage(YumLocalPackage):
               
          else:
              checksum = misc.checksum('sha', self.localpath)
@@ -24,4 +31,32 @@
          
          self._checksum = checksum
  
-Only in createrepo-0.9.5/createrepo: yumbased.py~
+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)
++                csumo.write(checksum)
++                csumo.close()
++                os.rename(tmpfilename, csumfile)
++            except:
++                pass
+         
+         self._checksum = checksum
+ 


Index: createrepo.spec
===================================================================
RCS file: /cvs/pkgs/rpms/createrepo/devel/createrepo.spec,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- createrepo.spec	8 Oct 2008 16:38:36 -0000	1.43
+++ createrepo.spec	9 Oct 2008 17:45:34 -0000	1.44
@@ -3,7 +3,7 @@
 Summary: Creates a common metadata repository
 Name: createrepo
 Version: 0.9.5
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: GPLv2
 Group: System Environment/Base
 Source: %{name}-%{version}.tar.gz
@@ -47,8 +47,9 @@
 %{python_sitelib}/createrepo
 
 %changelog
-* Wed Oct  8 2008 James Antill <james at fedoraproject.org> - 0.9.5-3
+* 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
 
 * Fri Feb 22 2008 Seth Vidal <skvidal at fedoraproject.org> - 0.9.5-2
 - patch for the mistake in the raise for an empty pkgid




More information about the scm-commits mailing list