]> git.saurik.com Git - apt.git/blame - test/integration/test-apt-sources-deb822
add support for Enabled: no in deb822 sources.list
[apt.git] / test / integration / test-apt-sources-deb822
CommitLineData
a537ce19
MV
1#!/bin/sh
2set -e
3
4TESTDIR=$(readlink -f $(dirname $0))
5. $TESTDIR/framework
6
7setupenvironment
8configarchitecture "i386"
9
4194c9ae
MV
10SOURCES="rootdir/etc/apt/sources.list"
11
12echo "deb http://ftp.debian.org/debian stable main" > $SOURCES
d2d68aaf
MV
13testequalwithmsg "Old style sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
14'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
15'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
16
17
18BASE="# some comment
19# that contains a : as well
20#Type: meep
21
22Type: deb
866e9fad 23URI: http://ftp.debian.org/debian
6c069a22
MV
24Suites: stable
25Sections: main
e67b9a23
MV
26Description: summay
27 and the long part"
a537ce19
MV
28
29# simple case
4194c9ae 30echo "$BASE" > $SOURCES
d2d68aaf 31testequalwithmsg "Simple deb822 sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
a537ce19
MV
32'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
33'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
34
a537ce19 35# Two entries
4194c9ae
MV
36echo "$BASE" > $SOURCES
37echo "" >> $SOURCES
38echo "$BASE" | sed s/stable/unstable/ >> $SOURCES
a537ce19 39
d2d68aaf 40testequalwithmsg "Multiple entries in deb822 sources.list work" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
a537ce19
MV
41'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
42'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
43'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 :
44'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 :
45'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris
46
d73743dd
MV
47# two suite entries
48echo "$BASE" | sed -e "s/stable/stable unstable/" > $SOURCES
49testequalwithmsg "Two Suite entries deb822 sources.list work" "'http://ftp.debian.org/debian/dists/stable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-i386_Packages 0 :
50'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
51'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0
52'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 :
53'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 :
54'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris
a537ce19
MV
55
56# ARCH option
4194c9ae 57echo "$BASE" > $SOURCES
7037aab5 58echo "Architectures: amd64,armel" >> $SOURCES
a537ce19 59
d2d68aaf 60testequalwithmsg "Arch: option in deb822 sources.list works" "'http://ftp.debian.org/debian/dists/stable/main/binary-amd64/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-amd64_Packages 0 :
a537ce19
MV
61'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 :
62'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 :
63'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris
d2d68aaf 64
4194c9ae
MV
65# invalid sources.list file
66echo "deb http://ftp.debian.org" > $SOURCES
67
68testequalwithmsg "Invalid sources.list file gives proper error" "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist)
69E: The list of sources could not be read." aptget update --print-uris
70
71echo "Type: deb
6c069a22 72Suites: stable
4194c9ae
MV
73" > $SOURCES
74
75testequalwithmsg "Invalid deb822 sources.list file gives proper error" "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse)
76E: The list of sources could not be read." aptget update --print-uris
e67b9a23 77
7dd62ea9
MV
78# with Enabled: false
79echo "$BASE" > $SOURCES
80echo "Enabled: no" >> $SOURCES
81testempty aptget update --print-uris