]>
git.saurik.com Git - apt.git/blob - apt-pkg/init.cc
1 // -*- mode: cpp; mode: fold -*-
3 // $Id: init.cc,v 1.9 1998/10/30 07:53:39 jgg Exp $
4 /* ######################################################################
6 Init - Initialize the package library
8 ##################################################################### */
10 // Include files /*{{{*/
11 #include <apt-pkg/init.h>
18 // pkgInitialize - Initialize the configuration class /*{{{*/
19 // ---------------------------------------------------------------------
20 /* Directories are specified in such a way that the FindDir function will
21 understand them. That is, if they don't start with a / then their parent
22 is prepended, this allows a fair degree of flexability. */
23 bool pkgInitialize(Configuration
&Cnf
)
26 Cnf
.Set("APT::Architecture",ARCHITECTURE
);
29 Cnf
.Set("Dir::State","/var/state/apt/");
30 Cnf
.Set("Dir::State::lists","lists/");
32 /* These really should be jammed into a generic 'Local Database' engine
33 which is yet to be determined. The functions in pkgcachegen should
34 be the only users of these */
35 Cnf
.Set("Dir::State::xstatus","xstatus");
36 Cnf
.Set("Dir::State::userstatus","status.user");
37 Cnf
.Set("Dir::State::status","/var/lib/dpkg/status");
40 Cnf
.Set("Dir::Cache","/var/cache/apt/");
41 Cnf
.Set("Dir::Cache::archives","archives/");
42 Cnf
.Set("Dir::Cache::srcpkgcache","srcpkgcache.bin");
43 Cnf
.Set("Dir::Cache::pkgcache","pkgcache.bin");
46 Cnf
.Set("Dir::Etc","/etc/apt/");
47 Cnf
.Set("Dir::Etc::sourcelist","sources.list");
48 Cnf
.Set("Dir::Etc::main","apt.conf");
49 Cnf
.Set("Dir::Bin::methods","/usr/lib/apt/metods");
51 // Read the main config file
52 string FName
= Cnf
.FindFile("Dir::Etc::main");
54 if (stat(FName
.c_str(),&Buf
) != 0)
57 // Read an alternate config file
58 const char *Cfg
= getenv("APT_CONFIG");
60 if (ReadConfigFile(Cnf
,FName
) != true || ReadConfigFile(Cnf
,Cfg
) != true)
63 if (Cnf
.FindB("Debug::pkgInitialize",false) == true)