test-bug-767891-force-essential-important 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64' 'i386'
  7. insertinstalledpackage 'apt' 'amd64' '1'
  8. insertinstalledpackage 'foo' 'amd64,i386' '1' 'Multi-Arch: same'
  9. insertinstalledpackage 'bar' 'amd64' '1' 'Provides: foo'
  10. insertpackage 'unstable' 'foo2' 'amd64,i386' '1' 'Multi-Arch: same'
  11. setupaptarchive
  12. rm -f rootdir/var/cache/apt/*.bin
  13. testsuccessequal 'Reading package lists...
  14. Building dependency tree...
  15. The following packages will be REMOVED:
  16. apt* bar* foo* foo:i386*
  17. WARNING: The following essential packages will be removed.
  18. This should NOT be done unless you know exactly what you are doing!
  19. apt
  20. 0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
  21. Purg apt [1]
  22. Purg bar [1]
  23. Purg foo [1]
  24. Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s
  25. rm -f rootdir/var/cache/apt/*.bin
  26. testsuccessequal 'Reading package lists...
  27. Building dependency tree...
  28. The following packages will be REMOVED:
  29. apt* bar* foo* foo:i386*
  30. 0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
  31. Purg apt [1]
  32. Purg bar [1]
  33. Purg foo [1]
  34. Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential=''
  35. msgmsg 'foo:i386 got the Important flag'
  36. rm -f rootdir/var/cache/apt/*.bin
  37. testsuccessequal 'Reading package lists...
  38. Building dependency tree...
  39. The following packages will be REMOVED:
  40. apt* bar* foo* foo:i386*
  41. WARNING: The following essential packages will be removed.
  42. This should NOT be done unless you know exactly what you are doing!
  43. foo foo:i386
  44. 0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
  45. Purg apt [1]
  46. Purg bar [1]
  47. Purg foo [1]
  48. Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential='foo'
  49. rm -f rootdir/var/cache/apt/*.bin
  50. testsuccessequal 'Reading package lists...
  51. Building dependency tree...
  52. The following packages will be REMOVED:
  53. apt* bar* foo* foo:i386*
  54. WARNING: The following essential packages will be removed.
  55. This should NOT be done unless you know exactly what you are doing!
  56. apt foo foo:i386
  57. 0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
  58. Purg apt [1]
  59. Purg bar [1]
  60. Purg foo [1]
  61. Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceEssential::='foo'
  62. msgmsg 'essentials only from native'
  63. rm -f rootdir/var/cache/apt/*.bin
  64. testsuccessequal 'Reading package lists...
  65. Building dependency tree...
  66. Calculating upgrade...
  67. The following NEW packages will be installed:
  68. foo2
  69. 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
  70. Inst foo2 (1 unstable [amd64])
  71. Conf foo2 (1 unstable [amd64])' apt full-upgrade -s -o pkgCacheGen::ForceEssential::='foo2'
  72. msgmsg 'important only effects installed'
  73. rm -f rootdir/var/cache/apt/*.bin
  74. testsuccessequal 'Reading package lists...
  75. Building dependency tree...
  76. The following packages will be REMOVED:
  77. apt* bar* foo* foo:i386*
  78. WARNING: The following essential packages will be removed.
  79. This should NOT be done unless you know exactly what you are doing!
  80. apt foo foo:i386
  81. 0 upgraded, 0 newly installed, 4 to remove and 0 not upgraded.
  82. Purg apt [1]
  83. Purg bar [1]
  84. Purg foo [1]
  85. Purg foo:i386 [1]' apt purge apt foo foo:i386 bar -s -o pkgCacheGen::ForceImportant::='foo'
  86. rm -f rootdir/var/cache/apt/*.bin
  87. testsuccessequal 'Reading package lists...
  88. Building dependency tree...
  89. Calculating upgrade...
  90. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' apt full-upgrade -s -o pkgCacheGen::ForceImportant::='foo2'