diff --git a/en_US.ISO8859-1/books/porters-handbook/plist/chapter.xml b/en_US.ISO8859-1/books/porters-handbook/plist/chapter.xml index 4766940049..3b470afa65 100644 --- a/en_US.ISO8859-1/books/porters-handbook/plist/chapter.xml +++ b/en_US.ISO8859-1/books/porters-handbook/plist/chapter.xml @@ -211,31 +211,19 @@ PLIST_SUB+= X11I386="@comment " The sample configuration files should always have the .sample suffix. If for some historical - reason using the standard suffix is not possible, use + reason using the standard suffix is not possible, or if the + sample files come from some other directory, use this construct: - @unexec if cmp -s %D/etc/orbit.conf-dist %D/etc/orbit.conf; then rm -f %D/etc/orbit.conf; fi -etc/orbit.conf-dist -@exec if [ ! -f %D/etc/orbit.conf ] ; then cp -p %D/%F %B/orbit.conf; fi + @sample etc/orbit.conf-dist etc/orbit.conf - The order of these lines is important. On deinstallation, - the sample file is compared to the actual configuration file. - If these files are identical, no changes have been made by the - user and the actual file can be safely deleted. Because the - sample file must still exist for the comparison, the - @unexec line comes before the sample - configuration file name. On installation, if an actual - configuration file is not already present, the sample file is - copied to the actual file. The sample file must be present - before it can be copied, so the @exec line - comes after the sample configuration file name. + or - To debug any issues, temporarily remove the - -s flag to &man.cmp.1; for more - output. + @sample %%EXAMPLESDIR%%/orbit.conf etc/orbit.conf - See &man.pkg-create.8; for more information on - %D and related substitution markers. + The format is @sample + sample-file + actual-config-file. @@ -408,17 +396,21 @@ etc/orbit.conf-dist <literal>@sample</literal> - <replaceable>file</replaceable> + file + [file] - Add the file passed as argument to the plist. + This is used to handle installation of configuration + files, through example files bundled with the package. The + actual, non-sample, file is either the second + filename, if present, or the first filename without the + .sample extension. - On installation, check for a real file with - just the base name (the name without the - .sample extension). If the real file is - not found, copy the sample file to the base file name. On - deinstallation, remove the configuration file if it has not - been modified. See for more - information. + This does three things. First, add the first file passed + as argument, the sample file, to the plist. Then, on + installation, if the actual file is not found, copy the sample + file to the actual file. And finally, on deinstallation, + remove the actual file if it has not been modified. See for more information.