diff options
Diffstat (limited to 'apt-pkg')
-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/depcache.cc | 4 | ||||
-rw-r--r-- | apt-pkg/init.cc | 3 | ||||
-rw-r--r-- | apt-pkg/init.h | 2 |
6 files changed, 19 insertions, 2 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 987f4c3a4..c2b335ed7 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -1174,6 +1174,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 a457ff047..14cf5c943 100644 --- a/apt-pkg/contrib/strutl.h +++ b/apt-pkg/contrib/strutl.h @@ -61,6 +61,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 9f0da3be6..79bea85fe 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1265,7 +1265,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg) string::size_type pos; FILE *report; - if (_config->FindB("Dpkg::ApportFailureReport", false) == false) + if (_config->FindB("Dpkg::ApportFailureReport", true) == false) { std::clog << "configured to not write apport reports" << std::endl; return; diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc index 23abc76c1..72bdd3199 100644 --- a/apt-pkg/depcache.cc +++ b/apt-pkg/depcache.cc @@ -1192,9 +1192,13 @@ bool pkgDepCache::IsDeleteOk(PkgIterator const &Pkg,bool rPurge, std::clog << OutputInDepth(Depth) << "Hold prevents MarkDelete of " << Pkg << " FU=" << FromUser << std::endl; return false; } + // if the removal is not explictely requested by the user, protect + // explicit new-install package from accidental removal by the + // problemresolver else if (FromUser == false && Pkg->CurrentVer == 0) { StateCache &P = PkgState[Pkg->ID]; + // Status == 2 means this applies for new installs only if (P.InstallVer != 0 && P.Status == 2 && (P.Flags & Flag::Auto) != Flag::Auto) { if (DebugMarker == true) diff --git a/apt-pkg/init.cc b/apt-pkg/init.cc index f0bad78df..e031cbb94 100644 --- a/apt-pkg/init.cc +++ b/apt-pkg/init.cc @@ -84,6 +84,9 @@ bool pkgInitConfig(Configuration &Cnf) Cnf.Set("Dir::Ignore-Files-Silently::", "\\.disabled$"); Cnf.Set("Dir::Ignore-Files-Silently::", "\\.bak$"); Cnf.Set("Dir::Ignore-Files-Silently::", "\\.dpkg-[a-z]+$"); + // ubuntu specific + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.distUpgrade$"); + Cnf.Set("Dir::Ignore-Files-Silently::", "\\.save$"); // Translation Cnf.Set("APT::Acquire::Translation", "environment"); diff --git a/apt-pkg/init.h b/apt-pkg/init.h index 15a1165b9..6d3ef953c 100644 --- a/apt-pkg/init.h +++ b/apt-pkg/init.h @@ -21,7 +21,7 @@ // reverse-dependencies of libapt-pkg against the new SONAME. // Non-ABI-Breaks should only increase RELEASE number. // See also buildlib/libversion.mak -#define APT_PKG_MAJOR 4 +#define APT_PKG_MAJOR 4 #define APT_PKG_MINOR 10 #define APT_PKG_RELEASE 1 |