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.
 
 
 
 
 
 

152 lines
5.0 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. insertinstalledpackage 'build-conflict' 'i386' '1'
  10. setupaptarchive
  11. msgmsg 'Test with' 'unsigned dsc'
  12. cat > 2vcard_0.5-3.dsc <<EOF
  13. Format: 1.0
  14. Source: 2vcard
  15. Binary: 2vcard
  16. Architecture: all
  17. Version: 0.5-3
  18. Maintainer: Martin Albisetti <argentina@gmail.com>
  19. Uploaders: Marcela Tiznado <mlt@debian.org>
  20. Standards-Version: 3.8.0
  21. Build-Depends: debhelper (>= 5.0.37)
  22. Build-Conflicts: build-conflict (<< 2)
  23. Checksums-Sha1:
  24. b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
  25. 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
  26. Checksums-Sha256:
  27. efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
  28. 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
  29. Files:
  30. f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
  31. 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
  32. EOF
  33. test2vcardbuilddep() {
  34. testsuccessequal "Reading package lists...
  35. Building dependency tree...
  36. Note, using file './2vcard_0.5-3.dsc' to get the build dependencies
  37. The following packages will be REMOVED:
  38. build-conflict
  39. The following NEW packages will be installed:
  40. build-essential debhelper
  41. 0 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
  42. Remv build-conflict [1]
  43. Inst build-essential (1 stable [i386])
  44. Inst debhelper (7 stable [i386])
  45. Conf build-essential (1 stable [i386])
  46. Conf debhelper (7 stable [i386])" aptget build-dep -s ./2vcard_0.5-3.dsc
  47. testfailure aptget build-dep --simulate 2vcard_0.5-3.dsc
  48. cd downloaded
  49. testsuccess aptget build-dep --simulate ../2vcard_0.5-3.dsc
  50. testsuccess aptget build-dep --simulate "$(readlink -f ../2vcard_0.5-3.dsc)"
  51. cd ..
  52. }
  53. test2vcardbuilddep
  54. msgmsg 'Test with' 'signed dsc'
  55. cat > 2vcard_0.5-3.dsc <<EOF
  56. -----BEGIN PGP SIGNED MESSAGE-----
  57. Hash: SHA1
  58. Format: 1.0
  59. Source: 2vcard
  60. Binary: 2vcard
  61. Architecture: all
  62. Version: 0.5-3
  63. Maintainer: Martin Albisetti <argentina@gmail.com>
  64. Uploaders: Marcela Tiznado <mlt@debian.org>
  65. Standards-Version: 3.8.0
  66. Build-Depends: debhelper (>= 5.0.37)
  67. Build-Conflicts: build-conflict (<< 2)
  68. Checksums-Sha1:
  69. b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
  70. 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
  71. Checksums-Sha256:
  72. efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
  73. 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
  74. Files:
  75. f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
  76. 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
  77. -----BEGIN PGP SIGNATURE-----
  78. Version: GnuPG v1.4.9 (GNU/Linux)
  79. iEYEARECAAYFAkijKhsACgkQsrBfRdYmq7aA2gCfaOW9riTYVQMx5ajKQVAcctlC
  80. z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
  81. =4eRd
  82. -----END PGP SIGNATURE-----
  83. EOF
  84. test2vcardbuilddep
  85. msgmsg 'Test with' 'unpacked source dir'
  86. mkdir -p foo-1.0/debian
  87. cat > foo-1.0/debian/control <<'EOF'
  88. Source: apturl
  89. Section: admin
  90. Priority: optional
  91. Maintainer: Michael Vogt <mvo@ubuntu.com>
  92. Build-Depends: debhelper (>= 7)
  93. X-Python3-Version: >= 3.2
  94. Standards-Version: 3.9.3
  95. Package: apturl-common
  96. Architecture: any
  97. Depends: ${python3:Depends},
  98. ${shlibs:Depends},
  99. ${misc:Depends},
  100. python3-apt,
  101. python3-update-manager
  102. Replaces: apturl (<< 0.3.6ubuntu2)
  103. Description: install packages using the apt protocol - common data
  104. AptUrl is a simple graphical application that takes an URL (which follows the
  105. apt-protocol) as a command line option, parses it and carries out the
  106. operations that the URL describes (that is, it asks the user if he wants the
  107. indicated packages to be installed and if the answer is positive does so for
  108. him).
  109. .
  110. This package contains the common data shared between the frontends.
  111. EOF
  112. testsuccessequal "Reading package lists...
  113. Building dependency tree...
  114. Note, using directory './foo-1.0' to get the build dependencies
  115. The following NEW packages will be installed:
  116. build-essential debhelper
  117. 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
  118. Inst build-essential (1 stable [i386])
  119. Inst debhelper (7 stable [i386])
  120. Conf build-essential (1 stable [i386])
  121. Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./foo-1.0
  122. testfailure aptget build-dep --simulate foo-1.0
  123. cd downloaded
  124. testsuccess aptget build-dep --simulate ../foo-1.0
  125. testsuccess aptget build-dep --simulate "$(readlink -f ../foo-1.0)"
  126. cd ..
  127. testfailureequal 'Reading package lists...
  128. Building dependency tree...
  129. E: Must specify at least one package to check builddeps for' aptget build-dep
  130. testfailureequal 'Reading package lists...
  131. Building dependency tree...
  132. E: No architecture information available for armel. See apt.conf(5) APT::Architectures for setup' aptget build-dep --simulate ./foo-1.0 -a armel
  133. testfailureequal 'Reading package lists...
  134. Building dependency tree...
  135. E: Unable to find a source package for foo' aptget build-dep --simulate foo