From MAILER-DAEMON Mon Oct 02 09:25:33 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dz0iz-0002X8-TE
	for mharc-bug-patch@gnu.org; Mon, 02 Oct 2017 09:25:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56185)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pantungmin@hotmail.com>) id 1dyxDo-00043X-T1
	for bug-patch@gnu.org; Mon, 02 Oct 2017 05:41:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pantungmin@hotmail.com>) id 1dyxDm-0007d2-AO
	for bug-patch@gnu.org; Mon, 02 Oct 2017 05:41:08 -0400
Received: from mail-oln040092253038.outbound.protection.outlook.com
	([40.92.253.38]:12648
	helo=APC01-SG2-obe.outbound.protection.outlook.com)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <pantungmin@hotmail.com>)
	id 1dyxDl-0007bL-Hr
	for bug-patch@gnu.org; Mon, 02 Oct 2017 05:41:06 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com;
	s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; 
	bh=+dikG2gFEWo+lB/XDJGHUl5XtNBpYb+eF+UXkVG/1r4=;
	b=A2O9Fng6TqHdpv0RAxVmVGkLbKFEKIOyOoA8n4OpY10ZH5oIcScTn470pnUN3+cp9yF5EO5Mg8cWExLPHcMq9L3NWMK9iqNhn/un0W//PlbPtYdS2UHul2yJUUTpYfy96TFamprkf2WxDWsmLDEgXiPS8N1825rH7BjOR5vfBoz941g/YUv76ZoOzELI6HMOxq5nemphTwAmDL7xrBndVsilwGzGRb2YQtpA6ezeMCfYAqZUkH2oPBjvJ5i3+KpnXmU2q48bQpKCU9U1bCkWbKxoX/RA7wJC9IiHkuDMAmo3/NIHbcL/SiMjq5yWHEqbf5pbtJN5J2Vu+u69/KmMUA==
Received: from PU1APC01FT049.eop-APC01.prod.protection.outlook.com
	(10.152.252.52) by PU1APC01HT209.eop-APC01.prod.protection.outlook.com
	(10.152.253.180) with Microsoft SMTP Server (version=TLS1_2,
	cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.56.11;
	Mon, 2 Oct 2017 09:41:01 +0000
Received: from KL1PR03MB1494.apcprd03.prod.outlook.com (10.152.252.51) by
	PU1APC01FT049.mail.protection.outlook.com (10.152.253.9) with Microsoft
	SMTP Server (version=TLS1_2,
	cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id
	15.20.56.11 via Frontend Transport; Mon, 2 Oct 2017 09:41:01 +0000
Received: from KL1PR03MB1494.apcprd03.prod.outlook.com
	([fe80::49c6:bd67:2684:a727]) by
	KL1PR03MB1494.apcprd03.prod.outlook.com
	([fe80::49c6:bd67:2684:a727%14]) with mapi id 15.20.0077.016;
	Mon, 2 Oct 2017 09:41:00 +0000
From: ? ?? <pantungmin@hotmail.com>
To: "bug-patch@gnu.org" <bug-patch@gnu.org>
Thread-Topic: [Patch] - Separated patch hunk FAIL or ignored from *.rej to
	different suffix filename.
Thread-Index: AQHTO2DbvEDczoPqvUi3sEFK/o6Mbg==
Date: Mon, 2 Oct 2017 09:41:00 +0000
Message-ID: <KL1PR03MB149450BEA0E5491932C617D2D27D0@KL1PR03MB1494.apcprd03.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
authentication-results: gnu.org; dkim=none (message not signed)
	header.d=none; gnu.org; dmarc=none action=none header.from=hotmail.com; 
x-incomingtopheadermarker: OriginalChecksum:4FBD8E1014751F9A3020E973DD4AB3A4007149AF20A75323A6594159BCAF656A;
	UpperCasedChecksum:F3D0FD4D7E37B49948F5D6EEADCDCB50B811286F3B2CB9E2C6463560266DBE05;
	SizeAsReceived:6966; Count:44
x-ms-exchange-messagesentrepresentingtype: 1
x-tmn: [qmrDDxHgIgBsF27m++fv7fGTW4CJgVij]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; PU1APC01HT209;
	6:kYrLoyRHsZODZ2OtSXiKuKG8M6RLAHAigQ3YVOLl5GDPP0LCfqG2ctj0sWuhrNve1Ot1ZPHcxRwPjVDXwNrtxB7SKH3iMc3H/WA49F+WmdDii5LPIT9OAst8rij0Lf8/VmR7kAKmJTjVO1vFHGBtT+she9rNnAQO5QmTBXMEact6XcB30x1h5Cnze9gYbUi4WpVmTyN+1sHG5yjytOJm0DIO1UUYv188B5sw/Wo37VeBRyq6r9lEhMqnnH/+/XeZZf2ZiHKN0rQkJ9hy8KbNKIMpaVxgaBtbo97uDIBIMwveAWBCK4AM53NsAZSCHMI9kw2NzQbpLkwhkybd4HOR2A==;
	5:uP/mYZ3h4BAxMssJyblc+Ojl44h2AVZAsP+DfuLoESiHNPOBEsO/MQm6P2mwYvdXnJI9R1eYcS1ZGAtW/gT7zPpsw/laLyl9q2ezH6X743d5WG+/6MgyC5SxjbnErFR1yN0XYOOI3MEz8/lUoonHcg==;
	24:A1sj7pbTYTv4d8eBATy/ny6WGiwaE5ewYys3G73FHfwxLwiND7bCPtZ1puMiN98vXTtBzYFvFjYlKstQ72P17v+BCB+j5ChsxAshnonOD5A=;
	7:JW2L7joACmyHK8WE9ZSK+YUFWG443ZUetXYMwBxd1yR63AMK+abqWOfVrga9zPCfo9KY7vndLqUD85Ir6j3sEP7dnw7DAXX5RATTw+ylF9kO412YOxFlsGbcAxRSeFqPUOlSNVrn0jyB6N715h2Cr+nTvjko7Wpg2eabCmF+nL9Dij+m3DsmDLbyCzmsOAjH0kBTow1XH1hFiWSymsAGIDiLFFJpVruxMIKymkacYZQ=
x-incomingheadercount: 44
x-eopattributedmessage: 0
x-ms-office365-filtering-correlation-id: 9136ef1a-7955-482a-3871-08d50979b114
x-microsoft-antispam: UriScan:; BCL:0; PCL:0;
	RULEID:(22001)(201702061074)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1601125374)(1603101448)(1701031045);
	SRVR:PU1APC01HT209; 
x-ms-traffictypediagnostic: PU1APC01HT209:
x-exchange-antispam-report-test: UriScan:;
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0;
	RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(444000031);
	SRVR:PU1APC01HT209; BCL:0; PCL:0;
	RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);
	SRVR:PU1APC01HT209; 
