Skip to content

Commit 81e16f3

Browse files
committed
refact: use gpg file in sources
1 parent 90032da commit 81e16f3

1 file changed

Lines changed: 17 additions & 27 deletions

File tree

install_deps.sh

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,29 @@ if [[ $(apt-cache search --names-only 'libfido2-dev' | wc -l) -gt 0 ]]; then
4242
apt install -y libfido2-dev libcbor-dev
4343
fi
4444

45-
# The following parameters are used for installing Debian distribution packages
46-
# on Ubuntu systems or old Debian systems.
47-
# *ONLY* used at:
48-
# Ubuntu series: jammy & bionic
49-
# Debian series: bullseye & bookworm
50-
DEBIAN_SOURCE="http://deb.debian.org/debian/"
51-
OPENPGP_SERVER="keyserver.ubuntu.com"
52-
53-
if [[ -n "${APT_MIRROR:-}" ]]; then
54-
DEBIAN_SOURCE="http://${APT_MIRROR}/debian/"
55-
fi
56-
if [[ -n "${PGP_SERVER:-}" ]]; then
57-
OPENPGP_SERVER="${PGP_SERVER}"
58-
fi
5945

46+
# install the latest debhelper from debian sid by adding debian sources
6047
_DEBIAN_SID_DEBHELPER() {
61-
# install the latest debhelper from debian sid by adding debian sources
62-
apt install -y gnupg
63-
echo "deb $DEBIAN_SOURCE sid main" >> /etc/apt/sources.list
64-
# Allow apt update to fail in order to capture missing keys
65-
KEYS=$(apt update 2>&1 | grep -o 'NO_PUBKEY [A-F0-9]\+' | sed 's/NO_PUBKEY //' | sort | uniq || true)
66-
for KEY in ${KEYS}; do
67-
apt-key adv --keyserver "${OPENPGP_SERVER}" --recv-keys "${KEY}"
68-
done
48+
DEBIAN_SOURCE="http://deb.debian.org/debian/"
49+
[[ -n "${APT_MIRROR:-}" ]] && \
50+
DEBIAN_SOURCE="http://${APT_MIRROR}/debian/"
51+
52+
# Download Debian sid GPG key
53+
wget -O /usr/share/keyrings/debian-sid.gpg https://deb.debian.org/debian/dists/sid/Release.gpg
54+
55+
# Add Debian sid source with the GPG key
56+
echo "deb [signed-by=/usr/share/keyrings/debian-sid.gpg] $DEBIAN_SOURCE sid main" > /etc/apt/sources.list.d/debian-sid.list
57+
6958
apt update
7059
apt install -y debhelper
60+
rm /etc/apt/sources.list.d/debian-sid.list
7161
}
7262

7363
CODE_NAME=$(lsb_release -sc)
7464

75-
if [ "${CODE_NAME}" != "focal" ]; then
76-
apt install -y dh-virtualenv
77-
fi
65+
# if [ "${CODE_NAME}" != "focal" ]; then
66+
# apt install -y dh-virtualenv
67+
# fi
7868

7969
__coreutils_ver="$(dpkg-query -f '${Version}' -W coreutils || true)"
8070
[[ -z $__coreutils_ver ]] && __coreutils_ver="0.0.0"
@@ -89,10 +79,10 @@ fi
8979
case ${CODE_NAME} in
9080
# dists with coreutils >= 9.5 can use the latest debhelper from debian sid
9181
trixie)
92-
_DEBIAN_SID_DEBHELPER
82+
# _DEBIAN_SID_DEBHELPER
9383
;;
9484
plucky|questing|resolute)
95-
_DEBIAN_SID_DEBHELPER
85+
# _DEBIAN_SID_DEBHELPER
9686
;;
9787
*)
9888
echo "$CODE_NAME does NOT NEED to add Debian sources."

0 commit comments

Comments
 (0)