[pkg-bacula-devel] 01/02: Remove leftover /etc/tmpfiles.d/bacula.conf if identical to new

Carsten Leonhardt leo at debian.org
Mon Jul 18 15:48:14 UTC 2016


>  debian/bacula-common.postinst | 11 +++++++++++
>  1 file changed, 11 insertions(+)
>
> diff --git a/debian/bacula-common.postinst b/debian/bacula-common.postinst
> index c245ede..342affb 100644
> --- a/debian/bacula-common.postinst
> +++ b/debian/bacula-common.postinst
> @@ -15,6 +15,17 @@ case "$1" in
>  
>          . /usr/share/bacula-common/common-functions.dpkg
>          readOrCreatePasswords # create our common passwords if needed
> +
> +	# Remove leftover /etc/tmpfiles.d/bacula.conf if it is identical
> +	# to /usr/lib/tmpfiles.d/bacula.conf
> +	if [ -f /etc/tmpfiles.d/bacula.conf ]; then
> +		if diff /etc/tmpfiles.d/bacula.conf /usr/lib/tmpfiles.d/bacula.conf >/dev/null; then
> +			rm /etc/tmpfiles.d/bacula.conf

I think this can be improved:

https://wiki.debian.org/DpkgConffileHandling

and following the links from there:

https://manpages.debian.org/cgi-bin/man.cgi?query=dpkg-maintscript-helper&section=1

> +		else
> +			echo "/etc/tmpfiles.d/bacula.conf and /usr/lib/tmpfiles.d/bacula.conf differ, please check contents manually" >&2
> +		fi

I doubt that people see that message when they upgrade from jessie to
stretch. I'd go for handling that with

dpkg-maintscript-helper rm_conffile ...

and maybe a debian/NEWS entry, probably rather just an entry in
debian/changelog (unless someone gives me an idea why someone could have
changed that file).

> +	fi
> +
>      ;;
>  esac




More information about the pkg-bacula-devel mailing list