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 Reading package lists...
29 Building dependency tree...
30 The following NEW packages will be installed:
32 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
33 Inst bar (1.0 unstable [all])
34 Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s
36 testsuccessequal 'Reading package lists...
37 Building dependency tree...
38 The following NEW packages will be installed:
40 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
41 Inst bar (1.0 unstable [all])
42 Inst foo (1.0 unstable [all])
43 Conf bar (1.0 unstable [all])
44 Conf foo (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=i386
46 testsuccessequal 'Reading package lists...
47 Building dependency tree...
48 The following NEW packages will be installed:
50 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
51 Inst bar (1.0 unstable [all])
52 Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=armel
54 testsuccessequal 'Reading package lists...
55 Building dependency tree...
56 The following NEW packages will be installed:
58 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
59 Inst bar (1.0 unstable [all])
60 Conf bar (1.0 unstable [all])' aptget build-dep buildprofiles -s -o APT::Architecture=i386 -P stage1
62 KEEP='Reading package lists...
63 Reading package lists...
64 Building dependency tree...
65 The following NEW packages will be installed:
67 0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
68 Inst foo (1.0 unstable [all])
69 Conf foo (1.0 unstable [all])'
71 DROP="Reading package lists...
72 $1 has no build depends.
73 Reading package lists...
74 Building dependency tree...
75 0 upgraded
, 0 newly installed
, 0 to remove and
0 not upgraded.
"
78 msgtest 'Check if version of installed dpkg is high enough for' 'build profiles support'
79 if dpkg --compare-versions "$(command dpkg-query --showformat='${Version}' --show dpkg)" 'ge' '1.17.14'; then
82 msgtest "Test with
" "dpkg
-checkbuilddeps -d '$1' -P '$2'"
83 local OUTPUT="${TMPWORKINGDIRECTORY}/rootdir
/tmp
/testwithdpkg.output
"
84 if dpkgcheckbuilddeps -d "$1" -P "$2" /dev/null >$OUTPUT 2>&1; then
85 if [ "$3" = "$DROP" ]; then
92 if [ "$3" = "$KEEP" ]; then
103 msgtest "Test with
" "dpkg
-checkbuilddeps -d '$1' -P '$2'"
110 testequal "$4" aptget build-dep "$1" -s -P "$3"
111 export DEB_BUILD_PROFILES="$(echo "$3" | tr ',' ' ')"
112 testequal "$4" aptget build-dep "$1" -s -o with::environment=1
113 unset DEB_BUILD_PROFILES
115 testequal "$4" aptget build-dep "$1" -s
117 testwithdpkg "$2" "$3" "$4"
120 testsuccess aptcache gencaches
122 testprofile 'spec-1' 'foo <!stage1>' '' "$KEEP"
123 testprofile 'spec-1' 'foo <!stage1>' 'stage1' "$DROP"
124 testprofile 'spec-1' 'foo <!stage1>' 'notest' "$KEEP"
125 testprofile 'spec-1' 'foo <!stage1>' 'stage1,notest' "$DROP"
128 testprofile 'spec-2' 'foo <stage1>' '' "$DROP"
129 testprofile 'spec-2' 'foo <stage1>' 'stage1' "$KEEP"
130 testprofile 'spec-2' 'foo <stage1>' 'notest' "$DROP"
131 testprofile 'spec-2' 'foo <stage1>' 'stage1,notest' "$KEEP"
134 testprofile 'spec-3' 'foo <!stage1 !notest>' '' "$KEEP"
135 testprofile 'spec-3' 'foo <!stage1 !notest>' 'stage1' "$DROP"
136 testprofile 'spec-3' 'foo <!stage1 !notest>' 'notest' "$DROP"
137 testprofile 'spec-3' 'foo <!stage1 !notest>' 'stage1,notest' "$DROP"
140 testprofile 'spec-4' 'foo <stage1 notest>' '' "$DROP"
141 testprofile 'spec-4' 'foo <stage1 notest>' 'stage1' "$DROP"
142 testprofile 'spec-4' 'foo <stage1 notest>' 'notest' "$DROP"
143 testprofile 'spec-4' 'foo <stage1 notest>' 'stage1,notest' "$KEEP"
146 testprofile 'spec-5' 'foo <!stage1 notest>' '' "$DROP"
147 testprofile 'spec-5' 'foo <!stage1 notest>' 'stage1' "$DROP"
148 testprofile 'spec-5' 'foo <!stage1 notest>' 'notest' "$KEEP"
149 testprofile 'spec-5' 'foo <!stage1 notest>' 'stage1,notest' "$DROP"
152 testprofile 'spec-6' 'foo <stage1 !notest>' '' "$DROP"
153 testprofile 'spec-6' 'foo <stage1 !notest>' 'stage1' "$KEEP"
154 testprofile 'spec-6' 'foo <stage1 !notest>' 'notest' "$DROP"
155 testprofile 'spec-6' 'foo <stage1 !notest>' 'stage1,notest' "$DROP"
158 testprofile 'spec-7' 'foo <stage1> <!notest>' '' "$KEEP"
159 testprofile 'spec-7' 'foo <stage1> <!notest>' 'stage1' "$KEEP"
160 testprofile 'spec-7' 'foo <stage1> <!notest>' 'notest' "$DROP"
161 testprofile 'spec-7' 'foo <stage1> <!notest>' 'stage1,notest' "$KEEP"