GNU bug report logs - #49934
Hw-Probe

Previous Next

Package: guix-patches;

Reported by: phodina <phodina <at> protonmail.com>

Date: Sat, 7 Aug 2021 22:00:01 UTC

Severity: normal

Tags: patch

Merged with 50283

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ricardo Wurmus <rekado <at> elephly.net>
To: 49934 <at> debbugs.gnu.org
Cc: Raghav Gururajan <rg <at> raghavgururajan.name>
Subject: [bug#49934] Hw-Probe
Date: Thu, 16 Dec 2021 06:53:22 +0100
Thanks for the patch!

I’m afraid the 'patch build phase is much too repetitive.  You can
greatly simplify it by doing a substitution like this:

--8<---------------cut here---------------start------------->8---
(substitute* "hw-probe.pl"
  (("Cmd\\(\"([^\"]+)" _ command)
   (string-append "Cmd(\"" (which command))))
--8<---------------cut here---------------end--------------->8---

The regular expression has a sub-group that matches everything after the
opening double quote until it hits another double quote.  That group is
captured as “command”.  We then look up that string in the build
environment with “which” (not the executable of the same name), which
returns the absolute file name corresponding to the command.

-- 
Ricardo




This bug report was last modified 3 years and 27 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.