This is an automated email from the git hooks/post-receive script. guillem pushed a commit to branch main in repository dpkg.
View the commit online: https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=a49f0a9c93e1fe256573f7007e14e48b146f9443 commit a49f0a9c93e1fe256573f7007e14e48b146f9443 Author: Guillem Jover <guil...@debian.org> AuthorDate: Wed Aug 18 06:20:27 2021 +0200 build: Detect appropriate sed program at configure time Use it in the build system consistently. --- configure.ac | 1 + dselect/methods/Makefile.am | 2 +- m4/dpkg-compiler.m4 | 2 +- m4/dpkg-linker.m4 | 2 +- m4/dpkg-progs.m4 | 2 +- man/Makefile.am | 6 +++--- scripts/Makefile.am | 10 +++++----- scripts/mk/Makefile.am | 2 +- t-func/atlocal.in | 2 ++ t-func/deb-format.at | 12 ++++++------ t-func/local.at | 2 +- 11 files changed, 23 insertions(+), 20 deletions(-) diff --git a/configure.ac b/configure.ac index 40a2bc51d..1e3a52fcf 100644 --- a/configure.ac +++ b/configure.ac @@ -72,6 +72,7 @@ DPKG_DEB_COMPRESSOR([xz]) DPKG_DEB_PROG_TAR # Checks for programs. +AC_PROG_SED AC_PROG_CC DPKG_C_C99 AC_PROG_CXX diff --git a/dselect/methods/Makefile.am b/dselect/methods/Makefile.am index 7debf368d..e200b3de4 100644 --- a/dselect/methods/Makefile.am +++ b/dselect/methods/Makefile.am @@ -38,7 +38,7 @@ CLEANFILES = \ $(nobase_methods_SCRIPTS) \ $(nil) -do_perl_subst = $(AM_V_GEN) sed \ +do_perl_subst = $(AM_V_GEN) $(SED) \ -e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL):" SUFFIXES = .pl diff --git a/m4/dpkg-compiler.m4 b/m4/dpkg-compiler.m4 index 7872951c5..681aaff9a 100644 --- a/m4/dpkg-compiler.m4 +++ b/m4/dpkg-compiler.m4 @@ -124,7 +124,7 @@ AC_DEFUN([DPKG_COMPILER_OPTIMIZATIONS], [ [], [enable_compiler_optimizations=yes]) AS_IF([test "x$enable_compiler_optimizations" = "xno"], [ - CFLAGS=$(echo "$CFLAGS" | sed -e "s/ -O[[1-9]]*\b/ -O0/g") + CFLAGS=$(echo "$CFLAGS" | $SED -e "s/ -O[[1-9]]*\b/ -O0/g") ]) ]) diff --git a/m4/dpkg-linker.m4 b/m4/dpkg-linker.m4 index 4451199ea..d3abb3087 100644 --- a/m4/dpkg-linker.m4 +++ b/m4/dpkg-linker.m4 @@ -12,7 +12,7 @@ AC_DEFUN([DPKG_LINKER_OPTIMIZATIONS], [ [], [enable_linker_optimizations=yes]) AS_IF([test "x$enable_linker_optimizations" = "xno"], [ - LDFLAGS=$(echo "$LDFLAGS" | sed -e "s/ -Wl,-O[[0-9]]*\b//g") + LDFLAGS=$(echo "$LDFLAGS" | $SED -e "s/ -Wl,-O[[0-9]]*\b//g") ], [ save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-O1" diff --git a/m4/dpkg-progs.m4 b/m4/dpkg-progs.m4 index 746ff0169..bc373ba43 100644 --- a/m4/dpkg-progs.m4 +++ b/m4/dpkg-progs.m4 @@ -44,7 +44,7 @@ AC_DEFUN([DPKG_PROG_PO4A], [ AC_CACHE_CHECK([for po4a >= _PO4A_MIN_VERSION], [ac_cv_path_PO4A], [ AC_PATH_PROGS_FEATURE_CHECK([PO4A], [po4a], [ po4aversion=$(LC_ALL=C $ac_path_PO4A --version \ - | sed -ne 's/^po4a version \(.*\)\.$/\1/p') + | $SED -ne 's/^po4a version \(.*\)\.$/\1/p') AS_VERSION_COMPARE([$po4aversion], [_PO4A_MIN_VERSION], [po4acheck=no], [po4acheck=yes], [po4acheck=yes]) AS_IF([test "x$po4acheck" = "xyes"], [ diff --git a/man/Makefile.am b/man/Makefile.am index 6e37b35dc..a0136258c 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -148,7 +148,7 @@ EXTRA_DIST += \ # Extract the list of languages from the po4a config file. -LINGUAS_DIST = `sed -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po/po4a.cfg` +LINGUAS_DIST = `$(SED) -ne 's/^.*\[po4a_langs\] \(.*\)$$/\1/p' $(srcdir)/po/po4a.cfg` # If the user has not defined it let's use the default. LINGUAS ?= $(LINGUAS_DIST) @@ -214,7 +214,7 @@ POD2MAN_V_0 = @echo " POD2MAN $@"; POD2MAN_OPTS = --utf8 --center='dpkg suite' --release=$(PACKAGE_VERSION) \ --date='$(PACKAGE_RELEASE_DATE)' -PODSUBST = sed \ +PODSUBST = $(SED) \ -e 's/%PACKAGE%/$(PACKAGE)/g' \ -e 's/%VERSION%/$(PACKAGE_VERSION)/g' \ -e 's/%RELEASE_DATE%/$(PACKAGE_RELEASE_DATE)/g' \ @@ -227,7 +227,7 @@ PODSUBST = sed \ -e 's:%PKGDATADIR%:$(pkgdatadir):g' \ $(nil) -MANFIXUP = sed \ +MANFIXUP = $(SED) \ -f $(srcdir)/utf8toman.sed \ $(nil) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index e42b26e12..49a5c0cce 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -149,7 +149,7 @@ man3_MANS = man_perl_section = 3perl -do_perl_subst = $(AM_V_GEN) sed \ +do_perl_subst = $(AM_V_GEN) $(SED) \ -e "s:^\#![[:space:]]*/usr/bin/perl:\#!$(PERL):" \ -e "s:our \$$CONFDIR = .*;:our \$$CONFDIR = '$(pkgconfdir)';:" \ -e "s:our \$$ADMINDIR = .*;:our \$$ADMINDIR = '$(admindir)';:" \ @@ -160,7 +160,7 @@ do_perl_subst = $(AM_V_GEN) sed \ -e "s:our \$$PROGPATCH = .*;:our \$$PROGPATCH = '$(PATCH)';:" \ -e "s:our \$$PROGVERSION = .*;:our \$$PROGVERSION = '$(PACKAGE_VERSION)';:" -do_shell_subst = $(AM_V_GEN) sed \ +do_shell_subst = $(AM_V_GEN) $(SED) \ -e "s:^PKGDATADIR_DEFAULT=.*$$:PKGDATADIR_DEFAULT='$(pkgdatadir)':" \ -e "s:^version=['\"][^'\"]*[\"']:version=\"$(PACKAGE_VERSION)\":" @@ -183,7 +183,7 @@ if BUILD_POD_DOC # Remove empty manual pages (perl modules not documented) $(MKDIR_P) $(DESTDIR)$(man3dir) for module in $(nobase_dist_perllib_DATA); do \ - name=`echo $$module | sed -e 's|/|::|g' -e 's/\.pm$$//'`; \ + name=`echo $$module | $(SED) -e 's|/|::|g' -e 's/\.pm$$//'`; \ $(POD2MAN) --utf8 --center=libdpkg-perl --release=$(VERSION) \ --name="$$name" --section=$(man_perl_section) $(srcdir)/$$module \ >$(DESTDIR)$(man3dir)/$$name.$(man_perl_section); \ @@ -192,7 +192,7 @@ if BUILD_POD_DOC done endif -# Ideally we'd use 'sed -i', but unfortunately that's not portable. +# Ideally we'd use '$(SED) -i', but unfortunately that's not portable. install-data-hook: mv $(DESTDIR)$(perllibdir)/Dpkg.pm \ $(DESTDIR)$(perllibdir)/Dpkg.pm.tmp @@ -203,7 +203,7 @@ install-data-hook: uninstall-local: if BUILD_POD_DOC for module in $(nobase_dist_perllib_DATA); do \ - rm -f $(DESTDIR)$(man3dir)/`echo $$module | sed -e 's|/|::|g' -e 's/\.pm$$/.$(man_perl_section)/'`; \ + rm -f $(DESTDIR)$(man3dir)/`echo $$module | $(SED) -e 's|/|::|g' -e 's/\.pm$$/.$(man_perl_section)/'`; \ done endif diff --git a/scripts/mk/Makefile.am b/scripts/mk/Makefile.am index 9f0462eca..3f30c6efe 100644 --- a/scripts/mk/Makefile.am +++ b/scripts/mk/Makefile.am @@ -9,7 +9,7 @@ dist_pkgdata_DATA = \ pkg-info.mk \ vendor.mk -do_path_subst = $(AM_V_GEN) sed \ +do_path_subst = $(AM_V_GEN) $(SED) \ -e "s:dpkg_datadir[[:space:]]*=[[:space:]]*[^[:space:]]*:dpkg_datadir = $(pkgdatadir):" install-data-hook: diff --git a/t-func/atlocal.in b/t-func/atlocal.in index 1e77669fa..b4cbfbf0b 100644 --- a/t-func/atlocal.in +++ b/t-func/atlocal.in @@ -6,6 +6,8 @@ export PATH TESTDATA="@abs_top_srcdir@/t-func" export TESTDATA +SED=@SED@ + # Setup a sane environment umask 0022 diff --git a/t-func/deb-format.at b/t-func/deb-format.at index 956100ce9..4efe8486f 100644 --- a/t-func/deb-format.at +++ b/t-func/deb-format.at @@ -40,7 +40,7 @@ ar rc pkg-version-2x.deb debian-binary ar t pkg-version-2x.deb ar x pkg-templ.deb debian-binary # XXX: Ideally we would have no need to strip trailing spaces. -dpkg-deb -I pkg-version-2x.deb | sed -e 's/ *$//' +dpkg-deb -I pkg-version-2x.deb | $SED -e 's/ *$//' ], [], [debian-binary control.tar data.tar @@ -64,7 +64,7 @@ ar rc pkg-magic-extra.deb debian-binary ar t pkg-magic-extra.deb ar x pkg-templ.deb debian-binary # XXX: Ideally we would have no need to strip trailing spaces. -dpkg-deb -I pkg-magic-extra.deb | sed -e 's/ *$//' +dpkg-deb -I pkg-magic-extra.deb | $SED -e 's/ *$//' ], [], [debian-binary control.tar data.tar @@ -157,7 +157,7 @@ cp pkg-templ.deb pkg-extra-member.deb ar q pkg-extra-member.deb unknown ar t pkg-extra-member.deb # XXX: Ideally we would have no need to strip trailing spaces. -dpkg-deb -I pkg-extra-member.deb | sed -e 's/ *$//' +dpkg-deb -I pkg-extra-member.deb | $SED -e 's/ *$//' ], [], [debian-binary control.tar data.tar @@ -180,7 +180,7 @@ cp pkg-templ.deb pkg-under-member.deb ar ra debian-binary pkg-under-member.deb _ignore ar t pkg-under-member.deb # XXX: Ideally we would have no need to strip trailing spaces. -dpkg-deb -I pkg-under-member.deb | sed -e 's/ *$//' +dpkg-deb -I pkg-under-member.deb | $SED -e 's/ *$//' ], [], [debian-binary _ignore control.tar @@ -214,7 +214,7 @@ AT_CHECK([ ar rc pkg-control-none.deb debian-binary control.tar data.tar ar t pkg-control-none.deb # XXX: Ideally we would have no need to strip trailing spaces. -dpkg-deb -I pkg-control-none.deb | sed -e 's/ *$//' +dpkg-deb -I pkg-control-none.deb | $SED -e 's/ *$//' ], [], [debian-binary control.tar data.tar @@ -307,7 +307,7 @@ AT_CHECK([ ar rc pkg-mixed-comp.deb debian-binary control.tar.xz data.tar.gz ar t pkg-mixed-comp.deb # XXX: Ideally we would have no need to strip trailing spaces. -dpkg-deb -I pkg-mixed-comp.deb | sed -e 's/ *$//' +dpkg-deb -I pkg-mixed-comp.deb | $SED -e 's/ *$//' dpkg-deb -c pkg-mixed-comp.deb ], [], [debian-binary control.tar.xz diff --git a/t-func/local.at b/t-func/local.at index 3a221c18d..1c1cfff45 100644 --- a/t-func/local.at +++ b/t-func/local.at @@ -19,7 +19,7 @@ CTRL_TEMPL # DPKG_MOD_CONTROL([$pkgname], [$sedexpr]) m4_define([DPKG_MOD_CONTROL], [ - sed -i -e '$2' '$1/DEBIAN/control' + $SED -i -e '$2' '$1/DEBIAN/control' ]) # DPKG_GEN_FILE([$pkgname], [$file], [$contents]) -- Dpkg.Org's dpkg