From 240ec7672a4d513e7e6cca280aca3d67c265d1cc Mon Sep 17 00:00:00 2001 From: Patrick Schleizer Date: Tue, 3 Aug 2021 12:19:26 -0400 Subject: [PATCH] replace no longer required `/usr/lib/security-misc/apt-get-wrapper` with `apt-get --error-on=any` --- rpm_spec/security-misc.spec.in | 1 - usr/lib/security-misc/apt-get-update | 2 +- usr/lib/security-misc/apt-get-wrapper | 50 --------------------------- 3 files changed, 1 insertion(+), 52 deletions(-) delete mode 100755 usr/lib/security-misc/apt-get-wrapper diff --git a/rpm_spec/security-misc.spec.in b/rpm_spec/security-misc.spec.in index a2cfca6..63b6b91 100644 --- a/rpm_spec/security-misc.spec.in +++ b/rpm_spec/security-misc.spec.in @@ -106,7 +106,6 @@ make %{?_smp_mflags} /lib/systemd/system/remove-system-map.service /usr/lib/security-misc/apt-get-update /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/remove-system.map /usr/share/glib-2.0/schemas/30_security-misc.gschema.override diff --git a/usr/lib/security-misc/apt-get-update b/usr/lib/security-misc/apt-get-update index a61f760..ff58900 100755 --- a/usr/lib/security-misc/apt-get-update +++ b/usr/lib/security-misc/apt-get-update @@ -24,7 +24,7 @@ trap "sigterm_trap" SIGTERM SIGINT timeout \ --kill-after="$kill_after" \ "$timeout_after" \ - /usr/lib/security-misc/apt-get-wrapper update "$@" & + apt-get update --error-on=any "$@" & lastpid="$!" wait "$lastpid" diff --git a/usr/lib/security-misc/apt-get-wrapper b/usr/lib/security-misc/apt-get-wrapper deleted file mode 100755 index 81a2381..0000000 --- a/usr/lib/security-misc/apt-get-wrapper +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/bash - -## Copyright (C) 2012 - 2021 ENCRYPTED SUPPORT LP -## 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"