~mvo/apt/mvo

« back to all changes in this revision

Viewing changes to apt-pkg/init.cc

  • Committer: Michael Vogt
  • Date: 2011-11-10 15:32:52 UTC
  • mfrom: (1561.70.60 debian-experimental2)
  • Revision ID: michael.vogt@ubuntu.com-20111110153252-1u9lc3lm2cgb6b1m
merged from http://bzr.debian.org/bzr/apt/apt/debian-experimental2

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
   ##################################################################### */
9
9
                                                                        /*}}}*/
10
10
// Include files                                                        /*{{{*/
 
11
#include<config.h>
 
12
 
11
13
#include <apt-pkg/init.h>
12
14
#include <apt-pkg/fileutl.h>
13
15
#include <apt-pkg/error.h>
 
16
#include <apt-pkg/pkgsystem.h>
 
17
#include <apt-pkg/configuration.h>
14
18
 
15
 
#include <apti18n.h>
16
 
#include <config.h>
17
19
#include <cstdlib>
18
20
#include <sys/stat.h>
 
21
 
 
22
#include <apti18n.h>
19
23
                                                                        /*}}}*/
20
24
 
21
25
#define Stringfy_(x) # x
82
86
   Cnf.CndSet("Dir::Log::Terminal","term.log");
83
87
   Cnf.CndSet("Dir::Log::History","history.log");
84
88
 
85
 
   if (Cnf.Exists("Dir::Ignore-Files-Silently") == false)
86
 
   {
87
 
      Cnf.Set("Dir::Ignore-Files-Silently::", "~$");
88
 
      Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$");
89
 
      Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$");
90
 
      Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$");
91
 
   }
 
89
   Cnf.Set("Dir::Ignore-Files-Silently::", "~$");
 
90
   Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$");
 
91
   Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$");
 
92
   Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$");
 
93
   Cnf.Set("Dir::Ignore-Files-Silently::", "\\.save$");
 
94
   Cnf.Set("Dir::Ignore-Files-Silently::", "\\.orig$");
92
95
 
93
96
   // Default cdrom mount point
94
97
   Cnf.CndSet("Acquire::cdrom::mount", "/media/cdrom/");
106
109
   }
107
110
 
108
111
   // Read the configuration parts dir
109
 
   string Parts = Cnf.FindDir("Dir::Etc::parts");
 
112
   std::string Parts = Cnf.FindDir("Dir::Etc::parts");
110
113
   if (DirectoryExists(Parts) == true)
111
114
      Res &= ReadConfigDir(Cnf,Parts);
112
115
   else
113
116
      _error->WarningE("DirectoryExists",_("Unable to read %s"),Parts.c_str());
114
117
 
115
118
   // Read the main config file
116
 
   string FName = Cnf.FindFile("Dir::Etc::main");
 
119
   std::string FName = Cnf.FindFile("Dir::Etc::main");
117
120
   if (RealFileExists(FName) == true)
118
121
      Res &= ReadConfigFile(Cnf,FName);
119
122
 
140
143
bool pkgInitSystem(Configuration &Cnf,pkgSystem *&Sys)
141
144
{
142
145
   Sys = 0;
143
 
   string Label = Cnf.Find("Apt::System","");
 
146
   std::string Label = Cnf.Find("Apt::System","");
144
147
   if (Label.empty() == false)
145
148
   {
146
149
      Sys = pkgSystem::GetSystem(Label.c_str());