This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch master in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=f946d808e10d68eb305bcbacb3b7044c60198eed commit f946d808e10d68eb305bcbacb3b7044c60198eed Author: Guillem Jover <[email protected]> AuthorDate: Tue Jan 5 02:46:16 2021 +0100 build: Make it possible to override PKGDATADIR on built scripts too This makes it possible to run the functional test on the built but not installed scripts. --- scripts/Makefile.am | 2 +- scripts/dpkg-maintscript-helper.sh | 3 ++- scripts/dpkg-realpath.sh | 3 ++- tests/Test.mk | 6 ++++++ 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 3af710a18..7275c8edb 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -152,7 +152,7 @@ do_perl_subst = $(AM_V_GEN) sed \ -e "s:our \$$PROGVERSION = .*;:our \$$PROGVERSION = '$(PACKAGE_VERSION)';:" do_shell_subst = $(AM_V_GEN) sed \ - -e "s:^PKGDATADIR=.*$$:PKGDATADIR='$(pkgdatadir)':" \ + -e "s:^PKGDATADIR_DEFAULT=.*$$:PKGDATADIR_DEFAULT='$(pkgdatadir)':" \ -e "s:^version=['\"][^'\"]*[\"']:version=\"$(PACKAGE_VERSION)\":" SUFFIXES = .pl .sh diff --git a/scripts/dpkg-maintscript-helper.sh b/scripts/dpkg-maintscript-helper.sh index e597296c2..98067ceaa 100755 --- a/scripts/dpkg-maintscript-helper.sh +++ b/scripts/dpkg-maintscript-helper.sh @@ -600,7 +600,8 @@ if [ "$DPKG_ROOT" = "/" ]; then fi export DPKG_ROOT -PKGDATADIR="${DPKG_DATADIR:-scripts}" +PKGDATADIR_DEFAULT=scripts +PKGDATADIR="${DPKG_DATADIR:-$PKGDATADIR_DEFAULT}" . "$PKGDATADIR/sh/dpkg-error.sh" diff --git a/scripts/dpkg-realpath.sh b/scripts/dpkg-realpath.sh index 8f18b37aa..5636ab3c7 100755 --- a/scripts/dpkg-realpath.sh +++ b/scripts/dpkg-realpath.sh @@ -22,7 +22,8 @@ PROGNAME=$(basename "$0") version="unknown" EOL="\n" -PKGDATADIR="${DPKG_DATADIR:-scripts}" +PKGDATADIR_DEFAULT=scripts +PKGDATADIR="${DPKG_DATADIR:-$PKGDATADIR_DEFAULT}" . "$PKGDATADIR/sh/dpkg-error.sh" diff --git a/tests/Test.mk b/tests/Test.mk index 55fa58393..660da3e60 100644 --- a/tests/Test.mk +++ b/tests/Test.mk @@ -25,6 +25,12 @@ DPKG_ENV = \ PATH=$(DPKG_PATH) \ $(DPKG_MAINTSCRIPT_DEBUG) +ifdef DPKG_BUILDTREE +export DPKG_DATADIR := $(DPKG_BUILDTREE)/scripts +DPKG_ENV += \ + DPKG_DATADIR="$(DPKG_DATADIR)" +endif + export PATH PATH = $(DPKG_PATH) -- Dpkg.Org's dpkg

