ok thanks, I did not know pkg-install.

On 11/21/2014 11:39 PM, Scot Hetzel wrote:
> On Fri, Nov 21, 2014 at 2:36 PM, Moritz Warning <moritzwarn...@web.de> wrote:
>> Hi,
>>
>> I try to write a port of an application that needs to edit 
>> /etc/nsswitch.conf.
>> But I have trouble modifying /etc/nsswitch.conf in pkg-plist (there is where 
>> it should be done?).
>> Even creating a test file in pkg-plist seem be ignored:
>>
>> /etc/testfile
>> @exec echo 'test' >> /etc/testfile
>>
>> Any ideas what could be wrong?
>>
> You probably don't want to do this in the pkg-plist, instead you would
> normally do this in pkg-install:
> 
> 
> pkg-install
> #!/bin/sh
> 
> PKG_BATCH=${BATCH:=NO}
> PKG_PREFIX=${PKG_PREFIX:=/usr/local}
> 
> case $2 in
>         POST-INSTALL)
>                                       if [ "${PKG_BATCH}" = "NO" ]; then
>                                           # Do something to add an
> entry to /etc/nsswitch.conf
>                                       else
>                                           # Display a message
>                                           echo "*** We do not modify
> /etc/nsswitch.conf automatically in"
>                                           echo "*** BATCH mode. Please
> modify it yourself."
>                                       fi
>                                       ;;
>         POST-DEINSTALL)
>                                       # Do something to remove the
> entry that was added to /etc/nsswitch.conf
>                                       ;;
> esac
> 
> It might be better to add a pkg-message to the port that shows how to
> modify /etc/nsswitch.conf, instead of having the port modify it.
> 


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to