From dce63b96e54533cb35d6618d200701363d5b6e44 Mon Sep 17 00:00:00 2001 From: CoolStar Date: Wed, 23 May 2018 11:41:58 -0700 Subject: Backwards compatibility patches for Cydia repos --- apt-pkg/acquire-item.cc | 10 ++++++++-- apt-pkg/contrib/hashes.cc | 2 -- apt-pkg/deb/debmetaindex.cc | 5 +++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index bb3bc1b56..09b8954b6 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -257,7 +257,7 @@ static bool APT_NONNULL(3, 4, 5) AllowInsecureRepositories(InsecureType const ms if (TargetIsAllowedToBe(TransactionManager->Target, msg) == true) { - MessageInsecureRepository(false, msgstr, repo); + //MessageInsecureRepository(false, msgstr, repo); return true; } @@ -1608,7 +1608,7 @@ void pkgAcqMetaClearSig::QueueIndexes(bool const verify) /*{{{*/ } // optional targets that we do not have in the Release file are skipped - if (hasHashes == true && Target.IsOptional) + if (Target.IsOptional) { new CleanupItem(Owner, TransactionManager, Target); continue; @@ -1724,6 +1724,12 @@ void pkgAcqMetaClearSig::QueueIndexes(bool const verify) /*{{{*/ } else { + + if (Target.IsOptional) + { + new CleanupItem(Owner, TransactionManager, Target); + continue; + } // if we have no file to patch, no point in trying trypdiff &= (GetExistingFilename(GetFinalFileNameFromURI(Target.URI)).empty() == false); } diff --git a/apt-pkg/contrib/hashes.cc b/apt-pkg/contrib/hashes.cc index 98b92cc81..fd8b12355 100644 --- a/apt-pkg/contrib/hashes.cc +++ b/apt-pkg/contrib/hashes.cc @@ -140,8 +140,6 @@ APT_PURE bool HashString::usable() const /*{{{*/ { return ( (Type != "Checksum-FileSize") && - (Type != "MD5Sum") && - (Type != "SHA1") && !IsConfigured(Type.c_str(), "Untrusted") ); } diff --git a/apt-pkg/deb/debmetaindex.cc b/apt-pkg/deb/debmetaindex.cc index f88076abf..cd794c7a7 100644 --- a/apt-pkg/deb/debmetaindex.cc +++ b/apt-pkg/deb/debmetaindex.cc @@ -523,11 +523,12 @@ bool debReleaseIndex::Load(std::string const &Filename, std::string * const Erro } bool AuthPossible = false; - if(FoundHashSum == false) + /*if(FoundHashSum == false) _error->Warning(_("No Hash entry in Release file %s"), Filename.c_str()); else if(FoundStrongHashSum == false) _error->Warning(_("No Hash entry in Release file %s which is considered strong enough for security purposes"), Filename.c_str()); - else + else*/ + if (FoundHashSum && FoundStrongHashSum) AuthPossible = true; std::string const StrDate = Section.FindS("Date"); -- cgit v1.2.3