Kaynağa Gözat

sent Last-Modified header also for Translation files

David Kalnischkies 16 yıl önce
ebeveyn
işleme
c91d9a630b
2 değiştirilmiş dosya ile 12 ekleme ve 4 silme
  1. 10 3
      apt-pkg/acquire-item.cc
  2. 2 1
      debian/changelog

+ 10 - 3
apt-pkg/acquire-item.cc

@@ -140,7 +140,8 @@ void pkgAcquire::Item::Rename(string From,string To)
    }   
    }   
 }
 }
 									/*}}}*/
 									/*}}}*/
-
+// Acquire::Item::ReportMirrorFailure					/*{{{*/
+// ---------------------------------------------------------------------
 void pkgAcquire::Item::ReportMirrorFailure(string FailCode)
 void pkgAcquire::Item::ReportMirrorFailure(string FailCode)
 {
 {
    // we only act if a mirror was used at all
    // we only act if a mirror was used at all
@@ -182,7 +183,7 @@ void pkgAcquire::Item::ReportMirrorFailure(string FailCode)
 		      _config->Find("Methods::Mirror::ProblemReporting").c_str());
 		      _config->Find("Methods::Mirror::ProblemReporting").c_str());
    }
    }
 }
 }
-
+									/*}}}*/
 // AcqDiffIndex::AcqDiffIndex - Constructor				/*{{{*/
 // AcqDiffIndex::AcqDiffIndex - Constructor				/*{{{*/
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 /* Get the DiffIndex file first and see if there are patches availabe 
 /* Get the DiffIndex file first and see if there are patches availabe 
@@ -835,7 +836,13 @@ pkgAcqIndexTrans::pkgAcqIndexTrans(pkgAcquire *Owner,
 // ---------------------------------------------------------------------
 // ---------------------------------------------------------------------
 string pkgAcqIndexTrans::Custom600Headers()
 string pkgAcqIndexTrans::Custom600Headers()
 {
 {
-   return "\nFail-Ignore: true";
+   string Final = _config->FindDir("Dir::State::lists");
+   Final += URItoFileName(RealURI);
+
+   struct stat Buf;
+   if (stat(Final.c_str(),&Buf) != 0)
+      return "\nFail-Ignore: true";
+   return "\nFail-Ignore: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
 }
 }
 									/*}}}*/
 									/*}}}*/
 // AcqIndexTrans::Failed - Silence failure messages for missing files	/*{{{*/
 // AcqIndexTrans::Failed - Silence failure messages for missing files	/*{{{*/

+ 2 - 1
debian/changelog

@@ -47,6 +47,7 @@ apt (0.7.26~exp6) UNRELEASED; urgency=low
     - add a constant Exists check for MetaKeys
     - add a constant Exists check for MetaKeys
   * apt-pkg/acquire-item.cc:
   * apt-pkg/acquire-item.cc:
     - do not try PDiff if it is not listed in the Meta file
     - do not try PDiff if it is not listed in the Meta file
+    - sent Last-Modified header also for Translation files
   * apt-pkg/cacheiterator.h:
   * apt-pkg/cacheiterator.h:
     - let pkgCache::Iterator inherent std::iterator
     - let pkgCache::Iterator inherent std::iterator
   * ftparchive/writer.h:
   * ftparchive/writer.h:
@@ -87,7 +88,7 @@ apt (0.7.26~exp6) UNRELEASED; urgency=low
   * apt-pkg/indexcopy.cc:
   * apt-pkg/indexcopy.cc:
     - move the gpg codecopy to a new method and use it also in methods/gpgv.cc
     - move the gpg codecopy to a new method and use it also in methods/gpgv.cc
 
 
- -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 09 Jun 2010 17:18:26 +0200
+ -- David Kalnischkies <kalnischkies@gmail.com>  Wed, 09 Jun 2010 21:15:46 +0200
 
 
 apt (0.7.26~exp5) experimental; urgency=low
 apt (0.7.26~exp5) experimental; urgency=low