replace no longer required /usr/lib/security-misc/apt-get-wrapper with apt-get --error-on=any

This commit is contained in:
Patrick Schleizer 2021-08-03 12:19:26 -04:00
parent 8eae635668
commit 240ec7672a
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48
3 changed files with 1 additions and 52 deletions

View File

@ -106,7 +106,6 @@ make %{?_smp_mflags}
/lib/systemd/system/remove-system-map.service /lib/systemd/system/remove-system-map.service
/usr/lib/security-misc/apt-get-update /usr/lib/security-misc/apt-get-update
/usr/lib/security-misc/apt-get-update-sanity-test /usr/lib/security-misc/apt-get-update-sanity-test
/usr/lib/security-misc/apt-get-wrapper
/usr/lib/security-misc/panic-on-oops /usr/lib/security-misc/panic-on-oops
/usr/lib/security-misc/remove-system.map /usr/lib/security-misc/remove-system.map
/usr/share/glib-2.0/schemas/30_security-misc.gschema.override /usr/share/glib-2.0/schemas/30_security-misc.gschema.override

View File

@ -24,7 +24,7 @@ trap "sigterm_trap" SIGTERM SIGINT
timeout \ timeout \
--kill-after="$kill_after" \ --kill-after="$kill_after" \
"$timeout_after" \ "$timeout_after" \
/usr/lib/security-misc/apt-get-wrapper update "$@" & apt-get update --error-on=any "$@" &
lastpid="$!" lastpid="$!"
wait "$lastpid" wait "$lastpid"

View File

@ -1,50 +0,0 @@
#!/bin/bash
## Copyright (C) 2012 - 2021 ENCRYPTED SUPPORT LP <adrelanos@whonix.org>
## See the file COPYING for copying conditions.
set -e
set -o pipefail
set -o errtrace
cleanup() {
if [ -d "$temp_dir" ]; then
rm --recursive --force "$temp_dir"
fi
}
temp_dir="$(mktemp --directory)"
logfile="$temp_dir/log"
trap "cleanup" EXIT
apt_get_exit_code="0"
## Thanks to:
## dmw
## http://stackoverflow.com/a/26263980/2605155
## for the python way to create a pty.
python3.9 -c 'import pty, sys; pty.spawn(sys.argv[1:])' \
| apt-get "$@" 2>&1 \
| tee -a "$logfile" \
|| { apt_get_exit_code="$?"; true; };
if [ ! "$apt_get_exit_code" = "0" ]; then
exit "$apt_get_exit_code"
fi
log="$(cat "$logfile")"
while read -r -d $'\n' line; do
line_lower_case="${line,,}"
first_two="${line_lower_case:0:2}"
if [ "$first_two" = "e:" ]; then
exit 125
fi
if [ "$first_two" = "w:" ]; then
exit 125
fi
done < <( echo "$log" )
exit "$apt_get_exit_code"