[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Toward 0.2
From: |
Ludovic Courtès |
Subject: |
Re: Toward 0.2 |
Date: |
Fri, 01 Mar 2013 18:28:00 +0100 |
User-agent: |
Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) |
Nikita Karetnikov <address@hidden> skribis:
>> It’s not needed. All that needed is the name of the executable file
>> to wrap.
>
> I don't understand. How will 'rename-file' get the location of the
> executable? For example:
>
> (wrap-program "wget" [...])
>
> I guess that it will only work if you invoke 'wrap-program' from the
> same directory.
Yes, and that’s what we want.
However, the ‘exec’ line in the wrapper needs the absolute file name.
For that it can do along the lines of:
(string-append "exec " (canonicalize-path file))
>> For the case where there are have several variables you want to set.
>
> Could you provide an example? The following works without '#:rest':
>
> (display (wrap-program "wget" '(("PATH" ":" = ("/nix/.../gawk/bin"))
> ("CERT_PATH" ":" suffix
> ("/nix/.../share/certs"
>
> "/nix/.../foo/certs")))))
Yeah there are two choices: two required arguments (like above), where
the second one is a list, or one required argument and one rest
argument.
In the latter case, you would instead do:
(wrap-program "wget" '("PATH" ":" = ("/nix/.../gawk/bin"))
'("CERT_PATH" ":" suffix ("/nix/.../share/certs"
"/nix/.../foo/certs")))
I tend to prefer this form because it may be more concise in common
cases.
HTH,
Ludo’.
- Re: Toward 0.2, Ludovic Courtès, 2013/03/01
- Re: Toward 0.2, Nikita Karetnikov, 2013/03/01
- Re: Toward 0.2,
Ludovic Courtès <=
- Re: Toward 0.2, Nikita Karetnikov, 2013/03/02
- Re: Toward 0.2, Ludovic Courtès, 2013/03/02
- [PATCH] utils: Add 'wrap-program'. (was: Toward 0.2), Nikita Karetnikov, 2013/03/03
- Re: [PATCH] utils: Add 'wrap-program'., Ludovic Courtès, 2013/03/03
- Re: [PATCH] utils: Add 'wrap-program'., Nikita Karetnikov, 2013/03/03
- Re: [PATCH] utils: Add 'wrap-program'., Ludovic Courtès, 2013/03/04