]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-get-autoremove
add changelog
[apt.git] / test / integration / test-apt-get-autoremove
CommitLineData
b093a199
DK
1#!/bin/sh
2set -e
3
9962ae93 4TESTDIR=$(readlink -f $(dirname $0))
b093a199
DK
5. $TESTDIR/framework
6setupenvironment
01a6e24c 7configarchitecture 'i386'
b093a199 8
01a6e24c
DK
9buildsimplenativepackage 'unrelated' 'all' '1' 'unstable'
10buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable'
11buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf'
b093a199
DK
12setupaptarchive
13
14aptget install unrelated debhelper -qq 2>&1 > /dev/null
01a6e24c 15testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
b093a199 16
ec7f904e 17testmarkedauto 'po-debconf'
b093a199 18aptget remove debhelper -y -qq 2>&1 > /dev/null
5cf733e1 19testdpkgnotinstalled 'debhelper'
87bc1c45 20testdpkginstalled 'po-debconf' 'unrelated'
01a6e24c
DK
21
22echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
23testequal 'Reading package lists...
24Building dependency tree...
25Reading state information...
26The following packages will be REMOVED:
27 po-debconf
280 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
29Remv po-debconf [1.0.16]' aptget autoremove -s
30testdpkginstalled 'po-debconf'
31
32echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
b093a199 33aptget autoremove -y -qq 2>&1 > /dev/null
01a6e24c 34testdpkginstalled 'po-debconf'
b093a199 35
01a6e24c
DK
36echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
37aptget autoremove -y -qq 2>&1 > /dev/null
38testdpkginstalled "po-debconf"
39
40rm rootdir/etc/apt/apt.conf.d/00autoremove
41aptget autoremove -y -qq 2>&1 > /dev/null
5cf733e1 42testdpkgnotinstalled 'po-debconf'
ec7f904e 43testmarkedauto
b093a199
DK
44
45sed -i rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d'
01a6e24c 46testfileequal 'rootdir/var/log/apt/history.log' '
b093a199
DK
47Install: unrelated:i386 (1), debhelper:i386 (8.0.0), po-debconf:i386 (1.0.16, automatic)
48
49Remove: debhelper:i386 (8.0.0)
50
51Remove: po-debconf:i386 (1.0.16)'