summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc10
-rw-r--r--apt-pkg/acquire-item.h1
-rw-r--r--apt-pkg/acquire-method.cc1
-rw-r--r--apt-pkg/acquire-method.h1
4 files changed, 12 insertions, 1 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 8ec4ba2c0..7b2a89763 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -176,7 +176,8 @@ string pkgAcqIndex::Custom600Headers()
struct stat Buf;
if (stat(Final.c_str(),&Buf) != 0)
return "\nIndex-File: true";
-
+ if(ExpectedMD5 != "")
+ return "\nExpectedMD5: " + ExpectedMD5;
return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
}
/*}}}*/
@@ -1015,6 +1016,13 @@ void pkgAcqArchive::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
}
}
/*}}}*/
+// ---------------------------------------------------------------------
+string pkgAcqArchive::Custom600Headers()
+{
+ if(MD5 != "")
+ return "\nExpectedMD5: " + MD5;
+ return "";
+}
// AcqArchive::IsTrusted - Determine whether this archive comes from a
// trusted source /*{{{*/
// ---------------------------------------------------------------------
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index da1bea801..c9cd75321 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -205,6 +205,7 @@ class pkgAcqArchive : public pkgAcquire::Item
virtual string ShortDesc() {return Desc.ShortDesc;};
virtual void Finished();
virtual bool IsTrusted();
+ virtual string Custom600Headers();
pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
pkgRecords *Recs,pkgCache::VerIterator const &Version,
diff --git a/apt-pkg/acquire-method.cc b/apt-pkg/acquire-method.cc
index 41b832f3b..638797657 100644
--- a/apt-pkg/acquire-method.cc
+++ b/apt-pkg/acquire-method.cc
@@ -368,6 +368,7 @@ int pkgAcqMethod::Run(bool Single)
Tmp->Uri = LookupTag(Message,"URI");
Tmp->DestFile = LookupTag(Message,"FileName");
+ Tmp->ExpectedMD5 = LookupTag(Message,"ExpectedMD5");
if (StrToTime(LookupTag(Message,"Last-Modified"),Tmp->LastModified) == false)
Tmp->LastModified = 0;
Tmp->IndexFile = StringToBool(LookupTag(Message,"Index-File"),false);
diff --git a/apt-pkg/acquire-method.h b/apt-pkg/acquire-method.h
index e0e7c1d09..9e908d32c 100644
--- a/apt-pkg/acquire-method.h
+++ b/apt-pkg/acquire-method.h
@@ -33,6 +33,7 @@ class pkgAcqMethod
string DestFile;
time_t LastModified;
bool IndexFile;
+ string ExpectedMD5;
};
struct FetchResult