From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH] gnu: Add proxychains-ng. Date: Mon, 15 Aug 2016 12:17:54 +0200 Message-ID: <87lgzy1gkt.fsf@elephly.net> References: <87ziohc1wo.fsf@we.make.ritual.n0.is> <20160812181308.GB14494@jasmine> <87k2fjy1ib.fsf@we.make.ritual.n0.is> <87twen1db6.fsf@elephly.net> <87inv3yshn.fsf@we.make.ritual.n0.is> <87popa1p6h.fsf@elephly.net> <878tvya06a.fsf@we.make.ritual.n0.is> <87mvke1ify.fsf@elephly.net> <87inv2e4mh.fsf@we.make.ritual.n0.is> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZEy6-0003zE-UV for guix-devel@gnu.org; Mon, 15 Aug 2016 06:18:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bZEy2-0000NV-QJ for guix-devel@gnu.org; Mon, 15 Aug 2016 06:18:06 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:24042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bZEy2-0000NR-Hg for guix-devel@gnu.org; Mon, 15 Aug 2016 06:18:02 -0400 In-reply-to: <87inv2e4mh.fsf@we.make.ritual.n0.is> 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: ng0 Cc: guix-devel@gnu.org ng0 writes: > Ricardo Wurmus writes: >> + (modify-phases %standard-phases >> + (add-after 'unpack 'fix-configure-script >> + (lambda _ >> + ;; The configure script is very intolerant to unknown arguments, >> + ;; such as "CONFIG_SHELL". >> + (substitute* "configure" >> + (("\\*\\) break ;;" line) >> + (string-append "[A-Z]*) shift ;;\n" >> + line))) > > I'm curious what this substitute does. Could you explain it? Sure. We match the line *) break ;; in the configure script and save it as “line”. This line is the alternative case in the options parser. Any option starting with a dash is processed while any other option leads to “break”. This means that upon encountering “CONFIG_SHELL=…” the configure script aborts and doesn’t even get to setting the prefix. So what I’m doing is to add an additional case: [A-Z]*) shift ;; which is then followed by the original catch-all case (which leads to “break”). The additional case applies whenever an option begins with a capital letter. In that case it just throws away the option (“shift”). “shift” reduces a list by dropping the current element. This means that in the next iteration the next list element will be processed. Eventually this would lead to “break”, thus exiting the loop. It’s not the prettiest fix, but it works. It would be nicer if upstream didn’t do “while true” and relied on “break” to exit the loop. If they instead went through the whole list of arguments, ignoring anything they don’t recognize and only processing those that they expect. Maybe worth opening a bug report. ~~ Ricardo