add ssh to the apt transports (#851)
[termux-packages] / packages / apt / cmdline-apt-key.in.patch
CommitLineData
54cb74f9
FF
1diff -u -r ../apt-1.1.6/cmdline/apt-key.in ./cmdline/apt-key.in
2--- ../apt-1.1.6/cmdline/apt-key.in 2015-12-24 11:14:15.000000000 -0500
3+++ ./cmdline/apt-key.in 2015-12-25 17:58:37.186396718 -0500
4@@ -16,10 +16,7 @@
68faa04f
FF
5 aptkey_echo() { echo "$@"; }
6
7 requires_root() {
8- if [ "$(id -u)" -ne 0 ]; then
9- echo >&2 "ERROR: This command can only be used by root."
10- exit 1
11- fi
12+ continue
13 }
14
54cb74f9
FF
15 command_available() {
16@@ -231,7 +228,7 @@
68faa04f
FF
17 if [ -s "$TRUSTEDFILE" ]; then
18 $ACTION "$TRUSTEDFILE" "$@"
19 fi
20- local TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
21+ local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d"
54cb74f9 22 eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)"
68faa04f
FF
23 if [ -d "$TRUSTEDPARTS" ]; then
24 # strip / suffix as gpg will double-slash in that case (#665411)
54cb74f9 25@@ -301,11 +298,11 @@
d18c472a
FF
26 # if a --keyring was given, just use this one
27 if [ -n "$FORCED_KEYRING" ]; then
28 if [ -s "$FORCED_KEYRING" ]; then
29- cp --dereference "$FORCED_KEYRING" "$PUBRING"
30+ cp "$FORCED_KEYRING" "$PUBRING"
68faa04f
FF
31 fi
32 else
33 # otherwise all known keyrings are merged
34- local TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
35+ local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d"
36 eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
37 if [ -d "$TRUSTEDPARTS" ]; then
38 # ignore errors mostly for non-existing $TRUSTEDFILE
54cb74f9 39@@ -316,7 +313,7 @@
d18c472a
FF
40 done
41 } > "$PUBRING" 2>/dev/null
42 elif [ -s "$TRUSTEDFILE" ]; then
43- cp --dereference "$TRUSTEDFILE" "$PUBRING"
44+ cp "$TRUSTEDFILE" "$PUBRING"
45 fi
46 fi
47
54cb74f9 48@@ -460,7 +457,7 @@
68faa04f
FF
49 done
50
51 if [ -z "$TRUSTEDFILE" ]; then
52- TRUSTEDFILE="/etc/apt/trusted.gpg"
53+ TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg"
54 eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
55 eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
56 fi