GNU bug report logs - #75568
[PATCH] gnu: smartmontools: Fix PATH in smartd_warning.sh.

Previous Next

Package: guix-patches;

Reported by: Tomas Volf <~@wolfsden.cz>

Date: Tue, 14 Jan 2025 23:41:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 75568 <at> debbugs.gnu.org (full text, mbox):

From: Tomas Volf <~@wolfsden.cz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 75550 <at> debbugs.gnu.org, 75568 <at> debbugs.gnu.org,
 Sharlatan Hellseher <sharlatanus <at> gmail.com>
Subject: Re: [bug#75568] [PATCH] gnu: smartmontools: Fix PATH in
 smartd_warning.sh.
Date: Wed, 26 Mar 2025 22:45:55 +0100
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Tomas Volf <~@wolfsden.cz> skribis:
>
>> The script started with reset of the $PATH to a value not suitable to Guix.
>> In addition, the script requires coreutils and sed, so add those into the
>> $PATH.
>>
>> * gnu/packages/admin.scm (smartmontools)[arguments]<#:phases>: Add 'fix-path.
>>
>> Change-Id: Ide97f572e6f369fe24337f945474dc7a65584eda
>
> [...]
>
>> +          (add-after 'install 'fix-path
>> +            (lambda _
>> +              (substitute* (string-append #$output "/etc/smartd_warning.sh")
>> +                (("export PATH=.*$" all)
>> +                 (string-append "PATH="
>> +                                #$(file-append sed "/bin") ":"
>> +                                #$(file-append coreutils "/bin") ":"
>
> Please use (dirname (search-input-file inputs "/bin/sed")) etc. instead.
> That way, when creating a variant with different inputs, the right thing
> will be used.

Merged version uses the following:

--8<---------------cut here---------------start------------->8---
    (arguments
     (list
      #:make-flags
      #~(list "BUILD_INFO=\"(Guix)\"")
      #:configure-flags
      #~(list (format #f "--with-scriptpath=~{~a:~}$PATH"
                      (map (lambda (pkg)
                             (in-vicinity pkg "bin"))
                           '#$(list (this-package-input "coreutils-minimal")
                                    (this-package-input "sed")))))))
--8<---------------cut here---------------end--------------->8---

Is that acceptable as well or should I send a patch switching to
search-input-file?

Tomas

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 95 days ago.

Previous Next


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