Patchwork [1/2] gnupg: Replace manual link with update-alternatives

login
register
mail settings
Submitter Paul Barker
Date March 25, 2013, 12:55 a.m.
Message ID <1364172907-14541-2-git-send-email-paul@paulbarker.me.uk>
Download mbox | patch
Permalink /patch/46809/
State New
Headers show

Comments

Paul Barker - March 25, 2013, 12:55 a.m.
Removed manual creation of '/usr/bin/gpg' link to 'gpg2' and replaced with
proper usage of update-alternatives.

Signed-off-by: Paul Barker <paul@paulbarker.me.uk>
---
 meta/recipes-support/gnupg/gnupg_2.0.19.bb |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Patch

diff --git a/meta/recipes-support/gnupg/gnupg_2.0.19.bb b/meta/recipes-support/gnupg/gnupg_2.0.19.bb
index 8cd793b..2322a9e 100644
--- a/meta/recipes-support/gnupg/gnupg_2.0.19.bb
+++ b/meta/recipes-support/gnupg/gnupg_2.0.19.bb
@@ -9,7 +9,7 @@  PTH = "pth"
 PTH_libc-uclibc = "npth"
 PR = "r5"
 
-inherit autotools gettext
+inherit autotools gettext update-alternatives
 
 SRC_URI = "ftp://ftp.gnupg.org/gcrypt/${BPN}/${BPN}-${PV}.tar.bz2 \
            file://GnuPG2-CVE-2012-6085.patch"
@@ -25,6 +25,7 @@  EXTRA_OECONF = "--disable-ldap \
                 --with-readline=${STAGING_LIBDIR}/.. \
                "
 
-do_install_append() {
-	ln -sf gpg2 ${D}${bindir}/gpg
-}
+ALTERNATIVE_gnupg = "gpg"
+ALTERNATIVE_TARGET[gpg] = "${bindir}/gpg2"
+ALTERNATIVE_LINK_NAME[gpg] = "${bindir}/gpg"
+ALTERNATIVE_PRIORITY[gpg] = "100"