GNU bug report logs - #50283
HwInfo

Previous Next

Package: guix-patches;

Reported by: Raghav Gururajan <rg <at> raghavgururajan.name>

Date: Mon, 30 Aug 2021 19:32:01 UTC

Severity: normal

Tags: patch

Merged with 49934

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

Bug is archived. No further changes may be made.

Full log


Message #55 received at 50283-done <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: Raghav Gururajan <rg <at> raghavgururajan.name>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, 49934-done <at> debbugs.gnu.org,
 50283-done <at> debbugs.gnu.org
Subject: Re: bug#50283: HwInfo
Date: Thu, 23 Jun 2022 11:35:04 -0400
Hi,

Raghav Gururajan <rg <at> 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




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.