[Piuparts-commits] [piuparts] 02/02: p: clear all locale settings from the chroot environment

Holger Levsen holger at layer-acht.org
Mon May 2 08:47:06 UTC 2016


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch develop
in repository piuparts.

commit eedfd6581d37f90fb40e443e36afbeaad163b5b8
Author: Andreas Beckmann <anbe at debian.org>
Date:   Mon May 2 01:23:41 2016 +0200

    p: clear all locale settings from the chroot environment
    
    Signed-off-by: Andreas Beckmann <anbe at debian.org>
---
 debian/changelog |  2 ++
 piuparts.py      | 19 +++++++++++++++++--
 2 files changed, 19 insertions(+), 2 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b746fde..4255503 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -5,6 +5,8 @@ piuparts (0.71) UNRELEASED; urgency=medium
     - Define namedtuple FileInfo globally s.t. it can be pickled.
     - New option --no-check-valid-until to set apt option
       Acquire::Check-Valid-Until=false for testing archived releases.
+    - Clear all locale settings from the environment before running commands
+      in the chroot.
   * piuparts.conf:
     - Use --no-check-valid-until for squeeze.
     - New section [wheezy-security] (also used by wheezy LTS).
diff --git a/piuparts.py b/piuparts.py
index 223844d..4be1130 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -499,8 +499,23 @@ def run(command, ignore_errors=False, timeout=0):
     assert isinstance(command, type([]))
     logging.debug("Starting command: %s" % command)
     env = os.environ.copy()
-    env["LC_ALL"] = "C"
-    env["LANGUAGES"] = ""
+    for var in ["LANG",
+            "LANGUAGE",
+            "LC_CTYPE",
+            "LC_NUMERIC",
+            "LC_TIME",
+            "LC_COLLATE",
+            "LC_MONETARY",
+            "LC_MESSAGES",
+            "LC_PAPER",
+            "LC_NAME",
+            "LC_ADDRESS",
+            "LC_TELEPHONE",
+            "LC_MEASUREMENT",
+            "LC_IDENTIFICATION",
+            "LC_ALL"]:
+        if var in env:
+            del env[var]
     env["PIUPARTS_OBJECTS"] = ' '.join(str(vobject) for vobject in settings.testobjects)
     devnull = open('/dev/null', 'r')
     p = subprocess.Popen(command, env=env, stdin=devnull,

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/piuparts/piuparts.git



More information about the Piuparts-commits mailing list