Message ID | d7320ddeb1939ce0eeeea10f7267883692c269e7.1736898019.git.~@wolfsden.cz |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1B4A527BBEA; Tue, 14 Jan 2025 23:41:34 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_ALL,DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9AB8C27BBE2 for <patchwork@mira.cbaines.net>; Tue, 14 Jan 2025 23:41:33 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1tXqWw-00015y-JY; Tue, 14 Jan 2025 18:41:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tXqWt-00014r-Ix for guix-patches@gnu.org; Tue, 14 Jan 2025 18:41:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tXqWt-0007uB-AA for guix-patches@gnu.org; Tue, 14 Jan 2025 18:41:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=6oGGIvao2ogyGjNqfZrVx/0lH3UcjBvykvBRQOb2VMg=; b=opfCZfHJHHE3hYNu1VBLcaJ5Iv1CLg9kG+4FtlwYDbUAlv2Bj4d705WT6EV8Y6DTpHXv8JB8B6403MIQvSBzu/EkQTMab/vINSArA3O3dsWWjpp6304yvK2uON7Ke4JOECNO8kBGWLU+RSexMkIt1zPqkI+pww67HuXEjOxrrjDn1rAzVi5lz7GQUrNc/5V6J4guMJY+qrBAvvR1q19hkpo2pIefRMgSvjV6Y8D3VCxHygMwkDb02D3lrUA4dKhJ2t9lVmHJnjRvhhf003ZElj/kzngRZ/VcNLJazfAQYVbXyqBBXtJAqVZXdmMEWGcyicvngPW15f+HFCYXiHxIug==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tXqWs-00068X-Ut; Tue, 14 Jan 2025 18:41:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75568] [PATCH] gnu: smartmontools: Fix PATH in smartd_warning.sh. Resent-From: Tomas Volf <~@wolfsden.cz> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: sharlatanus@gmail.com, guix-patches@gnu.org Resent-Date: Tue, 14 Jan 2025 23:41:02 +0000 Resent-Message-ID: <handler.75568.B.173689804123546@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75568 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75550@debbugs.gnu.org, 75568@debbugs.gnu.org Cc: Tomas Volf <~@wolfsden.cz>, Sharlatan Hellseher <sharlatanus@gmail.com> X-Debbugs-Original-To: 75550@debbugs.gnu.org, guix-patches@gnu.org X-Debbugs-Original-Xcc: Sharlatan Hellseher <sharlatanus@gmail.com> Received: via spool by submit@debbugs.gnu.org id=B.173689804123546 (code B ref -1); Tue, 14 Jan 2025 23:41:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2025 23:40:41 +0000 Received: from localhost ([127.0.0.1]:56153 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1tXqWX-00067i-AK for submit@debbugs.gnu.org; Tue, 14 Jan 2025 18:40:41 -0500 Received: from lists.gnu.org ([2001:470:142::17]:55456) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <~@wolfsden.cz>) id 1tXqWU-00067A-Ky for submit@debbugs.gnu.org; Tue, 14 Jan 2025 18:40:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1tXqWN-0000xx-WB for guix-patches@gnu.org; Tue, 14 Jan 2025 18:40:32 -0500 Received: from wolfsden.cz ([37.205.8.62]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <~@wolfsden.cz>) id 1tXqWM-0007rb-A7 for guix-patches@gnu.org; Tue, 14 Jan 2025 18:40:31 -0500 Received: by wolfsden.cz (Postfix, from userid 104) id 57FDD3559A8; Tue, 14 Jan 2025 23:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1736898027; bh=GbcOvYJg8uRvTCKQKVZQEtT+9/4vwZsW0OeI3M+u+HQ=; h=From:To:Cc:Subject:Date; b=AAtqvEBLU3AdjXME5ZH9TXX0DKdyA197fqPLL424/eBjTJ5AjnGn4HTHHR7a0xU3l qn5i7/cKnoSlEzSwBoAhPWp7TCCFhQ8Y55WiVSXfdonucZldJK0e2mtp7Z2Nznro9K 6EFCzQSsDQfdnx1Ct7CIiI8vVYEJsBiyJnBcRQ8wJ2jU5Oox4xAjgAsWWojIOfZdWP P8ZdK8YefFnajrY4D87rne5hJupa9qiktpPNYEtuEMcFlv3ZOTyPgzW8fO226dPwSw rf/R+mTY8NrJpLsWfi8bgGkHu4sgcsrGHRpauOg9ffv3cnQkXKLGsY6wgv9r9vsUfp NDOMkHlHHUi8aHCyLklQUZrydlMbJfCCgqiJ/eqpbac6+FQ/4BUQoilr2Ygkwyybnn 8YWAY2DGkiSP34J0B7zo3uZdgtbzcvRuAkZd9DMZ0g8Nsqty7C7Bu7OcNkNBLJYmIQ BXtJyPuCwuxj6Yt99Kv5chzNzT+rQoR62z2Q1pAAGdENfkkwPwXpqHTQRBYWvWlQRH rrEe/5k5LAZOTi2GF8aFNQmrKBNUN8ck1+0qj4Lz2lINlNuX11nHhkSnc7E0GpY2zF OSEsWbT+lM2HEUnLHC17gugmA80U9GBruXrOCsrfbtq/KPNP+TiwJPODbRxDExh93n bmPtDAIaMW9+SBxhQ5ssLfM4= Received: from localhost (unknown [193.32.127.158]) by wolfsden.cz (Postfix) with ESMTPSA id 6AC85356609; Tue, 14 Jan 2025 23:40:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=wolfsden.cz; s=mail; t=1736898026; bh=GbcOvYJg8uRvTCKQKVZQEtT+9/4vwZsW0OeI3M+u+HQ=; h=From:To:Cc:Subject:Date; b=ohqVSpGHiitCIgF8YK9Mb4tntzEe/mHpwBe+jZ+20NWjA+LHIAoHBmq1Cez94UVfY Np/3Ncp0ZmPEH9xUCDQ3NNZXRXNjC5Qnn0TT2vsqLxv86gsk+zKENWqW+QsmM+zqCN PYZJ++rJ9I4t3xbVMZ1erjjMy51s8UmE4ab4pcc7Vg+/AWg7IDa7MLKLoY6/Sr4xxe GV+uS772WES4biC3EMtfA4kHguM5vbJv3tX/RFkGIgNCgLnelkHZnYOej/8PqACGYG npZFLlCy1TAskcYHEqW+9FLjOWWlZ/W+QsHsVwP3DI9mNuC9Tu3F+46Y3BKYJmxUg1 tjnLwYmNVXyRxXnd40yr4tNZj81cXLFFbjhWClVwEdDnShspdkEYpPL4wncT9NZSZm Wix07pZV49cjRICPg/6wRtBnid/bIEkTI4hD0kN8H7FqzKMqh1PV+NujFTMYHhPNVd ZJzDlwxtPgYPOYojjwlQSD+hDZaykUFEACz5vAKbcoqOclqYMCOVhaTQoD3oQL2UGV Y5Lqbsb2U1Huil9dfio/jrVYoX9MVxi5SAUd3MRSEE0pZ1B8ZnytGw5RE865BCN/Zc GRoueh972yYJUcZjy9OcKA2LJXfkztqunIsRkEHSoqDyBDz+iviy8grjOndwBvo7uU T2RPagqes+TbOUwxwd6LLFtM= From: Tomas Volf <~@wolfsden.cz> Date: Wed, 15 Jan 2025 00:40:19 +0100 Message-ID: <d7320ddeb1939ce0eeeea10f7267883692c269e7.1736898019.git.~@wolfsden.cz> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=37.205.8.62; envelope-from=~@wolfsden.cz; helo=wolfsden.cz X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#75568] gnu: smartmontools: Fix PATH in smartd_warning.sh.
|
|
Commit Message
Tomas Volf
Jan. 14, 2025, 11:40 p.m. UTC
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 --- gnu/packages/admin.scm | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
Comments
Hi Tomas, On Wed, 15 Jan 2025 07:40:19 +0800, Tomas Volf wrote: > > 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 > --- > gnu/packages/admin.scm | 15 +++++++++++++-- > 1 file changed, 13 insertions(+), 2 deletions(-) > > diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm > index 7f50d5f4e9..098e21ff8a 100644 > --- a/gnu/packages/admin.scm > +++ b/gnu/packages/admin.scm > @@ -2921,8 +2921,19 @@ (define-public smartmontools > "0gcrzcb4g7f994n6nws26g6x15yjija1gyzd359sjv7r3xj1z9p9")))) > (build-system gnu-build-system) > (arguments > - (list #:make-flags > - #~(list "BUILD_INFO=\"(Guix)\""))) > + (list > + #:make-flags > + #~(list "BUILD_INFO=\"(Guix)\"") > + #:phases > + #~(modify-phases %standard-phases > + (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") ":" > + "$PATH\n")))))))) Please add sed and coreutils-minimal to inputs and use search-input-file or this-package-input instead. For smartmontools the proper way is to set --with-scriptpath='...' configure flag, which is documented in its INSTALL file. (It can be disabled with a 'no' value as well.) > (inputs (list libcap-ng)) > (home-page "https://www.smartmontools.org/") > (synopsis "S.M.A.R.T. harddisk control and monitoring tools") > -- > 2.47.1 Thanks
Thank you for the review, responses below. Hilton Chain <hako@ultrarare.space> writes: > Hi Tomas, > > On Wed, 15 Jan 2025 07:40:19 +0800, > Tomas Volf wrote: >> >> 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 >> --- >> gnu/packages/admin.scm | 15 +++++++++++++-- >> 1 file changed, 13 insertions(+), 2 deletions(-) >> >> diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm >> index 7f50d5f4e9..098e21ff8a 100644 >> --- a/gnu/packages/admin.scm >> +++ b/gnu/packages/admin.scm >> @@ -2921,8 +2921,19 @@ (define-public smartmontools >> "0gcrzcb4g7f994n6nws26g6x15yjija1gyzd359sjv7r3xj1z9p9")))) >> (build-system gnu-build-system) >> (arguments >> - (list #:make-flags >> - #~(list "BUILD_INFO=\"(Guix)\""))) >> + (list >> + #:make-flags >> + #~(list "BUILD_INFO=\"(Guix)\"") >> + #:phases >> + #~(modify-phases %standard-phases >> + (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") ":" >> + "$PATH\n")))))))) > > Please add sed and coreutils-minimal to inputs and use search-input-file or > this-package-input instead. Why? I will of course do so, but would first like to understand why. The current way seems to work and keeps all the references in just one place. If I switch to the suggested approach, both `sed' and `coreutils' will be referenced in two places (once in the `inputs' and once here) and those will need to be kept in sync. So, uh, why do it? > > For smartmontools the proper way is to set --with-scriptpath='...' configure > flag, which is documented in its INSTALL file. (It can be disabled with a 'no' > value as well.) This does indeed seem to be more elegant approach, will use it for v2. > >> (inputs (list libcap-ng)) >> (home-page "https://www.smartmontools.org/") >> (synopsis "S.M.A.R.T. harddisk control and monitoring tools") >> -- >> 2.47.1 > > Thanks Tomas
On Fri, 24 Jan 2025 23:31:56 +0800, Tomas Volf wrote: > [...] > >> + (string-append "PATH=" > >> + #$(file-append sed "/bin") ":" > >> + #$(file-append coreutils "/bin") ":" > >> + "$PATH\n")))))))) > > > > Please add sed and coreutils-minimal to inputs and use search-input-file or > > this-package-input instead. > > Why? I will of course do so, but would first like to understand why. > The current way seems to work and keeps all the references in just one > place. If I switch to the suggested approach, both `sed' and > `coreutils' will be referenced in two places (once in the `inputs' and > once here) and those will need to be kept in sync. So, uh, why do it? The reason is to record dependency information at <package> level, since this is where the UI and most of the tools work. (`guix show', `guix refresh', package transformation etc.) For referencing dependencies from inputs in arguments, the benefit is mainly for transformations. Maybe it doesn't make much sense in this case (sed and coreutils), but it's a good practice to follow.
Hilton Chain <hako@ultrarare.space> writes: > On Fri, 24 Jan 2025 23:31:56 +0800, > Tomas Volf wrote: >> [...] >> >> + (string-append "PATH=" >> >> + #$(file-append sed "/bin") ":" >> >> + #$(file-append coreutils "/bin") ":" >> >> + "$PATH\n")))))))) >> > >> > Please add sed and coreutils-minimal to inputs and use search-input-file or >> > this-package-input instead. >> >> Why? I will of course do so, but would first like to understand why. >> The current way seems to work and keeps all the references in just one >> place. If I switch to the suggested approach, both `sed' and >> `coreutils' will be referenced in two places (once in the `inputs' and >> once here) and those will need to be kept in sync. So, uh, why do it? > > The reason is to record dependency information at <package> level, since this is > where the UI and most of the tools work. (`guix show', `guix refresh', package > transformation etc.) Is there a technical reason it cannot inspect the gexps used or is it just matter of "no one wrote the code yet"? > > For referencing dependencies from inputs in arguments, the benefit is mainly for > transformations. Maybe it doesn't make much sense in this case (sed and > coreutils), but it's a good practice to follow. I did not realize this at all. That is very good to know. Tomas
Hilton Chain <hako@ultrarare.space> writes: > > Please add sed and coreutils-minimal to inputs and use search-input-file or > this-package-input instead. > > For smartmontools the proper way is to set --with-scriptpath='...' configure > flag, which is documented in its INSTALL file. (It can be disabled with a 'no' > value as well.) Thank you for the review, I have sent v2 that hopefully incorporates your feedback. Tomas
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm index 7f50d5f4e9..098e21ff8a 100644 --- a/gnu/packages/admin.scm +++ b/gnu/packages/admin.scm @@ -2921,8 +2921,19 @@ (define-public smartmontools "0gcrzcb4g7f994n6nws26g6x15yjija1gyzd359sjv7r3xj1z9p9")))) (build-system gnu-build-system) (arguments - (list #:make-flags - #~(list "BUILD_INFO=\"(Guix)\""))) + (list + #:make-flags + #~(list "BUILD_INFO=\"(Guix)\"") + #:phases + #~(modify-phases %standard-phases + (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") ":" + "$PATH\n")))))))) (inputs (list libcap-ng)) (home-page "https://www.smartmontools.org/") (synopsis "S.M.A.R.T. harddisk control and monitoring tools")