]> git.saurik.com Git - apt.git/commitdiff
remove pkgAcqSubIndex
authorMichael Vogt <mvo@ubuntu.com>
Tue, 16 Sep 2014 15:03:04 +0000 (17:03 +0200)
committerMichael Vogt <mvo@ubuntu.com>
Tue, 16 Sep 2014 15:03:04 +0000 (17:03 +0200)
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h

index eee1097e918125a1a3e15e3e9c60b9fa25f58ca2..d005dce4c9656f91bbd041ab868248731c5b210f 100644 (file)
@@ -237,120 +237,6 @@ void pkgAcquire::Item::ReportMirrorFailure(string FailCode)
    }
 }
                                                                        /*}}}*/
-// AcqSubIndex::AcqSubIndex - Constructor                              /*{{{*/
-// ---------------------------------------------------------------------
-/* Get a sub-index file based on checksums from a 'master' file and
-   possibly query additional files */
-pkgAcqSubIndex::pkgAcqSubIndex(pkgAcquire *Owner, 
-                               unsigned long TransactionID,
-                               string const &URI,
-                               string const &URIDesc, string const &ShortDesc,
-                               HashStringList const &ExpectedHashes)
-   : Item(Owner, ExpectedHashes, TransactionID)
-{
-   /* XXX: Beware: Currently this class does nothing (of value) anymore ! */
-   Debug = _config->FindB("Debug::pkgAcquire::SubIndex",false);
-
-   DestFile = _config->FindDir("Dir::State::lists") + "partial/";
-   DestFile += URItoFileName(URI);
-
-   Desc.URI = URI;
-   Desc.Description = URIDesc;
-   Desc.Owner = this;
-   Desc.ShortDesc = ShortDesc;
-
-   QueueURI(Desc);
-
-   if(Debug)
-      std::clog << "pkgAcqSubIndex: " << Desc.URI << std::endl;
-}
-                                                                       /*}}}*/
-// AcqSubIndex::Custom600Headers - Insert custom request headers       /*{{{*/
-// ---------------------------------------------------------------------
-/* The only header we use is the last-modified header. */
-string pkgAcqSubIndex::Custom600Headers() const
-{
-   string Final = _config->FindDir("Dir::State::lists");
-   Final += URItoFileName(Desc.URI);
-
-   struct stat Buf;
-   if (stat(Final.c_str(),&Buf) != 0)
-      return "\nIndex-File: true\nFail-Ignore: true\n";
-   return "\nIndex-File: true\nFail-Ignore: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
-}
-                                                                       /*}}}*/
-void pkgAcqSubIndex::Failed(string Message,pkgAcquire::MethodConfig * /*Cnf*/)/*{{{*/
-{
-   if(Debug)
-      std::clog << "pkgAcqSubIndex failed: " << Desc.URI << " with " << Message << std::endl;
-
-   Complete = false;
-   Status = StatDone;
-   Dequeue();
-
-   // No good Index is provided
-}
-                                                                       /*}}}*/
-void pkgAcqSubIndex::Done(string Message,unsigned long long Size,HashStringList const &Hashes, /*{{{*/
-                          pkgAcquire::MethodConfig *Cnf)
-{
-   if(Debug)
-      std::clog << "pkgAcqSubIndex::Done(): " << Desc.URI << std::endl;
-
-   string FileName = LookupTag(Message,"Filename");
-   if (FileName.empty() == true)
-   {
-      Status = StatError;
-      ErrorText = "Method gave a blank filename";
-      return;
-   }
-
-   if (FileName != DestFile)
-   {
-      Local = true;
-      Desc.URI = "copy:" + FileName;
-      QueueURI(Desc);
-      return;
-   }
-
-   Item::Done(Message, Size, Hashes, Cnf);
-
-   string FinalFile = _config->FindDir("Dir::State::lists")+URItoFileName(Desc.URI);
-
-   /* Downloaded invalid transindex => Error (LP: #346386) (Closes: #627642) */
-   indexRecords SubIndexParser;
-   if (FileExists(DestFile) == true && !SubIndexParser.Load(DestFile)) {
-      Status = StatError;
-      ErrorText = SubIndexParser.ErrorText;
-      return;
-   }
-
-   // success in downloading the index
-   // rename the index
-   if(Debug)
-      std::clog << "Renaming: " << DestFile << " -> " << FinalFile << std::endl;
-   Rename(DestFile,FinalFile);
-   chmod(FinalFile.c_str(),0644);
-   DestFile = FinalFile;
-
-   if(ParseIndex(DestFile) == false)
-      return Failed("", NULL);
-
-   Complete = true;
-   Status = StatDone;
-   Dequeue();
-   return;
-}
-                                                                       /*}}}*/
-bool pkgAcqSubIndex::ParseIndex(string const &IndexFile)               /*{{{*/
-{
-   indexRecords SubIndexParser;
-   if (FileExists(IndexFile) == false || SubIndexParser.Load(IndexFile) == false)
-      return false;
-   // so something with the downloaded index
-   return true;
-}
-                                                                       /*}}}*/
 // AcqDiffIndex::AcqDiffIndex - Constructor                            /*{{{*/
 // ---------------------------------------------------------------------
 /* Get the DiffIndex file first and see if there are patches available
@@ -1812,11 +1698,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify)                          /*{{{*/
 
       if ((*Target)->IsOptional() == true)
       {
-        if ((*Target)->IsSubIndex() == true)
-           new pkgAcqSubIndex(Owner, TransactionID, 
-                               (*Target)->URI, (*Target)->Description,
-                               (*Target)->ShortDesc, ExpectedIndexHashes);
-        else if (transInRelease == false || Record != NULL || compressedAvailable == true)
+        if (transInRelease == false || Record != NULL || compressedAvailable == true)
         {
            if (_config->FindB("Acquire::PDiffs",true) == true && transInRelease == true &&
                MetaIndexParser->Exists((*Target)->MetaKey + ".diff/Index") == true)
index ae93ea3116179e85697df7ad1d5d1c32ec9dd8f0..90eccdd16eda365afda651168236354429d9d9e9 100644 (file)
@@ -338,44 +338,6 @@ struct DiffInfo {
    unsigned long size;
 };
                                                                        /*}}}*/
-/** \brief An item that is responsible for fetching a SubIndex         {{{
- *
- *  The MetaIndex file includes only records for important indexes
- *  and records for these SubIndex files so these can carry records
- *  for addition files like PDiffs and Translations
- */
-class pkgAcqSubIndex : public pkgAcquire::Item
-{
- protected:
-   /** \brief If \b true, debugging information will be written to std::clog. */
-   bool Debug;
-
- public:
-   // Specialized action members
-   virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
-   virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
-                    pkgAcquire::MethodConfig *Cnf);
-   virtual std::string DescURI() const {return Desc.URI;};
-   virtual std::string Custom600Headers() const;
-   virtual bool ParseIndex(std::string const &IndexFile);
-
-   /** \brief Create a new pkgAcqSubIndex.
-    *
-    *  \param Owner The Acquire object that owns this item.
-    *
-    *  \param URI The URI of the list file to download.
-    *
-    *  \param URIDesc A long description of the list file to download.
-    *
-    *  \param ShortDesc A short description of the list file to download.
-    *
-    *  \param ExpectedHashes The list file's hashsums which are expected.
-    */
-   pkgAcqSubIndex(pkgAcquire *Owner, 
-                  unsigned long TransactionID,
-                  std::string const &URI,std::string const &URIDesc,
-                  std::string const &ShortDesc, HashStringList const &ExpectedHashes);
-};
                                                                        /*}}}*/
 
 class pkgAcqMetaSigBase : public pkgAcquire::Item
@@ -991,9 +953,6 @@ class IndexTarget
    virtual bool IsOptional() const {
       return false;
    }
-   virtual bool IsSubIndex() const {
-      return false;
-   }
 };
                                                                        /*}}}*/
 /** \brief Information about an optional index file. */                        /*{{{*/
@@ -1004,22 +963,6 @@ class OptionalIndexTarget : public IndexTarget
    }
 };
                                                                        /*}}}*/
-/** \brief Information about an subindex index file. */                        /*{{{*/
-class SubIndexTarget : public IndexTarget
-{
-   virtual bool IsSubIndex() const {
-      return true;
-   }
-};
-                                                                       /*}}}*/
-/** \brief Information about an subindex index file. */                        /*{{{*/
-class OptionalSubIndexTarget : public OptionalIndexTarget
-{
-   virtual bool IsSubIndex() const {
-      return true;
-   }
-};
-                                                                       /*}}}*/
 
 /** \brief An acquire item that downloads the detached signature       {{{
  *  of a meta-index (Release) file, then queues up the release