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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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. insertpackage 'unstable' 'selfprov' 'amd64' '2' 'Provides: selfprov (= 1)'
  35. insertpackage 'unstable' 'needsselfprov1' 'amd64' '1' 'Depends: selfprov (= 1)'
  36. insertpackage 'unstable' 'needsselfprov2' 'amd64' '1' 'Depends: selfprov (= 2)'
  37. insertpackage 'unstable' 'needsselfprov12' 'amd64' '1' 'Depends: selfprov (= 1), selfprov (= 2)'
  38. insertpackage 'unstable' 'needsselfprov123' 'amd64' '1' 'Depends: selfprov (= 1), selfprov (= 2), selfprov (= 3)'
  39. setupaptarchive
  40. testsuccessequal 'Reading package lists...
  41. Building dependency tree...
  42. Calculating upgrade...
  43. The following packages will be upgraded:
  44. webapp webserver
  45. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  46. Inst webserver [1] (2 unstable [amd64])
  47. Inst webapp [1] (2 unstable [all])
  48. Conf webserver (2 unstable [amd64])
  49. Conf webapp (2 unstable [all])' aptget dist-upgrade -s
  50. testsuccessequal 'Reading package lists...
  51. Building dependency tree...
  52. The following packages will be upgraded:
  53. webapp webserver
  54. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  55. Inst webserver [1] (2 unstable [amd64])
  56. Inst webapp [1] (2 unstable [all])
  57. Conf webserver (2 unstable [amd64])
  58. Conf webapp (2 unstable [all])' aptget install webapp webserver -s
  59. testsuccessequal 'Reading package lists...
  60. Building dependency tree...
  61. The following packages will be upgraded:
  62. webapp webserver
  63. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  64. Inst webserver [1] (2 unstable [amd64])
  65. Inst webapp [1] (3 experimental [all])
  66. Conf webserver (2 unstable [amd64])
  67. Conf webapp (3 experimental [all])' aptget install webapp=3 webserver -s
  68. testsuccessequal 'Reading package lists...
  69. Building dependency tree...
  70. The following packages will be upgraded:
  71. webapp webserver
  72. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  73. Inst webserver [1] (3 experimental [amd64])
  74. Inst webapp [1] (2 unstable [all])
  75. Conf webserver (3 experimental [amd64])
  76. Conf webapp (2 unstable [all])' aptget install webapp webserver=3 -s
  77. testsuccessequal 'Reading package lists...
  78. Building dependency tree...
  79. The following NEW packages will be installed:
  80. foreign-webserver:i386
  81. The following packages will be upgraded:
  82. webapp
  83. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  84. Inst foreign-webserver:i386 (2 unstable [i386])
  85. Inst webapp [1] (2 unstable [all])
  86. Conf foreign-webserver:i386 (2 unstable [i386])
  87. Conf webapp (2 unstable [all])' aptget install webapp foreign-webserver:i386 -s
  88. testsuccessequal 'Reading package lists...
  89. Building dependency tree...
  90. The following NEW packages will be installed:
  91. foreign-webserver:i386
  92. The following packages will be upgraded:
  93. webapp
  94. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  95. Inst foreign-webserver:i386 (2 unstable [i386])
  96. Inst webapp [1] (3 experimental [all])
  97. Conf foreign-webserver:i386 (2 unstable [i386])
  98. Conf webapp (3 experimental [all])' aptget install webapp=3 foreign-webserver:i386 -s
  99. testsuccessequal 'Reading package lists...
  100. Building dependency tree...
  101. The following NEW packages will be installed:
  102. foreign-webserver:i386
  103. The following packages will be upgraded:
  104. webapp
  105. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  106. Inst foreign-webserver:i386 (4 experimental [i386])
  107. Inst webapp [1] (2 unstable [all])
  108. Conf foreign-webserver:i386 (4 experimental [i386])
  109. Conf webapp (2 unstable [all])' aptget install webapp foreign-webserver:i386=4 -s
  110. testfailureequal 'Reading package lists...
  111. Building dependency tree...
  112. Some packages could not be installed. This may mean that you have
  113. requested an impossible situation or if you are using the unstable
  114. distribution that some required packages have not yet been created
  115. or been moved out of Incoming.
  116. The following information may help to resolve the situation:
  117. The following packages have unmet dependencies:
  118. cool-webapp : Depends: httpd (>= 4)
  119. E: Unable to correct problems, you have held broken packages.' aptget install cool-webapp -s
  120. testfailureequal 'Reading package lists...
  121. Building dependency tree...
  122. Some packages could not be installed. This may mean that you have
  123. requested an impossible situation or if you are using the unstable
  124. distribution that some required packages have not yet been created
  125. or been moved out of Incoming.
  126. The following information may help to resolve the situation:
  127. The following packages have unmet dependencies:
  128. cool-webapp : Depends: httpd (>= 4)
  129. E: Unable to correct problems, you have held broken packages.' aptget install cool-webapp foreign-webserver:i386 -s
  130. testsuccessequal 'Reading package lists...
  131. Building dependency tree...
  132. The following NEW packages will be installed:
  133. cool-webapp foreign-webserver:i386
  134. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  135. Inst foreign-webserver:i386 (4 experimental [i386])
  136. Inst cool-webapp (4 experimental [all])
  137. Conf foreign-webserver:i386 (4 experimental [i386])
  138. Conf cool-webapp (4 experimental [all])' aptget install cool-webapp foreign-webserver:i386=4 -s
  139. testsuccessequal 'Reading package lists...
  140. Building dependency tree...
  141. The following additional packages will be installed:
  142. foo
  143. The following NEW packages will be installed:
  144. baz:i386 foo
  145. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  146. Inst foo (1 unstable [all])
  147. Inst baz:i386 (1 unstable [i386])
  148. Conf foo (1 unstable [all])
  149. Conf baz:i386 (1 unstable [i386])' aptget install baz:i386 -s
  150. testfailureequal 'Reading package lists...
  151. Building dependency tree...
  152. Some packages could not be installed. This may mean that you have
  153. requested an impossible situation or if you are using the unstable
  154. distribution that some required packages have not yet been created
  155. or been moved out of Incoming.
  156. The following information may help to resolve the situation:
  157. The following packages have unmet dependencies:
  158. baz : Depends: bar but it is not installable
  159. E: Unable to correct problems, you have held broken packages.' aptget install baz:amd64 -s
  160. testsuccessequal "Reading package lists...
  161. Building dependency tree...
  162. Selected version '2' (experimental [amd64]) for 'baz'
  163. The following additional packages will be installed:
  164. foo
  165. The following NEW packages will be installed:
  166. baz foo
  167. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  168. Inst foo (1 unstable [all])
  169. Inst baz (2 experimental [amd64])
  170. Conf foo (1 unstable [all])
  171. Conf baz (2 experimental [amd64])" aptget install baz/experimental -s
  172. testsuccessequal "Reading package lists...
  173. Building dependency tree...
  174. Selected version '2' (experimental [i386]) for 'baz:i386'
  175. The following additional packages will be installed:
  176. foo
  177. The following NEW packages will be installed:
  178. baz:i386 foo
  179. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  180. Inst foo (1 unstable [all])
  181. Inst baz:i386 (2 experimental [i386])
  182. Conf foo (1 unstable [all])
  183. Conf baz:i386 (2 experimental [i386])" aptget install baz:i386/experimental -s
  184. testfailureequal 'Reading package lists...
  185. Building dependency tree...
  186. Some packages could not be installed. This may mean that you have
  187. requested an impossible situation or if you are using the unstable
  188. distribution that some required packages have not yet been created
  189. or been moved out of Incoming.
  190. The following information may help to resolve the situation:
  191. The following packages have unmet dependencies:
  192. baz-broken:i386 : Depends: bar:amd64 but it is not installable
  193. E: Unable to correct problems, you have held broken packages.' aptget install baz-broken -s
  194. testsuccessequal 'Reading package lists...
  195. Building dependency tree...
  196. The following additional packages will be installed:
  197. next
  198. The following NEW packages will be installed:
  199. needsrealnext next
  200. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  201. Inst next (1 unstable [amd64])
  202. Inst needsrealnext (2 unstable [amd64])
  203. Conf next (1 unstable [amd64])
  204. Conf needsrealnext (2 unstable [amd64])' aptget install needsrealnext -s
  205. testsuccessequal 'Reading package lists...
  206. Building dependency tree...
  207. The following additional packages will be installed:
  208. next
  209. The following NEW packages will be installed:
  210. needsrealnext:i386 next
  211. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  212. Inst next (1 unstable [amd64])
  213. Inst needsrealnext:i386 (2 unstable [i386])
  214. Conf next (1 unstable [amd64])
  215. Conf needsrealnext:i386 (2 unstable [i386])' aptget install needsrealnext:i386 -s
  216. testsuccessequal 'Reading package lists...
  217. Building dependency tree...
  218. The following additional packages will be installed:
  219. virtualnext2
  220. The following NEW packages will be installed:
  221. needsnext2 virtualnext2
  222. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  223. Inst virtualnext2 (1 unstable [amd64])
  224. Inst needsnext2 (2 unstable [amd64])
  225. Conf virtualnext2 (1 unstable [amd64])
  226. Conf needsnext2 (2 unstable [amd64])' aptget install needsnext2 -s
  227. testsuccessequal 'Reading package lists...
  228. Building dependency tree...
  229. The following additional packages will be installed:
  230. virtualnext2
  231. The following NEW packages will be installed:
  232. needsnext2:i386 virtualnext2
  233. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  234. Inst virtualnext2 (1 unstable [amd64])
  235. Inst needsnext2:i386 (2 unstable [i386])
  236. Conf virtualnext2 (1 unstable [amd64])
  237. Conf needsnext2:i386 (2 unstable [i386])' aptget install needsnext2:i386 -s
  238. testsuccessequal 'Reading package lists...
  239. Building dependency tree...
  240. The following additional packages will be installed:
  241. virtualnext3
  242. The following NEW packages will be installed:
  243. needsnext3 virtualnext3
  244. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  245. Inst virtualnext3 (1 unstable [amd64])
  246. Inst needsnext3 (2 unstable [amd64])
  247. Conf virtualnext3 (1 unstable [amd64])
  248. Conf needsnext3 (2 unstable [amd64])' aptget install needsnext3 -s
  249. testfailureequal 'Reading package lists...
  250. Building dependency tree...
  251. Some packages could not be installed. This may mean that you have
  252. requested an impossible situation or if you are using the unstable
  253. distribution that some required packages have not yet been created
  254. or been moved out of Incoming.
  255. The following information may help to resolve the situation:
  256. The following packages have unmet dependencies:
  257. needsnext3:i386 : Depends: next3:i386 (>= 2) but it is not installable
  258. E: Unable to correct problems, you have held broken packages.' aptget install needsnext3:i386 -s
  259. testsuccessequal 'Reading package lists...
  260. Building dependency tree...
  261. The following additional packages will be installed:
  262. selfprov
  263. The following NEW packages will be installed:
  264. needsselfprov1 selfprov
  265. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  266. Inst selfprov (2 unstable [amd64])
  267. Inst needsselfprov1 (1 unstable [amd64])
  268. Conf selfprov (2 unstable [amd64])
  269. Conf needsselfprov1 (1 unstable [amd64])' aptget install needsselfprov1 -s
  270. testsuccessequal 'Reading package lists...
  271. Building dependency tree...
  272. The following additional packages will be installed:
  273. selfprov
  274. The following NEW packages will be installed:
  275. needsselfprov2 selfprov
  276. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  277. Inst selfprov (2 unstable [amd64])
  278. Inst needsselfprov2 (1 unstable [amd64])
  279. Conf selfprov (2 unstable [amd64])
  280. Conf needsselfprov2 (1 unstable [amd64])' aptget install needsselfprov2 -s
  281. testsuccessequal 'Reading package lists...
  282. Building dependency tree...
  283. The following additional packages will be installed:
  284. selfprov
  285. The following NEW packages will be installed:
  286. needsselfprov12 selfprov
  287. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  288. Inst selfprov (2 unstable [amd64])
  289. Inst needsselfprov12 (1 unstable [amd64])
  290. Conf selfprov (2 unstable [amd64])
  291. Conf needsselfprov12 (1 unstable [amd64])' aptget install needsselfprov12 -s
  292. testfailureequal 'Reading package lists...
  293. Building dependency tree...
  294. Some packages could not be installed. This may mean that you have
  295. requested an impossible situation or if you are using the unstable
  296. distribution that some required packages have not yet been created
  297. or been moved out of Incoming.
  298. The following information may help to resolve the situation:
  299. The following packages have unmet dependencies:
  300. needsselfprov123 : Depends: selfprov (= 3)
  301. E: Unable to correct problems, you have held broken packages.' aptget install needsselfprov123 -s