diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-11-09 19:57:21 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-11-09 19:57:21 +0100 |
commit | d96c997ebeab76f690564fc1c93a35b1a885adf5 (patch) | |
tree | 322387ec9bf3f368f89f4b39d558efb6e8f4931b | |
parent | 34b491e735ad47c4805e63f3b83a659b8d10262b (diff) |
show the conflicting distribution warning again
Sometimes you should really act upon your todos.
Especially if you have placed them directly in the code.
Closes: 841874
-rw-r--r-- | apt-pkg/metaindex.cc | 3 | ||||
-rwxr-xr-x | test/integration/test-bug-841874-warning-for-mismatching-distribution | 38 |
2 files changed, 39 insertions, 2 deletions
diff --git a/apt-pkg/metaindex.cc b/apt-pkg/metaindex.cc index 6e5792b78..281824855 100644 --- a/apt-pkg/metaindex.cc +++ b/apt-pkg/metaindex.cc @@ -65,8 +65,7 @@ APT_PURE bool metaIndex::CheckDist(string const &MaybeDist) const } APT_PURE std::string metaIndex::GetExpectedDist() const { - // TODO: Used to be an explicit value set in the constructor - return ""; + return Dist; } /*}}}*/ APT_PURE metaIndex::checkSum *metaIndex::Lookup(string const &MetaKey) const /*{{{*/ diff --git a/test/integration/test-bug-841874-warning-for-mismatching-distribution b/test/integration/test-bug-841874-warning-for-mismatching-distribution new file mode 100755 index 000000000..9b9f1982e --- /dev/null +++ b/test/integration/test-bug-841874-warning-for-mismatching-distribution @@ -0,0 +1,38 @@ +#!/bin/sh +set -e + +TESTDIR="$(readlink -f "$(dirname "$0")")" +. "$TESTDIR/framework" +setupenvironment +configarchitecture 'amd64' + +insertpackage 'testing' 'foo' 'all' '1' + +getcodenamefromsuite() { echo -n 'stretch'; } +setupaptarchive --no-update +APTARCHIVE="$(readlink -f './aptarchive')" +ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/stretch" +ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/zurg" + +testfailure apt show foo +testsuccess apt update +testsuccess apt show foo + +rm -rf rootdir/var/lib/apt/lists +sed -i -e 's#testing#stretch#g' rootdir/etc/apt/sources.list.d/* +testsuccess apt update +testsuccess apt show foo + +rm -rf rootdir/var/lib/apt/lists +sed -i -e 's#stretch#zurg#g' rootdir/etc/apt/sources.list.d/* +testwarningmsg "W: Conflicting distribution: file:$APTARCHIVE zurg InRelease (expected zurg but got stretch)" apt update +testsuccess apt show foo + +# check that 'foo/bar' is rewritten to 'foo' while we are at it +rm -rf rootdir/var/lib/apt/lists +sed -i -e 's#zurg#stretch/updates#g' rootdir/etc/apt/sources.list.d/* +testfailure apt update +testfailure apt show foo +ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/stretch/updates" +testsuccess apt update +testsuccess apt show foo |