[Top][All Lists]

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

Re: .DELETE_ON_ERROR & error propagation through multi-command

From: Robert
Subject: Re: .DELETE_ON_ERROR & error propagation through multi-command
Date: Tue, 08 Nov 2011 17:11:20 +0100
User-agent: Mozilla/5.0 (Windows NT 5.1; rv:7.0.1) Gecko/20110928 Firefox/7.0.1 SeaMonkey/2.4.1

Paul Smith wrote:
On Tue, 2011-11-08 at 15:27 +0100, Robert wrote:
I'm not strong in Windows scripting so I can't say the best way to solve
your problem.  Presumably you want to preserve the exit code of the
python script, then do the "cd ..", then exit from the recipe line using
the saved exit code.

thanks.  The method with&&  seems to work here on Windows too.
MingW GNU make seems to use a sort of MingW sh .
Well, I see Windows cmd.exe shell also understands the&&

Just remember that in this case, the final "cd .." is not performed.

That may or may not matter to you.  As I mentioned, in UNIX systems it's
basically a no-op since the working directory is a property of each
individual process.  I don't think that's true in Windows, so omitting
the final "cd .." might cause issues.

I tried:

        cd install && grrrrr && cd ..
        echo abcdef >x.txt

C:\devel\prj> make xtest
cd install && grrrrr && cd ..
/bin/sh: grrrrr: command not found
make: *** [xtest] Error 127

So I think when there is a break with error, its anyway over. And the calling shell is as its previous folder.

        cd install && echo qwertz>y.txt && cd ..
        echo abcdef >x.txt

..puts the y.txt and x.txt as intended in the different folders

        cd install && echo qwertz>y.txt
        echo abcdef >x.txt

.. does the same. So the "logical recipe lines" seem to be isolated in sub-shells (not affecting cwd) as well on Windows/MingW


reply via email to

[Prev in Thread] Current Thread [Next in Thread]