abuild-sign: fix --installed to detect missing keys
This commit is contained in:
parent
32d080e427
commit
ea4c0e0eba
|
@ -112,6 +112,15 @@ if [ -z "$pubkey" ]; then
|
|||
pubkey=${PACKAGER_PUBKEY:-"${privkey}.pub"}
|
||||
fi
|
||||
|
||||
if ! $check_installed; then
|
||||
if $check_installed; then
|
||||
if ! [ -e "$privkey" ]; then
|
||||
echo "$program: $privkey: File not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
if ! [ -e "$pubkey" ]; then
|
||||
echo "$program: $pubkey: File not found" >&2
|
||||
exit 1
|
||||
fi
|
||||
else
|
||||
do_sign "$@"
|
||||
fi
|
||||
|
|
|
@ -6,6 +6,8 @@ init_tests \
|
|||
abuild_sign_invalid_opt \
|
||||
abuild_sign_missing_arg \
|
||||
abuild_sign_installed_missing \
|
||||
abuild_sign_installed_missing_pub \
|
||||
abuild_sign_installed_missing_priv \
|
||||
abuild_sign_installed
|
||||
|
||||
export ABUILD_SHAREDIR="$(atf_get_srcdir)/.."
|
||||
|
@ -38,6 +40,22 @@ abuild_sign_installed_missing_body() {
|
|||
abuild-sign --installed
|
||||
}
|
||||
|
||||
abuild_sign_installed_missing_pub_body() {
|
||||
init_keys
|
||||
rm .abuild/*.rsa.pub
|
||||
atf_check -s exit:1 \
|
||||
-e match:"rsa.pub: File not found" \
|
||||
abuild-sign --installed
|
||||
}
|
||||
|
||||
abuild_sign_installed_missing_priv_body() {
|
||||
init_keys
|
||||
rm .abuild/*.rsa
|
||||
atf_check -s exit:1 \
|
||||
-e match:"rsa: File not found" \
|
||||
abuild-sign --installed
|
||||
}
|
||||
|
||||
abuild_sign_installed_body() {
|
||||
init_keys
|
||||
atf_check -s exit:0 \
|
||||
|
|
Loading…
Reference in New Issue