summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Andres Klode <julian.klode@canonical.com>2019-05-06 22:23:45 +0200
committerJulian Andres Klode <julian.klode@canonical.com>2019-06-11 14:45:55 +0200
commitab94ebe064bf751de73a11398b1af5589ab8c668 (patch)
tree55119ebcee47b96a404123c39df216fd2176d945
parentfc7d9b53f201bfdc5b3955394e6609ed7dadd258 (diff)
Merge the ParseDepends functions
-rw-r--r--apt-pkg/deb/deblistparser.cc40
-rw-r--r--apt-pkg/deb/deblistparser.h41
-rw-r--r--debian/libapt-pkg5.90.symbols5
3 files changed, 18 insertions, 68 deletions
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 80ca10e37..832e3948d 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -546,28 +546,6 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
/* This parses the dependency elements out of a standard string in place,
bit by bit. */
const char *debListParser::ParseDepends(const char *Start,const char *Stop,
- std::string &Package,std::string &Ver,unsigned int &Op)
- { return ParseDepends(Start, Stop, Package, Ver, Op, false, true, false); }
-const char *debListParser::ParseDepends(const char *Start,const char *Stop,
- std::string &Package,std::string &Ver,unsigned int &Op,
- bool const &ParseArchFlags)
- { return ParseDepends(Start, Stop, Package, Ver, Op, ParseArchFlags, true, false); }
-const char *debListParser::ParseDepends(const char *Start,const char *Stop,
- std::string &Package,std::string &Ver,unsigned int &Op,
- bool const &ParseArchFlags, bool const &StripMultiArch)
- { return ParseDepends(Start, Stop, Package, Ver, Op, ParseArchFlags, StripMultiArch, false); }
-const char *debListParser::ParseDepends(const char *Start,const char *Stop,
- string &Package,string &Ver,
- unsigned int &Op, bool const &ParseArchFlags,
- bool const &StripMultiArch,
- bool const &ParseRestrictionsList)
-{
- return debListParser::ParseDepends(Start, Stop, Package, Ver, Op, ParseArchFlags,
- StripMultiArch, ParseRestrictionsList,
- _config->Find("APT::Architecture"));
-}
-
-const char *debListParser::ParseDepends(const char *Start,const char *Stop,
string &Package,string &Ver,
unsigned int &Op, bool const &ParseArchFlags,
bool const &StripMultiArch,
@@ -584,23 +562,15 @@ const char *debListParser::ParseDepends(const char *Start,const char *Stop,
return res;
}
-const char *debListParser::ParseDepends(const char *Start,const char *Stop,
- StringView &Package,StringView &Ver,
- unsigned int &Op, bool ParseArchFlags,
- bool StripMultiArch,
- bool ParseRestrictionsList)
-{
- return debListParser::ParseDepends(Start, Stop, Package, Ver, Op, ParseArchFlags,
- StripMultiArch, ParseRestrictionsList,
- _config->Find("APT::Architecture"));
-}
-const char *debListParser::ParseDepends(const char *Start,const char *Stop,
- StringView &Package,StringView &Ver,
+const char *debListParser::ParseDepends(const char *Start, const char *Stop,
+ StringView &Package, StringView &Ver,
unsigned int &Op, bool ParseArchFlags,
bool StripMultiArch,
- bool ParseRestrictionsList, string const &Arch)
+ bool ParseRestrictionsList, string Arch)
{
+ if (Arch.empty())
+ Arch = _config->Find("APT::Architecture");
// Strip off leading space
for (;Start != Stop && isspace_ascii(*Start) != 0; ++Start);
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index 1d731d5a9..807968452 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -77,35 +77,18 @@ class APT_HIDDEN debListParser : public pkgCacheListParser
virtual bool Step() APT_OVERRIDE;
- APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
- std::string &Package,std::string &Ver,unsigned int &Op);
- APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
- std::string &Package,std::string &Ver,unsigned int &Op,
- bool const &ParseArchFlags);
- APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
- std::string &Package,std::string &Ver,unsigned int &Op,
- bool const &ParseArchFlags, bool const &StripMultiArch);
- APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
- std::string &Package,std::string &Ver,unsigned int &Op,
- bool const &ParseArchFlags, bool const &StripMultiArch,
- bool const &ParseRestrictionsList);
- APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
- std::string &Package,std::string &Ver,unsigned int &Op,
- bool const &ParseArchFlags, bool const &StripMultiArch,
- bool const &ParseRestrictionsList,
- std::string const &Arch);
-
- APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
- APT::StringView &Package,
- APT::StringView &Ver,unsigned int &Op,
- bool const ParseArchFlags = false, bool StripMultiArch = true,
- bool const ParseRestrictionsList = false);
- APT_PUBLIC static const char *ParseDepends(const char *Start,const char *Stop,
- APT::StringView &Package,
- APT::StringView &Ver,unsigned int &Op,
- bool const ParseArchFlags, bool StripMultiArch,
- bool const ParseRestrictionsList,
- std::string const &Arch);
+ APT_PUBLIC static const char *ParseDepends(const char *Start, const char *Stop,
+ std::string &Package, std::string &Ver, unsigned int &Op,
+ bool const &ParseArchFlags = false, bool const &StripMultiArch = true,
+ bool const &ParseRestrictionsList = false,
+ std::string const &Arch = "");
+
+ APT_PUBLIC static const char *ParseDepends(const char *Start, const char *Stop,
+ APT::StringView &Package,
+ APT::StringView &Ver, unsigned int &Op,
+ bool const ParseArchFlags = false, bool StripMultiArch = true,
+ bool const ParseRestrictionsList = false,
+ std::string Arch = "");
APT_PUBLIC static const char *ConvertRelation(const char *I,unsigned int &Op);
diff --git a/debian/libapt-pkg5.90.symbols b/debian/libapt-pkg5.90.symbols
index 4d9ba92c7..ee4800455 100644
--- a/debian/libapt-pkg5.90.symbols
+++ b/debian/libapt-pkg5.90.symbols
@@ -263,7 +263,6 @@ libapt-pkg.so.5.90 libapt-pkg5.90 #MINVER#
(c++)"Configuration::Configuration(Configuration::Item const*)@APTPKG_5.90" 0.8.0
(c++)"Configuration::Configuration()@APTPKG_5.90" 0.8.0
(c++)"Configuration::~Configuration()@APTPKG_5.90" 0.8.0
- (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&, bool const&, bool const&)@APTPKG_5.90" 0.8.0
(c++)"debListParser::ConvertRelation(char const*, unsigned int&)@APTPKG_5.90" 0.8.0
(c++)"debListParser::GetPrio(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)@APTPKG_5.90" 0.8.0
(c++)"pkgAcqArchive::Finished()@APTPKG_5.90" 0.8.0
@@ -1011,9 +1010,6 @@ libapt-pkg.so.5.90 libapt-pkg5.90 #MINVER#
(c++)"GetTempDir[abi:cxx11]()@APTPKG_5.90" 0.9.14.2
(c++)"APT::Configuration::getBuildProfiles[abi:cxx11]()@APTPKG_5.90" 0.9.16
(c++)"APT::Configuration::getBuildProfilesString[abi:cxx11]()@APTPKG_5.90" 0.9.16
- (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&)@APTPKG_5.90" 0.9.16
- (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&, bool const&)@APTPKG_5.90" 0.9.16
- (c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&, bool const&, bool const&, bool const&)@APTPKG_5.90" 0.9.16
(c++)"Rename(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)@APTPKG_5.90" 0.9.16
(c++)"pkgDepCache::IsInstallOkDependenciesSatisfiableByCandidates(pkgCache::PkgIterator const&, bool, unsigned long, bool)@APTPKG_5.90" 1.0
(c++)"APT::Progress::PackageManagerFancy::GetTerminalSize()@APTPKG_5.90" 1.0
@@ -1435,6 +1431,7 @@ libapt-pkg.so.5.90 libapt-pkg5.90 #MINVER#
(c++)"AddCRC16Byte(unsigned short, unsigned char)@APTPKG_5.90" 1.4~beta1
(c++)"APT::String::Join(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@APTPKG_5.90" 1.4~beta4
(c++)"debListParser::ParseDepends(char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, unsigned int&, bool const&, bool const&, bool const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)@APTPKG_5.90" 1.4~beta3
+ (c++)"debListParser::ParseDepends(char const*, char const*, APT::StringView&, APT::StringView&, unsigned int&, bool, bool, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)@APTPKG_5.90" 1.9.0~
(c++)"pkgTagHash(char const*, unsigned long)@APTPKG_5.90" 1.4~beta1
(c++|optional=std)"void std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::emplace_back<char const (&) [4]>(char const (&) [4])@APTPKG_5.90" 1.4~beta4
(c++)"FileFd::ReadLine(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)@APTPKG_5.90" 1.5~beta2~