From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] Add thinkfan. Date: Tue, 10 May 2016 21:25:05 +0200 Message-ID: <874ma5lnqm.fsf@saiph.selenimh> References: <87mvoay9wo.fsf@saiph.selenimh> <20160501211418.GA10221@jasmine> <877ffalrj3.fsf@saiph.selenimh> <20160506181314.GB2123@jasmine> <87mvo2bvoh.fsf@saiph.selenimh> <20160507025858.GA25133@jasmine> <87eg9eb3ns.fsf@saiph.selenimh> <87zirzzl71.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b0DHQ-0004ZB-E0 for guix-devel@gnu.org; Tue, 10 May 2016 15:25:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b0DHO-0000YO-27 for guix-devel@gnu.org; Tue, 10 May 2016 15:25:15 -0400 In-Reply-To: <87zirzzl71.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Mon, 09 May 2016 10:31:46 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hello, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Nicolas Goaziou skribis: >> I realize there are hard-coded paths in init scripts. Would it make >> sense to patch them so as to refer to `thinkfan' in store instead of >> "/usr/sbin/thinkfan"? > > Yes, I think so. Here's the patch, then. Regards, --=20 Nicolas Goaziou 0x80A93738 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-gnu-thinkfan-Fix-daemon-path-in-init-scripts.patch Content-Description: thinkfan: fix hard-coded paths >From f6e8845b46cd469a2e9a8540879436671944c87e Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 10 May 2016 21:20:49 +0200 Subject: [PATCH] gnu: thinkfan: Fix daemon path in init scripts. * gnu/packages/linux.scm (thinkfan): Fix daemon path in init scripts. --- gnu/packages/linux.scm | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index fcea499..5500681 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -2622,15 +2622,20 @@ feature, and a laptop with an accelerometer. It has no effect on SSDs.") `("-DUSE_ATASMART:BOOL=ON") #:phases (modify-phases %standard-phases - ;; Install scripts for various foreign init systems. + ;; Install scripts for various foreign init systems. Also fix + ;; hard-coded path for daemon. (add-after 'install 'install-rc-scripts (lambda* (#:key outputs #:allow-other-keys) - (for-each (cute install-file <> - (string-append (assoc-ref outputs "out") - "/share/thinkfan")) - (find-files (string-append "../thinkfan-" ,version - "/rcscripts") - ".*")) + (let ((out (assoc-ref outputs "out")) + (files (find-files + (string-append "../thinkfan-" ,version "/rcscripts") + ".*"))) + (substitute* files + (("/usr/sbin/(\\$NAME|thinkfan)" _ name) + (string-append out "/sbin/" name))) + (for-each (cute install-file <> + (string-append out "/share/thinkfan")) + files)) #t))))) (inputs `(("libatasmart" ,libatasmart))) -- 2.7.4 --=-=-=--