guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] gnu: Add proxychains-ng.


From: Ricardo Wurmus
Subject: Re: [PATCH] gnu: Add proxychains-ng.
Date: Mon, 15 Aug 2016 12:17:54 +0200
User-agent: mu4e 0.9.16; emacs 25.1.1

ng0 <address@hidden> writes:

> Ricardo Wurmus <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]