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.

test-apt-never-markauto-sections 3.4 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. aptconfig dump --no-empty --format '%v%n' APT::Never-MarkAuto-Sections > nevermarkauto.sections
  8. testsuccess grep '^metapackages$' nevermarkauto.sections
  9. buildsimplenativepackage 'mydesktop' 'all' '1' 'unstable' 'Depends: mydesktop-core, foreignpkg
  10. Recommends: notavailable' '' 'metapackages'
  11. buildsimplenativepackage 'mydesktop-core' 'amd64' '1' 'unstable' 'Depends: bad-texteditor | texteditor, browser (>= 42), nosection, foreignpkg
  12. Recommends: notavailable
  13. Multi-Arch: foreign' '' 'metapackages'
  14. buildsimplenativepackage 'browser' 'amd64' '41' 'stable'
  15. buildsimplenativepackage 'browser' 'amd64' '42' 'unstable'
  16. buildsimplenativepackage 'texteditor' 'amd64' '1' 'stable'
  17. buildsimplenativepackage 'bad-texteditor' 'amd64' '1' 'stable' 'Depends: texteditor
  18. Conflicts: mydesktop-core'
  19. buildsimplenativepackage 'nosection' 'amd64' '1' 'stable' '' '' '<none>'
  20. buildsimplenativepackage 'foreignpkg' 'i386' '1' 'stable' 'Multi-Arch: foreign'
  21. setupaptarchive
  22. testsuccess aptcache show nosection
  23. testfailure grep 'Section' rootdir/tmp/testsuccess.output
  24. testequal 'dpkg' aptmark showmanual
  25. testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
  26. testmarkedmanual 'dpkg' 'mydesktop'
  27. testmarkedauto 'mydesktop-core' 'foreignpkg:i386' 'texteditor' 'browser' 'nosection'
  28. # if the remove is from a user, don't do manual-bit passing
  29. testequal 'Reading package lists...
  30. Building dependency tree...
  31. Reading state information...
  32. The following packages will be REMOVED:
  33. browser foreignpkg:i386 mydesktop mydesktop-core nosection texteditor
  34. 0 upgraded, 0 newly installed, 6 to remove and 0 not upgraded.
  35. Remv mydesktop [1]
  36. Remv mydesktop-core [1]
  37. Remv browser [42]
  38. Remv foreignpkg:i386 [1]
  39. Remv nosection [1]
  40. Remv texteditor [1]' aptget autoremove mydesktop -s
  41. testequal 'Reading package lists...
  42. Building dependency tree...
  43. Reading state information...
  44. The following packages will be REMOVED:
  45. mydesktop mydesktop-core texteditor
  46. 0 upgraded, 0 newly installed, 3 to remove and 0 not upgraded.
  47. Remv mydesktop [1]
  48. Remv mydesktop-core [1]
  49. Remv texteditor [1]' aptget autoremove texteditor -s #-o Debug::pkgDepCache::AutoInstall=1 -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1
  50. testsuccess aptget autoremove texteditor -y
  51. testdpkgnotinstalled mydesktop mydesktop-core texteditor
  52. testdpkginstalled browser
  53. testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection'
  54. testmarkedauto
  55. # test that installed/upgraded auto-pkgs are not set to manual
  56. testsuccess aptget install browser=41 -y --allow-downgrades
  57. testmarkedmanual 'browser' 'dpkg' 'foreignpkg:i386' 'nosection'
  58. testmarkedauto
  59. testsuccess aptmark auto browser
  60. testmarkedauto 'browser'
  61. testsuccess aptmark auto nosection
  62. testmarkedauto 'browser' 'nosection'
  63. testmarkedmanual 'dpkg' 'foreignpkg:i386'
  64. # nosection should be auto, not manual, but is marked as such by the resolver
  65. # removing mydesktop-core temporally… the resolver should be figuring out here
  66. # that there is no point of removing mydesktop-core as its an unavoidable
  67. # dependency of the user-requested mydesktop
  68. testsuccess aptget install mydesktop -y -o Debug::pkgProblemResolver=1 -o Debug::pkgDepCache::Marker=1 -o Debug::pkgDepCache::AutoInstall=1
  69. testmarkedmanual 'dpkg' 'foreignpkg:i386' 'mydesktop' 'nosection'
  70. testmarkedauto 'browser' 'mydesktop-core' 'texteditor'