diff options
Diffstat (limited to 'apt-pkg')
-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)); } |