[fpc-pascal] Search path order for fpc.cfg
Bo Berglund
bo.berglund at gmail.com
Wed Apr 15 01:10:31 CEST 2020
On Mon, 13 Apr 2020 21:41:31 +0200, Joost van der Sluis
<joost at cnoc.nl> wrote:
>Op 12-04-2020 om 12:01 schreef Bo Berglund via fpc-pascal:
>> This is something I have been wondering about for a while..
>> When I install FPC from sources I have to create a config file by
>> using this command:
>>
>> /home/user/lib/fpc/$FPCVER/samplecfg "/home/user/lib/fpc/$FPCVER"
>> "/home/user"
>> (replace "user" with the actual username such as pi or whatever)
>>
>> The problem with this is that the generated file is named fpc.cfg so I
>> have to do a rename afterwards and this is not always remembered (like
>> yesterday).
>
>Can you try running samplecfg without the second parameter and without
>root-rights? Then it should create a .fpc.cfg in your home-directory. So
>there is no need to rename the file.
>
>If you supply a second parameter with the location where you want to
>write the configuration-file to, samplecfg does not know it is in your
>home-directory, so it will use a normal, visible, file. At least that is
>how I would say it should work.
>
I did so using the syntax in my script but removing the target dir
argument.
This is what I saw (I had backed up .fpc.cfg first)
~$ /home/bosse/lib/fpc/3.0.4/samplecfg "/home/bosse/lib/fpc/3.0.4"
Running on linux
No write premission in /etc.
Writing sample configuration file to /home/bosse/.fpc.cfg <== HERE!
Writing sample configuration file to
/home/bosse/lib/fpc/3.0.4/ide/text/fp.cfg
Saved old "fp.cfg" to "fp.bak"
Writing sample configuration file to
/home/bosse/lib/fpc/3.0.4/ide/text/fp.ini
Saved old "fp.ini" to "fp.bak"
Writing sample configuration file to /home/bosse/.config/fppkg.cfg
Writing sample configuration file to /home/bosse/.fppkg/config/default
Seems like with the omission of arg 2 the result is thath it writes to
a lot of places including $home (using the leading period in the
name).
I don't know if my original script entry would have only written to
home since it had a target as arg 2?
--
Bo Berglund
Developer in Sweden
More information about the fpc-pascal
mailing list