From owner-freebsd-bugs@FreeBSD.ORG Tue Sep 15 20:40:04 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 09E491065672 for ; Tue, 15 Sep 2009 20:40:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id D6C018FC1D for ; Tue, 15 Sep 2009 20:40:03 +0000 (UTC) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FKe3qd038928 for ; Tue, 15 Sep 2009 20:40:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n8FKe3do038927; Tue, 15 Sep 2009 20:40:03 GMT (envelope-from gnats) Resent-Date: Tue, 15 Sep 2009 20:40:03 GMT Resent-Message-Id: <200909152040.n8FKe3do038927@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "deeptech71@gmail.com" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 790F6106566B for ; Tue, 15 Sep 2009 20:35:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 677AC8FC19 for ; Tue, 15 Sep 2009 20:35:27 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id n8FKZR4P015789 for ; Tue, 15 Sep 2009 20:35:27 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id n8FKZRie015788; Tue, 15 Sep 2009 20:35:27 GMT (envelope-from nobody) Message-Id: <200909152035.n8FKZRie015788@www.freebsd.org> Date: Tue, 15 Sep 2009 20:35:27 GMT From: "deeptech71@gmail.com" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/138858: patch(1) assumes that a file appears only once in the patch in check-only mode X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Sep 2009 20:40:04 -0000 >Number: 138858 >Category: bin >Synopsis: patch(1) assumes that a file appears only once in the patch in check-only mode >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: Tue Sep 15 20:40:03 UTC 2009 >Closed-Date: >Last-Modified: >Originator: deeptech71@gmail.com >Release: ~CURRENT >Organization: >Environment: FreeBSD x 8.0-BETA2 FreeBSD 8.0-BETA2 #0 r196195M: Fri Aug 14 02:25:06 UTC 2009 devhc@:/usr/obj/usr/src/sys/HQ i386 >Description: There are patches that should be applied in a strict order to be successful (ie., on a set of files, apply patch#1 first, then apply patch#2 on the result yielded by applying patch#1). I concatenate the patches (in correct order), and pipe them to patch(1). But, as always, I check what would happen if the patches were applied (use the -C option). The test run can show wrong results if the concatenated patch references a file multiple times near a common line, probably because in the check-only mode, patch(1) tries to apply each hunk on the original, unmodified files. >How-To-Repeat: diff -u orig mod1 > mod1.patch # mod1 changes line N of orig diff -u orig mod2 > mod2.patch # mod2 changes line N of orig, too ! cat mod1.patch mod2.patch | patch -Cs # looks OK cat mod1.patch mod2.patch | patch -s # fail ! >Fix: (If this won't be fixed soon, it would be nice to have this documented in the manpages.) >Release-Note: >Audit-Trail: >Unformatted: