unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: 49934@debbugs.gnu.org
Cc: Raghav Gururajan <rg@raghavgururajan.name>
Subject: [bug#49934] Hw-Probe
Date: Thu, 16 Dec 2021 06:53:22 +0100	[thread overview]
Message-ID: <87bl1hks0w.fsf@elephly.net> (raw)
In-Reply-To: <dv4hfMlNt3nZfXASs419gzeP1mFxIEOrH5yHul0FZWtEjR7Uv8ruRfTpr4ER4YkkvP0o8OQlqpe-lRZ4uwcztWBpayZU0GnmGOBDHyJEsps=@protonmail.com>

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




  parent reply	other threads:[~2021-12-16  6:03 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-07 21:58 [bug#49934] [PATCH 1/3] gnu: Add libx86emu phodina via Guix-patches via
2021-08-07 22:03 ` [bug#49934] Subject: [PATCH 2/3] gnu: Add hwinfo phodina via Guix-patches via
2021-08-07 22:05 ` [bug#49934] Subject: [PATCH 3/3] gnu: Add hw-probe phodina via Guix-patches via
2021-08-08 10:10 ` [bug#49934] [PATCH 1/3] gnu: Add libx86emu pelzflorian (Florian Pelz)
2021-08-09 12:00   ` phodina via Guix-patches via
2021-08-09 17:06     ` pelzflorian (Florian Pelz)
2021-08-30 21:34 ` [bug#49934] Hw-Probe Raghav Gururajan via Guix-patches via
2021-10-01 23:19 ` [bug#49934] [PATCH] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
2021-10-02  9:58   ` Maxime Devos
2021-10-01 23:26 ` [bug#49934] HwInfo Raghav Gururajan via Guix-patches via
2021-12-09 11:51 ` [bug#49934] [PATCH v2] gnu: Add hw-probe Raghav Gururajan via Guix-patches via
2021-12-09 12:18 ` [bug#49934] [PATCH v3] " Raghav Gururajan via Guix-patches via
2021-12-16  5:53 ` Ricardo Wurmus [this message]
2021-12-25 21:17   ` [bug#49934] Hw-Probe Raghav Gururajan via Guix-patches via
2021-12-27  9:59     ` Efraim Flashner
2022-06-23 15:35     ` [bug#50283] HwInfo Maxim Cournoyer
2022-06-24  8:31       ` Raghav Gururajan via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bl1hks0w.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=49934@debbugs.gnu.org \
    --cc=rg@raghavgururajan.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).