From cdb9307c701fd016325c83dc879351912fb35c9d Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Tue, 16 Nov 2010 10:35:10 +0100 Subject: add support for third party changelogs --- apt-pkg/contrib/strutl.cc | 9 +++++++++ apt-pkg/contrib/strutl.h | 1 + 2 files changed, 10 insertions(+) (limited to 'apt-pkg') 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));}; \ -- cgit v1.2.3 From 64553ed102c5a52604ea632b268c81f789b12176 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 12 Jan 2011 16:32:38 +0100 Subject: * apt-pkg/contrib/weakptr.h: - fix compile error with g++ 4.6 --- apt-pkg/contrib/weakptr.h | 1 + 1 file changed, 1 insertion(+) (limited to 'apt-pkg') diff --git a/apt-pkg/contrib/weakptr.h b/apt-pkg/contrib/weakptr.h index 5158e393c..ed92eb3f9 100644 --- a/apt-pkg/contrib/weakptr.h +++ b/apt-pkg/contrib/weakptr.h @@ -21,6 +21,7 @@ #ifndef WEAK_POINTER_H #define WEAK_POINTER_H +#include #include /** * Class for objects providing support for weak pointers. -- cgit v1.2.3 From 7763525dea18d978a1df8eee4a517314ae49ca71 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 27 Jan 2011 22:00:43 +0100 Subject: apt-pkg/deb/dpkgpm.cc: fix format string warning --- apt-pkg/deb/dpkgpm.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc index 9f0da3be6..7e8ee5b05 100644 --- a/apt-pkg/deb/dpkgpm.cc +++ b/apt-pkg/deb/dpkgpm.cc @@ -1230,7 +1230,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) { -- cgit v1.2.3