[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/47367: patch(1) mishandles Oops.rej
>Synopsis: patch(1) mishandles Oops.rej
>Arrival-Date: Thu Dec 27 02:05:00 +0000 2012
>Originator: David A. Holland
>Release: NetBSD 6.99.11 (20120906)
System: NetBSD macaran 6.99.11 NetBSD 6.99.11 (MACARAN) #15: Mon Oct 15
21:24:31 EDT 2012 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
$NetBSD: patch.c,v 1.29 2011/09/06 18:25:14 joerg Exp $
$NetBSD: pch.c,v 1.24 2011/09/06 18:25:14 joerg Exp $
$NetBSD: inp.c,v 1.23 2009/10/21 17:16:11 joerg Exp $
$NetBSD: util.c,v 1.26 2010/10/02 19:31:14 wiz Exp $
$NetBSD: backupfile.c,v 1.14 2008/09/19 18:33:34 joerg Exp $
$NetBSD: mkpath.c,v 1.1 2008/09/19 18:33:34 joerg Exp $
If you try to patch a file that doesn't exist, and attempt to continue
instead of ^Cing out, patch goes
File to patch:
No file found--skip this patch? [n] y
Hunk #1 ignored at 64.
Hunk #2 ignored at 99.
Hunk #3 ignored at 133.
3 out of 3 hunks ignored--saving rejects to Oops.rej
...but it truncates Oops.rej for each missing file, so you lose most
of the patch.
The output Oops.rej file also doesn't have a patch header, so you
can't tell where it was supposed to go.
Pick your favorite pkgsrc package with a bunch of patches, then do
tar -xvzf ../../../distfiles/thingy-1.0.tar.gz
cat ../../patches/patch-* | patch -p1
and enter nothing at the "File to patch:" prompts and 'y' and the
"skip this patch?" prompts.
Then look at the output Oops.rej file and notice that it reflects only
the last of the patches.
There is an Oops.rej.orig file also left behind that contains the
contents of the second-last patch, but the others are lost.
(I'm furthermore wondering what happens if the current directory also
contains a file called Oops for which a patch fails...)
Main Index |
Thread Index |