test-bug-675449-essential-are-protected 3.9 KB

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