[dpkg] 107/187: build: Do not honor DPKG_DATADIR on the installed Dpkg module

Reiner Herrmann reiner at reiner-h.de
Sun Nov 6 12:46:30 UTC 2016


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

deki-guest pushed a commit to branch master
in repository dpkg.

commit c3a9a82fcf58df34077638cdbfd7bb752624629e
Author: Guillem Jover <guillem at debian.org>
Date:   Sun Sep 4 18:21:02 2016 +0200

    build: Do not honor DPKG_DATADIR on the installed Dpkg module
    
    Move the environment variable DPKG_DATADIR override for Dpkg::DATADIR
    into the first assignment, so that the new replacement logic can make it
    disappear at installation time.
    
    This simplifies the code and reduces the exposure of this internal
    purpose machinery.
---
 debian/changelog    |  1 +
 scripts/Dpkg.pm     |  3 +--
 scripts/Makefile.am | 10 +++++-----
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index cdd61a4..ca38fd5 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -149,6 +149,7 @@ dpkg (1.18.11) UNRELEASED; urgency=medium
     - Use cp with -R instead of -r (the former is more portable and not
       marked as deprecated by POSIX).
     - Print an actual newline instead of a literal \n in lcov output.
+    - Do not honor DPKG_DATADIR on the installed Dpkg module.
 
   [ Updated man pages translations ]
   * German (Helge Kreutzmann).
diff --git a/scripts/Dpkg.pm b/scripts/Dpkg.pm
index deecfb3..89964b4 100644
--- a/scripts/Dpkg.pm
+++ b/scripts/Dpkg.pm
@@ -87,8 +87,7 @@ our $PROGVERSION = '1.18.x';
 our $CONFDIR = '/etc/dpkg';
 our $ADMINDIR = '/var/lib/dpkg';
 our $LIBDIR = '.';
-our $DATADIR = '..';
-$DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR};
+our $DATADIR = $ENV{DPKG_DATADIR} // '..';
 
 # XXX: Backwards compatibility, to be removed on VERSION 2.00.
 ## no critic (Variables::ProhibitPackageVars)
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index b9b7314..fd97ea0 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -123,11 +123,11 @@ man3_MANS =
 
 do_perl_subst = $(AM_V_GEN) sed \
 	-e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL):" \
-	-e "s:\$$CONFDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$CONFDIR='$(pkgconfdir)':" \
-	-e "s:\$$ADMINDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$ADMINDIR='$(admindir)':" \
-	-e "s:\$$LIBDIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$LIBDIR='$(pkglibdir)':" \
-	-e "s:\$$DATADIR[[:space:]]*=[[:space:]]*['\"][^'\"]*['\"]:\$$DATADIR='$(pkgdatadir)':" \
-	-e "s:\$$PROGVERSION[[:space:]]*=[[:space:]]*['\"][^'\"]*[\"']:\$$PROGVERSION='$(PACKAGE_VERSION)':"
+	-e "s:\$$CONFDIR = .*;:\$$CONFDIR = '$(pkgconfdir)';:" \
+	-e "s:\$$ADMINDIR = .*;:\$$ADMINDIR = '$(admindir)';:" \
+	-e "s:\$$LIBDIR = .*;:\$$LIBDIR = '$(pkglibdir)';:" \
+	-e "s:\$$DATADIR = .*;:\$$DATADIR = '$(pkgdatadir)';:" \
+	-e "s:\$$PROGVERSION = .*;:\$$PROGVERSION = '$(PACKAGE_VERSION)';:"
 
 do_shell_subst = $(AM_V_GEN) sed \
 	-e "s:^version[[:space:]]*=[[:space:]]*['\"][^'\"]*[\"']:version=\"$(PACKAGE_VERSION)\":"

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



More information about the Reproducible-commits mailing list