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.
 
 
 
 
 
 

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