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.
 
 
 
 
 
 

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