summaryrefslogtreecommitdiff
path: root/test/integration/test-apt-progress-fd-conffile
blob: 0b42b1b2fc4016792735c0cfd2427556e9785199 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/sh
set -e

TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework

setupenvironment
configarchitecture 'native'

# old conffile
setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable'
BUILDDIR='incoming/compiz-core-1.0'
mkdir -p ${BUILDDIR}/debian/compiz-core/etc
echo 'foo=bar;' > ${BUILDDIR}/compiz.conf
echo 'compiz.conf	/etc/compiz.conf' >> ${BUILDDIR}/debian/install
buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
rm -rf "$BUILDDIR"

# new conffile
setupsimplenativepackage 'compiz-core' 'native' '2.0' 'unstable'
BUILDDIR='incoming/compiz-core-2.0'
mkdir -p ${BUILDDIR}/debian/compiz-core/etc
echo 'foo2=bar2;' > ${BUILDDIR}/compiz.conf
echo 'compiz.conf	/etc/compiz.conf' >> ${BUILDDIR}/debian/install
buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
rm -rf "$BUILDDIR"

setupaptarchive

testsuccess aptget install compiz-core=1.0

# fake conffile change
echo "meep" >> rootdir/etc/compiz.conf/compiz.conf

# install
exec 3> apt-progress.log
echo n | aptget install compiz-core=2.0  -o APT::Status-Fd=3 -o Dpkg::Use-Pty=false

# and ensure there is a conffile message in the file
msgtest "Conffile prompt in apt-progress.log"
grep -q "pmconffile:/etc/compiz.conf/compiz.conf" apt-progress.log && msgpass || (cat apt-progress.log && msgfail)

cat apt-progress.log