]> git.saurik.com Git - apt.git/blame - test/integration/test-bug-686346-package-missing-architecture
merged from the debian-sid branch
[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...
560 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -s
57
58# pkgd has no update with an architecture
59testdpkginstalled pkgd
60msgtest 'Test apt-get purge' 'pkgd'
61aptget purge pkgd -y >/dev/null 2>&1 && msgpass || msgfail
62testdpkgnotinstalled pkgd
63
64# there is a pkgb with an architecture
65testdpkginstalled pkgb
66msgtest 'Test apt-get purge' 'pkgb:none'
67aptget purge pkgb:none -y >/dev/null 2>&1 && msgpass || msgfail
68testdpkgnotinstalled pkgb
69
70# check that dependencies are created after the none package exists in the cache
71rm rootdir/var/cache/apt/*.bin
72insertinstalledpackage 'pkgb' 'none' '1'
73insertinstalledpackage 'pkgf' 'none' '1' 'Conflicts: pkgb'
74insertinstalledpackage 'pkgg' 'amd64' '1' 'Conflicts: pkgb'
75insertinstalledpackage 'pkgb' 'amd64' '2'
76testequal "Reading package lists...
77Building dependency tree...
78Reading state information...
79You might want to run 'apt-get -f install' to correct these.
80The following packages have unmet dependencies:
81 pkgb : Conflicts: pkgb:none but 1 is installed
82 pkgb:none : Conflicts: pkgb but 2 is installed
83 pkgf:none : Conflicts: pkgb:none but 1 is installed
84 Conflicts: pkgb but 2 is installed
85 pkgg : Conflicts: pkgb but 2 is installed
86 Conflicts: pkgb:none but 1 is installed
87E: Unmet dependencies. Try using -f." aptget check
7605509f
DK
88
89# check that dependencies are generated for none-packages
90rm rootdir/var/lib/dpkg/status
91insertinstalledpackage 'pkgx' 'none' '1'
92insertinstalledpackage 'pkgy' 'none' '1' 'Depends: pkgz, pkgx (>= 1)'
93insertinstalledpackage 'pkgz' 'none' '1'
94testequal 'Reading package lists...
95Building dependency tree...
96Reading state information...
97The following packages will be REMOVED:
98 pkgx:none* pkgy:none*
990 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
100Purg pkgy:none [1]
101Purg pkgx:none [1]' aptget purge pkgx -s
102testequal 'Reading package lists...
103Building dependency tree...
104Reading state information...
105The following packages will be REMOVED:
106 pkgy:none* pkgz:none*
1070 upgraded, 0 newly installed, 2 to remove and 0 not upgraded.
108Purg pkgy:none [1]
109Purg pkgz:none [1]' aptget purge pkgz -s