diff options
author | David Kalnischkies <david@kalnischkies.de> | 2021-03-17 17:21:11 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2021-04-25 11:45:20 +0200 |
commit | 25e11a6b4bf11e5ffa364a0e2961ae89289f4611 (patch) | |
tree | 822443c62eca0eaaa913045c80b825e00a5bdcde | |
parent | 408f4e0d32d11d3f7b7ec0e27fe8cf73cad23a6c (diff) |
Streamline or-group closing after other arch-specific package
The comment and code are a bit too roundabout about what they actually
try to do, so lets just set that straight as this is really just about a
very specific case and doesn't deserve a general resetting.
Gbp-Dch: Ignore
-rw-r--r-- | apt-pkg/deb/debsrcrecords.cc | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/apt-pkg/deb/debsrcrecords.cc b/apt-pkg/deb/debsrcrecords.cc index 0b6cf1ff0..0a1f91f22 100644 --- a/apt-pkg/deb/debsrcrecords.cc +++ b/apt-pkg/deb/debsrcrecords.cc @@ -135,13 +135,9 @@ bool debSrcRecordParser::BuildDepends(std::vector<pkgSrcRecords::Parser::BuildDe // or something). if (rec.Package.empty()) { - // If we are in an OR group, we need to set the "Or" flag of the - // previous entry to our value. - if (BuildDeps.empty() == false && (BuildDeps[BuildDeps.size() - 1].Op & pkgCache::Dep::Or) == pkgCache::Dep::Or) - { - BuildDeps[BuildDeps.size() - 1].Op &= ~pkgCache::Dep::Or; - BuildDeps[BuildDeps.size() - 1].Op |= (rec.Op & pkgCache::Dep::Or); - } + // If this was the last or-group member, close the or-group with the previous entry + if (not BuildDeps.empty() && (BuildDeps.back().Op & pkgCache::Dep::Or) == pkgCache::Dep::Or && (rec.Op & pkgCache::Dep::Or) != pkgCache::Dep::Or) + BuildDeps.back().Op &= ~pkgCache::Dep::Or; } else { BuildDeps.emplace_back(std::move(rec)); } |