makepkg: allow signatures to work with split packages

Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Dan McGee 2009-08-24 13:22:12 -05:00
parent ee34869e89
commit 82e22596d8

View file

@ -1068,6 +1068,9 @@ create_package() {
local pkg_file="$PKGDEST/${nameofpkg}-${fullver}-${PKGARCH}${PKGEXT}" local pkg_file="$PKGDEST/${nameofpkg}-${fullver}-${PKGARCH}${PKGEXT}"
local ret=0 local ret=0
[[ -f $pkg_file ]] && rm -f "$pkg_file"
[[ -f $pkg_file.sig ]] && rm -f "$pkg_file.sig"
# when fileglobbing, we want * in an empty directory to expand to # when fileglobbing, we want * in an empty directory to expand to
# the null string rather than itself # the null string rather than itself
shopt -s nullglob shopt -s nullglob
@ -1097,6 +1100,8 @@ create_package() {
if (( ret )); then if (( ret )); then
warning "$(gettext "Failed to create symlink to package file.")" warning "$(gettext "Failed to create symlink to package file.")"
fi fi
create_signature "$pkg_file"
} }
create_signature() { create_signature() {
@ -1104,15 +1109,15 @@ create_signature() {
return return
fi fi
local ret=0 local ret=0
local filename="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" local filename="$1"
msg "$(gettext "Signing package...")" msg "$(gettext "Signing package...")"
if [ ! $(type -p "gpg") ]; then if [ ! $(type -p "gpg") ]; then
error "$(gettext "Cannot find the gpg binary! Is gnupg installed?")" error "$(gettext "Cannot find the gpg binary! Is gnupg installed?")"
exit 1 # $E_MISSING_PROGRAM exit 1 # $E_MISSING_PROGRAM
fi fi
gpg --detach-sign --use-agent $filename || ret=$? gpg --detach-sign --use-agent "$filename" || ret=$?
if (( ! ret )); then if (( ! ret )); then
msg2 "$(gettext "Created signature file %s.")" $filename.sig msg2 "$(gettext "Created signature file %s.")" "$filename.sig"
else else
warning "$(gettext "Failed to sign package file.")" warning "$(gettext "Failed to sign package file.")"
fi fi
@ -2134,8 +2139,6 @@ fi
fullver=$(get_full_version $epoch $pkgver $pkgrel) fullver=$(get_full_version $epoch $pkgver $pkgrel)
msg "$(gettext "Finished making: %s")" "$pkgbase $fullver ($(date))" msg "$(gettext "Finished making: %s")" "$pkgbase $fullver ($(date))"
create_signature
install_package install_package
exit 0 #E_OK exit 0 #E_OK