summaryrefslogtreecommitdiff
path: root/apt-pkg/init.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:50:59 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:50:59 +0000
commit08e8f724674eb96678dcabf856534c58f5c29996 (patch)
treef8cde76f1af140aa9d0536ea062d6e1fd0379c98 /apt-pkg/init.cc
parentc5162d564ac98a1e97812ec5d290d2375c0820d8 (diff)
Sync
Author: jgg Date: 1998-09-22 05:30:24 GMT Sync
Diffstat (limited to 'apt-pkg/init.cc')
-rw-r--r--apt-pkg/init.cc14
1 files changed, 11 insertions, 3 deletions
diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc
index f8cf54ee4..e171d2c6c 100644
--- a/apt-pkg/init.cc
+++ b/apt-pkg/init.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: init.cc,v 1.4 1998/07/26 04:49:26 jgg Exp $
+// $Id: init.cc,v 1.5 1998/09/22 05:30:24 jgg Exp $
/* ######################################################################
Init - Initialize the package library
@@ -9,6 +9,9 @@
/*}}}*/
// Include files /*{{{*/
#include <apt-pkg/init.h>
+
+#include <sys/stat.h>
+#include <unistd.h>
/*}}}*/
// pkgInitialize - Initialize the configuration class /*{{{*/
@@ -42,7 +45,12 @@ bool pkgInitialize(Configuration &Cnf)
Cnf.Set("Dir::Etc","/etc/apt/");
Cnf.Set("Dir::Etc::sourcelist","sources.list");
Cnf.Set("Dir::Etc::main","apt.conf");
-
- return true;
+
+ // Read the main config file
+ string FName = Cnf.FindDir("Dir::Etc::main");
+ struct stat Buf;
+ if (stat(FName.c_str(),&Buf) != 0)
+ return true;
+ return ReadConfigFile(Cnf,FName);
}
/*}}}*/