[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#684126: debian-policy: clarification needed for handling of directories used by maintainer scripts



On Thu, Aug 09, 2012 at 08:34:36AM +0900, Charles Plessy wrote:
> diff --git a/policy.sgml b/policy.sgml
> index 52dbb26..0aa08d2 100644
> --- a/policy.sgml
> +++ b/policy.sgml
> @@ -3854,7 +3854,16 @@ Checksums-Sha256:
>  	  pathname. Maintainer scripts should also not reset the
>  	  <tt>PATH</tt>, though they might choose to modify it by
>  	  prepending or appending package-specific directories. These
> -	  considerations really apply to all shell scripts.</p>
> +	  considerations really apply to all shell scripts.
> +	</p>
> +
> +	<p>
> +	  Maintainer scripts should not create directories.  Instead, the
> +	  binary packages should install the directories needed for their
> +	  maintainer scripts together with the other files and directories
> +	  distributed in their data tar archive, to ensure that they are
> +	  properly removed when purging packages.
> +	</p>
>        </sect>
>  

This rationale doesn't hold up.  Directories shipped in packages are removed
on package removal *if* they are empty at the time (after removing all the
files in the package).  So any directory used by the package for data or
config files that are not removed until package purge will not be removed
*unless* the postrm does it.  This is true whether the directory is shipped
in the package or created in the postinst.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org

Attachment: signature.asc
Description: Digital signature


Reply to: