From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50958) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWjaW-0002KC-Br for guix-patches@gnu.org; Wed, 03 Jan 2018 09:00:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWjaN-0002Cz-4N for guix-patches@gnu.org; Wed, 03 Jan 2018 09:00:12 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:53435) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eWjaN-0002Cn-23 for guix-patches@gnu.org; Wed, 03 Jan 2018 09:00:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1eWjaM-0007Te-O3 for guix-patches@gnu.org; Wed, 03 Jan 2018 09:00:02 -0500 Subject: [bug#29951] [PATCH] WIP guix: Add wrap-script. Resent-Message-ID: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50661) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eWjZu-0002AZ-Rh for guix-patches@gnu.org; Wed, 03 Jan 2018 08:59:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eWjZr-0001rB-QM for guix-patches@gnu.org; Wed, 03 Jan 2018 08:59:34 -0500 Received: from mail-out.m-online.net ([212.18.0.9]:56446) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eWjZr-0001qO-JZ for guix-patches@gnu.org; Wed, 03 Jan 2018 08:59:31 -0500 References: <20180102204434.2716-1-rekado@elephly.net> From: Hartmut Goebel Message-ID: <69141465-bdd7-4855-c5d0-a3750646273b@crazy-compilers.com> Date: Wed, 3 Jan 2018 14:59:27 +0100 MIME-Version: 1.0 In-Reply-To: <20180102204434.2716-1-rekado@elephly.net> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: rekado@elephly.net, 29951@debbugs.gnu.org This code is over-changeling my scheme knowledge :-) Thus just a few comments: > + (false-if-exception > + (and=> (regexp-exec coding-line-regex (read-line p)) > + (lambda (m) (match:substring m 0))))))))) When using emacs, this line can also contain other local variable definitions. What about keeping the whole line? > + (when interpreter > + (let* ((header (format #f "\ > +#!~a --no-auto-compile > +#!#; ~a > +#\\-~s > +#\\-~s > +" > + (which "guile") > + (or coding-line "Guix wrapper") > + (cons 'begin (map update-env vars)) > + `(apply execl ,interpreter > + (car (command-line)) > + (command-line)))) Does this take care of proper quoting the string-values? > + (call-with-ascii-input-file prog Does this work if the file contains non-ascii characters, e.g. \xf0 (assuming "ascii" means 0-127 only)? -- Regards Hartmut Goebel | Hartmut Goebel | h.goebel@crazy-compilers.com | | www.crazy-compilers.com | compilers which you thought are impossible |