]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/indexrecords.cc
mark internal interfaces as hidden
[apt.git] / apt-pkg / indexrecords.cc
index 8c1e2229b85fc6c44af151774a8abc05cc58918a..0f27af32b8a074eb4472c1e7ef4b121c332eac5d 100644 (file)
@@ -116,14 +116,10 @@ bool indexRecords::Load(const string Filename)                            /*{{{*/
             indexRecords::checkSum *Sum = new indexRecords::checkSum;
             Sum->MetaKeyFilename = Name;
             Sum->Size = Size;
-#if __GNUC__ >= 4
-       #pragma GCC diagnostic push
-       #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#endif
-            Sum->Hash = HashString(HashString::SupportedHashes()[i],Hash);
-#if __GNUC__ >= 4
-       #pragma GCC diagnostic pop
-#endif
+           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));
@@ -253,12 +249,30 @@ 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;
 }
 
-indexRecords::indexRecords(const string ExpectedDist) :
-   ExpectedDist(ExpectedDist), ValidUntil(0), SupportsAcquireByHash(false)
+indexRecords::indexRecords(const string &ExpectedDist) :
+   Trusted(CHECK_TRUST), d(NULL), ExpectedDist(ExpectedDist), ValidUntil(0),
+   SupportsAcquireByHash(false)
 {
 }