Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37744996
en ru br
Репозитории ALT
S:0.51.0-alt2
5.1: 0.40.6-alt1
4.1: 0.40.3-alt0.M41.1
4.0: 0.35.0-alt1
3.0: 0.33-alt1
www.altlinux.org/Changes

Группа :: Разработка/GNOME и GTK+
Пакет: intltool

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: intltool-merge-Create-cache-file-atomically.patch
Скачать


From d328542bea50b9445c63cdf2454052392282a1ce Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
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
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin