test-apt-progress-fd-conffile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. set -e
  3. TESTDIR=$(readlink -f $(dirname $0))
  4. . $TESTDIR/framework
  5. setupenvironment
  6. configarchitecture 'native'
  7. # old conffile
  8. setupsimplenativepackage 'compiz-core' 'native' '1.0' 'unstable'
  9. BUILDDIR='incoming/compiz-core-1.0'
  10. mkdir -p ${BUILDDIR}/debian/compiz-core/etc
  11. echo 'foo=bar;' > ${BUILDDIR}/compiz.conf
  12. echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install
  13. buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
  14. rm -rf "$BUILDDIR"
  15. # new conffile
  16. setupsimplenativepackage 'compiz-core' 'native' '2.0' 'unstable'
  17. BUILDDIR='incoming/compiz-core-2.0'
  18. mkdir -p ${BUILDDIR}/debian/compiz-core/etc
  19. echo 'foo2=bar2;' > ${BUILDDIR}/compiz.conf
  20. echo 'compiz.conf /etc/compiz.conf' >> ${BUILDDIR}/debian/install
  21. buildpackage "$BUILDDIR" 'unstable' 'main' 'native'
  22. rm -rf "$BUILDDIR"
  23. setupaptarchive
  24. testsuccess aptget install compiz-core=1.0
  25. # fake conffile change
  26. echo "meep" >> rootdir/etc/compiz.conf/compiz.conf
  27. # install
  28. exec 3> apt-progress.log
  29. echo n | aptget install compiz-core=2.0 -o APT::Status-Fd=3 -o Dpkg::Use-Pty=false
  30. # and ensure there is a conffile message in the file
  31. msgtest "Conffile prompt in apt-progress.log"
  32. grep -q "pmconffile:/etc/compiz.conf/compiz.conf" apt-progress.log && msgpass || (cat apt-progress.log && msgfail)
  33. cat apt-progress.log