4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
7 configarchitecture 'amd64' 'i386' 'armel'
9 insertinstalledpackage 'build-essential' 'all' '0' 'Multi-Arch: foreign'
11 insertpackage 'unstable' 'foo' 'all' '1.0'
12 insertpackage 'unstable' 'bar' 'all' '1.0'
14 insertsource 'unstable' 'buildprofiles' 'any' '1' 'Build-Depends: foo (>= 1.0) [i386 arm] <!stage1 !cross>, bar'
16 # table from https://wiki.debian.org/BuildProfileSpec
17 insertsource 'unstable' 'spec-1' 'any' '1' 'Build-Depends: foo <!stage1>'
18 insertsource 'unstable' 'spec-2' 'any' '1' 'Build-Depends: foo <stage1>'
19 insertsource 'unstable' 'spec-3' 'any' '1' 'Build-Depends: foo <!stage1 !notest>'
20 insertsource 'unstable' 'spec-4' 'any' '1' 'Build-Depends: foo <stage1 notest>'
21 insertsource 'unstable' 'spec-5' 'any' '1' 'Build-Depends: foo <!stage1 notest>'
22 insertsource 'unstable' 'spec-6' 'any' '1' 'Build-Depends: foo <stage1 !notest>'
23 insertsource 'unstable' 'spec-7' 'any' '1' 'Build-Depends: foo <stage1> <!notest>'
27 testsuccessequal 'Reading package lists...
28 Building dependency tree...
29 The following NEW packages will be installed:
31 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
32 Inst bar (1.0 unstable [all])
33 Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s
35 testsuccessequal 'Reading package lists...
36 Building dependency tree...
37 The following NEW packages will be installed:
39 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
40 Inst bar (1.0 unstable [all])
41 Inst foo (1.0 unstable [all])
42 Conf bar (1.0 unstable [all])
43 Conf foo (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=i386
45 testsuccessequal 'Reading package lists...
46 Building dependency tree...
47 The following NEW packages will be installed:
49 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
50 Inst bar (1.0 unstable [all])
51 Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=armel
53 testsuccessequal 'Reading package lists...
54 Building dependency tree...
55 The following NEW packages will be installed:
57 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
58 Inst bar (1.0 unstable [all])
59 Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=i386 -P stage1
61 KEEP='Reading package lists...
62 Building dependency tree...
63 The following NEW packages will be installed:
65 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
66 Inst foo (1.0 unstable [all])
67 Conf foo (1.0 unstable [all])'
69 DROP="Reading package lists...
70 Building dependency tree...
71 $1 has no build depends.
72 0 upgraded
, 0 newly installed
, 0 to remove and
0 not upgraded.
"
75 msgtest 'Check if version of installed dpkg is high enough for' 'build profiles support'
76 if dpkg --compare-versions "$(command dpkg-query --showformat='${Version}' --show dpkg)" 'ge' '1.17.14'; then
79 msgtest "Test with
" "dpkg
-checkbuilddeps -d '$1' -P '$2'"
80 local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir
/tmp
/testwithdpkg.output
"
81 if dpkgcheckbuilddeps -d "$1" -P "$2" /dev/null >$OUTPUT 2>&1; then
82 if [ "$3" = "$DROP" ]; then
89 if [ "$3" = "$KEEP" ]; then
100 msgtest "Test with
" "dpkg
-checkbuilddeps -d '$1' -P '$2'"
107 testequal "$4" aptget build-dep "$1" -s -P "$3"
108 export DEB_BUILD_PROFILES="$(echo "$3" | tr ',' ' ')"
109 testequal "$4" aptget build-dep "$1" -s -o with::environment=1
110 unset DEB_BUILD_PROFILES
112 testequal "$4" aptget build-dep "$1" -s
114 testwithdpkg "$2" "$3" "$4"
118 testprofile 'spec-1' 'foo <!stage1>' '' "$KEEP"
119 testprofile 'spec-1' 'foo <!stage1>' 'stage1' "$DROP"
120 testprofile 'spec-1' 'foo <!stage1>' 'notest' "$KEEP"
121 testprofile 'spec-1' 'foo <!stage1>' 'stage1,notest' "$DROP"
124 testprofile 'spec-2' 'foo <stage1>' '' "$DROP"
125 testprofile 'spec-2' 'foo <stage1>' 'stage1' "$KEEP"
126 testprofile 'spec-2' 'foo <stage1>' 'notest' "$DROP"
127 testprofile 'spec-2' 'foo <stage1>' 'stage1,notest' "$KEEP"
130 testprofile 'spec-3' 'foo <!stage1 !notest>' '' "$KEEP"
131 testprofile 'spec-3' 'foo <!stage1 !notest>' 'stage1' "$DROP"
132 testprofile 'spec-3' 'foo <!stage1 !notest>' 'notest' "$DROP"
133 testprofile 'spec-3' 'foo <!stage1 !notest>' 'stage1,notest' "$DROP"
136 testprofile 'spec-4' 'foo <stage1 notest>' '' "$DROP"
137 testprofile 'spec-4' 'foo <stage1 notest>' 'stage1' "$DROP"
138 testprofile 'spec-4' 'foo <stage1 notest>' 'notest' "$DROP"
139 testprofile 'spec-4' 'foo <stage1 notest>' 'stage1,notest' "$KEEP"
142 testprofile 'spec-5' 'foo <!stage1 notest>' '' "$DROP"
143 testprofile 'spec-5' 'foo <!stage1 notest>' 'stage1' "$DROP"
144 testprofile 'spec-5' 'foo <!stage1 notest>' 'notest' "$KEEP"
145 testprofile 'spec-5' 'foo <!stage1 notest>' 'stage1,notest' "$DROP"
148 testprofile 'spec-6' 'foo <stage1 !notest>' '' "$DROP"
149 testprofile 'spec-6' 'foo <stage1 !notest>' 'stage1' "$KEEP"
150 testprofile 'spec-6' 'foo <stage1 !notest>' 'notest' "$DROP"
151 testprofile 'spec-6' 'foo <stage1 !notest>' 'stage1,notest' "$DROP"
154 testprofile 'spec-7' 'foo <stage1> <!notest>' '' "$KEEP"
155 testprofile 'spec-7' 'foo <stage1> <!notest>' 'stage1' "$KEEP"
156 testprofile 'spec-7' 'foo <stage1> <!notest>' 'notest' "$DROP"
157 testprofile 'spec-7' 'foo <stage1> <!notest>' 'stage1,notest' "$KEEP"