From owner-freebsd-bugs Sun Jul 2 4:40:16 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 611D037BC2C for ; Sun, 2 Jul 2000 04:40:05 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id EAA34508; Sun, 2 Jul 2000 04:40:04 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from kronos.networkrichmond.com (kronos.networkrichmond.com [64.240.180.22]) by hub.freebsd.org (Postfix) with ESMTP id 989F137BBFD for ; Sun, 2 Jul 2000 04:38:21 -0700 (PDT) (envelope-from kbyanc@kronos.alcnet.com) Received: from vaio (c1096725-a.smateo1.sfba.home.com [24.20.139.104]) by kronos.networkrichmond.com (8.9.3/8.9.3/antispam) with ESMTP id HAA61108 for ; Sun, 2 Jul 2000 07:38:19 -0400 (EDT) Received: (from kbyanc@localhost) by vaio (8.9.3/8.9.3) id EAA88314; Sun, 2 Jul 2000 04:41:11 -0700 (PDT) (envelope-from kbyanc@mail.posi.net) Message-Id: <200007021141.EAA88314@vaio> Date: Sun, 2 Jul 2000 04:41:11 -0700 (PDT) From: kbyanc@posi.net Reply-To: kbyanc@posi.net To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: gnu/19638: patch's --skip/-S option doesn't skip when target doesn't exist Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 19638 >Category: gnu >Synopsis: patch's --skip/-S option doesn't skip when target doesn't exist >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Jul 02 04:40:04 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Kelly Yancey >Release: FreeBSD 5.0-CURRENT i386 >Organization: >Environment: FreeBSD backroom.corp.ONElist.com 5.0-CURRENT FreeBSD 5.0-CURRENT #1: Fri Jun 30 13:47:43 PDT 2000 root@backroom.corp.ONElist.com:/usr/src/sys/compile/BACKROOM i386 >Description: patch (as found in /usr/src/gnu/usr.bin/patch) does not honor -S (--skip) parameter when the target of the patchfile to skip does not exist. For example, if you used a command line such as: patch -p1 + -p2 + -S < my.diff to skip the third patchfile in the set, patch will prompt for the name of the file to patch (because it doesn't exist), even though it is to skip it. This patch addresses the issue on the simplest level. It still writes the 'skipped' patchfile out as a reject file (always named 'Oops.rej' since the target filename doesn't exist). It is debatable as to whether writing the reject file is correct for a skipped patch. -Kelly >How-To-Repeat: $ echo "this is a test" > file-a $ echo "this is another test" > file-b $ diff file-a file-b > diff-ab $ rm file-b $ patch -S < diff-ab >Fix: cvs diff: Diffing gnu/usr.bin/patch/ Index: gnu/usr.bin/patch//pch.c =================================================================== RCS file: /home/cvs/src/gnu/usr.bin/patch/pch.c,v retrieving revision 1.16 diff -u -r1.16 pch.c --- gnu/usr.bin/patch//pch.c 1999/09/05 17:31:55 1.16 +++ gnu/usr.bin/patch//pch.c 2000/07/02 11:10:28 @@ -173,7 +173,7 @@ if (p_indent && verbose) say3("(Patch is indented %d space%s.)\n", p_indent, p_indent==1?"":"s"); skip_to(p_start,p_sline); - while (filearg[0] == Nullch) { + while (!skip_rest_of_patch && filearg[0] == Nullch) { if (force || batch) { say1("No file to patch. Skipping...\n"); filearg[0] = savestr(bestguess); >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message