]> git.saurik.com Git - apt.git/commitdiff
merge from the debian-sid branch
authorDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 4 May 2010 11:26:49 +0000 (13:26 +0200)
committerDavid Kalnischkies <kalnischkies@gmail.com>
Tue, 4 May 2010 11:26:49 +0000 (13:26 +0200)
apt-pkg/acquire-item.cc
apt-pkg/acquire-item.h
apt-pkg/depcache.cc
apt-pkg/policy.cc
debian/changelog
methods/connect.cc
test/libapt/getlanguages_test.cc

index 916fca71eeaaf0e1722129c71d90010e36c2cc23..1f253bb81b96966d3ca9982aaaa713618eb9d086 100644 (file)
@@ -1561,8 +1561,9 @@ void pkgAcqArchive::Finished()
 /* The file is added to the queue */
 pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI,string Hash,
                       unsigned long Size,string Dsc,string ShortDesc,
-                      const string &DestDir, const string &DestFilename) :
-                       Item(Owner), ExpectedHash(Hash)
+                      const string &DestDir, const string &DestFilename,
+                       bool IsIndexFile) :
+                       Item(Owner), ExpectedHash(Hash), IsIndexFile(IsIndexFile)
 {
    Retries = _config->FindI("Acquire::Retries",0);
    
@@ -1677,3 +1678,12 @@ void pkgAcqFile::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
    Item::Failed(Message,Cnf);
 }
                                                                        /*}}}*/
+// AcqIndex::Custom600Headers - Insert custom request headers          /*{{{*/
+// ---------------------------------------------------------------------
+/* The only header we use is the last-modified header. */
+string pkgAcqFile::Custom600Headers()
+{
+   if (IsIndexFile)
+      return "\nIndex-File: true";
+}
+                                                                       /*}}}*/
index d862d0fdd9b363c918331a234061ceb05d52d100..bafa8263a8f38fe7ed7d2c2702bedd07d71caef8 100644 (file)
@@ -861,6 +861,9 @@ class pkgAcqFile : public pkgAcquire::Item
     */
    unsigned int Retries;
    
+   /** \brief Should this file be considered a index file */
+   bool IsIndexFile;
+
    public:
    
    // Specialized action members
@@ -869,6 +872,7 @@ class pkgAcqFile : public pkgAcquire::Item
                     pkgAcquire::MethodConfig *Cnf);
    virtual string DescURI() {return Desc.URI;};
    virtual string HashSum() {return ExpectedHash.toStr(); };
+   virtual string Custom600Headers();
 
    /** \brief Create a new pkgAcqFile object.
     *
@@ -892,6 +896,8 @@ class pkgAcqFile : public pkgAcquire::Item
     *
     *  \param DestFilename The filename+path the file is downloaded to.
     *
+    *  \param IsIndexFile The file is considered a IndexFile and cache-control
+    *                     headers like "cache-control: max-age=0" are send
     *
     * If DestFilename is empty, download to DestDir/<basename> if
     * DestDir is non-empty, $CWD/<basename> otherwise.  If
@@ -901,7 +907,8 @@ class pkgAcqFile : public pkgAcquire::Item
 
    pkgAcqFile(pkgAcquire *Owner, string URI, string Hash, unsigned long Size,
              string Desc, string ShortDesc,
-             const string &DestDir="", const string &DestFilename="");
+             const string &DestDir="", const string &DestFilename="",
+             bool IsIndexFile=false);
 };
                                                                        /*}}}*/
 /** @} */
index 659c4227e3f9245e8df6abafa573c285caed7ebf..4d1a08eb628da10d00a6f4c379dda58c07afc243 100644 (file)
@@ -192,7 +192,7 @@ bool pkgDepCache::readStateFile(OpProgress *Prog)                   /*{{{*/
         {
            PkgState[pkg->ID].Flags |= Flag::Auto;
            if (unlikely(debug_autoremove))
-              std::cout << "Auto-Installed : " << pkg.FullName() << std::endl;
+              std::clog << "Auto-Installed : " << pkg.FullName() << std::endl;
            if (pkgarch == "any")
            {
               pkgCache::GrpIterator G = pkg.Group();
@@ -1819,7 +1819,7 @@ bool pkgDepCache::Sweep()                                         /*{{{*/
      {
        state.Garbage=true;
        if(debug_autoremove)
-          std::cout << "Garbage: " << p.FullName() << std::endl;
+          std::clog << "Garbage: " << p.FullName() << std::endl;
      }
   }   
 
index 9b24c2ef183dad1b8fe7e26f50e94e836055c4e6..479cf393549ef6eb67c760e1f63552a33b78c6ce 100644 (file)
@@ -106,7 +106,7 @@ bool pkgPolicy::InitDefaults()
 
    if (_config->FindB("Debug::pkgPolicy",false) == true)
       for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); F++)
-        cout << "Prio of " << F.FileName() << ' ' << PFPriority[F->ID] << endl; 
+        std::clog << "Prio of " << F.FileName() << ' ' << PFPriority[F->ID] << std::endl; 
    
    return true;   
 }
index 3fd3f0a33592facc112bdd9259818177ba7d979d..0f01d1867dc5a1ca11f602345eba6caed9f6ca5b 100644 (file)
@@ -1,4 +1,14 @@
-apt (0.7.26~exp4) experimental; urgency=low
+apt (0.7.26~exp4) UNRELEASED; urgency=low
+
+  [ Michael Vogt ]
+  * [ Abi break ] apt-pkg/acquire-item.{cc,h}:
+    - add "IsIndexFile" to constructor of pkgAcqFile so that it sends
+      the right cache control headers
+  * apt-pkg/depcache.cc:
+    - fix incorrect std::cout usage for debug output
+  * test/libapt/getlanguages_test.cc:
+    - Add test for Esperanto that has nocounty associated with them
+      (LP: #560956)
 
   [ David Kalnischkies ]
   * apt-pkg/depcache.cc:
index adb16a19973c9341dfc9b38f0a311f913cac63a2..2f6b4833e2e636ccf12e87ce8c6b3d5ab86796eb 100644 (file)
@@ -116,6 +116,9 @@ static bool DoConnect(struct addrinfo *Addr,string Host,
       errno = Err;
       if(errno == ECONNREFUSED)
          Owner->SetFailExtraMsg("\nFailReason: ConnectionRefused");
+      else if (errno == ETIMEDOUT)
+        Owner->SetFailExtraMsg("\nFailReason: ConnectionTimedOut");
+      bad_addr.insert(bad_addr.begin(), string(Name));
       return _error->Errno("connect",_("Could not connect to %s:%s (%s)."),Host.c_str(),
                           Service,Name);
    }
index 0db190b507b9a0ff76ca78407d5f2fd4bcb99914..9a8910b586930c0367a59e9a5011a421bd00e064 100644 (file)
@@ -43,6 +43,13 @@ int main(int argc,char *argv[])
        equals(vec[0], "en_GB");
        equals(vec[1], "en");
 
+       // esperanto
+       env[0] = "eo.UTF-8";
+       vec = APT::Configuration::getLanguages(false, false, env);
+       equals(vec.size(), 2);
+       equals(vec[0], "eo");
+       equals(vec[1], "en");
+
        env[0] = "tr_DE@euro";
        vec = APT::Configuration::getLanguages(false, false, env);
        equals(vec.size(), 2);