From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: Re: weird errors Date: Mon, 15 Jan 2018 13:43:50 +0800 Message-ID: <87d12bvfqh.fsf@gmail.com> References: <87a7xhmpht.fsf@gnu.org> <20180114114346.78977872@scratchpost.org> <20180114174509.3428f435@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:51236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaxYz-0005aX-61 for guix-devel@gnu.org; Mon, 15 Jan 2018 00:44:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaxYw-0000YH-26 for guix-devel@gnu.org; Mon, 15 Jan 2018 00:44:05 -0500 Received: from mail-pf0-x231.google.com ([2607:f8b0:400e:c00::231]:36675) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eaxYv-0000Y3-Ra for guix-devel@gnu.org; Mon, 15 Jan 2018 00:44:01 -0500 Received: by mail-pf0-x231.google.com with SMTP id 23so7544146pfp.3 for ; Sun, 14 Jan 2018 21:44:01 -0800 (PST) In-Reply-To: <20180114174509.3428f435@scratchpost.org> (Danny Milosavljevic's message of "Sun, 14 Jan 2018 17:45:09 +0100") 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: Danny Milosavljevic Cc: guix-devel Hello Catonano, Danny Milosavljevic writes: >> So were the spaces the only problem ? > > In > https://gitlab.com/humanitiesNerd/guix-hacks/blob/trytonservice/gnu/services/trytond.scm > , you don't invoke a shell (example: "sh", "bash", "csh" etc) so the > "VARIABLE=VALUE" syntax will not be evaluated by the shell and the > kernel will try to start a program called "VARIABLE=VALUE" instead. > > So either (invoke "sh" "-c" "VARIABLE=VALUE trytond-admin ...") or > just use setenv and then invoke trytond-admin directly. Actually, there is one more way. You can run (I didn't test) (invoke "env" "VAR1=VAL1" ... "VARn=VALn" "trytond-admin" "ARG1" ... "ARGn") But personally I prefer the 'setenv' approach, it looks more schemish to me. In fact, I think we should have a 'with-environment-variables' macro which run the body with the appropriate environment variables set and restore them after we finish, similar to how 'with-directory-excursion' works. Cheers, Alex