[arch-commits] Commit in intltool/trunk (PKGBUILD intltool-fixrace.patch)
Jelle van der Waa
jelle at archlinux.org
Sun Jun 21 15:23:34 UTC 2020
Date: Sunday, June 21, 2020 @ 15:23:33
Author: jelle
Revision: 389847
Add reproducible builds patch for race condition when running with -j $(nproc)
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=950444
Added:
intltool/trunk/intltool-fixrace.patch
Modified:
intltool/trunk/PKGBUILD
------------------------+
PKGBUILD | 9 ++++++---
intltool-fixrace.patch | 43 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 49 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-06-21 15:22:48 UTC (rev 389846)
+++ PKGBUILD 2020-06-21 15:23:33 UTC (rev 389847)
@@ -2,7 +2,7 @@
pkgname=intltool
pkgver=0.51.0
-pkgrel=5
+pkgrel=6
pkgdesc="The internationalization tool collection"
arch=('any')
url="https://launchpad.net/intltool"
@@ -11,12 +11,14 @@
source=(https://launchpad.net/intltool/trunk/${pkgver}/+download/${pkgname}-${pkgver}.tar.gz{,.asc}
intltool-0.51.0-perl-5.26.patch
intltool-merge-Create-cache-file-atomically.patch
- intltool_distcheck-fix.patch)
+ intltool_distcheck-fix.patch
+ intltool-fixrace.patch)
sha256sums=('67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd'
'SKIP'
'458f5d53ac358810879080f69b11649901babcacc14471c243eb850e9436d546'
'13bd6deb65dc94933f132919d4eea4c24354d7c1c1c9e5930cb6e70c75703763'
- '58cb7d60796bc69c7d0865f106feb589d0271619e62f8741bff6f5ce1a2615ff')
+ '58cb7d60796bc69c7d0865f106feb589d0271619e62f8741bff6f5ce1a2615ff'
+ '5c453ccb8bfe6e0b05d7a55e66dcfa793ea81d9bbe9fdc41f668326ba9310deb')
validpgpkeys=('9EBD001680E8C8F9FAC61A9BE1A701D4C9DE75B5')
prepare() {
@@ -24,6 +26,7 @@
patch -Np1 -i ../intltool-0.51.0-perl-5.26.patch
patch -Np1 -i ../intltool-merge-Create-cache-file-atomically.patch
patch -Np1 -i ../intltool_distcheck-fix.patch
+ patch -Np1 -i ../intltool-fixrace.patch # https://bugs.launchpad.net/intltool/+bug/1687644
}
build() {
Added: intltool-fixrace.patch
===================================================================
--- intltool-fixrace.patch (rev 0)
+++ intltool-fixrace.patch 2020-06-21 15:23:33 UTC (rev 389847)
@@ -0,0 +1,43 @@
+From: Bernhard M. Wiedemann <bmwiedemann+intltool at suse.de>
+
+avoid a race where some processes try to use a partial cache file
+that is still being written to.
+Note that we release the lock before load_cache,
+because if we got the lock, the cache is already completely written
+and it is OK to have multiple parallel readers
+
+Index: intltool-0.51.0/intltool-merge.in
+===================================================================
+--- intltool-0.51.0.orig/intltool-merge.in
++++ intltool-0.51.0/intltool-merge.in
+@@ -43,6 +43,7 @@ use Getopt::Long;
+ use Text::Wrap;
+ use File::Basename;
+ use Encode;
++use Fcntl qw(:flock);
+
+ my $must_end_tag = -1;
+ my $last_depth = -1;
+@@ -392,11 +393,14 @@ sub load_cache
+
+ sub get_cached_translation_database
+ {
++ open(my $lockfh, ">", "$cache_file.lock") or die $!;
++ flock($lockfh, LOCK_EX) or die "Could not lock '$cache_file.lock' - $!";
+ my $cache_file_age = -M $cache_file;
+ if (defined $cache_file_age)
+ {
+ if ($cache_file_age <= &get_newest_po_age)
+ {
++ close($lockfh);
+ &load_cache;
+ return;
+ }
+@@ -404,6 +408,7 @@ sub get_cached_translation_database
+ }
+
+ &create_cache;
++ close($lockfh);
+ }
+
+ sub add_translation
More information about the arch-commits
mailing list