Browse Source

Improved patchfiles handling for the case a given file does not exist

- Till now we didn't checked if a patch does really exist, so you will
  mostly just notice if you search the build log for files that were
  not found.
- By now we will issue a file not found warning for that case so
  problems related to not existing patch files will be more obvious.
misl/sde-wrapper
Christian Wiese 17 years ago
parent
commit
aee19dae54
1 changed files with 15 additions and 10 deletions
  1. +15
    -10
      lib/functions.in

+ 15
- 10
lib/functions.in

@ -764,19 +764,24 @@ apply_patchfiles() {
x="$base/download/mirror/${x:0:1}/$x"
fi
echo "Apply patch $x ..."
# Apply the patch if the file does exist or issue a warning
if [ -f "$x" ] ; then
echo "Apply patch $x ..."
if [[ $x = *.bz2 ]] ; then
patch_file=`mktemp` ; patch_del=1
bzcat $x > $patch_file
else
patch_file=$x ; patch_del=0
fi
if [[ $x = *.bz2 ]] ; then
patch_file=`mktemp` ; patch_del=1
bzcat $x > $patch_file
else
patch_file=$x ; patch_del=0
fi
$filter $patch_file | patch $patchopt
$filter $patch_file | patch $patchopt
[ $patch_del = 1 ] && rm $patch_file
eval "$hook"
[ $patch_del = 1 ] && rm $patch_file
eval "$hook"
else
echo_warning "Unable to apply patch: $x (File not found!)"
fi
done
}

Loading…
Cancel
Save