if (TransactionManager->MetaIndexParser->CheckDist(ExpectedDist) == false)
_error->Warning(_("Conflicting distribution: %s (expected %s but got %s)"),
Desc.Description.c_str(), ExpectedDist.c_str(), NowCodename.c_str());
+ // might be okay, might be not
+ if (TransactionManager->LastMetaIndexParser != nullptr)
+ {
+ auto const LastCodename = TransactionManager->LastMetaIndexParser->GetCodename();
+ if (LastCodename.empty() == false && NowCodename.empty() == false && LastCodename != NowCodename)
+ _error->Warning(_("Conflicting distribution: %s (expected %s but got %s)"),
+ Desc.Description.c_str(), LastCodename.c_str(), NowCodename.c_str());
+ }
return true;
}
/*}}}*/
ln -s "${APTARCHIVE}/dists/testing" "${APTARCHIVE}/dists/buster"
testsuccess apt update
testsuccess apt show foo
+
+# changing codenames gets a warning, too
+rm -rf rootdir/var/lib/apt/lists
+sed -i -e 's#buster#testing#g' rootdir/etc/apt/sources.list.d/*
+testsuccess apt update
+testsuccess apt show foo
+sed -i -e 's#^Codename: buster#Codename: zurg#g' $(find ./aptarchive -name 'Release')
+signreleasefiles
+testwarningmsg "W: Conflicting distribution: file:$APTARCHIVE testing/updates InRelease (expected buster/updates but got zurg/updates)" apt update
+testsuccess apt show foo
+testsuccess apt update
+testsuccess apt show foo