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.
 
 
 
 
 
 

180 lines
6.8 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'amd64'
  7. insertpackage 'unversioned' 'libdb-dev' 'amd64' '5.3.0' 'Depends: libdb5.3-dev
  8. Conflicts: libdb5.1-dev'
  9. insertpackage 'unversioned' 'libdb5.1-dev' 'amd64' '5.1.29-7'
  10. insertpackage 'unversioned' 'libdb5.3-dev' 'amd64' '5.3.28-3' 'Conflicts: libdb5.1-dev'
  11. insertpackage 'unversioned' 'foo' 'amd64' '1'
  12. insertpackage 'unversioned' 'bar' 'amd64' '1'
  13. insertpackage 'unversioned' 'foo' 'amd64' '2' 'Conflicts: bar'
  14. insertpackage 'unversioned' 'bar' 'amd64' '2' 'Conflicts: foo'
  15. insertpackage 'unversioned' 'baz' 'amd64' '2' 'Depends: bar | foo'
  16. insertpackage 'versioned' 'libdb-dev' 'amd64' '5.3.0' 'Depends: libdb5.3-dev
  17. Conflicts: libdb5.1-dev (<< 5.2)'
  18. insertpackage 'versioned' 'libdb5.3-dev' 'amd64' '5.3.28-3' 'Conflicts: libdb5.1-dev (<< 5.2)'
  19. insertpackage 'versioned' 'foo' 'amd64' '2' 'Conflicts: bar (<= 2)'
  20. insertpackage 'versioned' 'bar' 'amd64' '2' 'Conflicts: foo (<= 2)'
  21. insertpackage 'versioned' 'baz' 'amd64' '2' 'Depends: bar (>= 2) | foo (>= 2)'
  22. insertpackage 'multipleno' 'foo' 'amd64' '2.1' 'Conflicts: bar (<= 3)'
  23. insertpackage 'multipleno' 'bar' 'amd64' '2.1' 'Conflicts: foo (<= 3), foo (<= 1)'
  24. insertpackage 'multipleyes' 'foo' 'amd64' '2.2' 'Conflicts: bar (<= 3)'
  25. # having foo multiple times as conflict is a non-advisable hack in general
  26. insertpackage 'multipleyes' 'bar' 'amd64' '2.2' 'Conflicts: foo (<= 3), foo (<= 3)'
  27. #774924 - slightly simplified
  28. insertpackage 'jessie' 'login' 'amd64' '2' 'Pre-Depends: libaudit1 (>= 0)'
  29. insertpackage 'jessie' 'libaudit1' 'amd64' '2' 'Depends: libaudit-common (>= 0)'
  30. insertpackage 'jessie' 'libaudit-common' 'amd64' '2' 'Breaks: libaudit0, libaudit1 (<< 2)'
  31. cp rootdir/var/lib/dpkg/status rootdir/var/lib/dpkg/status-backup
  32. setupaptarchive
  33. insertinstalledpackage 'libdb-dev' 'amd64' '5.1.7' 'Depends: libdb5.1-dev'
  34. insertinstalledpackage 'libdb5.1-dev' 'amd64' '5.1.29-7'
  35. testsuccessequal 'Reading package lists...
  36. Building dependency tree...
  37. Calculating upgrade...
  38. The following packages will be REMOVED:
  39. libdb5.1-dev
  40. The following NEW packages will be installed:
  41. libdb5.3-dev
  42. The following packages will be upgraded:
  43. libdb-dev
  44. 1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  45. Remv libdb5.1-dev [5.1.29-7] [libdb-dev:amd64 ]
  46. Inst libdb-dev [5.1.7] (5.3.0 unversioned [amd64]) []
  47. Inst libdb5.3-dev (5.3.28-3 unversioned [amd64])
  48. Conf libdb5.3-dev (5.3.28-3 unversioned [amd64])
  49. Conf libdb-dev (5.3.0 unversioned [amd64])' aptget dist-upgrade -st unversioned
  50. testsuccessequal 'Reading package lists...
  51. Building dependency tree...
  52. Calculating upgrade...
  53. The following packages will be REMOVED:
  54. libdb5.1-dev
  55. The following NEW packages will be installed:
  56. libdb5.3-dev
  57. The following packages will be upgraded:
  58. libdb-dev
  59. 1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  60. Remv libdb5.1-dev [5.1.29-7] [libdb-dev:amd64 ]
  61. Inst libdb-dev [5.1.7] (5.3.0 versioned [amd64]) []
  62. Inst libdb5.3-dev (5.3.28-3 versioned [amd64])
  63. Conf libdb5.3-dev (5.3.28-3 versioned [amd64])
  64. Conf libdb-dev (5.3.0 versioned [amd64])' aptget dist-upgrade -st versioned
  65. cp -f rootdir/var/lib/dpkg/status-backup rootdir/var/lib/dpkg/status
  66. insertinstalledpackage 'foo' 'amd64' '1'
  67. insertinstalledpackage 'bar' 'amd64' '1'
  68. testsuccessequal 'Reading package lists...
  69. Building dependency tree...
  70. Calculating upgrade...
  71. The following packages have been kept back:
  72. bar foo
  73. 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st unversioned
  74. testsuccessequal 'Reading package lists...
  75. Building dependency tree...
  76. Calculating upgrade...
  77. The following packages have been kept back:
  78. bar foo
  79. 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st versioned
  80. testsuccessequal 'Reading package lists...
  81. Building dependency tree...
  82. Calculating upgrade...
  83. The following packages have been kept back:
  84. bar foo
  85. 0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st multipleno
  86. testsuccessequal 'Reading package lists...
  87. Building dependency tree...
  88. Calculating upgrade...
  89. The following packages will be REMOVED:
  90. foo
  91. The following packages will be upgraded:
  92. bar
  93. 1 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
  94. Remv foo [1]
  95. Inst bar [1] (2.2 multipleyes [amd64])
  96. Conf bar (2.2 multipleyes [amd64])' aptget dist-upgrade -st multipleyes
  97. testsuccessequal 'Reading package lists...
  98. Building dependency tree...
  99. The following NEW packages will be installed:
  100. baz
  101. 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
  102. Inst baz (2 unversioned [amd64])
  103. Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned
  104. testsuccessequal 'Reading package lists...
  105. Building dependency tree...
  106. The following additional packages will be installed:
  107. foo
  108. The following packages will be REMOVED:
  109. bar
  110. The following NEW packages will be installed:
  111. baz
  112. The following packages will be upgraded:
  113. foo
  114. 1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  115. Remv bar [1]
  116. Inst foo [1] (2 versioned [amd64])
  117. Inst baz (2 versioned [amd64])
  118. Conf foo (2 versioned [amd64])
  119. Conf baz (2 versioned [amd64])' aptget install baz -st versioned
  120. testsuccessequal 'Reading package lists...
  121. Building dependency tree...
  122. The following NEW packages will be installed:
  123. baz
  124. 0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
  125. Inst baz (2 unversioned [amd64])
  126. Conf baz (2 unversioned [amd64])' aptget install baz -st unversioned
  127. testsuccessequal 'Reading package lists...
  128. Building dependency tree...
  129. The following additional packages will be installed:
  130. foo
  131. The following packages will be REMOVED:
  132. bar
  133. The following NEW packages will be installed:
  134. baz
  135. The following packages will be upgraded:
  136. foo
  137. 1 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
  138. Remv bar [1]
  139. Inst foo [1] (2 versioned [amd64])
  140. Inst baz (2 versioned [amd64])
  141. Conf foo (2 versioned [amd64])
  142. Conf baz (2 versioned [amd64])' aptget install baz -st versioned
  143. # recreating the exact situation is hard, so we pull tricks to get the score
  144. cp -f rootdir/var/lib/dpkg/status-backup rootdir/var/lib/dpkg/status
  145. insertinstalledpackage 'gdm3' 'amd64' '1' 'Depends: libaudit0, libaudit0'
  146. insertinstalledpackage 'login' 'amd64' '1' 'Essential: yes'
  147. insertinstalledpackage 'libaudit0' 'amd64' '1'
  148. testsuccessequal 'Reading package lists...
  149. Building dependency tree...
  150. Calculating upgrade...
  151. The following packages will be REMOVED:
  152. gdm3 libaudit0
  153. The following NEW packages will be installed:
  154. libaudit-common libaudit1
  155. The following packages will be upgraded:
  156. login
  157. 1 upgraded, 2 newly installed, 2 to remove and 0 not upgraded.
  158. Remv gdm3 [1]
  159. Remv libaudit0 [1]
  160. Inst libaudit-common (2 jessie [amd64])
  161. Conf libaudit-common (2 jessie [amd64])
  162. Inst libaudit1 (2 jessie [amd64])
  163. Conf libaudit1 (2 jessie [amd64])
  164. Inst login [1] (2 jessie [amd64])
  165. Conf login (2 jessie [amd64])' aptget dist-upgrade -st jessie