diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/cdrom.cc | 6 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 9 | ||||
-rw-r--r-- | apt-pkg/contrib/strutl.h | 1 | ||||
-rw-r--r-- | apt-pkg/deb/dpkgpm.cc | 2 | ||||
-rw-r--r-- | apt-pkg/init.cc | 5 |
5 files changed, 18 insertions, 5 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index 0e36f44a2..04ace10a6 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -198,7 +198,7 @@ int pkgCdrom::Score(string Path) // a symlink gets a big penalty struct stat Buf; string statPath = flNotFile(Path); - string cdromPath = _config->FindDir("Acquire::cdrom::mount","/cdrom/"); + string cdromPath = _config->FindDir("Acquire::cdrom::mount"); while(statPath != cdromPath && statPath != "./") { statPath.resize(statPath.size()-1); // remove the trailing '/' if (lstat(statPath.c_str(),&Buf) == 0) { @@ -509,7 +509,7 @@ bool pkgCdrom::Ident(string &ident, pkgCdromStatus *log) /*{{{*/ stringstream msg; // Startup - string CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/"); + string CDROM = _config->FindDir("Acquire::cdrom::mount"); if (CDROM[0] == '.') CDROM= SafeGetCWD() + '/' + CDROM; @@ -568,7 +568,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ stringstream msg; // Startup - string CDROM = _config->FindDir("Acquire::cdrom::mount","/cdrom/"); + string CDROM = _config->FindDir("Acquire::cdrom::mount"); if (CDROM[0] == '.') CDROM= SafeGetCWD() + '/' + CDROM; diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index f37045810..2e2bb5ebc 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1191,6 +1191,15 @@ char *safe_snprintf(char *Buffer,char *End,const char *Format,...) return Buffer + Did; } /*}}}*/ +// StripEpoch - Remove the version "epoch" from a version string /*{{{*/ +// --------------------------------------------------------------------- +string StripEpoch(const string &VerStr) +{ + size_t i = VerStr.find(":"); + if (i == string::npos) + return VerStr; + return VerStr.substr(i+1); +} // tolower_ascii - tolower() function that ignores the locale /*{{{*/ // --------------------------------------------------------------------- diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h index 6e0e253cf..89cbf0370 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -62,6 +62,7 @@ void strprintf(string &out,const char *format,...) __like_printf(2); char *safe_snprintf(char *Buffer,char *End,const char *Format,...) __like_printf(3); bool CheckDomainList(const string &Host, const string &List); int tolower_ascii(int const c) __attrib_const __hot; +string StripEpoch(const string &VerStr); #define APT_MKSTRCMP(name,func) \ inline int name(const char *A,const char *B) {return func(A,A+strlen(A),B,B+strlen(B));}; \ diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 3b10e1a23..7d0d34a46 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1226,7 +1226,7 @@ bool pkgDPkgPM::Go(int OutStatusFd) strprintf(dpkg_error, "Sub-process %s exited unexpectedly",Args[0]); if(dpkg_error.size() > 0) - _error->Error(dpkg_error.c_str()); + _error->Error("%s", dpkg_error.c_str()); if(stopOnError) { diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index 734f5b2c4..a30f27844 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -52,7 +52,7 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.Set("Dir::State::lists","lists/"); Cnf.Set("Dir::State::cdroms","cdroms.list"); Cnf.Set("Dir::State::mirrors","mirrors/"); - + // Cache Cnf.Set("Dir::Cache","var/cache/apt/"); Cnf.Set("Dir::Cache::archives","archives/"); @@ -88,6 +88,9 @@ bool pkgInitConfig(Configuration &Cnf) // Translation Cnf.Set("APT::Acquire::Translation", "environment"); + // Default cdrom mount point + Cnf.Set("Acquire::cdrom::mount", "/media/cdrom/"); + bool Res = true; // Read an alternate config file |