summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:53 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:53 +0000
commit5f3edc0fb8a81755a5237c0f189dd55ab9f453d9 (patch)
tree5e5695699a19186021d9c192774d08b9481a6182
parent8e5fc8f5bea54e3c016a14fe4025dcb94864e874 (diff)
Checks for the partial directories before doing downloads
Author: jgg Date: 1999-10-18 02:53:05 GMT Checks for the partial directories before doing downloads
-rw-r--r--apt-pkg/acquire.cc14
1 files changed, 13 insertions, 1 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 7a93fbd8e..0ee7ff447 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: acquire.cc,v 1.40 1999/10/18 00:37:35 jgg Exp $
+// $Id: acquire.cc,v 1.41 1999/10/18 02:53:05 jgg Exp $
/* ######################################################################
Acquire - File Acquiration
@@ -26,6 +26,7 @@
#include <dirent.h>
#include <sys/time.h>
#include <errno.h>
+#include <sys/stat.h>
/*}}}*/
// Acquire::pkgAcquire - Constructor /*{{{*/
@@ -46,6 +47,17 @@ pkgAcquire::pkgAcquire(pkgAcquireStatus *Log) : Log(Log)
QueueMode = QueueAccess;
Debug = _config->FindB("Debug::pkgAcquire",false);
+
+ // This is really a stupid place for this, but people whine so much..
+ struct stat St;
+ if (stat((_config->FindDir("Dir::State::lists") + "partial/").c_str(),&St) != 0 ||
+ S_ISDIR(St.st_mode) == 0)
+ _error->Error("Lists directory %s/partial is missing",
+ _config->FindDir("Dir::State::lists").c_str());
+ if (stat((_config->FindDir("Dir::Cache::Archives") + "partial/").c_str(),&St) != 0 ||
+ S_ISDIR(St.st_mode) == 0)
+ _error->Error("Archive directory %s/partial is missing",
+ _config->FindDir("Dir::Cache::Archives").c_str());
}
/*}}}*/
// Acquire::~pkgAcquire - Destructor /*{{{*/