]>
Commit | Line | Data |
---|---|---|
a537ce19 MV |
1 | #!/bin/sh |
2 | set -e | |
3 | ||
4 | TESTDIR=$(readlink -f $(dirname $0)) | |
5 | . $TESTDIR/framework | |
6 | ||
7 | setupenvironment | |
8 | configarchitecture "i386" | |
9 | ||
4194c9ae MV |
10 | SOURCES="rootdir/etc/apt/sources.list" |
11 | ||
12 | echo "deb http://ftp.debian.org/debian stable main" > $SOURCES | |
d2d68aaf MV |
13 | testequalwithmsg "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 | ||
18 | BASE="# some comment | |
19 | # that contains a : as well | |
20 | #Type: meep | |
21 | ||
22 | Type: deb | |
a537ce19 MV |
23 | URL: http://ftp.debian.org/debian |
24 | Dist: stable | |
25 | Section: main | |
26 | Comment: Some random string | |
27 | that can be very long" | |
28 | ||
29 | # simple case | |
4194c9ae | 30 | echo "$BASE" > $SOURCES |
a537ce19 | 31 | |
d2d68aaf | 32 | testequalwithmsg "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 |
33 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : |
34 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris | |
35 | ||
36 | ||
300b15e3 | 37 | # two sections (we support both "," and " " as seperator) |
4194c9ae | 38 | echo "$BASE" | sed s/main/"main,contrib"/ > $SOURCES |
300b15e3 | 39 | |
d2d68aaf | 40 | testequalwithmsg "Two sections 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 : |
300b15e3 MV |
41 | 'http://ftp.debian.org/debian/dists/stable/contrib/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_stable_contrib_binary-i386_Packages 0 : |
42 | 'http://ftp.debian.org/debian/dists/stable/contrib/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_contrib_i18n_Translation-en 0 : | |
43 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : | |
44 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris | |
45 | ||
46 | ||
a537ce19 | 47 | # Two entries |
4194c9ae MV |
48 | echo "$BASE" > $SOURCES |
49 | echo "" >> $SOURCES | |
50 | echo "$BASE" | sed s/stable/unstable/ >> $SOURCES | |
a537ce19 | 51 | |
d2d68aaf | 52 | testequalwithmsg "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 |
53 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : |
54 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 | |
55 | 'http://ftp.debian.org/debian/dists/unstable/main/binary-i386/Packages.bz2' ftp.debian.org_debian_dists_unstable_main_binary-i386_Packages 0 : | |
56 | 'http://ftp.debian.org/debian/dists/unstable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_unstable_main_i18n_Translation-en 0 : | |
57 | 'http://ftp.debian.org/debian/dists/unstable/InRelease' ftp.debian.org_debian_dists_unstable_InRelease 0 " aptget update --print-uris | |
58 | ||
59 | ||
60 | # ARCH option | |
4194c9ae MV |
61 | echo "$BASE" > $SOURCES |
62 | echo "Arch: amd64,armel" >> $SOURCES | |
a537ce19 | 63 | |
d2d68aaf | 64 | testequalwithmsg "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 |
65 | 'http://ftp.debian.org/debian/dists/stable/main/binary-armel/Packages.bz2' ftp.debian.org_debian_dists_stable_main_binary-armel_Packages 0 : |
66 | 'http://ftp.debian.org/debian/dists/stable/main/i18n/Translation-en.bz2' ftp.debian.org_debian_dists_stable_main_i18n_Translation-en 0 : | |
67 | 'http://ftp.debian.org/debian/dists/stable/InRelease' ftp.debian.org_debian_dists_stable_InRelease 0 " aptget update --print-uris | |
d2d68aaf | 68 | |
4194c9ae MV |
69 | # invalid sources.list file |
70 | echo "deb http://ftp.debian.org" > $SOURCES | |
71 | ||
72 | testequalwithmsg "Invalid sources.list file gives proper error" "E: Malformed line 1 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (dist) | |
73 | E: The list of sources could not be read." aptget update --print-uris | |
74 | ||
75 | echo "Type: deb | |
76 | Dist: stable | |
77 | " > $SOURCES | |
78 | ||
79 | testequalwithmsg "Invalid deb822 sources.list file gives proper error" "E: Malformed stanza 0 in source list $TMPWORKINGDIRECTORY/rootdir/etc/apt/sources.list (URI parse) | |
80 | E: The list of sources could not be read." aptget update --print-uris |