aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-01 16:52:29 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-05-01 16:52:29 +0000
commitc1b8bc6ff5a8d262b99fb4d6a870bba62cc5c3a9 (patch)
treeec3c8f5f51a9cb6f2222ea9d593d9d67438f6247
parent9963bab98bb429eb7339e72a8edfe9692c09633c (diff)
downloadpaludis-c1b8bc6ff5a8d262b99fb4d6a870bba62cc5c3a9.tar.gz
paludis-c1b8bc6ff5a8d262b99fb4d6a870bba62cc5c3a9.tar.xz
VDB USE may contain -flags. Ignore them.
-rw-r--r--paludis/vdb_repository.cc16
1 files changed, 15 insertions, 1 deletions
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index 556e4c8..c957a7f 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -302,6 +302,19 @@ namespace
return strip_leading(strip_trailing(std::string((std::istreambuf_iterator<char>(ff)),
std::istreambuf_iterator<char>()), " \t\n"), " \t\n");
}
+
+ /**
+ * Filter if a USE flag is a -flag.
+ *
+ * \ingroup grpvdbrepository
+ */
+ struct IsPositiveFlag
+ {
+ bool operator() (const std::string & f) const
+ {
+ return 0 != f.compare(0, 1, "-");
+ }
+ };
}
void
@@ -336,7 +349,8 @@ Implementation<VDBRepository>::load_entry(std::vector<VDBEntry>::iterator p) con
std::string raw_use(file_contents(location, p->name, p->version, "USE"));
p->use.clear();
Tokeniser<delim_kind::AnyOfTag, delim_mode::DelimiterTag> t(" \t\n");
- t.tokenise(raw_use, create_inserter<UseFlagName>(std::inserter(p->use, p->use.begin())));
+ t.tokenise(raw_use, filter_inserter(create_inserter<UseFlagName>(
+ std::inserter(p->use, p->use.begin())), IsPositiveFlag()));
}
VDBRepository::VDBRepository(const VDBRepositoryParams & p) :