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.
 
 
 
 
 
 

210 lines
6.9 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture 'i386'
  7. insertpackage 'stable' 'debhelper' 'i386' '7'
  8. insertpackage 'stable' 'build-essential' 'i386' '1'
  9. insertpackage 'stable' 'build-depends' 'i386' '1'
  10. insertsource 'stable' 'unrelated' 'any' '1'
  11. insertinstalledpackage 'build-conflict' 'i386' '1'
  12. setupaptarchive
  13. msgmsg 'Test with' 'unsigned dsc'
  14. cat > 2vcard_0.5-3.dsc <<EOF
  15. Format: 1.0
  16. Source: 2vcard
  17. Binary: 2vcard
  18. Architecture: all
  19. Version: 0.5-3
  20. Maintainer: Martin Albisetti <argentina@gmail.com>
  21. Uploaders: Marcela Tiznado <mlt@debian.org>
  22. Standards-Version: 3.8.0
  23. Build-Depends: debhelper (>= 5.0.37)
  24. Build-Conflicts: build-conflict (<< 2)
  25. Checksums-Sha1:
  26. b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
  27. 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
  28. Checksums-Sha256:
  29. efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
  30. 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
  31. Files:
  32. f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
  33. 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
  34. EOF
  35. test2vcardbuilddep() {
  36. local name="$1"
  37. testsuccessequal "Note, using file './$name' to get the build dependencies
  38. Reading package lists...
  39. Building dependency tree...
  40. The following packages will be REMOVED:
  41. build-conflict
  42. The following NEW packages will be installed:
  43. build-essential debhelper
  44. 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
  45. Remv build-conflict [1]
  46. Inst build-essential (1 stable [i386])
  47. Inst debhelper (7 stable [i386])
  48. Conf build-essential (1 stable [i386])
  49. Conf debhelper (7 stable [i386])" aptget build-dep -s ./$name
  50. testfailure aptget build-dep --simulate $name
  51. cd downloaded
  52. testsuccess aptget build-dep --simulate ../$name
  53. testsuccess aptget build-dep --simulate "$(readlink -f ../$name)"
  54. cd ..
  55. }
  56. test2vcardbuilddep "2vcard_0.5-3.dsc"
  57. cp "2vcard_0.5-3.dsc" "2VCard_0.5-3.dsc"
  58. test2vcardbuilddep "2VCard_0.5-3.dsc"
  59. msgmsg 'Test with' 'signed dsc'
  60. cat > 2vcard_0.5-3.dsc <<EOF
  61. -----BEGIN PGP SIGNED MESSAGE-----
  62. Hash: SHA1
  63. Format: 1.0
  64. Source: 2vcard
  65. Binary: 2vcard
  66. Architecture: all
  67. Version: 0.5-3
  68. Maintainer: Martin Albisetti <argentina@gmail.com>
  69. Uploaders: Marcela Tiznado <mlt@debian.org>
  70. Standards-Version: 3.8.0
  71. Build-Depends: debhelper (>= 5.0.37)
  72. Build-Conflicts: build-conflict (<< 2)
  73. Checksums-Sha1:
  74. b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
  75. 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
  76. Checksums-Sha256:
  77. efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
  78. 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
  79. Files:
  80. f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
  81. 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
  82. -----BEGIN PGP SIGNATURE-----
  83. Version: GnuPG v1.4.9 (GNU/Linux)
  84. iEYEARECAAYFAkijKhsACgkQsrBfRdYmq7aA2gCfaOW9riTYVQMx5ajKQVAcctlC
  85. z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
  86. =4eRd
  87. -----END PGP SIGNATURE-----
  88. EOF
  89. test2vcardbuilddep "2vcard_0.5-3.dsc"
  90. cp "2vcard_0.5-3.dsc" "2VCard_0.5-3.dsc"
  91. test2vcardbuilddep "2VCard_0.5-3.dsc"
  92. msgmsg 'Test with' 'unpacked source dir'
  93. mkdir -p foo-1.0/debian
  94. cat > foo-1.0/debian/control <<'EOF'
  95. Source: apturl
  96. Section: admin
  97. Priority: optional
  98. Maintainer: Michael Vogt <mvo@ubuntu.com>
  99. Build-Depends: debhelper (>= 7)
  100. Build-Depends-Indep:
  101. X-Python3-Version: >= 3.2
  102. Standards-Version: 3.9.3
  103. Package: apturl-common
  104. Architecture: any
  105. Depends: ${python3:Depends},
  106. ${shlibs:Depends},
  107. ${misc:Depends},
  108. python3-apt,
  109. python3-update-manager
  110. Replaces: apturl (<< 0.3.6ubuntu2)
  111. Description: install packages using the apt protocol - common data
  112. AptUrl is a simple graphical application that takes an URL (which follows the
  113. apt-protocol) as a command line option, parses it and carries out the
  114. operations that the URL describes (that is, it asks the user if he wants the
  115. indicated packages to be installed and if the answer is positive does so for
  116. him).
  117. .
  118. This package contains the common data shared between the frontends.
  119. EOF
  120. testsuccessequal "Note, using directory './foo-1.0' to get the build dependencies
  121. Reading package lists...
  122. Building dependency tree...
  123. The following NEW packages will be installed:
  124. build-essential debhelper
  125. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  126. Inst build-essential (1 stable [i386])
  127. Inst debhelper (7 stable [i386])
  128. Conf build-essential (1 stable [i386])
  129. Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./foo-1.0
  130. testfailure aptget build-dep --simulate foo-1.0
  131. cd downloaded
  132. testsuccess aptget build-dep --simulate ../foo-1.0
  133. testsuccess aptget build-dep --simulate "$(readlink -f ../foo-1.0)"
  134. cd ..
  135. cd foo-1.0
  136. testsuccess aptget build-dep --simulate './'
  137. testsuccess aptget build-dep --simulate '.'
  138. cd debian
  139. testsuccess aptget build-dep --simulate './../'
  140. testsuccess aptget build-dep --simulate '../'
  141. testsuccess aptget build-dep --simulate '..'
  142. cd ../..
  143. testfailureequal 'E: Must specify at least one package to check builddeps for' aptget build-dep
  144. testfailureequal 'E: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup' aptget build-dep --simulate ./foo-1.0 -a armel
  145. testfailureequal 'Reading package lists...
  146. E: Unable to find a source package for foo' aptget build-dep --simulate foo
  147. msgmsg 'Test with a dsc' 'with comments'
  148. cat > comments.dsc <<EOF
  149. # I love comments
  150. # I love them so much, I give them their own paragraph
  151. #This is my first package
  152. Format: 3.0 (native)
  153. Source: comments
  154. Binary: comments
  155. Architecture: all
  156. Version: 1
  157. #Version: 2
  158. Maintainer: Joe Sixpack <joe@example.org>
  159. Build-Depends: debhelper (>= 5),
  160. # TODO: add more
  161. build-depends (= 1),
  162. Standards-Version: 3.9.6
  163. # This is the end…
  164. # or this?
  165. EOF
  166. testsuccessequal "Note, using file './comments.dsc' to get the build dependencies
  167. Reading package lists...
  168. Building dependency tree...
  169. The following NEW packages will be installed:
  170. build-depends build-essential debhelper
  171. 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  172. Inst build-depends (1 stable [i386])
  173. Inst build-essential (1 stable [i386])
  174. Inst debhelper (7 stable [i386])
  175. Conf build-depends (1 stable [i386])
  176. Conf build-essential (1 stable [i386])
  177. Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./comments.dsc
  178. testsuccessequal "Note, using file './comments.dsc' to get the build dependencies
  179. Reading package lists...
  180. Building dependency tree...
  181. Execute external solver...
  182. The following NEW packages will be installed:
  183. build-depends build-essential debhelper
  184. 0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
  185. Inst build-depends (1 stable [i386])
  186. Inst build-essential (1 stable [i386])
  187. Inst debhelper (7 stable [i386])
  188. Conf build-depends (1 stable [i386])
  189. Conf build-essential (1 stable [i386])
  190. Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./comments.dsc --solver apt