summaryrefslogtreecommitdiff
path: root/apt-pkg/indexrecords.cc
diff options
context:
space:
mode:
authorMichael Vogt <mvo@ubuntu.com>2014-05-22 17:36:09 +0200
committerMichael Vogt <mvo@ubuntu.com>2014-05-22 17:36:09 +0200
commita2fdb57ff93c1b1f35b796c3c99878ec3ae54a06 (patch)
treecb25d89bff41de4fe35366a8ec6033844df989ff /apt-pkg/indexrecords.cc
parentffa8189668e54572318d1834881e470c238f3642 (diff)
Add APT::Acquire::$(host)::By-Hash=1 knob, add Acquire-By-Hash to Release file
The by-hash can be configured on a per-hostname basis and a Release file can indicate that it has by-hash support via a new flag. The location of the hash now matches the AptByHash spec
Diffstat (limited to 'apt-pkg/indexrecords.cc')
-rw-r--r--apt-pkg/indexrecords.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/apt-pkg/indexrecords.cc b/apt-pkg/indexrecords.cc
index 122194e94..5b53e796d 100644
--- a/apt-pkg/indexrecords.cc
+++ b/apt-pkg/indexrecords.cc
@@ -37,6 +37,11 @@ APT_PURE string indexRecords::GetSuite() const
return this->Suite;
}
+APT_PURE bool indexRecords::GetSupportsAcquireByHash() const
+{
+ return this->SupportsAcquireByHash;
+}
+
APT_PURE bool indexRecords::CheckDist(const string MaybeDist) const
{
return (this->Dist == MaybeDist
@@ -86,6 +91,8 @@ bool indexRecords::Load(const string Filename) /*{{{*/
strprintf(ErrorText, _("No sections in Release file %s"), Filename.c_str());
return false;
}
+ // FIXME: find better tag name
+ SupportsAcquireByHash = Section.FindB("Acquire-By-Hash", false);
Suite = Section.FindS("Suite");
Dist = Section.FindS("Codename");
@@ -243,6 +250,6 @@ indexRecords::indexRecords()
}
indexRecords::indexRecords(const string ExpectedDist) :
- ExpectedDist(ExpectedDist), ValidUntil(0)
+ ExpectedDist(ExpectedDist), ValidUntil(0), SupportsAcquireByHash(false)
{
}