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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207
  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. setupaptarchive
  26. testsuccessequal 'Reading package lists...
  27. Building dependency tree...
  28. Calculating upgrade...
  29. The following packages will be upgraded:
  30. webapp webserver
  31. 2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
  32. Inst webserver [1] (2 unstable [amd64])
  33. Inst webapp [1] (2 unstable [all])
  34. Conf webserver (2 unstable [amd64])
  35. Conf webapp (2 unstable [all])' aptget dist-upgrade -s
  36. testsuccessequal 'Reading package lists...
  37. Building dependency tree...
  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 install webapp webserver -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] (3 experimental [all])
  52. Conf webserver (2 unstable [amd64])
  53. Conf webapp (3 experimental [all])' aptget install webapp=3 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] (3 experimental [amd64])
  60. Inst webapp [1] (2 unstable [all])
  61. Conf webserver (3 experimental [amd64])
  62. Conf webapp (2 unstable [all])' aptget install webapp webserver=3 -s
  63. testsuccessequal 'Reading package lists...
  64. Building dependency tree...
  65. The following NEW packages will be installed:
  66. foreign-webserver:i386
  67. The following packages will be upgraded:
  68. webapp
  69. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  70. Inst foreign-webserver:i386 (2 unstable [i386])
  71. Inst webapp [1] (2 unstable [all])
  72. Conf foreign-webserver:i386 (2 unstable [i386])
  73. Conf webapp (2 unstable [all])' aptget install webapp foreign-webserver:i386 -s
  74. testsuccessequal 'Reading package lists...
  75. Building dependency tree...
  76. The following NEW packages will be installed:
  77. foreign-webserver:i386
  78. The following packages will be upgraded:
  79. webapp
  80. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  81. Inst foreign-webserver:i386 (2 unstable [i386])
  82. Inst webapp [1] (3 experimental [all])
  83. Conf foreign-webserver:i386 (2 unstable [i386])
  84. Conf webapp (3 experimental [all])' aptget install webapp=3 foreign-webserver:i386 -s
  85. testsuccessequal 'Reading package lists...
  86. Building dependency tree...
  87. The following NEW packages will be installed:
  88. foreign-webserver:i386
  89. The following packages will be upgraded:
  90. webapp
  91. 1 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
  92. Inst foreign-webserver:i386 (4 experimental [i386])
  93. Inst webapp [1] (2 unstable [all])
  94. Conf foreign-webserver:i386 (4 experimental [i386])
  95. Conf webapp (2 unstable [all])' aptget install webapp foreign-webserver:i386=4 -s
  96. testfailureequal 'Reading package lists...
  97. Building dependency tree...
  98. Some packages could not be installed. This may mean that you have
  99. requested an impossible situation or if you are using the unstable
  100. distribution that some required packages have not yet been created
  101. or been moved out of Incoming.
  102. The following information may help to resolve the situation:
  103. The following packages have unmet dependencies:
  104. cool-webapp : Depends: httpd (>= 4)
  105. E: Unable to correct problems, you have held broken packages.' aptget install cool-webapp -s
  106. testfailureequal 'Reading package lists...
  107. Building dependency tree...
  108. Some packages could not be installed. This may mean that you have
  109. requested an impossible situation or if you are using the unstable
  110. distribution that some required packages have not yet been created
  111. or been moved out of Incoming.
  112. The following information may help to resolve the situation:
  113. The following packages have unmet dependencies:
  114. cool-webapp : Depends: httpd (>= 4)
  115. E: Unable to correct problems, you have held broken packages.' aptget install cool-webapp foreign-webserver:i386 -s
  116. testsuccessequal 'Reading package lists...
  117. Building dependency tree...
  118. The following NEW packages will be installed:
  119. cool-webapp foreign-webserver:i386
  120. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  121. Inst foreign-webserver:i386 (4 experimental [i386])
  122. Inst cool-webapp (4 experimental [all])
  123. Conf foreign-webserver:i386 (4 experimental [i386])
  124. Conf cool-webapp (4 experimental [all])' aptget install cool-webapp foreign-webserver:i386=4 -s
  125. testsuccessequal 'Reading package lists...
  126. Building dependency tree...
  127. The following extra packages will be installed:
  128. foo
  129. The following NEW packages will be installed:
  130. baz:i386 foo
  131. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  132. Inst foo (1 unstable [all])
  133. Inst baz:i386 (1 unstable [i386])
  134. Conf foo (1 unstable [all])
  135. Conf baz:i386 (1 unstable [i386])' aptget install baz:i386 -s
  136. testfailureequal 'Reading package lists...
  137. Building dependency tree...
  138. Some packages could not be installed. This may mean that you have
  139. requested an impossible situation or if you are using the unstable
  140. distribution that some required packages have not yet been created
  141. or been moved out of Incoming.
  142. The following information may help to resolve the situation:
  143. The following packages have unmet dependencies:
  144. baz : Depends: bar but it is not installable
  145. E: Unable to correct problems, you have held broken packages.' aptget install baz:amd64 -s
  146. testsuccessequal "Reading package lists...
  147. Building dependency tree...
  148. Selected version '2' (experimental [amd64]) for 'baz'
  149. The following extra packages will be installed:
  150. foo
  151. The following NEW packages will be installed:
  152. baz foo
  153. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  154. Inst foo (1 unstable [all])
  155. Inst baz (2 experimental [amd64])
  156. Conf foo (1 unstable [all])
  157. Conf baz (2 experimental [amd64])" aptget install baz/experimental -s -q=0
  158. testsuccessequal "Reading package lists...
  159. Building dependency tree...
  160. Selected version '2' (experimental [i386]) for 'baz:i386'
  161. The following extra packages will be installed:
  162. foo
  163. The following NEW packages will be installed:
  164. baz:i386 foo
  165. 0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.
  166. Inst foo (1 unstable [all])
  167. Inst baz:i386 (2 experimental [i386])
  168. Conf foo (1 unstable [all])
  169. Conf baz:i386 (2 experimental [i386])" aptget install baz:i386/experimental -s -q=0
  170. testfailureequal 'Reading package lists...
  171. Building dependency tree...
  172. Some packages could not be installed. This may mean that you have
  173. requested an impossible situation or if you are using the unstable
  174. distribution that some required packages have not yet been created
  175. or been moved out of Incoming.
  176. The following information may help to resolve the situation:
  177. The following packages have unmet dependencies:
  178. baz-broken:i386 : Depends: bar but it is not installable
  179. E: Unable to correct problems, you have held broken packages.' aptget install baz-broken -s