]>
Commit | Line | Data |
---|---|---|
9c3e15ab MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | ||
7 | setupenvironment | |
5465192b | 8 | configarchitecture 'amd64' 'i386' |
9c3e15ab MV |
9 | |
10 | # regression test for #754904 | |
14341a7e | 11 | testfailureequal 'E: Unsupported file /dev/null given on commandline' aptget install -qq /dev/null |
9c3e15ab | 12 | |
5465192b DK |
13 | # only consider .deb files |
14 | cat > foo.rpm <<EOF | |
9c3e15ab MV |
15 | I'm not a deb, I'm a teapot. |
16 | EOF | |
14341a7e | 17 | testfailureequal 'E: Unsupported file ./foo.rpm given on commandline' aptget install -qq ./foo.rpm |
5465192b DK |
18 | |
19 | # and ensure we fail for invalid debs | |
20 | mv foo.rpm foo.deb | |
14341a7e DK |
21 | testfailuremsg "E: Sub-process Popen returned an error code (2) |
22 | E: Encountered a section with no Package: header | |
c9443c01 | 23 | E: Problem with MergeList ${TMPWORKINGDIRECTORY}/foo.deb |
14341a7e | 24 | E: The package lists or status file could not be parsed or opened." aptget install ./foo.deb |
9c3e15ab | 25 | |
5465192b DK |
26 | buildsimplenativepackage 'foo' 'i386,amd64' '1.0' |
27 | ||
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: | |
37 | ||
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 -q=0 | |
42 | ||
d61960d9 | 43 | testdpkgnotinstalled 'foo' |
c9443c01 | 44 | testsuccess aptget install ./incoming/foo_1.0_i386.deb -o Debug::pkgCacheGen=1 |
b2640c0a | 45 | testdpkginstalled 'foo:i386' |
5465192b DK |
46 | |
47 | testsuccessequal "Reading package lists... | |
48 | Building dependency tree... | |
49 | Reading state information... | |
50 | Note, selecting 'foo' instead of './incoming/foo_1.0_amd64.deb' | |
51 | The following packages will be REMOVED: | |
52 | foo:i386 | |
53 | The following NEW packages will be installed: | |
54 | foo | |
55 | 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. | |
56 | Remv foo:i386 [1.0] | |
c9443c01 DK |
57 | Inst foo (1.0 local-deb [amd64]) |
58 | Conf foo (1.0 local-deb [amd64])" aptget install ./incoming/foo_1.0_amd64.deb -s -q=0 | |
848fd2a6 JAK |
59 | |
60 | # Check that installing the local deb works if it is not the candidate | |
61 | echo "Package: foo | |
62 | Pin: version 1.0 | |
63 | Pin-Priority: -1" > rootdir/etc/apt/preferences | |
64 | ||
65 | testsuccessequal "Reading package lists... | |
66 | Building dependency tree... | |
67 | Reading state information... | |
68 | Note, selecting 'foo' instead of './incoming/foo_1.0_amd64.deb' | |
69 | The following packages will be REMOVED: | |
70 | foo:i386 | |
71 | The following NEW packages will be installed: | |
72 | foo | |
73 | 0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded. | |
74 | Remv foo:i386 [1.0] | |
75 | Inst foo (1.0 local-deb [amd64]) | |
76 | Conf foo (1.0 local-deb [amd64])" aptget install ./incoming/foo_1.0_amd64.deb -s -q=0 |