Compare commits

...

2 commits

5
apatch
View file

@ -44,7 +44,8 @@ abuild clean fetch unpack default_prepare
startdir="$PWD"
srcdir="$startdir/src"
. APKBUILD
test -n "$builddir" || builddir="$srcdir/$pkgname-$pkgver"
unset -f grep cut head git rm mv
[ -n "$builddir" ] || builddir="$srcdir/$pkgname-$pkgver"
patchpath="$startdir/$1"
@ -67,7 +68,7 @@ if [ -f "$patchpath" ]; then
msg "patch exists, trying to extract existing message"
# try to extract the original header from the patch
patch_start=$(grep -En '^(diff --git|--- )' "$patchpath" | cut -d: -f1 | head -n 1)
header_file="$(mktemp -t apatch.XXXXXX)"
header_file="/tmp/$(mktemp -u apatch.XXXXXX)"
head -n $(( patch_start - 1 )) "$patchpath" > "$header_file"
fi