[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.5-22-g8f8df90



The following commit has been merged in the master branch:
commit 8f8df9083ae2a888cef586cadd87f573b0443107
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Mar 11 15:06:58 2012 +0100

    Util: Fix regression with locales-all (Squeeze only)
    
    Also added support for using en_US.UTF-8 from locales-all to build
    Lintian in Squeeze.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index 1dfce2b..e0f99bc 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -50,6 +50,16 @@ lintian (2.5.6) UNRELEASED; urgency=low
   * lib/Lintian/Tag/Info.pm:
     + [NT] Fixed issue where "Experimental: no" was handled as a
       "yes" when generating a tag description.
+  * lib/Util.pm:
+    + [NT] If no locale can be found, just set LC_ALL to en_US.UTF-8.
+      This fixes an issue with Lintian in backports when only
+      locales-all is installed.  Thanks to Peter Palfrader for the
+      report.  (Closes: #663459)
+
+  * private/runtests:
+    + [NT] Support using en_US.UTF-8 from locales-all, when that is
+      available.  This allows locales-all to be used as a substitute
+      for locales when compiling Lintian on Squeeze.
 
   * reporting/harness:
     + [NT] Corrected inverted logic when checking for dry-run.
diff --git a/lib/Util.pm b/lib/Util.pm
index 543db18..baff01c 100644
--- a/lib/Util.pm
+++ b/lib/Util.pm
@@ -292,9 +292,11 @@ sub system_env {
 #
 # Based on LOCPATH (and /usr/lib/locale), this function will set
 # LC_ALL to C.UTF-8 or en_US.UTF-8.  If neither LOCPATH nor
-# /usr/lib/locale has any of those locales, then LC_ALL will be
-# cleared.  It is possible to skip the LC_ALL check by passing a
-# truth value as first argument.
+# /usr/lib/locale has any of those locales, then LC_ALL will be set to
+# en_US.UTF-8.
+#
+#  It is possible to skip the LC_ALL check by passing a truth value as
+# first argument.
 sub clean_env {
     my ($no_lcall) = @_;
     my @whitelist = qw(PATH INTLTOOL_EXTRACT LOCPATH);
@@ -312,7 +314,10 @@ sub clean_env {
             }
         }
     }
-    fail ("clean_env: could not find needed locale");
+    # We could not find any valid locale so far - presumably we get our locales
+    # from "locales-all", so just set it to "en_US.UTF-8".
+    # (related bug: #663459)
+    $ENV{LC_ALL} = 'en_US.UTF-8';
 }
 
 # Translate permission strings like `-rwxrwxrwx' into an octal number.
diff --git a/private/runtests b/private/runtests
index 27c1c5a..0c40673 100755
--- a/private/runtests
+++ b/private/runtests
@@ -39,7 +39,16 @@ fail(){
     exit 1
 }
 
-if [ ! -e "/usr/lib/locale/C.UTF-8" ] ; then
+# In Wheezy (and newer) libc-bin provides a C.UTF-8 locale.
+# In Squeeze (and older) we either need locales-all or generate
+# an en_US.UTF-8 locale ourselves.
+if [ -e "/usr/lib/locale/C.UTF-8" ] ; then
+    echo "Using C.UTF-8 locale from /usr/lib/locale"
+    unset LOCPATH
+elif dpkg -l | grep -q ^"ii *locales-all " ; then
+    echo "Using en_US.UTF-8 locale from locales-all"
+    unset LOCPATH
+else
     LOCPATH="$(pwd)/debian/test.locale"
     export LOCPATH
 
@@ -53,9 +62,6 @@ if [ ! -e "/usr/lib/locale/C.UTF-8" ] ; then
     else
         echo "Using pre-generated en_US.UTF-8 locale in $LOCPATH"
     fi
-else
-    echo "Using C.UTF-8 locale from /usr/lib/locale"
-    unset LOCPATH
 fi
 
 if [ "${NEW_SUITE}" = 1 ] ; then

-- 
Debian package checker


Reply to: