summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire-item.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r--apt-pkg/acquire-item.cc16
1 files changed, 12 insertions, 4 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 2c081261d..6444a21b3 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1731,6 +1731,9 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire * const Owner,
/* The only header we use is the last-modified header. */
string pkgAcqDiffIndex::Custom600Headers() const
{
+ if (TransactionManager->LastMetaIndexParser != NULL)
+ return "\nIndex-File: true";
+
string const Final = GetFinalFilename();
if(Debug)
@@ -2566,12 +2569,17 @@ void pkgAcqIndex::Init(string const &URI, string const &URIDesc,
/* The only header we use is the last-modified header. */
string pkgAcqIndex::Custom600Headers() const
{
- string Final = GetFinalFilename();
string msg = "\nIndex-File: true";
- struct stat Buf;
- if (stat(Final.c_str(),&Buf) == 0)
- msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
+
+ if (TransactionManager->LastMetaIndexParser == NULL)
+ {
+ std::string const Final = GetFinalFilename();
+
+ struct stat Buf;
+ if (stat(Final.c_str(),&Buf) == 0)
+ msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
+ }
if(Target.IsOptional)
msg += "\nFail-Ignore: true";