rpms/rsnapshot/devel rsnapshot.patch, NONE, 1.1 .cvsignore, 1.2, 1.3 rsnapshot.spec, 1.1, 1.2 sources, 1.2, 1.3

Michael Schwendt bugs.michael at gmx.net
Tue Apr 12 12:08:19 UTC 2005


On Tue, 12 Apr 2005 07:07:22 -0400, Gavin Henry (ghenry) wrote:

> Author: ghenry
> 
> Update of /cvs/extras/rpms/rsnapshot/devel

> +%post
> +#
> +# upgrade rsnapshot config file
> +#
> +RSNAPSHOT_CONFIG_VERSION=`%{_bindir}/rsnapshot check-config-version`
> +if test $? != 0; then
> +	echo "Error upgrading %{_sysconfdir}/rsnapshot.conf"
> +fi
> +
> +if test "$RSNAPSHOT_CONFIG_VERSION" = "1.2"; then
> +	# already latest version
> +	exit 0
> +fi
> +
> +if test "$RSNAPSHOT_CONFIG_VERSION" = "unknown"; then
> +	%{_bindir}/rsnapshot upgrade-config-file
> +	RETVAL=$?
> +	exit $RETVAL
> +fi
>  
> -install -d $RPM_BUILD_ROOT%{_mandir}/man1
> -install -m 644 rsnapshot.1 $RPM_BUILD_ROOT%{_mandir}/man1
> +echo "Error upgrading %{_sysconfdir}/rsnapshot.conf. Config format unknown!"
> +exit 1

It's real bad if a post-install script prints something or returns error
code 1. You really don't want RPM based upgrades to fail at that point.

Upgradability via "rsnapshot upgrade-config-file" should not be something
that causes anpackage update to fail. Simply call that tool and discard
any return values. If version upgrades cause configuration problems, the
software is broken by design and detect such problems at run-time, not
install time. Marking the config file %config(noreplace) is insufficient
then anyway.




More information about the fedora-extras-commits mailing list