From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <bug-guix-bounces+larch=yhetil.org@gnu.org>
Received: from mp11.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by ms9.migadu.com with LMTPS
	id yNuXMqRgTmSo/wAASxT56A
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 30 Apr 2023 14:35:48 +0200
Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits))
	by mp11.migadu.com with LMTPS
	id iB1zMqRgTmRmSwEA9RJhRA
	(envelope-from <bug-guix-bounces+larch=yhetil.org@gnu.org>)
	for <larch@yhetil.org>; Sun, 30 Apr 2023 14:35:48 +0200
Received: from lists.gnu.org (lists.gnu.org [209.51.188.17])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by aspmx1.migadu.com (Postfix) with ESMTPS id 50D8A28FCB
	for <larch@yhetil.org>; Sun, 30 Apr 2023 14:35:48 +0200 (CEST)
Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-guix-bounces@gnu.org>)
	id 1pt6Gf-0007mC-4M; Sun, 30 Apr 2023 08:35:05 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1pt6Gd-0007lH-R5
 for bug-guix@gnu.org; Sun, 30 Apr 2023 08:35:03 -0400
Received: from debbugs.gnu.org ([209.51.188.43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1pt6Gd-0007EW-GS
 for bug-guix@gnu.org; Sun, 30 Apr 2023 08:35:03 -0400
Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pt6Gc-0005wc-7Y
 for bug-guix@gnu.org; Sun, 30 Apr 2023 08:35:02 -0400
X-Loop: help-debbugs@gnu.org
Subject: bug#63150: [PATCH 1/2] gnu: quilt: Fix build because of grep warnings.
Resent-From: Josselin Poiret <dev@jpoiret.xyz>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-guix@gnu.org
Resent-Date: Sun, 30 Apr 2023 12:35:02 +0000
Resent-Message-ID: <handler.63150.B63150.168285807622805@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 63150
X-GNU-PR-Package: guix
X-GNU-PR-Keywords: 
To: Maze <maze@pkbd.org>, 63150@debbugs.gnu.org
Cc: Josselin Poiret <dev@jpoiret.xyz>
Received: via spool by 63150-submit@debbugs.gnu.org id=B63150.168285807622805
 (code B ref 63150); Sun, 30 Apr 2023 12:35:02 +0000
Received: (at 63150) by debbugs.gnu.org; 30 Apr 2023 12:34:36 +0000
Received: from localhost ([127.0.0.1]:37431 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1pt6GB-0005vj-GI
 for submit@debbugs.gnu.org; Sun, 30 Apr 2023 08:34:36 -0400
Received: from jpoiret.xyz ([206.189.101.64]:60646)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dev@jpoiret.xyz>) id 1pt6G7-0005vS-Aj
 for 63150@debbugs.gnu.org; Sun, 30 Apr 2023 08:34:34 -0400
Received: from authenticated-user (jpoiret.xyz [206.189.101.64])
 by jpoiret.xyz (Postfix) with ESMTPA id 17148184D70;
 Sun, 30 Apr 2023 12:34:29 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim;
 t=1682858069;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references;
 bh=+vlh7lC5wN/mXfPDy02hnNSatEUUR9tCthqUhj5Yow4=;
 b=WNaZdDHoSoQ4zIx/9qqGZXac95BbVD0+8ZlQgVSajTakyptFYbWCg7daU8UY6jvBNc5m59
 VJHzMZR59bvdgJ/jnSh2MdjKgShX1ascdFPul0tr+6hVrtnT/L7pIAQKC5SNN11kXhTtmS
 Hb47aExDvNHuWB3VYSGIveNhecmE2fIj/MvDv41E/A6AEkTKY4Xs3vMok3sehnj+ImXd1l
 RDtdm8dEY6ZSgDI9qepEiZp9qGtwByPFD0KyAUipus1RRLFZ+7/vZ4vNDrsxd3QVN4EfLT
 fnHyYrP1//DYMddbEciX4T9GXfXtZQp9KFpNTwv78AI/Nbfdue2t7py3X3bicw==
Date: Sun, 30 Apr 2023 14:34:27 +0200
Message-Id: <cbaaf8180a85e90c627071832eea33862b713ad0.1682858043.git.dev@jpoiret.xyz>
In-Reply-To: <875y9dekar.fsf@pkbd.org>
References: <875y9dekar.fsf@pkbd.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Spamd-Bar: ++++
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
X-BeenThere: bug-guix@gnu.org
List-Id: Bug reports for GNU Guix <bug-guix.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-guix>,
 <mailto:bug-guix-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-guix>
List-Post: <mailto:bug-guix@gnu.org>
List-Help: <mailto:bug-guix-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-guix>,
 <mailto:bug-guix-request@gnu.org?subject=subscribe>
Reply-to:  Josselin Poiret <dev@jpoiret.xyz>
From:  Josselin Poiret via Bug reports for GNU Guix <bug-guix@gnu.org>
Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org
Sender: bug-guix-bounces+larch=yhetil.org@gnu.org
X-Migadu-Country: US
X-Migadu-Flow: FLOW_IN
ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682858148; a=rsa-sha256; cv=none;
	b=rRttSjheVvgc4S3bntu65BYQqOKvlBc/g5yF47AmEOyDErESpH5T3g+7VyIfPm0lGRW68I
	QC4VhGKOorgQg9BKQTOBksQSOQcpPrYSlsvgJ61R92fQYr7d/DLrzcGLS0GGqNlYfqNe6R
	TlN8RyS5Da/7prrWKVMY1oRNz6c4W9jl2VnusZEl9N7YLbn8/cf0fnJkUwaOsoD+hrv/cA
	lPkoQb9xs+4x1FlvPCTzZHzKstmh40V/C33qa8r74pEclS4vr/oXTzYwx78mRf2UDZJjYb
	PHAGWXeJ7cTpeAP8hJUUsvlxhzuqqn7bMJcgSQEPF/hkjg1tTC7pCDZEOoW6/w==
ARC-Authentication-Results: i=1;
	aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=WNaZdDHo;
	dmarc=pass (policy=none) header.from=gnu.org;
	spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org;
	s=key1; t=1682858148;
	h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date:
	 message-id:message-id:to:to:cc:cc:mime-version:mime-version:
	 content-transfer-encoding:content-transfer-encoding:resent-cc:
	 resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to:
	 references:references:list-id:list-help:list-unsubscribe:
	 list-subscribe:list-post:dkim-signature;
	bh=+vlh7lC5wN/mXfPDy02hnNSatEUUR9tCthqUhj5Yow4=;
	b=aNI6m7x1xSBT38DxiuxQAiSuBE+a73s81X/tNJavqaRauO1xZAXOkMbKxYQ2CxM7m5Pecq
	97Mjd4jjWexGuyJK2sFVad2ze+ZMPEyfg0E2PhOtK8gsZdw3YwP8uqxUubI691C0JIRRJV
	ae9qP8VAQQbXHxUUiB1lHuc5AV7CkErBUj+vuiMzWbEYmafe9un+tYN12wDGQvavEvdG6n
	ywEzzNmuWizpvD5MnWx406QuxwqMZU8gXHpPvwxlfBEBGcC7Hzwvemz3yJxQm163hfZE66
	uEfVst4QTcobnMZpj/DhwsZdYHRWtp4urmY6xxAQHXn1bKDrrjVNreOMmG2TLA==
X-Migadu-Spam-Score: -2.80
X-Spam-Score: -2.80
X-Migadu-Queue-Id: 50D8A28FCB
X-Migadu-Scanner: scn0.migadu.com
Authentication-Results: aspmx1.migadu.com;
	dkim=fail ("headers rsa verify failed") header.d=jpoiret.xyz header.s=dkim header.b=WNaZdDHo;
	dmarc=pass (policy=none) header.from=gnu.org;
	spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org"
X-TUID: Zk7xCyExNEGO

From: Josselin Poiret <dev@jpoiret.xyz>

* gnu/packages/patches/quilt-avoid-grep-warnings.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/patchutils.scm (quilt): Use it.
---
Hi everyone,

This should fix the build and also update quilt.

Best,

 gnu/local.mk                                  |   1 +
 .../patches/quilt-avoid-grep-warnings.patch   | 142 ++++++++++++++++++
 gnu/packages/patchutils.scm                   |   3 +-
 3 files changed, 145 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/quilt-avoid-grep-warnings.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1a84e5b499..06e5f5aa7f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1825,6 +1825,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/qtwayland-gcc-11.patch			\
   %D%/packages/patches/qtwayland-dont-recreate-callbacks.patch	\
   %D%/packages/patches/qtwayland-cleanup-callbacks.patch	\
+  %D%/packages/patches/quilt-avoid-grep-warnings.patch	\
   %D%/packages/patches/ragel-char-signedness.patch		\
   %D%/packages/patches/randomjungle-disable-static-build.patch	\
   %D%/packages/patches/range-v3-build-with-gcc10.patch	\
diff --git a/gnu/packages/patches/quilt-avoid-grep-warnings.patch b/gnu/packages/patches/quilt-avoid-grep-warnings.patch
new file mode 100644
index 0000000000..b91dc98695
--- /dev/null
+++ b/gnu/packages/patches/quilt-avoid-grep-warnings.patch
@@ -0,0 +1,142 @@
+From f73f8d7f71de2878d3f92881a5fcb8eafd78cb5f Mon Sep 17 00:00:00 2001
+From: Jean Delvare <jdelvare@suse.de>
+Date: Fri, 9 Sep 2022 10:10:37 +0200
+Subject: Avoid warnings with grep 3.8
+
+GNU grep version 3.8 became more strict about needless quoting in
+patterns. We have one occurrence of that in quilt, where "/"
+characters are being quoted by default. There are cases where they
+indeed need to be quoted (typically when used in a sed s/// command)
+but most of the time they do not, and this results in the following
+warning:
+
+grep: warning: stray \ before /
+
+So rename quote_bre() to quote_sed_re(), and introduce
+quote_grep_re() which does not quote "/".
+
+Signed-off-by: Jean Delvare <jdelvare@suse.de>
+---
+ quilt/diff.in             |  2 +-
+ quilt/patches.in          |  2 +-
+ quilt/scripts/patchfns.in | 20 +++++++++++++-------
+ quilt/upgrade.in          |  4 ++--
+ 4 files changed, 17 insertions(+), 11 deletions(-)
+
+diff --git a/quilt/diff.in b/quilt/diff.in
+index e90dc33..07788ff 100644
+--- a/quilt/diff.in
++++ b/quilt/diff.in
+@@ -255,7 +255,7 @@ then
+ 	# Add all files in the snapshot into the file list (they may all
+ 	# have changed).
+ 	files=( $(find $QUILT_PC/$snap_subdir -type f \
+-		  | sed -e "s/^$(quote_bre $QUILT_PC/$snap_subdir/)//" \
++		  | sed -e "s/^$(quote_sed_re $QUILT_PC/$snap_subdir/)//" \
+ 		  | sort) )
+ 	printf "%s\n" "${files[@]}" >&4
+ 	unset files
+diff --git a/quilt/patches.in b/quilt/patches.in
+index bb17a46..eac45a9 100644
+--- a/quilt/patches.in
++++ b/quilt/patches.in
+@@ -60,7 +60,7 @@ scan_unapplied()
+ 	# Quote each file name only once
+ 	for file in "${opt_files[@]}"
+ 	do
+-		files_bre[${#files_bre[@]}]=$(quote_bre "$file")
++		files_bre[${#files_bre[@]}]=$(quote_grep_re "$file")
+ 	done
+ 
+ 	# "Or" all files in a single pattern
+diff --git a/quilt/scripts/patchfns.in b/quilt/scripts/patchfns.in
+index c2d5f9d..1bd7233 100644
+--- a/quilt/scripts/patchfns.in
++++ b/quilt/scripts/patchfns.in
+@@ -78,8 +78,14 @@ array_join()
+ 	done
+ }
+ 
+-# Quote a string for use in a basic regular expression.
+-quote_bre()
++# Quote a string for use in a regular expression for a grep pattern.
++quote_grep_re()
++{
++	echo "$1" | sed -e 's:\([][^$.*\\]\):\\\1:g'
++}
++
++# Quote a string for use in a regular expression for a sed s/// command.
++quote_sed_re()
+ {
+ 	echo "$1" | sed -e 's:\([][^$/.*\\]\):\\\1:g'
+ }
+@@ -215,7 +221,7 @@ patch_in_series()
+ 
+ 	if [ -e "$SERIES" ]
+ 	then
+-		grep -q "^$(quote_bre $patch)\([ \t]\|$\)" "$SERIES"
++		grep -q "^$(quote_grep_re $patch)\([ \t]\|$\)" "$SERIES"
+ 	else
+ 		return 1
+ 	fi
+@@ -365,7 +371,7 @@ is_applied()
+ {
+ 	local patch=$1
+ 	[ -e $DB ] || return 1
+-	grep -q "^$(quote_bre $patch)\$" $DB
++	grep -q "^$(quote_grep_re $patch)\$" $DB
+ }
+ 
+ applied_patches()
+@@ -465,7 +471,7 @@ remove_from_db()
+ 	local tmpfile
+ 	if tmpfile=$(gen_tempfile)
+ 	then
+-		grep -v "^$(quote_bre $patch)\$" $DB > $tmpfile
++		grep -v "^$(quote_grep_re $patch)\$" $DB > $tmpfile
+ 		cat $tmpfile > $DB
+ 		rm -f $tmpfile
+ 		[ -s $DB ] || rm -f $DB
+@@ -520,7 +526,7 @@ find_patch()
+ 		fi
+ 
+ 		local patch=${1#$SUBDIR_DOWN$QUILT_PATCHES/}
+-		local bre=$(quote_bre "$patch")
++		local bre=$(quote_sed_re "$patch")
+ 		set -- $(sed -e "/^$bre\(\|\.patch\|\.diff\?\)\(\|\.gz\|\.bz2\|\.xz\|\.lzma\|\.lz\)\([ "$'\t'"]\|$\)/!d" \
+ 			       -e 's/[ '$'\t''].*//' "$SERIES")
+ 		if [ $# -eq 1 ]
+@@ -631,7 +637,7 @@ files_in_patch()
+ 	then
+ 		find "$path" -type f \
+ 			       -a ! -path "$(quote_glob "$path")/.timestamp" |
+-		sed -e "s/$(quote_bre "$path")\///"
++		sed -e "s/$(quote_sed_re "$path")\///"
+ 	fi
+ }
+ 
+diff --git a/quilt/upgrade.in b/quilt/upgrade.in
+index dbf7d05..866aa33 100644
+--- a/quilt/upgrade.in
++++ b/quilt/upgrade.in
+@@ -74,7 +74,7 @@ printf $"Converting meta-data to version %s\n" "$DB_VERSION"
+ 
+ for patch in $(applied_patches)
+ do
+-	proper_name="$(grep "^$(quote_bre $patch)"'\(\|\.patch\|\.diff?\)\(\|\.gz\|\.bz2\)\([ \t]\|$\)' $SERIES)"
++	proper_name="$(grep "^$(quote_grep_re $patch)"'\(\|\.patch\|\.diff?\)\(\|\.gz\|\.bz2\)\([ \t]\|$\)' $SERIES)"
+ 	proper_name=${proper_name#$QUILT_PATCHES/}
+ 	proper_name=${proper_name%% *}
+ 	if [ -z "$proper_name" ]
+@@ -84,7 +84,7 @@ do
+ 	fi
+ 
+ 	if [ "$patch" != "$proper_name" -a -d $QUILT_PC/$patch ] \
+-	   && grep -q "^$(quote_bre $patch)\$" \
++	   && grep -q "^$(quote_grep_re $patch)\$" \
+ 		   $QUILT_PC/applied-patches
+ 	then
+ 		mv $QUILT_PC/$patch $QUILT_PC/$proper_name \
+-- 
+cgit v1.1
+
diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm
index 0d88a2d943..465e605010 100644
--- a/gnu/packages/patchutils.scm
+++ b/gnu/packages/patchutils.scm
@@ -117,7 +117,8 @@ (define-public quilt
        (uri (string-append "mirror://savannah/quilt/"
                            "quilt-" version ".tar.gz"))
        (sha256
-        (base32 "01vfvk4pqigahx82fhaaffg921ivd3k7rylz1yfvy4zbdyd32jri"))))
+        (base32 "01vfvk4pqigahx82fhaaffg921ivd3k7rylz1yfvy4zbdyd32jri"))
+       (patches (search-patches "quilt-avoid-grep-warnings.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("gettext" ,gettext-minimal)))

base-commit: 4884ee6dd4b1694a4a502dd8058d6c61fa0c0199
-- 
2.39.2