fix: ensure src-old is always removed on exit

This commit is contained in:
psykose 2022-04-29 06:50:57 +00:00
parent 131c15e715
commit 9a6ac8303b
Signed by: psykose
SSH key fingerprint: SHA256:HwlGVJNLZqHoOvMtkshyGaXLkcdbEJahYMlepHFL+Uk

7
apatch
View file

@ -1,5 +1,11 @@
#!/bin/sh
cleanup() {
rm -rf src-old
}
trap 'cleanup' EXIT INT HUP
startdir="$PWD"
[ -f APKBUILD ] || ( echo "please run this in a package directory"; exit 1 )
@ -32,4 +38,3 @@ done
)
busybox diff -U3 -r "src-old$builddir" "src$builddir" | sed "s|src-old$builddir|a|g;s|src$builddir|b|g" > $1
rm -rf src-old