]>
git.saurik.com Git - apt.git/blob - apt-pkg/init.cc
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: init.cc,v 1.6 1998/09/26 05:34:19 jgg Exp $
4 /* ######################################################################
6 Init - Initialize the package library
8 ##################################################################### */
10 // Include files /*{{{*/
11 #include <apt-pkg/init.h>
17 // pkgInitialize - Initialize the configuration class /*{{{*/
18 // ---------------------------------------------------------------------
19 /* Directories are specified in such a way that the FindDir function will
20 understand them. That is, if they don't start with a / then their parent
21 is prepended, this allows a fair degree of flexability. */
22 bool pkgInitialize(Configuration
&Cnf
)
25 Cnf
.Set("APT::Architecture","i386");
28 Cnf
.Set("Dir::State","/var/state/apt/");
29 Cnf
.Set("Dir::State::lists","lists/");
31 /* These really should be jammed into a generic 'Local Database' engine
32 which is yet to be determined. The functions in pkgcachegen should
33 be the only users of these */
34 Cnf
.Set("Dir::State::xstatus","xstatus");
35 Cnf
.Set("Dir::State::userstatus","status.user");
36 Cnf
.Set("Dir::State::status","/var/lib/dpkg/status");
39 Cnf
.Set("Dir::Cache","/tmp/");
40 Cnf
.Set("Dir::Cache::archives","archives/");
41 Cnf
.Set("Dir::Cache::srcpkgcache","srcpkgcache.bin");
42 Cnf
.Set("Dir::Cache::pkgcache","pkgcache.bin");
45 Cnf
.Set("Dir::Etc","/etc/apt/");
46 Cnf
.Set("Dir::Etc::sourcelist","sources.list");
47 Cnf
.Set("Dir::Etc::main","apt.conf");
49 // Read the main config file
50 string FName
= Cnf
.FindDir("Dir::Etc::main");
52 if (stat(FName
.c_str(),&Buf
) != 0)
54 return ReadConfigFile(Cnf
,FName
);