[ovs-dev] Bug#656448: Bug#656448: [PATCH] debian: Delete log files correctly when packages are purged.

Ethan Jackson ethan at nicira.com
Fri Jan 20 23:32:17 UTC 2012


Looks fine to me, though I'm no debian expert.

Ethan

On Thu, Jan 19, 2012 at 10:07, Ben Pfaff <blp at nicira.com> wrote:
> Debian Policy 10.8 says "Log files should be removed when the package is
> purged (but not when it is only removed)," but the Open vSwitch packages
> didn't properly implement this:
>
>   - The openvswitch-brcompat and openvswitch-pki packages didn't delete
>     their log files at purge time.
>
>   - The openvswitch-switch package deleted all of the log files at purge
>     time, even those owned by openvswitch-brcompat or openvswitch-pki.
>
> This commit fixes both problems.
>
> CC: 656448 at bugs.debian.org
> Reported-by: Andreas Beckmann <debian at abeckmann.de>
> Signed-off-by: Ben Pfaff <blp at nicira.com>
> ---
>  debian/automake.mk                                 |    2 ++
>  ...h-switch.postrm => openvswitch-brcompat.postrm} |    7 ++-----
>  ...switch-switch.postrm => openvswitch-pki.postrm} |    7 ++-----
>  debian/openvswitch-switch.postrm                   |    3 ++-
>  4 files changed, 8 insertions(+), 11 deletions(-)
>  copy debian/{openvswitch-switch.postrm => openvswitch-brcompat.postrm} (81%)
>  copy debian/{openvswitch-switch.postrm => openvswitch-pki.postrm} (81%)
>
> diff --git a/debian/automake.mk b/debian/automake.mk
> index 755d727..e18d47a 100644
> --- a/debian/automake.mk
> +++ b/debian/automake.mk
> @@ -10,6 +10,7 @@ EXTRA_DIST += \
>        debian/openvswitch-brcompat.install \
>        debian/openvswitch-brcompat.manpages \
>        debian/openvswitch-brcompat.postinst \
> +       debian/openvswitch-brcompat.postrm \
>        debian/openvswitch-common.dirs \
>        debian/openvswitch-common.install \
>        debian/openvswitch-common.manpages \
> @@ -31,6 +32,7 @@ EXTRA_DIST += \
>        debian/openvswitch-ipsec.init \
>        debian/openvswitch-ipsec.install \
>        debian/openvswitch-pki.postinst \
> +       debian/openvswitch-pki.postrm \
>        debian/openvswitch-switch.README.Debian \
>        debian/openvswitch-switch.dirs \
>        debian/openvswitch-switch.init \
> diff --git a/debian/openvswitch-switch.postrm b/debian/openvswitch-brcompat.postrm
> similarity index 81%
> copy from debian/openvswitch-switch.postrm
> copy to debian/openvswitch-brcompat.postrm
> index d911338..e21b002 100755
> --- a/debian/openvswitch-switch.postrm
> +++ b/debian/openvswitch-brcompat.postrm
> @@ -1,5 +1,5 @@
>  #!/bin/sh
> -# postrm script for openvswitch-switch
> +# postrm script for openvswitch-brcompat
>  #
>  # see: dh_installdeb(1)
>
> @@ -21,10 +21,7 @@ set -e
>
>  case "$1" in
>     purge)
> -        rm -f /etc/openvswitch/conf.db
> -        rm -f /etc/openvswitch/.conf.db.~lock~
> -        rm -f /etc/default/openvswitch-switch
> -        rm -f /var/log/openvswitch/* || true
> +        rm -f /var/log/openvswitch/ovs-brcompatd.log* || true
>         ;;
>
>     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
> diff --git a/debian/openvswitch-switch.postrm b/debian/openvswitch-pki.postrm
> similarity index 81%
> copy from debian/openvswitch-switch.postrm
> copy to debian/openvswitch-pki.postrm
> index d911338..5db4d6b 100755
> --- a/debian/openvswitch-switch.postrm
> +++ b/debian/openvswitch-pki.postrm
> @@ -1,5 +1,5 @@
>  #!/bin/sh
> -# postrm script for openvswitch-switch
> +# postrm script for openvswitch-pki
>  #
>  # see: dh_installdeb(1)
>
> @@ -21,10 +21,7 @@ set -e
>
>  case "$1" in
>     purge)
> -        rm -f /etc/openvswitch/conf.db
> -        rm -f /etc/openvswitch/.conf.db.~lock~
> -        rm -f /etc/default/openvswitch-switch
> -        rm -f /var/log/openvswitch/* || true
> +        rm -f /var/log/openvswitch/ovs-pki.log* || true
>         ;;
>
>     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
> diff --git a/debian/openvswitch-switch.postrm b/debian/openvswitch-switch.postrm
> index d911338..baf37c8 100755
> --- a/debian/openvswitch-switch.postrm
> +++ b/debian/openvswitch-switch.postrm
> @@ -24,7 +24,8 @@ case "$1" in
>         rm -f /etc/openvswitch/conf.db
>         rm -f /etc/openvswitch/.conf.db.~lock~
>         rm -f /etc/default/openvswitch-switch
> -        rm -f /var/log/openvswitch/* || true
> +        rm -f /var/log/openvswitch/ovs-vswitchd.log* || true
> +        rm -f /var/log/openvswitch/ovsdb-server.log* || true
>         ;;
>
>     remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
> --
> 1.7.2.5
>
>
>
> _______________________________________________
> dev mailing list
> dev at openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev





More information about the dev mailing list