Ver código fonte

* apt-pkg/acquire-item.{cc,h}:
- do not check for a "Package" tag in optional index targets
like the translations index

Michael Vogt 15 anos atrás
pai
commit
c5f661b715
4 arquivos alterados com 20 adições e 3 exclusões
  1. 4 0
      apt-pkg/acquire-item.cc
  2. 10 0
      apt-pkg/acquire-item.h
  3. 1 1
      configure.in
  4. 5 2
      debian/changelog

+ 4 - 0
apt-pkg/acquire-item.cc

@@ -808,6 +808,9 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, IndexTarget const *Target,
    if (CompressionExtension.empty() == false)
    if (CompressionExtension.empty() == false)
       CompressionExtension.erase(CompressionExtension.end()-1);
       CompressionExtension.erase(CompressionExtension.end()-1);
 
 
+   if (Target->IsOptional())
+     Verify = false;
+
    Init(Target->URI, Target->Description, Target->ShortDesc);
    Init(Target->URI, Target->Description, Target->ShortDesc);
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -905,6 +908,7 @@ void pkgAcqIndex::Done(string Message,unsigned long long Size,string Hash,
 
 
       /* Verify the index file for correctness (all indexes must
       /* Verify the index file for correctness (all indexes must
        * have a Package field) (LP: #346386) (Closes: #627642) */
        * have a Package field) (LP: #346386) (Closes: #627642) */
+      if (Verify == true)
       {
       {
 	 FileFd fd(DestFile, FileFd::ReadOnly);
 	 FileFd fd(DestFile, FileFd::ReadOnly);
 	 pkgTagSection sec;
 	 pkgTagSection sec;

+ 10 - 0
apt-pkg/acquire-item.h

@@ -559,6 +559,16 @@ class pkgAcqIndex : public pkgAcquire::Item
     */
     */
    bool Erase;
    bool Erase;
 
 
+   /** \brief Verify for correctness by checking if a "Package"
+    *         tag is found in the index. This can be set to
+    *         false for optional index targets
+    *       
+    */
+   // FIXME: instead of a bool it should use a verify string that will
+   //        then be used in the pkgAcqIndex::Done method to ensure that
+   //        the downloaded file contains the expected tag
+   bool Verify;
+
    /** \brief The download request that is currently being
    /** \brief The download request that is currently being
     *   processed.
     *   processed.
     */
     */

+ 1 - 1
configure.in

@@ -18,7 +18,7 @@ AC_CONFIG_AUX_DIR(buildlib)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 AC_CONFIG_HEADER(include/config.h:buildlib/config.h.in include/apti18n.h:buildlib/apti18n.h.in)
 
 
 dnl -- SET THIS TO THE RELEASE VERSION --
 dnl -- SET THIS TO THE RELEASE VERSION --
-AC_DEFINE_UNQUOTED(VERSION,"0.8.15")
+AC_DEFINE_UNQUOTED(VERSION,"0.8.16~exp5")
 PACKAGE="apt"
 PACKAGE="apt"
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_DEFINE_UNQUOTED(PACKAGE,"$PACKAGE")
 AC_SUBST(PACKAGE)
 AC_SUBST(PACKAGE)

+ 5 - 2
debian/changelog

@@ -1,4 +1,4 @@
-apt (0.8.16~exp5) UNRELEASED; urgency=low
+apt (0.8.16~exp5) UNRELEASEDexperimental; urgency=low
 
 
   * apt-pkg/makefile:
   * apt-pkg/makefile:
     - install sha256.h compat header
     - install sha256.h compat header
@@ -7,8 +7,11 @@ apt (0.8.16~exp5) UNRELEASED; urgency=low
       libapt does not segfault if the cache is remapped in between
       libapt does not segfault if the cache is remapped in between
       (LP: #812862)
       (LP: #812862)
     - fix crash when P.Arch() was used but the cache got remapped
     - fix crash when P.Arch() was used but the cache got remapped
+  * apt-pkg/acquire-item.{cc,h}:
+    - do not check for a "Package" tag in optional index targets
+      like the translations index
 
 
- -- Michael Vogt <mvo@debian.org>  Mon, 01 Aug 2011 15:31:55 +0200
+ -- Michael Vogt <mvo@debian.org>  Fri, 05 Aug 2011 09:11:42 +0200
 
 
 apt (0.8.16~exp4) experimental; urgency=low
 apt (0.8.16~exp4) experimental; urgency=low