You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

108 lines
3.9 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386'
  7. buildsimplenativepackage 'unrelated' 'all' '1' 'unstable'
  8. buildsimplenativepackage 'po-debconf' 'all' '1.0.16' 'unstable'
  9. buildsimplenativepackage 'debhelper' 'all' '8.0.0' 'unstable' 'Depends: po-debconf'
  10. setupaptarchive
  11. testsuccess aptget install unrelated debhelper -y
  12. testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
  13. testmarkedauto 'po-debconf'
  14. testsuccess aptget remove debhelper -y
  15. testdpkgnotinstalled 'debhelper'
  16. testdpkginstalled 'po-debconf' 'unrelated'
  17. AUTOREMOVE='apt autoremove'
  18. if [ -n "$SUDO_USER" ]; then
  19. AUTOREMOVE="sudo $AUTOREMOVE"
  20. fi
  21. echo 'APT::NeverAutoRemove { "^debc.*nf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
  22. testsuccessequal 'Reading package lists...
  23. Building dependency tree...
  24. Reading state information...
  25. The following packages will be REMOVED:
  26. po-debconf
  27. 0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
  28. Remv po-debconf [1.0.16]' aptget autoremove -s
  29. testequal "Reading package lists...
  30. Building dependency tree...
  31. Reading state information...
  32. The following package was automatically installed and is no longer required:
  33. po-debconf
  34. Use '$AUTOREMOVE' to remove it.
  35. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
  36. testequal "Reading package lists...
  37. Building dependency tree...
  38. Reading state information...
  39. 1 package was automatically installed and is no longer required.
  40. Use '$AUTOREMOVE' to remove it.
  41. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
  42. testdpkginstalled 'po-debconf'
  43. echo 'APT::NeverAutoRemove { "^po-debconf$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
  44. testsuccess aptget autoremove -y
  45. testdpkginstalled 'po-debconf'
  46. echo 'APT::NeverAutoRemove { "^po-.*$"; };' > rootdir/etc/apt/apt.conf.d/00autoremove
  47. testsuccess aptget autoremove -y
  48. testdpkginstalled "po-debconf"
  49. rm rootdir/etc/apt/apt.conf.d/00autoremove
  50. testsuccess aptget autoremove -y
  51. testdpkgnotinstalled 'po-debconf'
  52. testmarkedauto
  53. sed rootdir/var/log/apt/history.log -e '/^Commandline: / d' -e '/^Start-Date: / d' -e '/^End-Date: / d' -e 's#), #)\nInstall: #g' | sort -u > apt-history.log
  54. testfileequal 'apt-history.log' '
  55. Install: debhelper:i386 (8.0.0)
  56. Install: po-debconf:i386 (1.0.16, automatic)
  57. Install: unrelated:i386 (1)
  58. Remove: debhelper:i386 (8.0.0)
  59. Remove: po-debconf:i386 (1.0.16)'
  60. testsuccess aptget install debhelper -y
  61. testdpkginstalled 'unrelated' 'debhelper' 'po-debconf'
  62. testsuccess aptmark auto debhelper
  63. testmarkedauto 'debhelper' 'po-debconf'
  64. testsuccessequal 'Reading package lists...
  65. Building dependency tree...
  66. Reading state information...
  67. The following packages will be REMOVED:
  68. debhelper po-debconf
  69. 0 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
  70. Remv debhelper [8.0.0]
  71. Remv po-debconf [1.0.16]' aptget autoremove -s
  72. testequal "Reading package lists...
  73. Building dependency tree...
  74. Reading state information...
  75. The following packages were automatically installed and are no longer required:
  76. debhelper po-debconf
  77. Use '$AUTOREMOVE' to remove them.
  78. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s
  79. testequal "Reading package lists...
  80. Building dependency tree...
  81. Reading state information...
  82. 2 packages were automatically installed and are no longer required.
  83. Use '$AUTOREMOVE' to remove them.
  84. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." aptget install -s -o APT::Get::HideAutoRemove=small
  85. testsuccess aptmark hold debhelper
  86. testsuccessequal 'Reading package lists...
  87. Building dependency tree...
  88. Reading state information...
  89. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget autoremove -s
  90. testsuccess aptget autoremove debhelper -y --allow-change-held-packages
  91. testdpkgnotinstalled 'po-debconf' 'debhelper'
  92. testmarkedauto
  93. testsuccess aptget install debhelper --solver apt -y -o Debug::pkgDepCache::Marker=1
  94. testmarkedauto 'po-debconf'