From f0b91355afb6b9d0bdc52c489b8b6a1ce4e78ab4 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Mon, 12 Oct 2015 10:43:51 -0400 Subject: [PATCH] Add patch to hopefully close race condition in systemd builds - Related to https://bugzilla.redhat.com/show_bug.cgi?id=1249051 --- ...l-merge-Create-cache-file-atomically.patch | 38 +++++++++++++++++++ intltool.spec | 10 ++++- 2 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 intltool-merge-Create-cache-file-atomically.patch diff --git a/intltool-merge-Create-cache-file-atomically.patch b/intltool-merge-Create-cache-file-atomically.patch new file mode 100644 index 0000000..677ea45 --- /dev/null +++ b/intltool-merge-Create-cache-file-atomically.patch @@ -0,0 +1,38 @@ +From d328542bea50b9445c63cdf2454052392282a1ce Mon Sep 17 00:00:00 2001 +From: Colin Walters +Date: Thu, 8 Oct 2015 16:25:47 -0400 +Subject: [PATCH] intltool-merge: Create cache file atomically + +It's going to be relatively common for build systems operating in +parallel to run multiple copies of `intltool-merge`, yet the cache +file is not created atomically (i.e. with the "open .tmp file and +rename()" dance). + +I suspect (but have not yet determined conclusively) this is the cause +of some systemd build issues where translations don't appear in the +merged file. + +Regardless, this patch can't hurt. +--- + intltool-merge.in | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/intltool-merge.in b/intltool-merge.in +index 1afa2a4..d1eba8f 100644 +--- a/intltool-merge.in ++++ b/intltool-merge.in +@@ -371,9 +371,10 @@ sub create_cache + + &create_translation_database; + +- open CACHE, ">$cache_file" || die; ++ open CACHE, ">$cache_file" . ".tmp" || die; + print CACHE join "\x01", %translations; + close CACHE; ++ rename("$cache_file" . ".tmp", "$cache_file"); + } + + sub load_cache +-- +1.8.3.1 + diff --git a/intltool.spec b/intltool.spec index f989993..7a7b189 100644 --- a/intltool.spec +++ b/intltool.spec @@ -1,7 +1,7 @@ Name: intltool Summary: Utility for internationalizing various kinds of data files Version: 0.51.0 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 with exceptions Group: Development/Tools #VCS: bzr:https://code.edge.launchpad.net/~intltool/intltool/trunk @@ -21,6 +21,9 @@ BuildRequires: gettext # which has a sensible gettext integration. #Patch0: schemas-merge.patch Patch1: intltool-0.51.0-perl-5.22.patch +# https://bugs.launchpad.net/intltool/+bug/1505260 +# https://bugzilla.redhat.com/show_bug.cgi?id=1249051 +Patch2: intltool-merge-Create-cache-file-atomically.patch %description This tool automatically extracts translatable strings from oaf, glade, @@ -30,6 +33,7 @@ them in the po files. %prep %setup -q %patch1 -p1 +%patch2 -p1 %build %configure @@ -51,6 +55,10 @@ make check %{_mandir}/man8/intltool*.8* %changelog +* Mon Oct 12 2015 Colin Walters - 0.51.0-4 +- Add patch to hopefully close race condition in systemd builds +- Related to https://bugzilla.redhat.com/show_bug.cgi?id=1249051 + * Mon Jul 13 2015 Ralf Corsépius - 0.51.0-3 - Add intltool-0.51.0-perl-5.22.patch (Address RHBZ#1233444) - Remove unnecessary %%debug_package.