x-forefront-prvs: 0448A97BF2
x-forefront-antispam-report: SFV:NSPM; SFS:(7070007)(98901004); DIR:OUT;
	SFP:1901; SCL:1; SRVR:PU1APC01HT209;
	H:KL1PR03MB1494.apcprd03.prod.outlook.com; FPR:; SPF:None; LANG:;
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: hotmail.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Oct 2017 09:41:00.6722 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Internet
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-Transport-CrossTenantHeadersStamped: PU1APC01HT209
X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy]
X-Received-From: 40.92.253.38
X-Mailman-Approved-At: Mon, 02 Oct 2017 09:25:29 -0400
Subject: [bug-patch] [Patch] - Separated patch hunk FAIL or ignored from
 *.rej to different suffix filename.
X-BeenThere: bug-patch@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: "Bug reports, suggestions,
	general discussion for GNU patch." <bug-patch.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/bug-patch/>
List-Post: <mailto:bug-patch@gnu.org>
List-Help: <mailto:bug-patch-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-patch>,
	<mailto:bug-patch-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Oct 2017 09:41:09 -0000

By default.  ether patch "FAIL" or "ignored" hunks saved in the same file n=
ame.
However, In mostly case, We only care "FAIL" hunks from *.rej.
The patch can not separate two case(FAIL/Ignored)  in different suffix file=
name.

$ patch --dry-run -p1 -d backports/ --forward -N  < kernel_v4.9.patch

patching file include/net/cfg80211.h
Reversed (or previously applied) patch detected!  Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file include/net/cfg80211.h.r=
ej       <=3D=3D both FAIL and ignored hanks  saved to *.rej=20
patching file include/uapi/linux/nl80211.h
Reversed (or previously applied) patch detected!  Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file include/uapi/linux/nl802=
11.h.rej

Sol:

I tried rebuild patch-2.7 source. it is what I want.
but is any better way here?

peter@src$ git diff=20
diff --git a/src/patch.c b/src/patch.c
index febfd42..ad9fba8 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -586,7 +586,7 @@ main (int argc, char **argv)
                    /* FIXME: This should really be done differently!  */
                    const char *s =3D simple_backup_suffix;
                    size_t len;
-                   simple_backup_suffix =3D ".rej";
+                   simple_backup_suffix =3D skip_rest_of_patch ? ".ign": "=
.rej";
                    rej =3D find_backup_file_name (outname, simple_backups)=
;
                    len =3D strlen (rej);
                    if (rej[len - 1] =3D=3D '~')

$ patch-2.7 -p1 -d backports/ --forward -N  < kernel_v4.9_patch_for_qcacld2=
.0.patch
Reversed (or previously applied) patch detected!  Skipping patch.
2 out of 2 hunks ignored -- saving rejects to file include/net/cfg80211.h.i=
gn
patching file include/uapi/linux/nl80211.h
Reversed (or previously applied) patch detected!  Skipping patch.
3 out of 3 hunks ignored -- saving rejects to file include/uapi/linux/nl802=
11.h.ign
patching file net/mac80211/mlme.c
Hunk #1 FAILED at 4486.
1 out of 1 hunk FAILED -- saving rejects to file net/mac80211/mlme.c.rej   =
        <=3D=3D patch FAIL save to *.rej
patching file net/wireless/core.h
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file net/wireless/core.h.ign
patching file net/wireless/mlme.c
Reversed (or previously applied) patch detected!  Skipping patch.
1 out of 1 hunk ignored -- saving rejects to file net/wireless/mlme.c.ign  =
           <=3D=3D Skip and save to *.ign
patching file net/wireless/nl80211.c

Regards
Peter=


