makepkg: fix signing of source packages

In commit c6b04c0465 the signing stage was
moved out of fakeroot, and thus into the main control flow instead of
create_{,src}package

While the function for signing binary packages has logic to build
and gpg-sign multiple filenames, the source package never got this
special treatment. This would be fine, except it uses the standard
variables to set define the filename... like ${fullver}, which is
usually set beforehand, but in this case is not. We don't define fullver
globally as it's an internal implementation detail, except by sheer
coincidence if PKGVERFUNC is false due to improperly guarded code.

Result: source packages didn't end up signed. Instead, we raised a logic
error:

==> WARNING: Failed to sign package file somepackage-.src.tar.gz.

==> ERROR: An unknown error has occurred. Exiting...

Instead, let's just build the version inline, since we only use it once.

Reported-by: GaKu999 <g4ku999@gmail.com>
Signed-off-by: Eli Schwartz <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Eli Schwartz 2020-10-11 22:22:04 -04:00 committed by Allan McRae
parent 406a37206f
commit f76bd2c6c1

View file

@ -1360,7 +1360,7 @@ if (( SOURCEONLY )); then
if [[ $SIGNPKG = 'y' ]]; then if [[ $SIGNPKG = 'y' ]]; then
msg "$(gettext "Signing package...")" msg "$(gettext "Signing package...")"
create_signature "$SRCPKGDEST/${pkgbase}-${fullver}${SRCEXT}" create_signature "$SRCPKGDEST/${pkgbase}-$(get_full_version)${SRCEXT}"
fi fi
msg "$(gettext "Source package created: %s")" "$pkgbase ($(date +%c))" msg "$(gettext "Source package created: %s")" "$pkgbase ($(date +%c))"