summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorChristian Perrier <bubulle@debian.org>2005-03-05 09:28:33 +0000
committerChristian Perrier <bubulle@debian.org>2005-03-05 09:28:33 +0000
commit2c01f1c077870be1fb00663fc6bb80366498efab (patch)
treec7c997e669f03bd240c44cfbb64ed6d5fd7c2f03 /apt-pkg
parent7e360377931dbdea7ec3afe606bca39435353581 (diff)
parentc8b944492073b938395fd890dfa8ed1e4b55fab4 (diff)
Merge with matt
Patches applied: * apt@packages.debian.org/apt--main--0--patch-59 Open 0.6.32 * apt@packages.debian.org/apt--main--0--patch-60 Merge apt--mvo--0 * apt@packages.debian.org/apt--main--0--patch-61 Add missing whitespace in new Debug::Acquire::gpgv output * apt@packages.debian.org/apt--main--0--patch-62 Merge apt--mvo--0 * apt@packages.debian.org/apt--main--0--patch-63 Open 0.6.34 * apt@packages.debian.org/apt--main--0--patch-64 Add missing semicolon in configure-index (Debian #295773) * apt@packages.debian.org/apt--main--0--patch-65 Update build-depends on gettext to 0.12 * michael.vogt@canonical.com--2004/apt--mvo--0--patch-12 * star-merged with matt, removed the unset("no_proxy") in methods/ftp.cc * michael.vogt@canonical.com--2004/apt--mvo--0--patch-13 * commented the ftp no_proxy unseting in methods/ftp.cc * michael.vogt@canonical.com--2004/apt--mvo--0--patch-14 * starmeged with matt, added some comments to the unsetting of no_proxy in ftp.cc * michael.vogt@canonical.com--2004/apt--mvo--0--patch-15 * merged with matt's tree * michael.vogt@canonical.com--2004/apt--mvo--0--patch-16 * added support for "Acquire::gpgv::options" in methods/gpgv.cc * michael.vogt@ubuntu.com--2005/apt--mvo--0--base-0 tag of michael.vogt@canonical.com--2004/apt--mvo--0--patch-16 * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-1 * slightly cosmetic change in methods/gpgv.cc * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-2 * merge with matts tree, added documentation for the gpgv stuff * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-3 * added gpgv::Options to configure-index * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-4 * PulseIntervall can be configured now to make frontends like synaptic hayppy. it's done in a way that does not break binary compatibility * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-5 * fix for apt-get update removing the cdroms Release.gpg files * michael.vogt@ubuntu.com--2005/apt--mvo--0--patch-6 * path scoring changed, the non-symlink path is scored highest
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc12
-rw-r--r--apt-pkg/acquire.cc6
-rw-r--r--apt-pkg/acquire.h3
-rw-r--r--apt-pkg/cdrom.cc17
4 files changed, 23 insertions, 15 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index de8cfe8f2..714edd8d8 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -350,18 +350,8 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,
/* The only header we use is the last-modified header. */
string pkgAcqMetaSig::Custom600Headers()
{
- // mvo: we don't really need the last-modified header here
- // 1) it points to "Final" and that was renamed to "DestFile"
- // so it's never send anyway
- // 2) because DestFIle is in partial/ we will send a partial request
- // with if-range in the http method (or the equivalent for ftp).
- // that should give the same result
-
- string Final = _config->FindDir("Dir::State::lists");
- Final += URItoFileName(RealURI);
-
struct stat Buf;
- if (stat(Final.c_str(),&Buf) != 0)
+ if (stat(DestFile.c_str(),&Buf) != 0)
return "\nIndex-File: true";
return "\nIndex-File: true\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 3c207fd27..70dce4f54 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -312,7 +312,7 @@ void pkgAcquire::RunFds(fd_set *RSet,fd_set *WSet)
/* This runs the queues. It manages a select loop for all of the
Worker tasks. The workers interact with the queues and items to
manage the actual fetch. */
-pkgAcquire::RunResult pkgAcquire::Run()
+pkgAcquire::RunResult pkgAcquire::Run(int PulseIntervall)
{
Running = true;
@@ -327,7 +327,7 @@ pkgAcquire::RunResult pkgAcquire::Run()
// Run till all things have been acquired
struct timeval tv;
tv.tv_sec = 0;
- tv.tv_usec = 500000;
+ tv.tv_usec = PulseIntervall;
while (ToFetch > 0)
{
fd_set RFds;
@@ -357,7 +357,7 @@ pkgAcquire::RunResult pkgAcquire::Run()
// Timeout, notify the log class
if (Res == 0 || (Log != 0 && Log->Update == true))
{
- tv.tv_usec = 500000;
+ tv.tv_usec = PulseIntervall;
for (Worker *I = Workers; I != 0; I = I->NextAcquire)
I->Pulse();
if (Log != 0 && Log->Pulse(this) == false)
diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h
index 65c53a953..3e338b220 100644
--- a/apt-pkg/acquire.h
+++ b/apt-pkg/acquire.h
@@ -100,7 +100,8 @@ class pkgAcquire
enum RunResult {Continue,Failed,Cancelled};
- RunResult Run();
+ RunResult Run() { return Run(500000); }; // Binary compatibility
+ RunResult Run(int PulseIntervall);
void Shutdown();
// Simple iteration mechanism
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index a91fc7181..1b9e98519 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -169,6 +169,23 @@ int pkgCdrom::Score(string Path)
Res += 10;
if (Path.find("/debian/") != string::npos)
Res -= 10;
+
+ // check for symlinks in the patch leading to the actual file
+ // a symlink gets a big penalty
+ struct stat Buf;
+ string statPath = flNotFile(Path);
+ string cdromPath = _config->FindDir("Acquire::cdrom::mount","/cdrom/");
+ while(statPath != cdromPath && statPath != "./") {
+ statPath.resize(statPath.size()-1); // remove the trailing '/'
+ if (lstat(statPath.c_str(),&Buf) == 0) {
+ if(S_ISLNK(Buf.st_mode)) {
+ Res -= 60;
+ break;
+ }
+ }
+ statPath = flNotFile(statPath); // descent
+ }
+
return Res;
}