From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id EDPUBh3c+16UHAAA0tVLHw (envelope-from ) for ; Wed, 01 Jul 2020 00:43:09 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KOS5Ah3c+14gewAAB5/wlQ (envelope-from ) for ; Wed, 01 Jul 2020 00:43:09 +0000 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 83F56940223 for ; Wed, 1 Jul 2020 00:43:08 +0000 (UTC) Received: from localhost ([::1]:48428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqQqA-0006Cx-QR for larch@yhetil.org; Tue, 30 Jun 2020 20:43:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqQq6-0006BW-FU for guix-patches@gnu.org; Tue, 30 Jun 2020 20:43:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40497) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jqQq6-0007dr-68 for guix-patches@gnu.org; Tue, 30 Jun 2020 20:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jqQq6-0003Vh-4a for guix-patches@gnu.org; Tue, 30 Jun 2020 20:43:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42146] [PATCH 5/?] build-system/gnu: Allow lack of matches in substitution phases. References: <20200630220913.14665-1-kuba@kadziolka.net> In-Reply-To: <20200630220913.14665-1-kuba@kadziolka.net> Resent-From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 01 Jul 2020 00:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42146 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 42146@debbugs.gnu.org Received: via spool by 42146-submit@debbugs.gnu.org id=B42146.159356416613465 (code B ref 42146); Wed, 01 Jul 2020 00:43:02 +0000 Received: (at 42146) by debbugs.gnu.org; 1 Jul 2020 00:42:46 +0000 Received: from localhost ([127.0.0.1]:52042 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqQpq-0003V5-72 for submit@debbugs.gnu.org; Tue, 30 Jun 2020 20:42:46 -0400 Received: from pat.zlotemysli.pl ([37.59.186.212]:60106) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqQpo-0003Ux-Gg for 42146@debbugs.gnu.org; Tue, 30 Jun 2020 20:42:45 -0400 Received: (qmail 29638 invoked by uid 1009); 1 Jul 2020 02:42:43 +0200 Received: from 188.123.215.55 (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl (envelope-from , uid 1002) with qmail-scanner-2.08st (clamdscan: 0.98.6/25858. spamassassin: 3.4.0. perlscan: 2.08st. Clear:RC:1(188.123.215.55):. Processed in 0.013567 secs); 01 Jul 2020 00:42:43 -0000 Received: from unknown (HELO localhost.localdomain) (kuba@kadziolka.net@188.123.215.55) by pat.zlotemysli.pl with AES256-SHA encrypted SMTP; 1 Jul 2020 02:42:43 +0200 From: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Date: Wed, 1 Jul 2020 02:42:42 +0200 Message-Id: <20200701004242.18245-1-kuba@kadziolka.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -0.01 X-TUID: hXpO6bSK10xm * guix/build/utils.scm (patch-makefile-SHELL, patch-/usr/bin/file), guix/build/gnu-build-system.scm (patch-dot-desktop-files): Allow lack of matches in substitute*. --- guix/build/gnu-build-system.scm | 3 ++- guix/build/utils.scm | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/guix/build/gnu-build-system.scm b/guix/build/gnu-build-system.scm index 2e7dff2034..4b96761233 100644 --- a/guix/build/gnu-build-system.scm +++ b/guix/build/gnu-build-system.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2018 Mark H Weaver ;;; Copyright © 2020 Brendan Tildesley +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -724,7 +725,7 @@ which cannot be found~%" ;; '.desktop' files contain translations and are always ;; UTF-8-encoded. (with-fluids ((%default-port-encoding "UTF-8")) - (substitute* files + (substitute* files #:require-matches? #f (("^Exec=([^/[:blank:]\r\n]*)(.*)$" _ binary rest) (string-append "Exec=" (which binary) rest)) (("^TryExec=([^/[:blank:]\r\n]*)(.*)$" _ binary rest) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 1bfb774c60..a8218a7743 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -1005,7 +1005,7 @@ When KEEP-MTIME? is true, the atime/mtime of FILE are kept unchanged." (let ((st (stat file))) ;; Consider FILE is using an 8-bit encoding to avoid errors. (with-fluids ((%default-port-encoding #f)) - (substitute* file + (substitute* file #:require-matches? #f (("^ *SHELL[[:blank:]]*:?=[[:blank:]]*([[:graph:]]*/)([[:graph:]]+)(.*)$" _ dir shell args) (let* ((old (string-append dir shell)) @@ -1033,7 +1033,7 @@ no replacement 'file' command, doing nothing~%") (let ((st (stat file))) ;; Consider FILE is using an 8-bit encoding to avoid errors. (with-fluids ((%default-port-encoding #f)) - (substitute* file + (substitute* file #:require-matches? #f (("/usr/bin/file") (begin (format (current-error-port) -- 2.26.2