aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-11 00:44:10 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-11 00:44:10 +0000
commit15ecdaafeaa624b8f580240223d0c1282a990d25 (patch)
tree721b84a43eb6b24fb654780c3417f1894952fc51
parentebf4f209fa242c5f4388e74f33aa5cf1531ce3eb (diff)
downloadpaludis-15ecdaafeaa624b8f580240223d0c1282a990d25.tar.gz
paludis-15ecdaafeaa624b8f580240223d0c1282a990d25.tar.xz
Support -flags in package.use.{mask,force}
-rw-r--r--paludis/repositories/portage/portage_repository_profile.cc48
-rw-r--r--paludis/repositories/portage/portage_repository_profile_file.cc8
2 files changed, 50 insertions, 6 deletions
diff --git a/paludis/repositories/portage/portage_repository_profile.cc b/paludis/repositories/portage/portage_repository_profile.cc
index 0197873..987973f 100644
--- a/paludis/repositories/portage/portage_repository_profile.cc
+++ b/paludis/repositories/portage/portage_repository_profile.cc
@@ -338,7 +338,29 @@ Implementation<PortageRepositoryProfile>::make_vars_from_file_vars()
UseFlagName> >())).first;
for ( ; t != t_end ; ++t)
- i->second.push_back(std::make_pair(d, UseFlagName(*t)));
+ {
+ if (0 == t->compare(0, 1, "-"))
+ {
+ UseFlagName r(t->substr(1));
+ bool found(false);
+ for (std::list<std::pair<PackageDepAtom::ConstPointer, UseFlagName> >::iterator
+ e(i->second.begin()), e_end(i->second.end()) ; e != e_end ; )
+ {
+ if (stringify(*e->first) == stringify(*d) && e->second == r)
+ {
+ found = true;
+ i->second.erase(e++);
+ }
+ else
+ ++e;
+ }
+
+ if (! found)
+ Log::get_instance()->message(ll_qa, lc_context, "No match for '" + stringify(*line) + "'");
+ }
+ else
+ i->second.push_back(std::make_pair(d, UseFlagName(*t)));
+ }
}
}
catch (const NameError & e)
@@ -369,7 +391,29 @@ Implementation<PortageRepositoryProfile>::make_vars_from_file_vars()
UseFlagName> >())).first;
for ( ; t != t_end ; ++t)
- i->second.push_back(std::make_pair(d, UseFlagName(*t)));
+ {
+ if (0 == t->compare(0, 1, "-"))
+ {
+ UseFlagName r(t->substr(1));
+ bool found(false);
+ for (std::list<std::pair<PackageDepAtom::ConstPointer, UseFlagName> >::iterator
+ e(i->second.begin()), e_end(i->second.end()) ; e != e_end ; )
+ {
+ if (stringify(*e->first) == stringify(*d) && e->second == r)
+ {
+ found = true;
+ i->second.erase(e++);
+ }
+ else
+ ++e;
+ }
+
+ if (! found)
+ Log::get_instance()->message(ll_qa, lc_context, "No match for '" + stringify(*line) + "'");
+ }
+ else
+ i->second.push_back(std::make_pair(d, UseFlagName(*t)));
+ }
}
}
catch (const NameError & e)
diff --git a/paludis/repositories/portage/portage_repository_profile_file.cc b/paludis/repositories/portage/portage_repository_profile_file.cc
index 1ad991c..1301e0e 100644
--- a/paludis/repositories/portage/portage_repository_profile_file.cc
+++ b/paludis/repositories/portage/portage_repository_profile_file.cc
@@ -20,7 +20,7 @@
#include "portage_repository_profile_file.hh"
#include <paludis/util/log.hh>
#include <paludis/config_file.hh>
-#include <set>
+#include <list>
using namespace paludis;
@@ -30,7 +30,7 @@ namespace paludis
struct Implementation<ProfileFile> :
InternalCounted<Implementation<ProfileFile> >
{
- std::set<std::string> lines;
+ std::list<std::string> lines;
};
}
@@ -47,14 +47,14 @@ ProfileFile::add_file(const FSEntry & f)
{
if (0 == line->compare(0, 1, "-", 0, 1))
{
- std::set<std::string>::iterator i(_imp->lines.find(line->substr(1)));
+ std::list<std::string>::iterator i(std::find(_imp->lines.begin(), _imp->lines.end(), line->substr(1)));
if (_imp->lines.end() == i)
Log::get_instance()->message(ll_qa, lc_context, "No match for '" + *line + "'");
else
_imp->lines.erase(i);
}
else
- _imp->lines.insert(*line);
+ _imp->lines.push_back(*line);
}
}