diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-item.cc | 4 | ||||
-rw-r--r-- | apt-pkg/acquire-item.h | 10 |
2 files changed, 14 insertions, 0 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index df83d1481..d0fbf948f 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -808,6 +808,9 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, IndexTarget const *Target, if (CompressionExtension.empty() == false) CompressionExtension.erase(CompressionExtension.end()-1); + if (Target->IsOptional()) + Verify = false; + 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 * have a Package field) (LP: #346386) (Closes: #627642) */ + if (Verify == true) { FileFd fd(DestFile, FileFd::ReadOnly); pkgTagSection sec; diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index f39a90c0b..13be17a01 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -559,6 +559,16 @@ class pkgAcqIndex : public pkgAcquire::Item */ 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 * processed. */ |