type="zip"; uncomp="unzip -d"; ;;
*.Z)
type="compress"; uncomp="uncompress -c"; ;;
+ *.diff*)
+ type="diff"; uncomp="cat"; ;;
+ *.patch*)
+ type="patch"; uncomp="cat"; ;;
*)
- type="plaintext"; uncomp="cat"; ;;
+ echo "Unsupported format file for ${patch}, skip it";
+ return 0;
+ ;;
esac
echo ""
echo "Applying $patch using ${type}: "
else
for i in `cd $path; ls -d $patches 2> /dev/null` ; do
if [ -d "${path}/$i" ] ; then
- echo "${path}/$i skipped"
+ scan_patchdir "${path}/$i"
elif echo "$i" | grep -q -E "\.tar(\..*)?$|\.tbz2?$|\.tgz$" ; then
unpackedarchivedir="$builddir/.patches-$(basename $i)-unpacked"
rm -rf "$unpackedarchivedir" 2> /dev/null
mkdir "$unpackedarchivedir"
- tar -C "$unpackedarchivedir" --strip-components=1 -xaf "${path}/$i"
+ tar -C "$unpackedarchivedir" -xaf "${path}/$i"
scan_patchdir "$unpackedarchivedir"
else
apply_patch "$path" "$i" || exit 1