Commit ad611237 authored by Dubiousjim's avatar Dubiousjim Committed by Natanael Copa

abuild-sign: wrap cd in a subshell, use set -e

parent 3eac2775
......@@ -25,9 +25,11 @@ do_sign() {
i=$(readlink -f $f)
[ -d "$i" ] && i="$i/APKINDEX.tar.gz"
repo="${i%/*}"
cd "$repo" || die "Failed to sign $i"
(
set -e
cd "$repo"
sig=".SIGN.RSA.$keyname"
openssl dgst -sha1 -sign "$privkey" -out "$sig" "$i" || die "Failed to sign $i"
openssl dgst -sha1 -sign "$privkey" -out "$sig" "$i"
tmptargz=$(mktemp)
tar -c "$sig" | abuild-tar --cut | gzip -9 > "$tmptargz"
tmpsigned=$(mktemp)
......@@ -38,6 +40,7 @@ do_sign() {
if [ -z "$quiet" ]; then
echo "Signed $i"
fi
) || die "Failed to sign $i"
done
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment