diff options
author | David Kalnischkies <david@kalnischkies.de> | 2016-05-07 13:45:25 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2016-05-07 13:45:25 +0200 |
commit | 03a34b88df3a74dac91c2f3b609d2c44e9462022 (patch) | |
tree | ea917e306a68c88da3b48e432b29e4f418f946eb /apt-pkg/acquire-item.cc | |
parent | 5a23c56d6852a27d45c2ae227b43060f7beac051 (diff) |
fix same-mirror redirection for Release{,.gpg} pair
Commit 9b8034a9fd40b4d05075fda719e61f6eb4c45678 just deals with
InRelease properly and generates broken URIs in case the mirror (or the
achieve really) has no InRelease file.
[As this was in no released version no need to clutter changelog with a
fix notice.]
Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r-- | apt-pkg/acquire-item.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index fde45e1fe..9b809db71 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -344,7 +344,7 @@ bool pkgAcqTransactionItem::QueueURI(pkgAcquire::ItemDesc &Item) { // this ensures we rewrite only once and only the first step auto const OldBaseURI = Target.Option(IndexTarget::BASE_URI); - if (APT::String::Startswith(Item.URI, OldBaseURI)) + if (OldBaseURI.empty() == false && APT::String::Startswith(Item.URI, OldBaseURI)) { auto const ExtraPath = Item.URI.substr(OldBaseURI.length()); Item.URI = flCombine(TransactionManager->BaseURI, ExtraPath); @@ -1107,7 +1107,7 @@ bool pkgAcqMetaBase::CheckDownloadDone(pkgAcqTransactionItem * const I, const st { if (APT::String::Endswith(I->Desc.URI, "InRelease")) TransactionManager->BaseURI = I->Desc.URI.substr(0, I->Desc.URI.length() - strlen("InRelease")); - else + else if (APT::String::Endswith(I->Desc.URI, "Release")) TransactionManager->BaseURI = I->Desc.URI.substr(0, I->Desc.URI.length() - strlen("Release")); } |