gnupg: Avoid linking with libbz2
[termux-packages] / packages / apt / apt-key.patch
CommitLineData
59f0d218
FF
1diff -u -r ../upstream.git/cmdline/apt-key.in ./cmdline/apt-key.in
2--- ../upstream.git/cmdline/apt-key.in 2014-04-25 13:39:00.000000000 +0200
3+++ ./cmdline/apt-key.in 2014-06-03 11:55:07.623749140 +0200
4@@ -40,10 +40,7 @@
5 TMP_KEYRING=${APT_DIR}/var/lib/apt/keyrings/maybe-import-keyring.gpg
6
7 requires_root() {
8- if [ "$(id -u)" -ne 0 ]; then
9- echo >&1 "ERROR: This command can only be used by root."
10- exit 1
11- fi
12+ # We do not require root
13 }
14
15 # gpg defaults to mode 0600 for new keyrings. Create one with 0644 instead.
16@@ -216,11 +213,11 @@
17 remove_key_from_keyring "$FORCED_KEYRING" "$1"
18 else
19 # otherwise all known keyrings are up for inspection
20- local TRUSTEDFILE="/etc/apt/trusted.gpg"
21+ local TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg"
22 eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
23 eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
24 remove_key_from_keyring "$TRUSTEDFILE" "$1"
25- TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
26+ TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d"
27 eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
28 if [ -d "$TRUSTEDPARTS" ]; then
29 for trusted in $(run-parts --list "$TRUSTEDPARTS" --regex '^.*\.gpg$'); do
30@@ -278,14 +275,14 @@
31 done
32
33 if [ -z "$TRUSTEDFILE" ]; then
34- TRUSTEDFILE="/etc/apt/trusted.gpg"
35+ TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg"
36 eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
37 eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
38 if [ -r "$TRUSTEDFILE" ]; then
39 GPG="$GPG --keyring $TRUSTEDFILE"
40 fi
41 GPG="$GPG --primary-keyring $TRUSTEDFILE"
42- TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
43+ TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d"
44 eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
45 if [ -d "$TRUSTEDPARTS" ]; then
46 # strip / suffix as gpg will double-slash in that case (#665411)