From a473295d01ed9c599926d9a8c212d4e1a404f78b Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 29 Nov 2016 22:40:20 -0800 Subject: Store tags in the cache (they are very useful :/). --- apt-pkg/deb/deblistparser.cc | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 0fc08d8fb..878170d00 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -244,6 +244,8 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) if (ParseProvides(Ver) == false) return false; + if (ParseTag(Ver) == false) + return false; return true; } @@ -950,6 +952,46 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) return false; } } + return true; +} + /*}}}*/ +// ListParser::ParseTag - Parse the tag list /*{{{*/ +// --------------------------------------------------------------------- +/* */ +bool debListParser::ParseTag(pkgCache::VerIterator &Ver) +{ + const char *Start; + const char *Stop; + if (Section.Find("Tag",Start,Stop) == false) + return true; + + while (1) { + while (1) { + if (Start == Stop) + return true; + if (Stop[-1] != ' ' && Stop[-1] != '\t') + break; + --Stop; + } + + const char *Begin = Stop - 1; + while (Begin != Start && Begin[-1] != ' ' && Begin[-1] != ',') + --Begin; + + if (NewTag(Ver, Begin, Stop - Begin) == false) + return false; + + while (1) { + if (Begin == Start) + return true; + if (Begin[-1] == ',') + break; + --Begin; + } + + Stop = Begin - 1; + } + return true; } /*}}}*/ -- cgit v1.2.3 From ef1e4dfd2853abb2e8900c26c1c17bf053863e85 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 29 Nov 2016 22:55:57 -0800 Subject: Most interfaces (Maemo) need a high-level name :/. --- apt-pkg/deb/deblistparser.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 878170d00..ec5787fb4 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -148,6 +148,15 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver) const char *Start; const char *Stop; + if (Section.Find("Name",Start,Stop) == true) + { + Ver->Display = WriteString(Start, Stop - Start); + } + else if (Section.Find("Maemo-Display-Name",Start,Stop) == true) + { + Ver->Display = WriteString(Start, Stop - Start); + } + // Parse the section if (Section.Find(pkgTagSection::Key::Section,Start,Stop) == true) { -- cgit v1.2.3 From 4e99adb0d3727c0ae41edc9b3f52448d0d5b7655 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Tue, 29 Nov 2016 23:58:01 -0800 Subject: Avoid wedging the entire system if recoverable :/. --- apt-pkg/deb/deblistparser.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index ec5787fb4..258344009 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -824,8 +824,10 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, unsigned int Op; Start = ParseDepends(Start, Stop, Package, Version, Op, false, false, false); - if (Start == 0) - return _error->Error("Problem parsing dependency %zu",static_cast(Key)); // TODO + if (Start == 0) { + _error->Warning("Problem parsing dependency %zu",static_cast(Key)); // TODO + continue; + } size_t const found = Package.rfind(':'); if (found == string::npos) @@ -892,8 +894,10 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) { Start = ParseDepends(Start,Stop,Package,Version,Op, false, false, false); const size_t archfound = Package.rfind(':'); - if (Start == 0) - return _error->Error("Problem parsing Provides line"); + if (Start == 0) { + _error->Warning("Problem parsing Provides line"); + continue; + } if (unlikely(Op != pkgCache::Dep::NoOp && Op != pkgCache::Dep::Equals)) { _error->Warning("Ignoring Provides line with non-equal DepCompareOp for package %s", Package.to_string().c_str()); } else if (archfound != string::npos) { -- cgit v1.2.3 From cc51afda7080d6f3cc1cffe6f956d5376c4cb40e Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Fri, 30 Dec 2016 13:49:21 -0800 Subject: My "tolerance" patch was a tad bit overzealous :(. --- apt-pkg/deb/deblistparser.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 258344009..25d8e6f22 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -824,10 +824,8 @@ bool debListParser::ParseDepends(pkgCache::VerIterator &Ver, unsigned int Op; Start = ParseDepends(Start, Stop, Package, Version, Op, false, false, false); - if (Start == 0) { - _error->Warning("Problem parsing dependency %zu",static_cast(Key)); // TODO - continue; - } + if (Start == 0) + return _error->Warning("Problem parsing dependency %zu",static_cast(Key)); // TODO size_t const found = Package.rfind(':'); if (found == string::npos) @@ -894,10 +892,8 @@ bool debListParser::ParseProvides(pkgCache::VerIterator &Ver) { Start = ParseDepends(Start,Stop,Package,Version,Op, false, false, false); const size_t archfound = Package.rfind(':'); - if (Start == 0) { - _error->Warning("Problem parsing Provides line"); - continue; - } + if (Start == 0) + return _error->Warning("Problem parsing Provides line"); if (unlikely(Op != pkgCache::Dep::NoOp && Op != pkgCache::Dep::Equals)) { _error->Warning("Ignoring Provides line with non-equal DepCompareOp for package %s", Package.to_string().c_str()); } else if (archfound != string::npos) { -- cgit v1.2.3 From baec76f5f0f9fcbd71f6e2afaa7fc85543bd624c Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Sun, 29 Jan 2017 15:01:00 -0800 Subject: The entire concept of PendingError() is flawed :/. --- apt-pkg/deb/deblistparser.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 25d8e6f22..23048008b 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -76,7 +76,7 @@ string debListParser::Package() { std::transform(Result.begin(), Result.end(), Result.begin(), tolower_ascii); if(unlikely(Result.empty() == true)) - _error->Error("Encountered a section with no Package: header"); + _error->Warning("Encountered a section with no Package: header"); return Result; } /*}}}*/ -- cgit v1.2.3 From 2d71f8c24d490b5a3773821264124f0ed5c9a9d2 Mon Sep 17 00:00:00 2001 From: Jaywalker Date: Tue, 6 Feb 2018 23:51:41 -0600 Subject: Fixed system() using coolstar's patch and added other required patches --- apt-pkg/deb/deblistparser.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'apt-pkg/deb/deblistparser.cc') diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc index 23048008b..17c283615 100644 --- a/apt-pkg/deb/deblistparser.cc +++ b/apt-pkg/deb/deblistparser.cc @@ -63,6 +63,7 @@ debListParser::debListParser(FileFd *File) : else forceEssential.emplace_back("apt"); forceImportant = _config->FindVector("pkgCacheGen::ForceImportant"); + Arch = _config->Find("APT::architecture"); } /*}}}*/ // ListParser::Package - Return the package name /*{{{*/ -- cgit v1.2.3