OS X Installer

Anders F Björklund afb at algonet.se
Wed Aug 12 16:37:13 PDT 2009


Jacob Carlborg wrote:

>>> The solution is to create a "symlink program" and drop it in
>>> /usr/local/bin. I know it works; I wrote one to do just that:
>>>
>>> #include <unistd.h>
>>>
>>> int main(unsigned int argc, char **argv) {
>>> argv[0] = "/usr/local/dmd/osx/bin/dmd";
>>> execv("/usr/local/dmd/osx/bin/dmd", argv);
>>> }
>>
>> I did that for my linux package, but used shell instead.
>> Then the dmd.conf was a link back to the real config file,
>> to /etc/dmd.conf for dmd and to /etc/dmd2.conf for dmd2...
>>
>> /usr/bin/dmd2 -> /usr/libexec/dmd2/dmd
>> /usr/libexec/dmd2/dmd.conf -> /etc/dmd2.conf
>> Then the conf files didn't conflict anymore.
>>
>> --anders
> 
> If I understand you correctly you have a symlink "/usr/bin/dmd2" 
> pointing to "/usr/libexec/dmd2/dmd" and then a symlink 
> "/usr/libexec/dmd2/dmd.conf" pointing to "/etc/dmd2.conf".
> 
> I can't see how that would work, correct me if I'm wrong: dmd will only 
> search for a conf file named dmd.conf in the same path as the dmd 
> executable, in /etc or in the user home directory.
> 
> dmd will not find the file in /etc because it's named "dmd2.conf". The 
> file "usr/libexec/dmd2/dmd.conf" will not work because the dmd.conf will 
> needs to be in the same directory as the symlink and not the actual 
> executable, this was the first I tried.

Right, /usr/libexec/dmd2/dmd is the actual program.
And /usr/bin/dmd2 was a wrapper that exec'd it...

#!/bin/sh
exec /usr/libexec/dmd2/dmd "$*"

Guess one could use the same workaround for moving
dmd over to "dmd1", and make dmd into a symlink ?

dmd -> dmd1 # depending on
dmd -> dmd2 # your preference

--anders

http://www.digitalmars.com/d/archives/digitalmars/D/announce/DMD_1.029_and_2.013_releases_11949.html#N11988



More information about the Digitalmars-d mailing list