diff options
author | Julian Andres Klode <julian.klode@canonical.com> | 2019-05-06 22:23:45 +0200 |
---|---|---|
committer | Julian Andres Klode <julian.klode@canonical.com> | 2019-06-11 14:45:55 +0200 |
commit | ab94ebe064bf751de73a11398b1af5589ab8c668 (patch) | |
tree | 55119ebcee47b96a404123c39df216fd2176d945 /apt-pkg | |
parent | fc7d9b53f201bfdc5b3955394e6609ed7dadd258 (diff) |
Merge the ParseDepends functions
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/deb/deblistparser.cc | 40 | ||||
-rw-r--r-- | apt-pkg/deb/deblistparser.h | 41 |
2 files changed, 17 insertions, 64 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); |