develooper Front page | perl.perl5.porters | Postings from August 2019

[perl #134361] [PATCH] $(MINIPERL_EXE) shouldn't be required toexist for "rm"

Thread Previous
From:
Tony Cook via RT
Date:
August 20, 2019 06:22
Subject:
[perl #134361] [PATCH] $(MINIPERL_EXE) shouldn't be required toexist for "rm"
Message ID:
rt-4.0.24-32012-1566282131-1596.134361-15-0@perl.org
On Wed, 14 Aug 2019 23:19:58 -0700, haukex@zero-g.net wrote:
> Hi,
> 
> $ man rm
>        -f, --force
>               ignore nonexistent files and arguments, never prompt
> $ rm doesnotexist ; echo $?
> rm: cannot remove 'doesnotexist': No such file or directory
> 1
> $ rm -f doesnotexist ; echo $?
> 0
> 
> It's the nonzero exit code that causes `make` to think the build step
> failed. Or am I misunderstanding you?

	-@rm \$(MINIPERL_EXE)

The "-" at the front of the recipe means that the exit code of rm is ignored.  (The @ means the command isn't echoed.)

From the GNU make documentation:

   To ignore errors in a recipe line, write a '-' at the beginning of
the line's text (after the initial tab).  The '-' is discarded before
the line is passed to the shell for execution.

   For example,

     clean:
             -rm -f *.o

This causes 'make' to continue even if 'rm' is unable to remove a file.

Tony

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org/Ticket/Display.html?id=134361

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About