From 1704ff619aafe3cacea447a11a5079c5129426f0 Mon Sep 17 00:00:00 2001 From: theofficialgman <28281419+theofficialgman@users.noreply.github.com> Date: Wed, 27 Dec 2023 19:50:11 -0500 Subject: [PATCH] api: simplify `adoptium_installer` --- api | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/api b/api index 541bc706fb..b4a8c81f86 100755 --- a/api +++ b/api @@ -706,18 +706,14 @@ debian_ppa_installer() { #setup a PPA on a Debian distro. Arguments: ppa_name di adoptium_installer() { status "Adding Adoptium repository:" - echo "- public key -> keyring" - rm -f /tmp/adoptium-public-key /tmp/adoptium-archive-keyring.gpg - wget -O /tmp/adoptium-public-key https://adoptium.jfrog.io/artifactory/api/security/keypair/default-gpg-key/public - gpg --no-default-keyring --keyring /tmp/adoptium-keyring.gpg --import /tmp/adoptium-public-key + echo "- downloading public key" rm -f /tmp/adoptium-public-key + wget -O /tmp/adoptium-public-key https://adoptium.jfrog.io/artifactory/api/security/keypair/default-gpg-key/public || error "Failed to download adoptium public key" - echo " - keyring -> GPG key" - gpg --no-default-keyring --keyring /tmp/adoptium-keyring.gpg --export --output /tmp/adoptium-archive-keyring.gpg - rm -f /tmp/adoptium-keyring.gpg - - echo " - Moving GPG key to /usr/share/keyrings" - sudo mv -f /tmp/adoptium-archive-keyring.gpg /usr/share/keyrings + echo " - storing binary format public key in /usr/share/keyrings" + # the dearmor command converts arbitrary input (OpenPGP ASCII armor or binary format) into binary format + cat /tmp/adoptium-public-key | gpg --dearmor | sudo tee /usr/share/keyrings/adoptium-archive-keyring.gpg >/dev/null + rm -f /tmp/adoptium-public-key echo " - Creating /etc/apt/sources.list.d/adoptium.list" case "$__os_codename" in