deblob-main and cmp

Matias A. Fonzo selk at dragora.org
Mon Mar 30 22:55:44 UTC 2009


Hi

I was watching the code of deblob-main, and I ask myself: when the "deblob-check" and "deblob-$kver" it is compared?.

This lines are skipped (and for deblob-check, too):

[...]
if test -f $dir/deblob-$kver; then
  if cmp $dir/deblob-$kver $deblob; then
    :
  else
    echo $dir/deblob-$kver and $deblob are different >&2
    exit 1
  fi
fi
[...]

Because, $dir is:
dir=`echo $0 | sed 's,/[^/]*$,,'`

The value is, dir=deblob-main
So we have:

if test -f deblob-main/deblob-$kver; then
  ...
fi

deblob-main cannot be a directory, because is a file.

Why not the use of "pwd" instead of "echo $0 | sed 's,/[^/]*$,,'"?. It is POSIX.

Best regards,

Matias A. Fonzo.


More information about the linux-libre mailing list