diff --git a/atomic-cache-checksum.patch b/atomic-cache-checksum.patch new file mode 100644 index 0000000..68899a3 --- /dev/null +++ b/atomic-cache-checksum.patch @@ -0,0 +1,27 @@ +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 + 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) + + else: + checksum = misc.checksum('sha', self.localpath) +- csumo = open(csumfile, 'w') ++ ++ # 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 + +Only in createrepo-0.9.5/createrepo: yumbased.py~ diff --git a/createrepo.spec b/createrepo.spec index 1e74075..bdce153 100644 --- a/createrepo.spec +++ b/createrepo.spec @@ -3,12 +3,13 @@ Summary: Creates a common metadata repository Name: createrepo Version: 0.9.5 -Release: 2%{?dist} +Release: 3%{?dist} License: GPLv2 Group: System Environment/Base Source: %{name}-%{version}.tar.gz Patch0: ten-changelog-limit.patch Patch1: empty-pkgid-raise.patch +Patch2: atomic-cache-checksum.patch URL: http://linux.duke.edu/projects/metadata/ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArchitectures: noarch @@ -24,6 +25,7 @@ packages. %setup -q %patch0 -p0 %patch1 -p0 +%patch2 -p1 %build @@ -45,6 +47,9 @@ rm -rf $RPM_BUILD_ROOT %{python_sitelib}/createrepo %changelog +* Wed Oct 8 2008 James Antill - 0.9.5-3 +- Do atomic updates to the cachedir, for parallel runs + * Fri Feb 22 2008 Seth Vidal - 0.9.5-2 - patch for the mistake in the raise for an empty pkgid