app-crypt/gnupg: provide /usr/bin/gpg and /usr/bin/gpgv in pkg_postinst

After app-crypt/gnupg[alternatives] is merged, gnupg no longer provides
/usr/bin/gpg, and there's no /usr/bin/gpg on the system until
app-alternatives/gpg can be merged. That's somewhat-fine unless
app-alternatives/gpg is a signed binpkg, in which case gpg is needed
to verify it.

Provide gpg and gpgv as orphaned symlinks in pkg_postinst to handle
this case.

Reported-by: Jay Faulkner <jayf@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sam James 2025-10-28 18:49:42 +00:00
parent 90e01486c2
commit 133742ca3a
No known key found for this signature in database
GPG Key ID: 738409F520DF9190
2 changed files with 22 additions and 0 deletions

View File

@ -204,3 +204,14 @@ my_src_install_all() {
dodoc "${FILESDIR}"/README-systemd
systemd_douserunit "${GNUPG_SYSTEMD_UNITS[@]/#/${T}/}"
}
pkg_postinst() {
# If /usr/bin/gpg and /usr/bin/gpgv do not exist, provide them.
if [[ ! -e ${EROOT}/usr/bin/gpg ]]; then
ln -sf -- gpg-reference "${EROOT}"/usr/bin/gpg || die
fi
if [[ ! -e ${EROOT}/usr/bin/gpgv ]]; then
ln -sf -- gpgv-reference "${EROOT}"/usr/bin/gpgv || die
fi
}

View File

@ -208,3 +208,14 @@ my_src_install_all() {
dodoc "${FILESDIR}"/README-systemd
systemd_douserunit "${GNUPG_SYSTEMD_UNITS[@]/#/${T}/}"
}
pkg_postinst() {
# If /usr/bin/gpg and /usr/bin/gpgv do not exist, provide them.
if [[ ! -e ${EROOT}/usr/bin/gpg ]]; then
ln -sf -- gpg-reference "${EROOT}"/usr/bin/gpg || die
fi
if [[ ! -e ${EROOT}/usr/bin/gpgv ]]; then
ln -sf -- gpgv-reference "${EROOT}"/usr/bin/gpgv || die
fi
}