termux-packages/packages/apt/cmdline-apt-key.in.patch

44 lines
1.4 KiB
Diff
Raw Normal View History

2017-09-17 20:51:20 +02:00
diff -u -r ../apt-1.4.7/cmdline/apt-key.in ./cmdline/apt-key.in
--- ../apt-1.4.7/cmdline/apt-key.in 2017-07-13 23:45:39.000000000 +0200
+++ ./cmdline/apt-key.in 2017-07-26 12:18:17.424086422 +0200
@@ -16,10 +16,7 @@
2015-12-04 02:00:19 +01:00
aptkey_echo() { echo "$@"; }
requires_root() {
- if [ "$(id -u)" -ne 0 ]; then
2017-09-17 20:51:20 +02:00
- apt_error "This command can only be used by root."
2015-12-04 02:00:19 +01:00
- exit 1
- fi
2017-09-17 20:51:20 +02:00
+continue
2015-12-04 02:00:19 +01:00
}
command_available() {
2017-09-17 20:51:20 +02:00
@@ -260,7 +257,7 @@
if accessible_file_exists "$TRUSTEDFILE"; then
2015-12-04 02:00:19 +01:00
$ACTION "$TRUSTEDFILE" "$@"
fi
- local TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
+ local TRUSTEDPARTS="@TERMUX_PREFIX@/etc/apt/trusted.gpg.d"
eval "$(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)"
2015-12-04 02:00:19 +01:00
if [ -d "$TRUSTEDPARTS" ]; then
2017-09-17 20:51:20 +02:00
TRUSTEDPARTS="$(readlink -f "$TRUSTEDPARTS")"
@@ -542,7 +539,7 @@
2015-12-04 02:00:19 +01:00
done
if [ -z "$TRUSTEDFILE" ]; then
- TRUSTEDFILE="/etc/apt/trusted.gpg"
+ TRUSTEDFILE="@TERMUX_PREFIX@/etc/apt/trusted.gpg"
eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
fi
2017-09-17 20:51:20 +02:00
@@ -612,7 +609,8 @@
unset TMPDIR
fi
fi
- GPGHOMEDIR="$(mktemp --directory --tmpdir 'apt-key-gpghome.XXXXXXXXXX')"
+ # Use short options as busybox mktemp does not support long ones:
+ GPGHOMEDIR="$(mktemp -d -t 'apt-key-gpghome.XXXXXXXXXX')"
CURRENTTRAP="${CURRENTTRAP} cleanup_gpg_home;"
trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
if [ -z "$GPGHOMEDIR" ]; then