[Build-common-hackers] Bug#285583: Protect and correct echo arguments

Vincent Danjean Vincent Danjean <Vincent.Danjean@ens-lyon.org>, 285583@bugs.debian.org
Tue, 14 Dec 2004 09:36:33 +0100


This is a multi-part MIME message sent by reportbug.

--===============0793808274==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: cdbs
Version: 0.4.25-1
Severity: minor
Tags: patch

  Hi,

  In class/makefile.mk, 'echo' command does not have its arguments
protected nor it is exactly the executed command.
Please, apply the attached patch for the next release.

Rem:
  Protecting ';' in the arguments of echo allow to specify :
DEB_MAKE_ENVVARS= . /usr/lib/GNUstep/System/Makefiles/GNUstep.sh ; 
(note the ";" at the end)
  It would also be possible to redefine DEB_MAKE_INVOKE instead of
DEB_MAKE_ENVVARS, but there is the same kind of problems :
'echo $(DEB_MAKE_INVOKE) $(DEB_MAKE_CHECK_TARGET);' fails because, due
to the ";", the shell sees two commands.

-- System Information:
Debian Release: 3.1
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing')
Architecture: i386 (i686)
Kernel: Linux 2.6.7-act
Locale: LANG=C, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15)

-- no debconf information

--===============0793808274==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="patch"

--- makefile.mk.orig	2004-10-20 16:43:23.000000000 +0200
+++ makefile.mk	2004-12-14 09:30:28.000000000 +0100
@@ -45,7 +45,7 @@
 common-install-arch common-install-indep:: common-install-impl
 common-install-impl::
 	@if test -n "$(DEB_MAKE_INSTALL_TARGET)"; then \
-	  echo $(DEB_MAKE_ENVVARS) make -C $(DEB_BUILDDIR) $(DEB_MAKE_INSTALL_TARGET); \
+	  echo $(subst ;,\;,$(DEB_MAKE_INVOKE) $(DEB_MAKE_INSTALL_TARGET)); \
 	  $(DEB_MAKE_INVOKE) $(DEB_MAKE_INSTALL_TARGET); \
 	 else \
 	   echo "DEB_MAKE_INSTALL_TARGET unset, skipping default makefile.mk common-install target"; \
@@ -55,7 +55,7 @@
 common-post-build-arch common-post-build-indep:: common-post-build-impl
 common-post-build-impl::
 	@if test -n "$(DEB_MAKE_CHECK_TARGET)"; then \
-	  echo $(DEB_MAKE_INVOKE) $(DEB_MAKE_CHECK_TARGET); \
+	  echo $(subst ;,\;,$(DEB_MAKE_INVOKE) $(DEB_MAKE_CHECK_TARGET)); \
 	  $(DEB_MAKE_INVOKE) $(DEB_MAKE_CHECK_TARGET); \
 	else \
 	   echo "DEB_MAKE_CHECK_TARGET unset, not running checks"; \

--===============0793808274==--