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

Re: Bug#587956: a patch



On Wed, Aug 11, 2010 at 12:25:19AM +0200, Adam Borowski wrote:

> --- netbase.postinst.orig	2010-08-10 23:05:42.440582610 +0200
> +++ netbase.postinst	2010-08-10 23:06:37.256578113 +0200
> @@ -57,6 +57,20 @@
>  EOF
>  }
>  
> +# delete bindv6only.conf that was created by 4.38 .. 4.42
> +remove_bindv6only_conf() {
> +  if [ ! -e /etc/sysctl.d/bindv6only.conf ]; then
> +    return 0
> +  fi
> +  if [ "$2" ] && dpkg --compare-versions "$2" ge "4.42"; then
> +    return 0
> +  fi

Note that the '[ "$2" ] &&' is redundant.

Please also include a lower version check; this code shouldn't be executed
on upgrade from a version predating the addition of the file to the package.

> +  if ! echo "289c9c015f7c4da3b77b428ada1fb72a  /etc/sysctl.d/bindv6only.conf"|md5sum -c --status; then
> +    return 0
> +  fi

I think it's more idiomatic to write:

  if [ $(md5sum /etc/sysctl.d/bindv6only.conf | awk '{ print $1 }') != 289c9c015f7c4da3b77b428ada1fb72a ]
  then
    return 0
  fi

Cheers,
-- 
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: