summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2018-11-08 11:43:47 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-01-10 16:08:51 +0000
commitbbe4a4fdfdc4f5e9014d3316ae36862a30cce597 (patch)
tree29678d9610aecbb44934776c36857eeeb242e785
parent832ab44934e98c0612a7e0e75725227547705687 (diff)
downloadabuild-bbe4a4fdfdc4f5e9014d3316ae36862a30cce597.tar.bz2
abuild-bbe4a4fdfdc4f5e9014d3316ae36862a30cce597.tar.xz
abuild-sign: fall back to libressl if openssl is missing
openssl binary may be missing while migrating system from libressl to openssl. Make sure we can always sign the backage if either is there.
-rw-r--r--abuild-sign.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/abuild-sign.in b/abuild-sign.in
index 7b5b6db..5890bf5 100644
--- a/abuild-sign.in
+++ b/abuild-sign.in
@@ -17,6 +17,7 @@ fi
do_sign() {
local f i keyname repo
+ local openssl=$(command -v openssl || echo libressl)
# we are actually only interested in the name, not the file itself
keyname=${pubkey##*/}
@@ -29,7 +30,7 @@ do_sign() {
set -e
cd "$repo"
sig=".SIGN.RSA.$keyname"
- openssl dgst -sha1 -sign "$privkey" -out "$sig" "$i"
+ $openssl dgst -sha1 -sign "$privkey" -out "$sig" "$i"
tmptargz=$(mktemp)
tar -f - -c "$sig" | abuild-tar --cut | gzip -9 > "$tmptargz"
tmpsigned=$(mktemp)