7.2 Cleaning up empty directories

- Reword a bit
- Create a subsection from it
- Add second subsection dealing with installing empty directories on package
  install

Approved by:	keramida
This commit is contained in:
Pav Lucistnik 2005-09-14 18:31:32 +00:00
parent fef4642f67
commit 9681fee667
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=25647

View file

@ -5824,9 +5824,12 @@ PLIST_SUB= OCTAVE_VERSION=${OCTAVE_VERSION}</programlisting>
</sect1>
<sect1 id="plist-cleaning">
<title>Cleaning up empty directories</title>
<title>Empty directories</title>
<para>Do make your ports clean up after themselves when they are
<sect2 id="plist-dir-cleaning">
<title>Cleaning up empty directories</title>
<para>Do make your ports remove empty directories when they are
de-installed. This is usually accomplished by adding
<literal>@dirrm</literal> lines for all directories that are
specifically created by the port. You need to delete subdirectories
@ -5841,7 +5844,7 @@ lib/X11/oneko/sounds/cat.au
@dirrm lib/X11/oneko</programlisting>
<para>However, sometimes <literal>@dirrm</literal> will give you
errors because other ports also share the same subdirectory. You
errors because other ports share the same directory. You
can call <command>rmdir</command> from <literal>@unexec</literal> to
remove only empty directories without warning.</para>
@ -5851,6 +5854,22 @@ lib/X11/oneko/sounds/cat.au
&man.pkg.delete.1; to exit abnormally even if
<filename><makevar>PREFIX</makevar>/share/doc/gimp</filename> is not
empty due to other ports installing some files in there.</para>
</sect2>
<sect2 id="plist-dir-empty">
<title>Creating empty directories</title>
<para>Empty directories created during port installation need special
attention. They will not get created when installing the package,
because packages only store the files, and &man.pkg.add.1; creates
directories for them as needed. To make sure the empty directory
is created when installing the package, add this line to
<filename>pkg-plist</filename> above the corresponding
<literal>@dirrm</literal> line:</para>
<programlisting>@exec mkdir -p %D/share/foo/templates</programlisting>
</sect2>
</sect1>
<sect1 id="plist-config">