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 echo 'Package: /pkg-/
129 Pin: release a=experimental
130 Pin-Priority: 501' > rootdir/etc/apt/preferences.d/pinit
132 testsuccess aptget install ./incoming/pkg-as-it-should-be_0_all.deb
133 testsuccess aptget install "$(readlink -f ./incoming/pkg-leading-newline_0_all.deb)"
134 testsuccess aptget install ./incoming/pkg-trailing-newline_0_all.deb
137 if [ "$(id -u)" = '0' ]; then
138 # see if permission dropping is checked before usage
140 testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb --reinstall
141 testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
143 testsuccesswithnotice aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb --reinstall
144 testfailure grep 'is already the newest version' rootdir/tmp/testsuccesswithnotice.output
146 testsuccesswithnotice aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb --reinstall
147 testfailure grep 'is already the newest version' rootdir/tmp/testsuccesswithnotice.output
150 testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb --reinstall
151 testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
154 sed -i -e '/^Depends: foo/ d' rootdir/var/lib/dpkg/status
155 testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.deb
156 testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
157 testsuccess apt purge -y pkg-as-it-should-be
159 echo "Package
: pkg
-as-it-should-be
163 Filename
: incoming
/pkg
-as-it-should-be_0_all.deb
164 Size
: $(stat -c %s incoming/pkg-as-it-should-be_0_all.deb)
165 SHA256
: $(sha256sum incoming/pkg-as-it-should-be_0_all.deb | cut -d' ' -f 1)
167 testdpkgnotinstalled 'pkg-as-it-should-be'
168 testnopackage pkg-as-it-should-be
169 testsuccess apt install --with-source ./Packages pkg-as-it-should-be -s
170 testsuccess apt install --with-source ./Packages pkg-as-it-should-be --print-uris
171 testsuccess apt show --with-source ./Packages pkg-as-it-should-be
172 testequal 'Package: pkg-as-it-should-be' head -n1 rootdir/tmp/testsuccess.output
173 testsuccess apt install -y --with-source ./Packages pkg-as-it-should-be
174 testdpkginstalled 'pkg-as-it-should-be'
177 echo 'dpkg::install::recursive "true
";
178 dpkg::install::recursive::force "true
";
179 dpkg::install::recursive::minimum "0";' > rootdir/etc/apt/apt.conf.d/lowerminimum.conf
180 mv ./incoming/pkg-as-it-should-be_0_all.deb ./incoming/pkg-as-it-should-be_0_all.ddeb
181 testsuccess aptget install -y ./incoming/pkg-as-it-should-be_0_all.ddeb --reinstall
182 testfailure grep 'is already the newest version' rootdir/tmp/testsuccess.output
183 testsuccess apt purge -y pkg-as-it-should-be
184 testdpkgnotinstalled 'pkg-as-it-should-be'
186 mv ./incoming/pkg-as-it-should-be_0_all.ddeb ./incoming/pkg-as-it-should-be_0_all.foobar
187 echo "Package
: pkg
-as-it-should-be
191 Filename
: incoming
/pkg
-as-it-should-be_0_all.foobar
192 Size
: $(stat -c %s incoming/pkg-as-it-should-be_0_all.foobar)
193 SHA256
: $(sha256sum incoming/pkg-as-it-should-be_0_all.foobar | cut -d' ' -f 1)
194 " | gzip > Packages.gz
195 testsuccess apt install --with-source ./Packages.gz pkg-as-it-should-be -s
196 testsuccess apt install --with-source ./Packages.gz pkg-as-it-should-be --print-uris
197 testsuccess apt show --with-source ./Packages.gz pkg-as-it-should-be
198 testequal 'Package: pkg-as-it-should-be' head -n1 rootdir/tmp/testsuccess.output
199 testsuccess apt install -y --with-source ./Packages.gz pkg-as-it-should-be
200 testdpkginstalled 'pkg-as-it-should-be'