test-bug-758153-versioned-provides-support 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. #!/bin/sh
  2. set -e
  3. # dpkg implements versioned provides in commit 5bb02fe80e9f40dcad9703a72f67cf615ff217b5
  4. # but previous versions seem to allow parsing, working and ignoring it.
  5. TESTDIR=$(readlink -f $(dirname $0))
  6. . $TESTDIR/framework
  7. setupenvironment
  8. configarchitecture 'amd64' 'i386'
  9. insertinstalledpackage 'webapp' 'all' '1' 'Depends: httpd'
  10. insertinstalledpackage 'webserver' 'all' '1' 'Provides: httpd'
  11. insertpackage 'unstable' 'webapp' 'all' '2' 'Depends: httpd (>= 2)'
  12. insertpackage 'unstable' 'webserver' 'amd64' '2' 'Provides: httpd (= 2)'
  13. insertpackage 'unstable' 'foreign-webserver' 'i386' '2' 'Multi-Arch: foreign
  14. Provides: httpd (= 2)'
  15. insertpackage 'experimental' 'webapp' 'all' '3' 'Depends: httpd (>= 1.5)'
  16. insertpackage 'experimental' 'webserver' 'amd64' '3' 'Provides: httpd (= 3)'
  17. insertpackage 'experimental' 'foreign-webserver' 'i386' '4' 'Multi-Arch: foreign
  18. Provides: httpd (= 4)'
  19. insertpackage 'experimental' 'cool-webapp' 'all' '4' 'Depends: httpd (>= 4)'
  20. # arch-qualified provides, see #777071
  21. insertpackage 'unstable' 'foo' 'all' '1' 'Provides: bar:i386'
  22. insertpackage 'unstable' 'baz' 'i386,amd64' '1' 'Depends: bar'
  23. insertpackage 'experimental' 'baz' 'i386,amd64' '2' 'Depends: bar:i386'
  24. insertpackage 'experimental' 'baz-broken' 'i386' '2' 'Depends: bar:amd64'
  25. insertpackage 'unstable' 'next' 'amd64' '1' 'Multi-Arch: foreign
  26. Provides: next (= 2)'
  27. insertpackage 'unstable' 'needsrealnext' 'amd64,i386' '2' 'Depends: next (>= 2)'
  28. insertpackage 'unstable' 'virtualnext2' 'amd64' '1' 'Multi-Arch: foreign
  29. Provides: next2 (= 2)'
  30. insertpackage 'unstable' 'needsnext2' 'amd64,i386' '2' 'Depends: next2 (>= 2)'
  31. insertpackage 'unstable' 'virtualnext3' 'amd64' '1' 'Multi-Arch: no
  32. Provides: next3 (= 2)'
  33. insertpackage 'unstable' 'needsnext3' 'amd64,i386' '2' 'Depends: next3 (>= 2)'
  34. setupaptarchive
  35. testsuccessequal 'Reading package lists...
  36. Building dependency tree...
  37. Calculating upgrade...
  38. The following packages will be upgraded:
  39. webapp webserver
  40. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  41. Inst webserver [1] (2 unstable [amd64])
  42. Inst webapp [1] (2 unstable [all])
  43. Conf webserver (2 unstable [amd64])
  44. Conf webapp (2 unstable [all])' aptget dist-upgrade -s
  45. testsuccessequal 'Reading package lists...
  46. Building dependency tree...
  47. The following packages will be upgraded:
  48. webapp webserver
  49. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  50. Inst webserver [1] (2 unstable [amd64])
  51. Inst webapp [1] (2 unstable [all])
  52. Conf webserver (2 unstable [amd64])
  53. Conf webapp (2 unstable [all])' aptget install webapp webserver -s
  54. testsuccessequal 'Reading package lists...
  55. Building dependency tree...
  56. The following packages will be upgraded:
  57. webapp webserver
  58. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  59. Inst webserver [1] (2 unstable [amd64])
  60. Inst webapp [1] (3 experimental [all])
  61. Conf webserver (2 unstable [amd64])
  62. Conf webapp (3 experimental [all])' aptget install webapp=3 webserver -s
  63. testsuccessequal 'Reading package lists...
  64. Building dependency tree...
  65. The following packages will be upgraded:
  66. webapp webserver
  67. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  68. Inst webserver [1] (3 experimental [amd64])
  69. Inst webapp [1] (2 unstable [all])
  70. Conf webserver (3 experimental [amd64])
  71. Conf webapp (2 unstable [all])' aptget install webapp webserver=3 -s
  72. testsuccessequal 'Reading package lists...
  73. Building dependency tree...
  74. The following NEW packages will be installed:
  75. foreign-webserver:i386
  76. The following packages will be upgraded:
  77. webapp
  78. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  79. Inst foreign-webserver:i386 (2 unstable [i386])
  80. Inst webapp [1] (2 unstable [all])
  81. Conf foreign-webserver:i386 (2 unstable [i386])
  82. Conf webapp (2 unstable [all])' aptget install webapp foreign-webserver:i386 -s
  83. testsuccessequal 'Reading package lists...
  84. Building dependency tree...
  85. The following NEW packages will be installed:
  86. foreign-webserver:i386
  87. The following packages will be upgraded:
  88. webapp
  89. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  90. Inst foreign-webserver:i386 (2 unstable [i386])
  91. Inst webapp [1] (3 experimental [all])
  92. Conf foreign-webserver:i386 (2 unstable [i386])
  93. Conf webapp (3 experimental [all])' aptget install webapp=3 foreign-webserver:i386 -s
  94. testsuccessequal 'Reading package lists...
  95. Building dependency tree...
  96. The following NEW packages will be installed:
  97. foreign-webserver:i386
  98. The following packages will be upgraded:
  99. webapp
  100. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  101. Inst foreign-webserver:i386 (4 experimental [i386])
  102. Inst webapp [1] (2 unstable [all])
  103. Conf foreign-webserver:i386 (4 experimental [i386])
  104. Conf webapp (2 unstable [all])' aptget install webapp foreign-webserver:i386=4 -s
  105. testfailureequal 'Reading package lists...
  106. Building dependency tree...
  107. Some packages could not be installed. This may mean that you have
  108. requested an impossible situation or if you are using the unstable
  109. distribution that some required packages have not yet been created
  110. or been moved out of Incoming.
  111. The following information may help to resolve the situation:
  112. The following packages have unmet dependencies:
  113. cool-webapp : Depends: httpd (>= 4)
  114. E: Unable to correct problems, you have held broken packages.' aptget install cool-webapp -s
  115. testfailureequal 'Reading package lists...
  116. Building dependency tree...
  117. Some packages could not be installed. This may mean that you have
  118. requested an impossible situation or if you are using the unstable
  119. distribution that some required packages have not yet been created
  120. or been moved out of Incoming.
  121. The following information may help to resolve the situation:
  122. The following packages have unmet dependencies:
  123. cool-webapp : Depends: httpd (>= 4)
  124. E: Unable to correct problems, you have held broken packages.' aptget install cool-webapp foreign-webserver:i386 -s
  125. testsuccessequal 'Reading package lists...
  126. Building dependency tree...
  127. The following NEW packages will be installed:
  128. cool-webapp foreign-webserver:i386
  129. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  130. Inst foreign-webserver:i386 (4 experimental [i386])
  131. Inst cool-webapp (4 experimental [all])
  132. Conf foreign-webserver:i386 (4 experimental [i386])
  133. Conf cool-webapp (4 experimental [all])' aptget install cool-webapp foreign-webserver:i386=4 -s
  134. testsuccessequal 'Reading package lists...
  135. Building dependency tree...
  136. The following extra packages will be installed:
  137. foo
  138. The following NEW packages will be installed:
  139. baz:i386 foo
  140. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  141. Inst foo (1 unstable [all])
  142. Inst baz:i386 (1 unstable [i386])
  143. Conf foo (1 unstable [all])
  144. Conf baz:i386 (1 unstable [i386])' aptget install baz:i386 -s
  145. testfailureequal 'Reading package lists...
  146. Building dependency tree...
  147. Some packages could not be installed. This may mean that you have
  148. requested an impossible situation or if you are using the unstable
  149. distribution that some required packages have not yet been created
  150. or been moved out of Incoming.
  151. The following information may help to resolve the situation:
  152. The following packages have unmet dependencies:
  153. baz : Depends: bar but it is not installable
  154. E: Unable to correct problems, you have held broken packages.' aptget install baz:amd64 -s
  155. testsuccessequal "Reading package lists...
  156. Building dependency tree...
  157. Selected version '2' (experimental [amd64]) for 'baz'
  158. The following extra packages will be installed:
  159. foo
  160. The following NEW packages will be installed:
  161. baz foo
  162. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  163. Inst foo (1 unstable [all])
  164. Inst baz (2 experimental [amd64])
  165. Conf foo (1 unstable [all])
  166. Conf baz (2 experimental [amd64])" aptget install baz/experimental -s -q=0
  167. testsuccessequal "Reading package lists...
  168. Building dependency tree...
  169. Selected version '2' (experimental [i386]) for 'baz:i386'
  170. The following extra packages will be installed:
  171. foo
  172. The following NEW packages will be installed:
  173. baz:i386 foo
  174. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  175. Inst foo (1 unstable [all])
  176. Inst baz:i386 (2 experimental [i386])
  177. Conf foo (1 unstable [all])
  178. Conf baz:i386 (2 experimental [i386])" aptget install baz:i386/experimental -s -q=0
  179. testfailureequal 'Reading package lists...
  180. Building dependency tree...
  181. Some packages could not be installed. This may mean that you have
  182. requested an impossible situation or if you are using the unstable
  183. distribution that some required packages have not yet been created
  184. or been moved out of Incoming.
  185. The following information may help to resolve the situation:
  186. The following packages have unmet dependencies:
  187. baz-broken:i386 : Depends: bar but it is not installable
  188. E: Unable to correct problems, you have held broken packages.' aptget install baz-broken -s
  189. testsuccessequal 'Reading package lists...
  190. Building dependency tree...
  191. The following extra packages will be installed:
  192. next
  193. The following NEW packages will be installed:
  194. needsrealnext next
  195. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  196. Inst next (1 unstable [amd64])
  197. Inst needsrealnext (2 unstable [amd64])
  198. Conf next (1 unstable [amd64])
  199. Conf needsrealnext (2 unstable [amd64])' aptget install needsrealnext -s
  200. testsuccessequal 'Reading package lists...
  201. Building dependency tree...
  202. The following extra packages will be installed:
  203. next
  204. The following NEW packages will be installed:
  205. needsrealnext:i386 next
  206. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  207. Inst next (1 unstable [amd64])
  208. Inst needsrealnext:i386 (2 unstable [i386])
  209. Conf next (1 unstable [amd64])
  210. Conf needsrealnext:i386 (2 unstable [i386])' aptget install needsrealnext:i386 -s
  211. testsuccessequal 'Reading package lists...
  212. Building dependency tree...
  213. The following extra packages will be installed:
  214. virtualnext2
  215. The following NEW packages will be installed:
  216. needsnext2 virtualnext2
  217. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  218. Inst virtualnext2 (1 unstable [amd64])
  219. Inst needsnext2 (2 unstable [amd64])
  220. Conf virtualnext2 (1 unstable [amd64])
  221. Conf needsnext2 (2 unstable [amd64])' aptget install needsnext2 -s
  222. testsuccessequal 'Reading package lists...
  223. Building dependency tree...
  224. The following extra packages will be installed:
  225. virtualnext2
  226. The following NEW packages will be installed:
  227. needsnext2:i386 virtualnext2
  228. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  229. Inst virtualnext2 (1 unstable [amd64])
  230. Inst needsnext2:i386 (2 unstable [i386])
  231. Conf virtualnext2 (1 unstable [amd64])
  232. Conf needsnext2:i386 (2 unstable [i386])' aptget install needsnext2:i386 -s
  233. testsuccessequal 'Reading package lists...
  234. Building dependency tree...
  235. The following extra packages will be installed:
  236. virtualnext3
  237. The following NEW packages will be installed:
  238. needsnext3 virtualnext3
  239. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  240. Inst virtualnext3 (1 unstable [amd64])
  241. Inst needsnext3 (2 unstable [amd64])
  242. Conf virtualnext3 (1 unstable [amd64])
  243. Conf needsnext3 (2 unstable [amd64])' aptget install needsnext3 -s
  244. testfailureequal 'Reading package lists...
  245. Building dependency tree...
  246. Some packages could not be installed. This may mean that you have
  247. requested an impossible situation or if you are using the unstable
  248. distribution that some required packages have not yet been created
  249. or been moved out of Incoming.
  250. The following information may help to resolve the situation:
  251. The following packages have unmet dependencies:
  252. needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable
  253. E: Unable to correct problems, you have held broken packages.' aptget install needsnext3:i386 -s