deblob-main and cmp

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


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
    echo $dir/deblob-$kver and $deblob are different >&2
    exit 1

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

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