Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 409227 - eutils.eclass:epatch: use -o /dev/null in place of --dry-run
Summary: eutils.eclass:epatch: use -o /dev/null in place of --dry-run
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo's Team for Core System packages
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-21 20:32 UTC by Ben Kohler
Modified: 2012-10-10 17:29 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Kohler gentoo-dev 2012-03-21 20:32:16 UTC
It would be nice to switch --dry-run to -o /dev/null in epatch, so that when a patch fails and patch.out reports "saving rejects to foo.rej" this file would actually exist, and could be used to troubleshoot the failed patch.

As far as I know, this would not cause any undesirable side-effects.

I know this has been discussed briefly in another bug report *somewhere* but I cannot find it today.  To make matters even MORE confusing, even if a user KNOWS that --dry-run does not actually produce a rejects file, epatch lies and does not tell the user that it is using --dry-run:

echo "PATCH COMMAND:  ${patch_cmd} < '${PATCH_TARGET}'"
...
${patch_cmd} --dry-run -f < "${PATCH_TARGET}" 2>&1

Reproducible: Always
Comment 1 SpanKY gentoo-dev 2012-03-23 03:34:10 UTC
i'm not sure relying on this trick is safe or really even useful.  the log also provides the full name of the patch, so it's fairly trivial to apply it yourself if you want to see where things are going wrong.
Comment 2 Ben Kohler gentoo-dev 2012-09-23 18:05:58 UTC
While poking around recent gnu patch changes, I noticed that dry-run behavior has been changed.  It uses better language so it's very clear that it's a dry run, and no longer claims to be creating a rejects file on dry run.

Unless anyone objects, I will close this bug when we get a patch release with these changes:  http://git.savannah.gnu.org/gitweb/?p=patch.git;a=commitdiff;h=3ccb16e10b7b4312e9b6096760ddc4c2d90194f2
Comment 3 Ben Kohler gentoo-dev 2012-10-05 15:19:08 UTC
sys-devel/patch-2.7.1 includes this patch, closing
Comment 4 SpanKY gentoo-dev 2012-10-10 17:29:29 UTC
thanks for following up