<pre style='margin:0'>
David B. Evans (dbevans) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/4d6e7e2a69db8f69470718a487578a104edc13e7">https://github.com/macports/macports-ports/commit/4d6e7e2a69db8f69470718a487578a104edc13e7</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 4d6e7e2a69db8f69470718a487578a104edc13e7
</span>Author: David B. Evans <devans@macports.org>
AuthorDate: Fri Jul 7 12:33:35 2017 -0700
<span style='display:block; white-space:pre;color:#404040;'> intltool: apply upstream bugfix for possible race condition
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> https://bugs.launchpad.net/intltool/+bug/1687644
</span>---
textproc/intltool/Portfile | 8 +++++-
textproc/intltool/files/patch-fix-race.diff | 43 +++++++++++++++++++++++++++++
2 files changed, 50 insertions(+), 1 deletion(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/textproc/intltool/Portfile b/textproc/intltool/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 023f2f2..bcb9fc4 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/textproc/intltool/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/textproc/intltool/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -5,7 +5,7 @@ PortSystem 1.0
</span> name intltool
epoch 1
version 0.51.0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-revision 2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+revision 3
</span> maintainers {devans @dbevans} openmaintainer
categories textproc gnome
license GPL-2+
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -47,10 +47,16 @@ patchfiles patch-remove-intltool-perl-hack.diff
</span>
# in perl 5.22 literal left braces in regex patterns must be escaped to avoid deprecation warnings
# introduced in perl 5.21.3
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# now a hard error in perl 5.26.0
</span> # https://metacpan.org/pod/release/PCM/perl-5.21.3/pod/perl5211delta.pod#A-literal-should-now-be-escaped-in-a-pattern
patchfiles-append patch-silence-perl-5.22-deprecation-warnings.diff
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# apply upstream bugfix to fix possible load_cache race condition when using make -jNUMBER as ports does
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://bugs.launchpad.net/intltool/+bug/1687644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+patchfiles-append patch-fix-race.diff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> configure.perl ${prefix}/bin/perl${pbranch}
test.run yes
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/textproc/intltool/files/patch-fix-race.diff b/textproc/intltool/files/patch-fix-race.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..2bbbff6
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/textproc/intltool/files/patch-fix-race.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,43 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+From: Bernhard M. Wiedemann <bmwiedemann+intltool@suse.de>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+avoid a race where some processes try to use a partial cache file
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+that is still being written to.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Note that we release the lock before load_cache,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+because if we got the lock, the cache is already completely written
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+and it is OK to have multiple parallel readers
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+Index: intltool-0.51.0/intltool-merge.in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+===================================================================
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- intltool-merge.in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ intltool-merge.in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -43,6 +43,7 @@ use Getopt::Long;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ use Text::Wrap;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ use File::Basename;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ use Encode;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++use Fcntl qw(:flock);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $must_end_tag = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $last_depth = -1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -392,11 +393,14 @@ sub load_cache
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sub get_cached_translation_database
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ open(my $lockfh, ">", "$cache_file.lock") or die $!;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ flock($lockfh, LOCK_EX) or die "Could not lock '$cache_file.lock' - $!";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $cache_file_age = -M $cache_file;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (defined $cache_file_age)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($cache_file_age <= &get_newest_po_age)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ close($lockfh);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &load_cache;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -404,6 +408,7 @@ sub get_cached_translation_database
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ &create_cache;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++ close($lockfh);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ sub add_translation
</span></pre><pre style='margin:0'>
</pre>