X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/63c7141275c8c5c0f6e60f5242785e50cabaf2a0..e9185eca390435b4060ef26c7c69d39f994da7a7:/test/integration/test-kernel-helper-autoremove diff --git a/test/integration/test-kernel-helper-autoremove b/test/integration/test-kernel-helper-autoremove index 5e9b9f59a..2e8da1c1e 100755 --- a/test/integration/test-kernel-helper-autoremove +++ b/test/integration/test-kernel-helper-autoremove @@ -1,8 +1,8 @@ #!/bin/sh set -e -TESTDIR=$(readlink -f $(dirname $0)) -. $TESTDIR/framework +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" setupenvironment configarchitecture 'amd64' @@ -53,6 +53,10 @@ testprotected() { testfailure --nomsg grep -e '^\^linux-image-amd64\$$' -e '^\^linux-image-686-pae\$$' -e ':i386' protected.list } +AUTOREMOVE='apt autoremove' +if [ -n "$SUDO_USER" ]; then + AUTOREMOVE="sudo $AUTOREMOVE" +fi testsuccessequal "Reading package lists... Building dependency tree... Reading state information... @@ -63,7 +67,7 @@ The following packages were automatically installed and are no longer required: $CURRENTKERNEL (5-1) ${CURRENTKERNEL}-686-pae:i386 (5-1) ${CURRENTKERNEL}-dbg (5-1) -Use 'apt-get autoremove' to remove them. +Use '$AUTOREMOVE' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV testsuccessequal "Reading package lists... Building dependency tree... @@ -76,13 +80,13 @@ The following packages were automatically installed and are no longer required: ${CURRENTKERNEL}-686-pae:i386 (5-1) ${CURRENTKERNEL}-dbg (5-1) ${CURRENTKERNEL}-rt (5-1) -Use 'apt-get autoremove' to remove them. +Use '$AUTOREMOVE' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -sV --ignore-hold testequal "Reading package lists... Building dependency tree... Reading state information... 6 packages were automatically installed and are no longer required. -Use 'apt-get autoremove' to remove them. +Use '$AUTOREMOVE' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small testequal "Reading package lists... Building dependency tree...