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

[SCM] Debian package checker branch, master, updated. 2.5.12-126-gee248d1



The following commit has been merged in the master branch:
commit 699ba59bee1a2bf27682bfe092c8e741ec0e1e7f
Author: Niels Thykier <niels@thykier.net>
Date:   Sun May 26 18:43:04 2013 +0200

    Remove the code for setting/updating LOCPATH
    
    With C.UTF-8 provided by stable's libc-bin, we no longer need this
    code.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index ef38133..5de51ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -117,6 +117,9 @@ lintian (2.5.13) UNRELEASED; urgency=low
     + [NT] Add a section about how to avoid some common ways
       of introducing security issues.
 
+  * frontend/lintian:
+    + [NT] Ignore LINTIAN_ROOT/locale and /var/lib/lintian/locale.
+
   * lib/*:
     + [NT] Fix a number of spelling mistakes in the POD.
   * lib/Lintian/Collect/{Package,Binary}.pm:
@@ -147,6 +150,8 @@ lintian (2.5.13) UNRELEASED; urgency=low
     + [NT] Replace resolve_pkg_path with to normalize_pkg_path.
       The latter has slightly different return values in some
       cases.
+    + [NT] Avoid the LOCPATH dance to find the path to an UTF-8
+      locale now that stable's libc-bin provides C.UTF-8 for us.
 
   * private/refresh-perl-provides:
     + [NT] Apply patch from Niko Tyni to improve Lintian's
diff --git a/frontend/lintian b/frontend/lintian
index 8f1ecde..f4aecd7 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -810,15 +810,6 @@ if ($debug) {
     $opt{'verbose'} = 0 unless defined $opt{'verbose'};
 }
 
-# Use our custom-generated locale for programs we call, if it's available.  We
-# first look in the Lintian root and then in /var/lib/lintian, which is the
-# standard location for the install-time-generated locale.
-if (-d "$opt{'LINTIAN_ROOT'}/locale/en_US.UTF-8") {
-    $ENV{LOCPATH} = "$opt{'LINTIAN_ROOT'}/locale";
-} elsif (-d '/var/lib/lintian/locale/en_US.UTF-8') {
-    $ENV{LOCPATH} = '/var/lib/lintian/locale';
-}
-
 $Lintian::Output::GLOBAL->verbosity_level ($opt{'verbose'});
 $Lintian::Output::GLOBAL->debug ($debug);
 $Lintian::Output::GLOBAL->color ($opt{'color'});
diff --git a/lib/Lintian/Util.pm b/lib/Lintian/Util.pm
index f52c303..6fb67ba 100644
--- a/lib/Lintian/Util.pm
+++ b/lib/Lintian/Util.pm
@@ -778,52 +778,21 @@ The list of whitelisted %ENV variables are:
  LOCPATH
  LC_ALL (*)
 
-(*) LC_ALL is a special case as clean_env will change its value using
-the following rules:
-
-
-If CLOC is given (and a truth value), clean_env will set LC_ALL to
-"C".
-
-Otherwise, clean_env sets LC_ALL to "C.UTF-8" or "en_US.UTF-8" by
-checking for the presence of the following paths (in preferred order):
-
- $ENV{LOCPATH}/C.UTF-8
- $ENV{LOCPATH}/en_US.UTF-8
- /usr/lib/locale/C.UTF-8
- /usr/lib/locale/en_US.UTF-8
-
-If none of these exists, LC_ALL is set to en_US.UTF-8 (as locales-all
-provides that locale without creating any paths in /usr/lib/locaale).
+(*) LC_ALL is a special case as clean_env will change its value to
+either "C.UTF-8" or "C" (if CLOC is given and a truth value).
 
 =cut
 
 sub clean_env {
     my ($cloc) = @_;
     my @whitelist = qw(PATH INTLTOOL_EXTRACT LOCPATH);
-    my @locales = qw(C.UTF-8 en_US.UTF-8);
     my %newenv = map { exists $ENV{$_} ? ($_ => $ENV{$_}) : () } (@whitelist, @_);
     %ENV = %newenv;
+    $ENV{'LC_ALL'} = 'C.UTF-8';
 
     if ($cloc) {
         $ENV{LC_ALL} = 'C';
-        return;
-    }
-
-    foreach my $locpath ($ENV{LOCPATH}, '/usr/lib/locale') {
-        if ($locpath && -d $locpath) {
-            foreach my $loc (@locales) {
-                if ( -d "$locpath/$loc" ) {
-                    $ENV{LC_ALL} = $loc;
-                    return;
-                }
-            }
-        }
     }
-    # 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';
 }
 
 =item perm2oct(PERM)
diff --git a/private/runtests b/private/runtests
index de51852..be04ae0 100755
--- a/private/runtests
+++ b/private/runtests
@@ -53,31 +53,6 @@ fail(){
     exit 1
 }
 
-# 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
-
-    # Apparently, it is not possible to generate a C.UTF-8 locale in
-    # Squeeze, so settle with an en_US.UTF-8 one.
-    if [ ! -e "$LOCPATH"/en_US.UTF-8 ] ; then
-        echo "Generating en_US.UTF-8 locale for the test suite"
-        mkdir -p "$LOCPATH"
-        localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias \
-            --quiet "$LOCPATH"/en_US.UTF-8 || fail "Locale generation failed"
-    else
-        echo "Using pre-generated en_US.UTF-8 locale in $LOCPATH"
-    fi
-fi
-
 if [ "${NEW_SUITE}" = 1 ] ; then
     t/runtests --dump-logs -k $PARALLEL_ARGS t "$TEST_WORK_DIR" "$@"
 fi

-- 
Debian package checker


Reply to: