X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/8d20b69d2fd7a8fec82bb559f0e39059bbaecf1b..7824564bfde681eddf6969174bba7604d6f34848:/apt-pkg/indexrecords.cc?ds=sidebyside diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc index 5b53e796d..d65266f64 100644 --- a/apt-pkg/indexrecords.cc +++ b/apt-pkg/indexrecords.cc @@ -116,6 +116,10 @@ bool indexRecords::Load(const string Filename) /*{{{*/ indexRecords::checkSum *Sum = new indexRecords::checkSum; Sum->MetaKeyFilename = Name; Sum->Size = Size; + std::string SizeStr; + strprintf(SizeStr, "%llu", Size); + Sum->Hashes.push_back(HashString("Checksum-FileSize", SizeStr)); + APT_IGNORE_DEPRECATED(Sum->Hash = HashString(HashString::SupportedHashes()[i],Hash);) Entries[Name] = Sum; } Entries[Name]->Hashes.push_back(HashString(HashString::SupportedHashes()[i],Hash)); @@ -245,11 +249,44 @@ bool indexRecords::parseSumData(const char *&Start, const char *End, /*{{{*/ return true; } /*}}}*/ -indexRecords::indexRecords() + +APT_PURE bool indexRecords::IsAlwaysTrusted() const +{ + if (Trusted == ALWAYS_TRUSTED) + return true; + return false; +} +APT_PURE bool indexRecords::IsNeverTrusted() const +{ + if (Trusted == NEVER_TRUSTED) + return true; + return false; +} +void indexRecords::SetTrusted(bool const Trusted) { + if (Trusted == true) + this->Trusted = ALWAYS_TRUSTED; + else + this->Trusted = NEVER_TRUSTED; } +#if APT_PKG_ABI >= 413 +indexRecords::indexRecords(const string &ExpectedDist) : + Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0), + SupportsAcquireByHash(false) +{ +} +#else +indexRecords::indexRecords() : + Trusted(CHECK_TRUST), d(NULL), ExpectedDist(""), ValidUntil(0), + SupportsAcquireByHash(false) +{ +} indexRecords::indexRecords(const string ExpectedDist) : - ExpectedDist(ExpectedDist), ValidUntil(0), SupportsAcquireByHash(false) + Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0), + SupportsAcquireByHash(false) { } +#endif + +indexRecords::~indexRecords() {}