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

Re: RFC: Howto exclude config.sub and config.guess updates from .diff.gz



Il giorno Mon, 11 Feb 2008 16:50:33 +0100
Cyril Brulebois <cyril.brulebois@enst-bretagne.fr> ha scritto:

> On 11/02/2008, David Paleino wrote:
> > This seems to me more hackish than it should; is there a cleaner way
> > to do it (maybe I'm just complicating myself and don't see The Easy
> > Way [1])?
> 
> You could have a look at how cdbs does it, which might help.

I'll do it, thanks.

> > [1] I know that using "[ ! test ] || ..." is pretty awkward, but it
> > didn't work with "[ test ] &&". Maybe "&&" should be escaped
> > somehow? I don't really know.
> 
> That's simple, compare:
>   [ foo ] && bar
>   [ ! foo ] || bar
> 
> If foo, then bar, and success.
> If not foo, then not bar, and failure. Here is your problem.
>
> The foo/bar relationship is the same, but not the return code, which
> is problematic in a Makefile, since it introduces a failure, thus make
> stops (see lintian about ignoring the errors in the clean target).

Not true:

$ touch foo
$ [ -f foo ] && true   (1)
$ echo $?
0
$ [ ! -f foo ] || true (2)
$ echo $?
0 
$

Those relationships are:

(1) (true) and (true) == true
(2) (false) or (true) == true

And the lintian warning suggests:

[ ! -f Makefile ] || $(MAKE) distclean

but I can't understand why it couldn't suggest something like:

[ -f Makefile ] && $(MAKE) distclean

which triggers the same result (at least in bash -- that's why I'm supposing
that "&&" needs to be escaped somehow in Makefiles).

Regards,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174

Attachment: signature.asc
Description: PGP signature


Reply to: