With a patch I have, when applied with --dry-run, patch reports rejects failure. The same patch without dry run applies fine without even fuzz. Reproducible: Always Steps to Reproduce: Here's a demo: root@insecure linux-2.6.10-rsbac # patch -p1 --dry-run -f < /var/tmp/portage/rsbac-dev-sources-2.6.10/work/patches/1/rsbac-patches-2.6-10.0/1505_rsbac_bugfix_v1.2.3-9.patch patching file include/rsbac/aci.h patching file include/rsbac/fs.h patching file rsbac/adf/auth/auth_main.c patching file rsbac/adf/reg/kproc_hide.c patching file rsbac/adf/reg/root_plug.c patching file rsbac/data_structures/aci_data_structures.c patching file rsbac/data_structures/auth_data_structures.c patching file rsbac/help/syscalls.c patching file rsbac/data_structures/aci_data_structures.c patching file include/rsbac/fs.h Hunk #1 FAILED at 33. 1 out of 1 hunk FAILED -- saving rejects to file include/rsbac/fs.h.rej patching file include/rsbac/helpers.h patching file rsbac/help/helpers.c patching file rsbac/help/debug.c patching file rsbac/data_structures/aci_data_structures.c patching file rsbac/help/pm_getname.c root@insecure linux-2.6.10-rsbac # root@insecure linux-2.6.10-rsbac # patch -p1 -f < /var/tmp/portage/rsbac-dev-sources-2.6.10/work/patches/1/rsbac-patches-2.6-10.0/1505_rsbac_bugfix_v1.2.3-9.patch patching file include/rsbac/aci.h patching file include/rsbac/fs.h patching file rsbac/adf/auth/auth_main.c patching file rsbac/adf/reg/kproc_hide.c patching file rsbac/adf/reg/root_plug.c patching file rsbac/data_structures/aci_data_structures.c patching file rsbac/data_structures/auth_data_structures.c patching file rsbac/help/syscalls.c patching file rsbac/data_structures/aci_data_structures.c patching file include/rsbac/fs.h patching file include/rsbac/helpers.h patching file rsbac/help/helpers.c patching file rsbac/help/debug.c patching file rsbac/data_structures/aci_data_structures.c patching file rsbac/help/pm_getname.c root@insecure linux-2.6.10-rsbac # Actual Results: Refuses to patch in dry-un (rejects). Expected Results: Should patch! Using: sys-devel/patch-2.5.9 The patch is: http://dev.gentoo.org/~kang/rsbac/patches/1.2.3/2.6/rsbac-patches-2.6-10.0/1505_rsbac_bugfix_v1.2.3-9.patch The kernel is: vanilla 2.6.10 + rsbac patch for 2.6.10 + pax test17 for 2.6.10 + patches found in: http://dev.gentoo.org/~kang/rsbac/patches/1.2.3/2.6/rsbac-patches-2.6-10.0 For your convenience, the ebuild used is here: http://dev.gentoo.org/~kang/rsbac/rsbac-dev-sources-2.6.10.ebuild And patching problem summary is here: http://dev.gentoo.org/~kang/rsbac/patch.txt I tried to use -i instead of < redirection to prevent buffer problems, but I get the same errors.
According to metadata.xml, assigning to base-system herd.
try cutting the patch file down to the 1 problematic hunk ... if it still fails with just that 1 hunk, attach it here along with the file it applies against
It works if i split hunks while this is a work around, shouldn't this still be a bug ? ever experienced it ?
I did a few more tests... if i put any other hunk with the failing one, dry-run *never* works if its alone it does indeed work
i didnt tell you to fix your patch, i told you to attach the problematic files here so i could test :P
... if it still fails with just that 1 hunk, attach it here along with the file it applies against ... I see a IF so yes, you did tell me that ;) Sorry for the delay, my ISP was down for longer than a week :(
Created attachment 48872 [details, diff] just the bad hunk
Created attachment 48873 [details, diff] the whole patch
Ok, I finally got the explanation why it's like that: < ferringb> so... like I said, later hunk relying on an earlier patch, something dry-run doesn't pick up on (nor is it easy to implement, long standing issue with patch actually) And I didn't know. The bug is probably invalid. (I let you mark it so) Sorry :)
sounds good ;)