[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#49934: bug#50283: HwInfo
From: |
Maxim Cournoyer |
Subject: |
bug#49934: bug#50283: HwInfo |
Date: |
Thu, 23 Jun 2022 11:35:04 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) |
Hi,
Raghav Gururajan <rg@raghavgururajan.name> writes:
> Hi Ricardo!
>
>> --8<---------------cut here---------------start------------->8---
>> (substitute* "hw-probe.pl"
>> (("Cmd\\(\"([^\"]+)" _ command)
>> (string-append "Cmd(\"" (which command))))
>> --8<---------------cut here---------------end--------------->8---
>
> Thanks for the snippet and explanation.
>
> I am wondering these,
> [1] Does require import of specific modules?
No. `which', the Scheme procedure, is part of (guix build utils).
> [2] If `(which command)`'s output is empty, will it return #f?
Yes, and I agree that's a problem.
Fortunately, the recently added search-input-file more usefully raises
an error when the file it is looking for doesn't exist, so I used that.
It was a bit painful to hunt all the commands but in the end it works
beautifully! I pushed the result as
3611f99affc4d2edcf4141e3022dd0d2a0b04068.
Closing, thanks!
Maxim
- bug#49934: bug#50283: HwInfo,
Maxim Cournoyer <=