Browse Source

build: Honor DPKG_DATADIR again in the installed Dpkg modules

This was an explicit public interface, documented in the man page. It
is also the only way to cleanly override the architecture tables,
which might be needed in certain circumstances. Partially revert the
commit c3a9a82fcf58df34077638cdbfd7bb752624629e, but preserve the code
simplification.
Guillem Jover 7 years ago
parent
commit
4fbf5294c5
3 changed files with 12 additions and 8 deletions
  1. 2 0
      debian/changelog
  2. 3 1
      scripts/Dpkg.pm
  3. 7 7
      scripts/Makefile.am

+ 2 - 0
debian/changelog

@@ -14,6 +14,8 @@ dpkg (1.18.16) UNRELEASED; urgency=medium
       switched to be a perl module. Missed in dpkg 1.18.8.
   * Build system:
     - Enable compression libs also in automatic check mode in configure.
+    - Honor DPKG_DATADIR again in the installed Dpkg modules. This was an
+      explicit public interface, documented in the man page.
 
   [ Updated scripts translations ]
   * German (Helge Kreutzmann).

+ 3 - 1
scripts/Dpkg.pm

@@ -100,7 +100,9 @@ our $PROGTAR = $ENV{DPKG_PROGTAR} // 'tar';
 our $CONFDIR = '/etc/dpkg';
 our $ADMINDIR = '/var/lib/dpkg';
 our $LIBDIR = '.';
-our $DATADIR = $ENV{DPKG_DATADIR} // '..';
+our $DATADIR = '..';
+
+$DATADIR = $ENV{DPKG_DATADIR} if defined $ENV{DPKG_DATADIR};
 
 # XXX: Backwards compatibility, to be removed on VERSION 2.00.
 ## no critic (Variables::ProhibitPackageVars)

+ 7 - 7
scripts/Makefile.am

@@ -126,13 +126,13 @@ man3_MANS =
 
 do_perl_subst = $(AM_V_GEN) sed \
 	-e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL):" \
-	-e "s:\$$CONFDIR = .*;:\$$CONFDIR = '$(pkgconfdir)';:" \
-	-e "s:\$$ADMINDIR = .*;:\$$ADMINDIR = '$(admindir)';:" \
-	-e "s:\$$LIBDIR = .*;:\$$LIBDIR = '$(pkglibdir)';:" \
-	-e "s:\$$DATADIR = .*;:\$$DATADIR = '$(pkgdatadir)';:" \
-	-e "s:\$$PROGMAKE = .*;:\$$PROGMAKE = '$(MAKE)';:" \
-	-e "s:\$$PROGTAR = .*;:\$$PROGTAR = '$(TAR)';:" \
-	-e "s:\$$PROGVERSION = .*;:\$$PROGVERSION = '$(PACKAGE_VERSION)';:"
+	-e "s:our \$$CONFDIR = .*;:our \$$CONFDIR = '$(pkgconfdir)';:" \
+	-e "s:our \$$ADMINDIR = .*;:our \$$ADMINDIR = '$(admindir)';:" \
+	-e "s:our \$$LIBDIR = .*;:our \$$LIBDIR = '$(pkglibdir)';:" \
+	-e "s:our \$$DATADIR = .*;:our \$$DATADIR = '$(pkgdatadir)';:" \
+	-e "s:our \$$PROGMAKE = .*;:our \$$PROGMAKE = '$(MAKE)';:" \
+	-e "s:our \$$PROGTAR = .*;:our \$$PROGTAR = '$(TAR)';:" \
+	-e "s:our \$$PROGVERSION = .*;:our \$$PROGVERSION = '$(PACKAGE_VERSION)';:"
 
 do_shell_subst = $(AM_V_GEN) sed \
 	-e "s:^version[[:space:]]*=[[:space:]]*['\"][^'\"]*[\"']:version=\"$(PACKAGE_VERSION)\":"