diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:18:38 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-14 19:18:38 +0000 |
commit | b81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4 (patch) | |
tree | bf5624f8edc149dca9d78bfa8bcbf2d493c8b128 /test/integration/test-apt-get-autoremove | |
parent | Adding upstream version 2.9.2. (diff) | |
download | apt-b81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4.tar.xz apt-b81238fa02b2348f3fbb90e4d5e54a3ad8d78ac4.zip |
Adding upstream version 2.9.3.upstream/2.9.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/test-apt-get-autoremove')
-rwxr-xr-x | test/integration/test-apt-get-autoremove | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/test/integration/test-apt-get-autoremove b/test/integration/test-apt-get-autoremove index 66257f4..9454df5 100755 --- a/test/integration/test-apt-get-autoremove +++ b/test/integration/test-apt-get-autoremove @@ -27,10 +27,6 @@ testdpkginstalled 'po-debconf' 'unrelated' echo 'unrelated purge' | dpkg --set-selections testdpkgstatus 'pi' '1' 'unrelated' -AUTOREMOVE='apt autoremove' -if [ -n "$SUDO_USER" ]; then - AUTOREMOVE="sudo $AUTOREMOVE" -fi echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove testsuccessequal 'Reading package lists... Building dependency tree... @@ -39,20 +35,28 @@ The following packages will be REMOVED: po-debconf 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded. Remv po-debconf [1.0.16]' aptget autoremove -s -testequal "Reading package lists... +for sudouser in '_apt' ''; do + if [ -n "$sudouser" ]; then + export SUDO_USER="$sudouser" + AUTOREMOVE='sudo apt autoremove' + else + unset SUDO_USER + AUTOREMOVE='apt autoremove' + fi + testequal "Reading package lists... Building dependency tree... Reading state information... The following package was automatically installed and is no longer required: po-debconf Use '$AUTOREMOVE' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -testequal "Reading package lists... + testequal "Reading package lists... Building dependency tree... Reading state information... 1 package was automatically installed and is no longer required. Use '$AUTOREMOVE' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small -testequal "Reading package lists... + testequal "Reading package lists... Building dependency tree... Reading state information... Calculating upgrade... @@ -60,6 +64,8 @@ The following package was automatically installed and is no longer required: po-debconf Use '$AUTOREMOVE' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget upgrade -s +done + testsuccessequal 'Reading package lists... Building dependency tree... Reading state information... @@ -111,7 +117,7 @@ Reading state information... Calculating upgrade... The following package was automatically installed and is no longer required: po-debconf -Use '$AUTOREMOVE' to remove it. +Use 'apt autoremove' to remove it. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget upgrade -s rm -f rootdir/etc/apt/apt.conf.d/autoremoval @@ -163,13 +169,13 @@ Building dependency tree... Reading state information... The following packages were automatically installed and are no longer required: debhelper po-debconf -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s testequal "Reading package lists... Building dependency tree... Reading state information... 2 packages were automatically installed and are no longer required. -Use '$AUTOREMOVE' to remove them. +Use 'apt autoremove' to remove them. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small testsuccess aptmark hold debhelper |