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

Bug#535624: Patch update



On Thu, Jul 23, 2009 at 16:09:05 -0300, Maximiliano Curia wrote:

> Hola!
> 
> This is a patch update that fixes the previuos patch and handles the error
> generated by the 1:7.3+19 version.
> 
> Thanks to Julien Cristau for the support given via irc.
> 
Thanks for working on this Maximiliano.

> diff -Naru xorg-7.3+19/debian/xserver-xorg.postinst.in xorg-7.3+20/debian/xserver-xorg.postinst.in
> --- xorg-7.3+19/debian/xserver-xorg.postinst.in	2009-06-03 16:24:40.000000000 -0300
> +++ xorg-7.3+20/debian/xserver-xorg.postinst.in	2009-07-23 15:26:44.621526322 -0300
> @@ -932,12 +932,17 @@
>  # Don't touch the config on upgrades except to deal with known issues with old
>  # configs.
>  if [ -z "$UPGRADE" ] || dpkg --compare-versions "$2" le "1:7.0.14" || \
> -  [ "$ARCHITECTURE" = sparc ] && dpkg --compare-versions "$2" lt-nl 1:7.3+19; then
> +  { [ "$ARCHITECTURE" = sparc ] && \
> +      dpkg --compare-versions "$2" lt-nl 1:7.3+19; } || \
> +  { [ -n "$(find "$XORGCONFIG" -maxdepth 0 -size 0 2>/dev/null)" ] &&  \
> +      [ "$2" = 1:7.3+19 ]; }; then
>    # compare the current and stored checksums; if they do not match, assume
>    # that's the way the user wants it.  if we're reconfiguring, overwrite
>    # it regardless and back it up.
>    if [ "$(md5sum "$XORGCONFIG")" = "$(cat "$XORGCONFIG_CHECKSUM")" ] || \
> -     ! [ -e "$XORGCONFIG" ] || [ -n "$RECONFIGURE" ]; then
> +     ! [ -e "$XORGCONFIG" ] || [ -n "$RECONFIGURE" ] || \
> +	 { [ -n "$(find "$XORGCONFIG" -maxdepth 0 -size 0 2>/dev/null)" ] && \
> +		 [ "$2" = 1:7.3+19 ]; }; then

I don't understand why this is necessary.
xserver-xorg.preinst does this:

  if [ "$1" = "install" ]; then
    if ! [ -e "$XORGCONFIG" ]; then
      # cheap, fork()-free version of "touch"
      : > "$XORGCONFIG"
      md5sum "$XORGCONFIG" > "$XORGCONFIG_CHECKSUM"
    fi
  fi

so even with the buggy preinst the checksum in $XORGCONFIG_CHECKSUM
should match the empty file.  What am I missing?

>      # they match or user deleted the file or they're running dpkg-reconfigure; 
>      # prepare a new version
>      NEW_XORGCONFIG="$XORGCONFIG.dpkg-new"

Cheers,
Julien



Reply to: