summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-05-04 10:02:15 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-05-04 10:02:15 +0200
commit549edd163e34a50091623b47881f2eefbdc53aca (patch)
treeec46425ae005e8e426727ab896e7614df06aced6 /apt-pkg
parent259f688a29728604d7930662e9743619982706ab (diff)
parent52d9d000a74ea71edff93f00ae38aceb9ada53d4 (diff)
merged from the debian-sid branch
Diffstat (limited to 'apt-pkg')
-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
4 files changed, 23 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 75f69ee11..2c7cdd5c2 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -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();
@@ -1772,7 +1772,7 @@ bool pkgDepCache::Sweep() /*{{{*/
{
state.Garbage=true;
if(debug_autoremove)
- std::cout << "Garbage: " << p.FullName() << std::endl;
+ std::clog << "Garbage: " << p.FullName() << std::endl;
}
}
diff --git a/apt-pkg/policy.cc b/apt-pkg/policy.cc
index 9b24c2ef1..479cf3935 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;
}