7.3 Configuration files:
- tell people it's desirable to install both config.sample and config and provide a copy&pasteable lines for proper handling of it Approved by: keramida (mentor)
This commit is contained in:
parent
6611bdac7c
commit
452bd3f433
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/head/; revision=25529
1 changed files with 21 additions and 1 deletions
|
|
@ -5673,7 +5673,27 @@ lib/X11/oneko/sounds/cat.au
|
|||
|
||||
<para>Instead, install sample files with a suffix
|
||||
(<filename><replaceable>filename</replaceable>.sample</filename>
|
||||
will work well) and print out a <link
|
||||
will work well). Copy the sample file as the real configuration
|
||||
file, if it does not exist. On deinstall, delete the configuration
|
||||
file, but only if it was not modified by the user. You need to
|
||||
handle this both in the port <filename>Makefile</filename>, and in
|
||||
the <filename>pkg-plist</filename> (for installation from
|
||||
the package).</para>
|
||||
|
||||
<para>Example of the <filename>Makefile</filename> part:</para>
|
||||
|
||||
<programlisting>post-install:
|
||||
@if [ ! -f ${PREFIX}/etc/orbit.conf ]; then \
|
||||
${CP} -p ${PREFIX}/etc/orbit.conf.sample ${PREFIX}/etc/orbit.conf ; \
|
||||
fi</programlisting>
|
||||
|
||||
<para>Example of the <filename>pkg-plist</filename> part:</para>
|
||||
|
||||
<programlisting>@unexec if cmp -s %D/etc/orbit.conf.sample %D/etc/orbit.conf; then rm -f %D/etc/orbit.conf; fi
|
||||
etc/orbit.conf.sample
|
||||
@exec if [ ! -f %D/etc/orbit.conf ] ; then cp -p %D/%F %B/orbit.conf; fi</programlisting>
|
||||
|
||||
<para>Alternatively, print out a <link
|
||||
linkend="porting-message">message</link> pointing out that the
|
||||
user has to copy and edit the file before the software can be made
|
||||
to work.</para>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue