4 TESTDIR
="$(readlink -f "$(dirname "$0")")"
8 configarchitecture 'amd64' 'i386'
10 # regression test for #754904
11 testfailureequal 'E: Unsupported file /dev/null given on commandline' aptget install -qq /dev/null
13 # only consider .deb files
15 I'm not a deb, I'm a teapot.
17 testfailureequal 'E: Unsupported file ./foo.rpm given on commandline' aptget install -qq ./foo.rpm
19 # and ensure we fail for invalid debs
21 testfailuremsg "E
: Sub
-process Popen returned an error code
(2)
22 E
: Encountered a section with no Package
: header
23 E
: Problem with MergeList
${TMPWORKINGDIRECTORY}/foo.deb
24 E
: The package lists or status
file could not be parsed or opened.
" aptget install ./foo.deb
26 buildsimplenativepackage 'foo' 'i386,amd64' '1.0'
28 testfailureequal "Reading package lists...
29 Building dependency tree...
30 Note
, selecting
'foo:i386' instead of
'./incoming/foo_1.0_i386.deb'
31 Note
, selecting
'foo' instead of
'./incoming/foo_1.0_amd64.deb'
32 Some packages could not be installed. This may mean that you have
33 requested an impossible situation or
if you are using the unstable
34 distribution that some required packages have not yet been created
35 or been moved out of Incoming.
36 The following information may
help to resolve the situation
:
38 The following packages have unmet dependencies
:
39 foo
:i386
: Conflicts
: foo but
1.0 is to be installed
40 foo
: Conflicts
: foo
:i386 but
1.0 is to be installed
41 E
: Unable to correct problems
, you have held broken packages.
" aptget install ./incoming/foo_1.0_i386.deb ./incoming/foo_1.0_amd64.deb -s
43 testdpkgnotinstalled 'foo' 'foo:i386'
44 testsuccess aptget install ./incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1
45 testdpkginstalled 'foo:i386'
46 testfailure aptget install incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1
48 testsuccess aptget install "$(readlink -f ../incoming/foo_1.0_i386.deb)" -o Debug::pkgCacheGen=1 -y --reinstall
49 testfailure grep 'is already the newest version' ../rootdir/tmp/testsuccess.output
50 testsuccess aptget install ../incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1 -y --reinstall
51 testfailure grep 'is already the newest version' ../rootdir/tmp/testsuccess.output
54 testsuccessequal "Reading package lists...
55 Building dependency tree...
56 Reading state information...
57 Note
, selecting
'foo' instead of
'./incoming/foo_1.0_amd64.deb'
58 The following packages will be REMOVED
:
60 The following NEW packages will be installed
:
62 0 upgraded
, 1 newly installed
, 1 to remove and
0 not upgraded.
64 Inst foo
(1.0 local-deb [amd64
])
65 Conf foo
(1.0 local-deb [amd64
])" aptget install ./incoming/foo_1.0_amd64.deb -s
67 testsuccessequal 'Reading package lists...
68 Building dependency tree...
69 Reading state information...
70 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget install --with-source ./incoming/foo_1.0_amd64.deb -s
72 testsuccessequal 'Reading package lists...
73 Building dependency tree...
74 Reading state information...
75 The following packages will be REMOVED:
77 The following NEW packages will be installed:
79 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
81 Inst foo (1.0 local-deb [amd64])
82 Conf foo (1.0 local-deb [amd64])' aptget install --with-source ./incoming/foo_1.0_amd64.deb foo -s
84 # Check that installing the local deb works if it is not the candidate
87 Pin
-Priority: -1" > rootdir/etc/apt/preferences
89 testsuccessequal "Reading package lists...
90 Building dependency tree...
91 Reading state information...
92 Note
, selecting
'foo' instead of
'./incoming/foo_1.0_amd64.deb'
93 The following packages will be REMOVED
:
95 The following NEW packages will be installed
:
97 0 upgraded
, 1 newly installed
, 1 to remove and
0 not upgraded.
99 Inst foo
(1.0 local-deb [amd64
])
100 Conf foo
(1.0 local-deb [amd64
])" aptget install ./incoming/foo_1.0_amd64.deb -s
104 mkdir -p ./incoming/$PKG/DEBIAN
106 echo -n "$2" >> ./incoming/$PKG/DEBIAN/control
111 Maintainer
: No Body
<no@example.org
>
114 Description
: test package
" >> ./incoming/$PKG/DEBIAN/control
116 echo -n "$3" >> ./incoming/$PKG/DEBIAN/control
118 testsuccess dpkg-deb --build ./incoming/$PKG/ ./incoming
119 #dpkg-deb -I ./incoming/${PKG}_0_all.deb control
121 createpkg 'as-it-should-be'
122 createpkg 'leading-newline' '
125 createpkg 'trailing-newline' '' '
128 testsuccess aptget install ./incoming/pkg-as-it-should-be_0_all.deb
129 testsuccess aptget install ./incoming/pkg-leading-newline_0_all.deb
130 testsuccess aptget install ./incoming/pkg-trailing-newline_0_all.deb
133 if [ "$(id -u)" = '0' ]; then
134 # see if permission dropping is checked before usage
136 testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb --reinstall
137 testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
139 testsuccesswithnotice aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb --reinstall
140 testfailure grep 'is already the newest version' rootdir/tmp/testsuccesswithnotice.output
142 testsuccesswithnotice aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb --reinstall
143 testfailure grep 'is already the newest version' rootdir/tmp/testsuccesswithnotice.output
146 testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb --reinstall
147 testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
150 sed -i -e '/^Depends: foo/ d' rootdir/var/lib/dpkg/status
151 testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb
152 testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
153 testsuccess apt purge -y pkg-as-it-should-be
155 echo "Package
: pkg
-as-it-should-be
159 Filename
: incoming
/pkg
-as-it-should-be_0_all.deb
160 Size
: $(stat -c %s incoming/pkg-as-it-should-be_0_all.deb)
161 SHA256
: $(sha256sum incoming/pkg-as-it-should-be_0_all.deb | cut -d' ' -f 1)
163 testdpkgnotinstalled 'pkg-as-it-should-be'
164 testnopackage pkg-as-it-should-be
165 testsuccess apt install --with-source ./Packages pkg-as-it-should-be -s
166 testsuccess apt install --with-source ./Packages pkg-as-it-should-be --print-uris
167 testsuccess apt show --with-source ./Packages pkg-as-it-should-be
168 testequal 'Package: pkg-as-it-should-be' head -n1 rootdir/tmp/testsuccess.output
169 testsuccess apt install -y --with-source ./Packages pkg-as-it-should-be
170 testdpkginstalled 'pkg-as-it-should-be'
173 echo 'dpkg::install::recursive "true
";
174 dpkg::install::recursive::force "true
";
175 dpkg::install::recursive::minimum "0";' > rootdir/etc/apt/apt.conf.d/lowerminimum.conf
176 mv ./incoming/pkg-as-it-should-be_0_all.deb ./incoming/pkg-as-it-should-be_0_all.ddeb
177 testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.ddeb --reinstall
178 testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
179 testsuccess apt purge -y pkg-as-it-should-be
180 testdpkgnotinstalled 'pkg-as-it-should-be'
182 mv ./incoming/pkg-as-it-should-be_0_all.ddeb ./incoming/pkg-as-it-should-be_0_all.foobar
183 echo "Package
: pkg
-as-it-should-be
187 Filename
: incoming
/pkg
-as-it-should-be_0_all.foobar
188 Size
: $(stat -c %s incoming/pkg-as-it-should-be_0_all.foobar)
189 SHA256
: $(sha256sum incoming/pkg-as-it-should-be_0_all.foobar | cut -d' ' -f 1)
190 " | gzip > Packages.gz
191 testsuccess apt install --with-source ./Packages.gz pkg-as-it-should-be -s
192 testsuccess apt install --with-source ./Packages.gz pkg-as-it-should-be --print-uris
193 testsuccess apt show --with-source ./Packages.gz pkg-as-it-should-be
194 testequal 'Package: pkg-as-it-should-be' head -n1 rootdir/tmp/testsuccess.output
195 testsuccess apt install -y --with-source ./Packages.gz pkg-as-it-should-be
196 testdpkginstalled 'pkg-as-it-should-be'