#!/bin/sh
set -e
-TESTDIR=$(readlink -f $(dirname $0))
-. $TESTDIR/framework
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
-buildsimplenativepackage 'debhelper' 'i386' '7' 'stable'
-buildsimplenativepackage 'build-essential' 'i386' '1' 'stable'
+insertpackage 'stable' 'build-essential' 'i386' '1'
+insertpackage 'stable' 'build-depends' 'i386' '1'
+insertpackage 'stable' 'build-depends-arch' 'i386' '1'
+insertpackage 'stable' 'build-depends-indep' 'i386' '1'
+insertinstalledpackage 'build-conflicts' 'i386' '1'
+insertinstalledpackage 'build-conflicts-arch' 'i386' '1'
+insertinstalledpackage 'build-conflicts-indep' 'i386' '1'
setupaptarchive
-cat > 2vcard_0.5-3.dsc <<EOF
-Format: 1.0
-Source: 2vcard
-Binary: 2vcard
-Architecture: all
-Version: 0.5-3
-Maintainer: Martin Albisetti <argentina@gmail.com>
-Uploaders: Marcela Tiznado <mlt@debian.org>
-Standards-Version: 3.8.0
-Build-Depends: debhelper (>= 5.0.37)
-Checksums-Sha1:
- b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
- 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
-Checksums-Sha256:
- efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
- 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
-Files:
- f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
- 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
-EOF
-
-testsuccessequal "Reading package lists...
-Building dependency tree...
-Note, using file '2vcard_0.5-3.dsc' to get the build dependencies
-The following NEW packages will be installed:
- build-essential debhelper
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
-Inst build-essential (1 stable [i386])
-Inst debhelper (7 stable [i386])
-Conf build-essential (1 stable [i386])
-Conf debhelper (7 stable [i386])" aptget build-dep -s 2vcard_0.5-3.dsc
-cat > 2vcard_0.5-3.dsc <<EOF
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-Format: 1.0
-Source: 2vcard
-Binary: 2vcard
+cat > foobar.dsc <<EOF
+Format: 3.0 (native)
+Source: foobar
+Binary: foobar
Architecture: all
-Version: 0.5-3
-Maintainer: Martin Albisetti <argentina@gmail.com>
-Uploaders: Marcela Tiznado <mlt@debian.org>
-Standards-Version: 3.8.0
-Build-Depends: debhelper (>= 5.0.37)
-Checksums-Sha1:
- b7f1ce31ec856414a3f0f1090689f91aa7456d56 9398 2vcard_0.5.orig.tar.gz
- 5f9acd07ebda6ab00fa6b4fe3198c13e94090862 2036 2vcard_0.5-3.diff.gz
-Checksums-Sha256:
- efdc22859ac2f8f030d038dc4faa9020082ebae34212498c288968ffd45c9764 9398 2vcard_0.5.orig.tar.gz
- 82673ff3456af571094066c89bcea87b25c23c87cf1d0050b731e5222563626b 2036 2vcard_0.5-3.diff.gz
-Files:
- f73a69c170f772f3f6e75f2d11bbb792 9398 2vcard_0.5.orig.tar.gz
- 1e806d32233af87437258d86b1561f57 2036 2vcard_0.5-3.diff.gz
-
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.9 (GNU/Linux)
-
-iEYEARECAAYFAkijKhsACgkQsrBfRdYmq7aA2gCfaOW9riTYVQMx5ajKQVAcctlC
-z2UAn1oXgTai6opwhVfkxrlmJ+iRxzuc
-=4eRd
------END PGP SIGNATURE-----
+Version: 1
+Maintainer: Joe Sixpack <joe@example.org>
+Build-Depends: build-depends (>= 1)
+Build-Depends-Indep: build-depends-indep (>= 1)
+Build-Depends-Arch: build-depends-arch (>= 1)
+Build-Conflicts: build-conflicts (>= 1)
+Build-Conflicts-Indep: build-conflicts-indep (>= 1)
+Build-Conflicts-Arch: build-conflicts-arch (>= 1)
+Standards-Version: 3.9.8
EOF
-
-testsuccessequal "Reading package lists...
+testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies
+Reading package lists...
Building dependency tree...
-Note, using file '2vcard_0.5-3.dsc' to get the build dependencies
+The following packages will be REMOVED:
+ build-conflicts build-conflicts-arch build-conflicts-indep
The following NEW packages will be installed:
- build-essential debhelper
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ build-depends build-depends-arch build-depends-indep build-essential
+0 upgraded, 4 newly installed, 3 to remove and 0 not upgraded.
+Remv build-conflicts [1]
+Remv build-conflicts-arch [1]
+Remv build-conflicts-indep [1]
+Inst build-depends (1 stable [i386])
+Inst build-depends-arch (1 stable [i386])
+Inst build-depends-indep (1 stable [i386])
Inst build-essential (1 stable [i386])
-Inst debhelper (7 stable [i386])
-Conf build-essential (1 stable [i386])
-Conf debhelper (7 stable [i386])" aptget build-dep --simulate 2vcard_0.5-3.dsc
-
-
-# unpacked source dir
-mkdir -p foo-1.0/debian
-cat > foo-1.0/debian/control <<'EOF'
-Source: apturl
-Section: admin
-Priority: optional
-Maintainer: Michael Vogt <mvo@ubuntu.com>
-Build-Depends: debhelper (>= 7)
-X-Python3-Version: >= 3.2
-Standards-Version: 3.9.3
-
-Package: apturl-common
-Architecture: any
-Depends: ${python3:Depends},
- ${shlibs:Depends},
- ${misc:Depends},
- python3-apt,
- python3-update-manager
-Replaces: apturl (<< 0.3.6ubuntu2)
-Description: install packages using the apt protocol - common data
- AptUrl is a simple graphical application that takes an URL (which follows the
- apt-protocol) as a command line option, parses it and carries out the
- operations that the URL describes (that is, it asks the user if he wants the
- indicated packages to be installed and if the answer is positive does so for
- him).
- .
- This package contains the common data shared between the frontends.
-
-EOF
+Conf build-depends (1 stable [i386])
+Conf build-depends-arch (1 stable [i386])
+Conf build-depends-indep (1 stable [i386])
+Conf build-essential (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc
-testsuccessequal "Reading package lists...
+testsuccessequal "Note, using file './foobar.dsc' to get the build dependencies
+Reading package lists...
Building dependency tree...
-Note, using directory './foo-1.0' to get the build dependencies
+The following packages will be REMOVED:
+ build-conflicts build-conflicts-arch
The following NEW packages will be installed:
- build-essential debhelper
-0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
+ build-depends build-depends-arch build-essential
+0 upgraded, 3 newly installed, 2 to remove and 0 not upgraded.
+Remv build-conflicts [1]
+Remv build-conflicts-arch [1]
+Inst build-depends (1 stable [i386])
+Inst build-depends-arch (1 stable [i386])
Inst build-essential (1 stable [i386])
-Inst debhelper (7 stable [i386])
-Conf build-essential (1 stable [i386])
-Conf debhelper (7 stable [i386])" aptget build-dep --simulate ./foo-1.0
+Conf build-depends (1 stable [i386])
+Conf build-depends-arch (1 stable [i386])
+Conf build-essential (1 stable [i386])" aptget build-dep --simulate ./foobar.dsc --arch-only