fix progress output for (dist-)upgrade calculation
[ntk/apt.git] / test / integration / test-bug-686346-package-missing-architecture
CommitLineData
c919ad6e
DK
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6setupenvironment
7configarchitecture 'amd64'
8
9insertinstalledpackage 'pkgb' 'none' '1'
10insertinstalledpackage 'pkgd' 'none' '1'
11insertpackage 'unstable' 'pkga' 'amd64' '2' 'Depends: pkgb'
12insertpackage 'unstable' 'pkgb' 'amd64' '2'
13insertpackage 'unstable' 'pkgc' 'amd64' '1' 'Conflicts: pkgb'
14insertpackage 'unstable' 'pkge' 'none' '1'
15
16setupaptarchive
17
18testequal 'Reading package lists...
19Building dependency tree...
20The following packages will be REMOVED:
21 pkgb:none
22The following NEW packages will be installed:
23 pkgc
240 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
25Remv pkgb:none [1]
26Inst pkgc (1 unstable [amd64])
27Conf pkgc (1 unstable [amd64])' aptget install pkgc -s
28
29testequal 'Reading package lists...
30Building dependency tree...
31The following extra packages will be installed:
32 pkgb
33The following packages will be REMOVED:
34 pkgb:none
35The following NEW packages will be installed:
36 pkga pkgb
370 upgraded, 2 newly installed, 1 to remove and 0 not upgraded.
38Remv pkgb:none [1]
39Inst pkgb (2 unstable [amd64])
40Inst pkga (2 unstable [amd64])
41Conf pkgb (2 unstable [amd64])
42Conf pkga (2 unstable [amd64])' aptget install pkga -s
43
44# ensure that arch-less stanzas from Packages files are ignored
45msgtest 'Package is distributed in the Packages files' 'pkge'
46grep -q 'Package: pkge' $(find aptarchive -name 'Packages') && msgpass || msgfail
47testnopackage pkge
48testnopackage pkge:none
49testnopackage pkge:*
50
51# do not automatically change from none-arch to whatever-arch as
52# this breaks other none packages and dpkg has this ruleset as
53# this difference seems so important that it has to be maintained …
54testequal 'Reading package lists...
55Building dependency tree...
2a884c61 56Calculating upgrade...
c919ad6e
DK
570 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -s
58
59# pkgd has no update with an architecture
60testdpkginstalled pkgd
61msgtest 'Test apt-get purge' 'pkgd'
0440d936 62testsuccess --nomsg aptget purge pkgd -y
c919ad6e
DK
63testdpkgnotinstalled pkgd
64
65# there is a pkgb with an architecture
66testdpkginstalled pkgb
67msgtest 'Test apt-get purge' 'pkgb:none'
0440d936 68testsuccess --nomsg aptget purge pkgb:none -y
c919ad6e
DK
69testdpkgnotinstalled pkgb
70
71# check that dependencies are created after the none package exists in the cache
72rm rootdir/var/cache/apt/*.bin
73insertinstalledpackage 'pkgb' 'none' '1'
74insertinstalledpackage 'pkgf' 'none' '1' 'Conflicts: pkgb'
75insertinstalledpackage 'pkgg' 'amd64' '1' 'Conflicts: pkgb'
76insertinstalledpackage 'pkgb' 'amd64' '2'
18908589 77testequalor2 "Reading package lists...
c919ad6e
DK
78Building dependency tree...
79Reading state information...
80You might want to run 'apt-get -f install' to correct these.
81The following packages have unmet dependencies:
82 pkgb : Conflicts: pkgb:none but 1 is installed
83 pkgb:none : Conflicts: pkgb but 2 is installed
84 pkgf:none : Conflicts: pkgb:none but 1 is installed
85 Conflicts: pkgb but 2 is installed
86 pkgg : Conflicts: pkgb but 2 is installed
87 Conflicts: pkgb:none but 1 is installed
18908589
DK
88E: Unmet dependencies. Try using -f." "Reading package lists...
89Building dependency tree...
90Reading state information...
91You might want to run 'apt-get -f install' to correct these.
92The following packages have unmet dependencies:
93 pkgb : Conflicts: pkgb:none but 1 is installed
94 pkgb:none : Conflicts: pkgb but 2 is installed
95 pkgf:none : Conflicts: pkgb but 2 is installed
96 Conflicts: pkgb:none but 1 is installed
97 pkgg : Conflicts: pkgb but 2 is installed
98 Conflicts: pkgb:none but 1 is installed
c919ad6e 99E: Unmet dependencies. Try using -f." aptget check
7605509f
DK
100
101# check that dependencies are generated for none-packages
102rm rootdir/var/lib/dpkg/status
103insertinstalledpackage 'pkgx' 'none' '1'
104insertinstalledpackage 'pkgy' 'none' '1' 'Depends: pkgz, pkgx (>= 1)'
105insertinstalledpackage 'pkgz' 'none' '1'
106testequal 'Reading package lists...
107Building dependency tree...
108Reading state information...
109The following packages will be REMOVED:
110 pkgx:none* pkgy:none*
1110 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
112Purg pkgy:none [1]
113Purg pkgx:none [1]' aptget purge pkgx -s
114testequal 'Reading package lists...
115Building dependency tree...
116Reading state information...
117The following packages will be REMOVED:
118 pkgy:none* pkgz:none*
1190 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
120Purg pkgy:none [1]
121Purg pkgz:none [1]' aptget purge pkgz -s