XPost: linux.debian.bugs.dist
From:
nicolas@debian.org
Package: dpkg-dev
Followup-For: Bug #872381
Hello.
The attached commits rebase the suggestions, take your answers into
account and slightly improved some style issues.
There may remain typos, nothing is tested this time.
From d56d5af7fa1a01a581d0cc1901572ca9c407f538 Mon Sep 17 00:00:00 2001
From: Nicolas Boulenguez <
nicolas@debian.org>
Date: Mon, 29 Jul 2019 14:38:32 +0200
Subject: [PATCH 1/8] scripts/mk: stop hard-coding dpkg_datadir, protect from
double inclusion
The Makefile snippets include each other from their common directory,
but the path differ during tests and after installation. Instead of
rewriting the file with a hardcoded path, compute it within Make.
Use the same variables to avoid 'include' when possible, as it
involves system calls.
When setting dpkg_datadir, prefer 'ifndef' and ':=' to '?=', so that
the value is computed at most once.
---
build-aux/subst.am | 6 ------
scripts/mk/Makefile.am | 21 ---------------------
scripts/mk/architecture.mk | 5 +++++
scripts/mk/buildapi.mk | 5 +++++
scripts/mk/buildflags.mk | 6 ++++++
scripts/mk/buildopts.mk | 5 +++++
scripts/mk/buildtools.mk | 11 ++++++++++-
scripts/mk/default.mk | 10 +++++++++-
scripts/mk/pkg-info.mk | 5 +++++
scripts/mk/vendor.mk | 11 ++++++++++-
10 files changed, 55 insertions(+), 30 deletions(-)
diff --git a/build-aux/subst.am b/build-aux/subst.am
index 5515930d0..167a71257 100644
--- a/build-aux/subst.am
+++ b/build-aux/subst.am
@@ -39,9 +39,3 @@ SUFFIXES += .pl
@test -d `dirname $@` || $(MKDIR_P) `dirname $@`
$(do_perl_subst) <$< >$@
$(AM_V_at) chmod +x $@
-
-# Makefile support.
-
-do_make_subst = $(AM_V_GEN) $(SED) \
- -e "s:dpkg_datadir[[:space:]]*=[[:space:]]*[^[:space:]]*:dpkg_datadir = $(pkgdatadir):" \
- # EOL
diff --git a/scripts/mk/Makefile.am b/scripts/mk/Makefile.am
index 257ba5252