[Pkg-utopia-maintainers] Bug#802283: firewalld: Create an alternative for /usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.policy symlink

Michael Biebl biebl at debian.org
Tue Oct 10 11:03:33 UTC 2017


Am 10.10.2017 um 12:54 schrieb Laurent Bigonville:
> 
>>From 97de6680c623bedcf75c8d7a13dd7a0693d210c2 Mon Sep 17 00:00:00 2001
> From: Laurent Bigonville <bigon at debian.org>
> Date: Tue, 14 Feb 2017 15:36:26 +0100
> Subject: [PATCH] Handle
>  /usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.policy symlink using
>  alternatives
> 
> Closes: #802283
> ---
>  debian/firewalld.postinst |  6 ++++++
>  debian/firewalld.prerm    | 25 +++++++++++++++++++++++++
>  debian/rules              |  2 ++
>  3 files changed, 33 insertions(+)
>  create mode 100644 debian/firewalld.prerm
> 
> diff --git a/debian/firewalld.postinst b/debian/firewalld.postinst
> index cc7b96d..68ee272 100644
> --- a/debian/firewalld.postinst
> +++ b/debian/firewalld.postinst
> @@ -12,6 +12,12 @@ case "$1" in
>                  chmod 0750 /etc/firewalld
>              fi
>  	fi
> +	update-alternatives --install /usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.policy \
> +		org.fedoraproject.FirewallD1.policy \
> +		/usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.server.policy.choice 20
> +	update-alternatives --install /usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.policy \
> +		org.fedoraproject.FirewallD1.policy \
> +		/usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.desktop.policy.choice 10
>      ;;
>  
>      abort-upgrade|abort-remove|abort-deconfigure)
> diff --git a/debian/firewalld.prerm b/debian/firewalld.prerm
> new file mode 100644
> index 0000000..d0e3239
> --- /dev/null
> +++ b/debian/firewalld.prerm
> @@ -0,0 +1,25 @@
> +#!/bin/sh
> +set -e
> +
> +
> +case "$1" in
> +  # only remove in remove/deconfigure so we don't disrupt users' preferences
> +  remove|deconfigure)
> +    update-alternatives --remove org.fedoraproject.FirewallD1.policy \
> +	    /usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.server.policy.choice
> +    update-alternatives --remove org.fedoraproject.FirewallD1.policy \
> +	    /usr/share/polkit-1/actions/org.fedoraproject.FirewallD1.desktop.policy.choice
> +    ;;
> +
> +  upgrade|failed-upgrade)
> +    ;;

Can you fix the indentation to use 4 spaces consistently everywhere.

> +  *)
> +    echo "prerm called with unknown argument \`$1'" >&2
> +    exit 0

Why "exit 0"? That is inconsistent with postinst.

> +    ;;
> +esac
> +
> +#DEBHELPER#
> +
> +exit 0

We should drop the trailing "exit 0" (also from postinst). It's rather
pointless when using "set -e".

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-utopia-maintainers/attachments/20171010/ea79b5bc/attachment-0001.sig>


More information about the Pkg-utopia-maintainers mailing list