[PATCH] remove bashisms in Makefile

Luca Capello luca at pca.it
Tue Mar 23 12:27:03 UTC 2010


Hi there!

Since it seems mailman has messed the original post, I have fully
included it below:

  http://lists.alioth.debian.org/pipermail/debian-flyers-devel/2008-May/000262.html

On Wed, 28 May 2008 23:40:08 +0200, Luca Capello wrote:
> Please Cc: me, I'm not subscribed to the list.
>
> Another patch because since dash will be the default shell in Lenny,
> `make clean` doesn't work anymore:
>
> =====
> luca at ismo:~/Hacking/debian/debian-flyers$ checkbashisms -f Makefile
> script Makefile does not appear to have a #! interpreter line;
> you may get strange results
> possible bashism in Makefile line 124 (brace expansion):
>         -rm -f $(base).{ps,eps,dvi,aux,log,jpg} *~
> possible bashism in Makefile line 125 (brace expansion):
>         -rm -f all.{ps,eps,dvi,aux,log,jpg}
> luca at gismo:~/Hacking/debian/debian-flyers$
> =====

This is still true, and now that dash is the default shell, `make clean`
seems to not work anymore:
=====
luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$ ls
all.tex    debian.eps    flyer-one-page.tex  layout.tex      NEWS             readme.txt   TODO
COPYRIGHT  deutsch.tex   flyer.tex           Makefile        portugues.tex    sponsors     translation-check.pl
CVS        english.tex   francaise.tex       mkconfig        preamble.tex     svenska.tex
dansk.tex  espanyol.tex  italiano.tex        nederlands.tex  README.printing  swirl.eps

luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$ make
[...]

luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$ ls
all.tex     dansk.tex    espanyol.tex  flyer-one-page.tex  italiano.tex  nederlands.tex  README.printing  swirl.eps
config.tex  debian.eps   flyer.aux     flyer.ps            layout.tex    NEWS            readme.txt       TODO
COPYRIGHT   deutsch.tex  flyer.dvi     flyer.tex           Makefile      portugues.tex   sponsors         translation-check.pl
CVS         english.tex  flyer.log     francaise.tex       mkconfig      preamble.tex    svenska.tex

luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$ make clean
rm -f flyer.{ps,eps,dvi,aux,log,jpg} *~
rm -f all.{ps,eps,dvi,aux,log,jpg}
rm -f flyer-*.ps

luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$ ls
all.tex     dansk.tex    espanyol.tex  flyer-one-page.tex  italiano.tex  nederlands.tex  README.printing  swirl.eps
config.tex  debian.eps   flyer.aux     flyer.ps            layout.tex    NEWS            readme.txt       TODO
COPYRIGHT   deutsch.tex  flyer.dvi     flyer.tex           Makefile      portugues.tex   sponsors         translation-check.pl
CVS         english.tex  flyer.log     francaise.tex       mkconfig      preamble.tex    svenska.tex

luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$
=====

> While the simplest solution would have been listing all the files to be
> removed, I propose a for loop which is IMHO "cleaner" :-)
[...]
> Index: Makefile
> ===================================================================
> RCS file: /cvsroot/debian-flyers/general/Makefile,v
> retrieving revision 1.18
> diff -u -r1.18 Makefile
> --- Makefile	6 Sep 2007 04:33:01 -0000	1.18
> +++ Makefile	28 May 2008 21:39:08 -0000
> @@ -121,9 +121,11 @@
>  	scp $? alioth.debian.org:/org/alioth.debian.org/chroot/ftproot/pub/debian-flyers/
>  
>  clean:
> -	-rm -f $(base).{ps,eps,dvi,aux,log,jpg} *~
> -	-rm -f all.{ps,eps,dvi,aux,log,jpg}
> -	-rm -f $(base)-*.ps
> +	-for I in ps eps dvi aux log jpg; do \
> +		rm -f $(base)."$$I"; \
> +		rm -f all."$$I"; \
> +	done
> +	-rm -f $(base)-*.ps *~
>  
>  ChangeLog: NEWS
>  	cvs2cl --accum --prune

My previous patch still applies without any problem and indeed it works:
=====
luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$ patch -p0 \
  /home/luca/debian-flyers_remove-bashisms-in-Makefile_20080528-gismo.diff
patching file Makefile

luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$ make clean
for I in ps eps dvi aux log jpg; do \
                rm -f flyer."$I"; \
                rm -f all."$I"; \
        done
rm -f flyer-*.ps *~

luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$ ls
all.tex     dansk.tex    espanyol.tex        italiano.tex  nederlands.tex  README.printing  swirl.eps
config.tex  debian.eps   flyer-one-page.tex  layout.tex    NEWS            readme.txt       TODO
COPYRIGHT   deutsch.tex  flyer.tex           Makefile      portugues.tex   sponsors         translation-check.pl
CVS         english.tex  francaise.tex       mkconfig      preamble.tex    svenska.tex

luca at gismo:~/src/OpenExpo_Bern_debian.ch_flyers/general$
=====

Please consider my patch or any other possible fix :-)

Thx, bye,
Gismo / Luca
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/debian-flyers-devel/attachments/20100323/93d309e6/attachment.pgp>


More information about the debian-flyers-devel mailing list