diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-08-30 22:34:28 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-30 22:50:55 +0200 |
commit | 3090ae6972fd0e15767a96708c248f3ab87502f2 (patch) | |
tree | 64784316160820e1673cd2810aad6a2b370fd809 /test/integration/test-apt-acquire-additional-files-duplicates | |
parent | c4d1ab98921cddc8bd01f1e23ec1f4f9e7d2a90a (diff) |
detect and deal with indextarget duplicates
Multiple targets downloading the same file is bad™ as it leads us to all
sorts of problems like the acquire system breaking or simply a problem
of which settings to use for them. Beside that this is most likely a
mistake and silently ignoring it doesn't help the user realizing his
mistake…
On the other hand, we have 'duplicates' which are 'created' by how we
create indextargets, so we have to prevent those from being created to
but do not emit a warning for them as this is an implementation detail.
And then, there is the absolute and most likely user mistake: Having the
same target(s) activated in multiple entries.
Diffstat (limited to 'test/integration/test-apt-acquire-additional-files-duplicates')
-rwxr-xr-x | test/integration/test-apt-acquire-additional-files-duplicates | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/test/integration/test-apt-acquire-additional-files-duplicates b/test/integration/test-apt-acquire-additional-files-duplicates new file mode 100755 index 000000000..dbfc0eb74 --- /dev/null +++ b/test/integration/test-apt-acquire-additional-files-duplicates @@ -0,0 +1,86 @@ +#!/bin/sh +set -e + +TESTDIR=$(readlink -f $(dirname $0)) +. $TESTDIR/framework +setupenvironment +configarchitecture 'amd64' 'i386' + +cat > rootdir/etc/apt/apt.conf.d/content-target.conf <<EOF +Acquire::IndexTargets::deb::Contents1 { + MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE)"; + ShortDescription "Contents"; + Description "\$(RELEASE) Contents"; + DefaultEnabled "false"; +}; +Acquire::IndexTargets::deb::Contents2 { + MetaKey "\$(COMPONENT)/Contents-\$(ARCHITECTURE)"; + ShortDescription "Contents"; + Description "\$(RELEASE) Contents"; + DefaultEnabled "false"; +}; +Acquire::IndexTargets::deb::Contentsflat { + MetaKey "Contents-\$(ARCHITECTURE)"; + ShortDescription "Contents"; + Description "\$(RELEASE) Contents"; + DefaultEnabled "false"; +}; +EOF + +mkdir -p ./rootdir/var/lib/apt/lists +APTLISTS="$(readlink -f ./rootdir/var/lib/apt/lists)" +APTETC="$(readlink -f ./rootdir/etc/apt)" +cat > rootdir/etc/apt/sources.list <<EOF +deb http://example.org/debian stable main rocks +deb-src http://example.org/debian stable main rocks +EOF +testsuccessequal "${APTLISTS}/example.org_debian_dists_stable_main_source_Sources +${APTLISTS}/example.org_debian_dists_stable_rocks_source_Sources +${APTLISTS}/example.org_debian_dists_stable_main_binary-amd64_Packages +${APTLISTS}/example.org_debian_dists_stable_main_binary-i386_Packages +${APTLISTS}/example.org_debian_dists_stable_main_i18n_Translation-en +${APTLISTS}/example.org_debian_dists_stable_rocks_binary-amd64_Packages +${APTLISTS}/example.org_debian_dists_stable_rocks_binary-i386_Packages +${APTLISTS}/example.org_debian_dists_stable_rocks_i18n_Translation-en" aptget indextargets --no-release-info --format '$(FILENAME)' + +cat >> rootdir/etc/apt/sources.list <<EOF +deb http://example.org/debian stable main rocks +EOF +testwarningequal "${APTLISTS}/example.org_debian_dists_stable_main_source_Sources +${APTLISTS}/example.org_debian_dists_stable_rocks_source_Sources +${APTLISTS}/example.org_debian_dists_stable_main_binary-amd64_Packages +${APTLISTS}/example.org_debian_dists_stable_main_binary-i386_Packages +${APTLISTS}/example.org_debian_dists_stable_main_i18n_Translation-en +${APTLISTS}/example.org_debian_dists_stable_rocks_binary-amd64_Packages +${APTLISTS}/example.org_debian_dists_stable_rocks_binary-i386_Packages +${APTLISTS}/example.org_debian_dists_stable_rocks_i18n_Translation-en +W: Target Packages (main/binary-amd64/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Packages (main/binary-i386/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Translations (main/i18n/Translation-en) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Packages (rocks/binary-amd64/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Packages (rocks/binary-i386/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Translations (rocks/i18n/Translation-en) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3" aptget indextargets --no-release-info --format '$(FILENAME)' + +cat >> rootdir/etc/apt/sources.list <<EOF +deb [target=Contents1,Contents2,Contentsflat arch=amd64] http://example.org/debian stable main rocks +deb-src [target=Contents1,Contents2,Contentsflat arch=amd64] http://example.org/debian stable main rocks +EOF +testwarningequal "${APTLISTS}/example.org_debian_dists_stable_main_source_Sources +${APTLISTS}/example.org_debian_dists_stable_rocks_source_Sources +${APTLISTS}/example.org_debian_dists_stable_main_binary-amd64_Packages +${APTLISTS}/example.org_debian_dists_stable_main_binary-i386_Packages +${APTLISTS}/example.org_debian_dists_stable_main_i18n_Translation-en +${APTLISTS}/example.org_debian_dists_stable_rocks_binary-amd64_Packages +${APTLISTS}/example.org_debian_dists_stable_rocks_binary-i386_Packages +${APTLISTS}/example.org_debian_dists_stable_rocks_i18n_Translation-en +${APTLISTS}/example.org_debian_dists_stable_main_Contents-amd64 +${APTLISTS}/example.org_debian_dists_stable_Contents-amd64 +${APTLISTS}/example.org_debian_dists_stable_rocks_Contents-amd64 +W: Target Packages (main/binary-amd64/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Packages (main/binary-i386/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Translations (main/i18n/Translation-en) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Packages (rocks/binary-amd64/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Packages (rocks/binary-i386/Packages) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Translations (rocks/i18n/Translation-en) is configured multiple times in ${APTETC}/sources.list:1 and ${APTETC}/sources.list:3 +W: Target Contents2 wants to acquire the same file (main/Contents-amd64) as Contents1 from source ${APTETC}/sources.list:4 +W: Target Contents2 wants to acquire the same file (rocks/Contents-amd64) as Contents1 from source ${APTETC}/sources.list:4" aptget indextargets --no-release-info --format '$(FILENAME)' |