summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-05-04 09:57:24 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-05-04 09:57:24 +0200
commit52d9d000a74ea71edff93f00ae38aceb9ada53d4 (patch)
treee03749a63a2057b107ba900bbdbdfb9ad320c037
parent3b1fffc35f3eb277d92f38c687c270edd1d8550d (diff)
parent8f40076991ecc89ab1e3c486da2696a44c285f18 (diff)
merge from the mvo branch
-rw-r--r--apt-pkg/acquire-item.cc14
-rw-r--r--apt-pkg/acquire-item.h9
-rw-r--r--apt-pkg/depcache.cc4
-rw-r--r--apt-pkg/policy.cc2
-rw-r--r--debian/changelog13
-rw-r--r--methods/connect.cc3
-rw-r--r--test/libapt/getlanguages_test.cc7
7 files changed, 46 insertions, 6 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index 4f0abbb91..6d4336425 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -1547,8 +1547,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);
@@ -1663,3 +1664,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";
+}
+ /*}}}*/
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index d862d0fdd..bafa8263a 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -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);
};
/*}}}*/
/** @} */
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 5943d858a..0f30f13c2 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -186,7 +186,7 @@ bool pkgDepCache::readStateFile(OpProgress *Prog) /*{{{*/
if(reason > 0)
PkgState[pkg->ID].Flags |= Flag::Auto;
if(debug_autoremove)
- std::cout << "Auto-Installed : " << pkgname << std::endl;
+ std::clog << "Auto-Installed : " << pkgname << std::endl;
amt+=section.size();
if(Prog != NULL)
Prog->OverallProgress(amt, file_size, 1,
@@ -1511,7 +1511,7 @@ bool pkgDepCache::Sweep() /*{{{*/
{
state.Garbage=true;
if(debug_autoremove)
- std::cout << "Garbage: " << p.Name() << std::endl;
+ std::clog << "Garbage: " << p.Name() << std::endl;
}
}
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index b12a50d0a..4996007a3 100644
--- a/apt-pkg/policy.cc
+++ b/apt-pkg/policy.cc
@@ -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;
}
diff --git a/debian/changelog b/debian/changelog
index f166b7d32..eb618118d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+apt (0.7.26~exp4) unstable; urgency=low
+
+ * [ 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)
+
+ -- Michael Vogt <michael.vogt@ubuntu.com> Tue, 04 May 2010 09:55:08 +0200
+
apt (0.7.26~exp3) UNRELEASED; urgency=low
[ Christian Perrier ]
diff --git a/methods/connect.cc b/methods/connect.cc
index adb16a199..2f6b4833e 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -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);
}
diff --git a/test/libapt/getlanguages_test.cc b/test/libapt/getlanguages_test.cc
index 0db190b50..9a8910b58 100644
--- a/test/libapt/getlanguages_test.cc
+++ b/test/libapt/getlanguages_test.cc
@@ -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);