[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: dh_make debian/rules clean target



On Fri, 13 Sep 2002, Luca - De Whiskey's - De Vitis wrote:

> On Fri, Sep 13, 2002 at 02:30:55PM +0200, Stefano Zacchiroli wrote:
> > > There is no need of all the above:
> > >
> > > 	test -f /usr/share/misc/config.sub && \
> > >  		cp -f /usr/share/misc/config.sub config.sub
> >
> > Wrong, this is a non solution because if /usr/share/misc/config.sub does
> > not exists 'test' command will fail and make exits (because make exits
> > as soon as a command return non zero).
>
> If you do not want make to exit, do this:
>
>  	-test -f /usr/share/misc/config.sub && \
>   		cp -f /usr/share/misc/config.sub config.sub

And if /usr/share/misc/config.sub exists, but the cp fails, then make will
continue, when it shouldn't.

set -e; if test /usr/share/misc/config.sub; then cp -f /usr/share/misc/config.sub config.sub; fi

My original make solution had a type(if/ifneq).  Also, the make solution is
faster(less forking in the case that the files are not installed, and less
work for the shell to do).




Reply to: