aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-06-15 14:13:18 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-06-15 14:13:18 +0100
commit69673da432788e0eb1492cb905e689361e9989ec (patch)
tree7321169825f4e9efe20d46cc1f69efacef5c6b77
parente5cf28cc1179dbeb60964bb512ac12005735d3f3 (diff)
downloadpaludis-69673da432788e0eb1492cb905e689361e9989ec.tar.gz
paludis-69673da432788e0eb1492cb905e689361e9989ec.tar.xz
With disambiguation disabled, don't care whether a set actually exists or not.
-rw-r--r--paludis/environments/paludis/keywords_conf.cc22
-rw-r--r--paludis/environments/paludis/licenses_conf.cc22
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc12
-rw-r--r--paludis/environments/paludis/use_conf.cc52
-rw-r--r--paludis/user_dep_spec.cc3
5 files changed, 58 insertions, 53 deletions
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index 8720c0d..385d25a 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -105,20 +105,11 @@ KeywordsConf::add(const FSEntry & filename)
tokens.at(0) = "*/*";
}
- if (std::string::npos == tokens.at(0).find("/"))
- {
- NamedSetMap::iterator i(_imp->set.insert(std::make_pair(SetName(tokens.at(0)), std::make_pair(
- std::tr1::shared_ptr<SetSpecTree::ConstItem>(), KeywordsList()))).first);
-
- for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
- t != t_end ; ++t)
- i->second.second.push_back(KeywordName(*t));
- }
- else
+ try
{
std::tr1::shared_ptr<PackageDepSpec> d(new PackageDepSpec(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
- UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation)));
+ UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation + updso_throw_if_set)));
if (d->package_ptr())
{
KeywordsList & k(_imp->qualified[*d->package_ptr()][d]);
@@ -134,6 +125,15 @@ KeywordsConf::add(const FSEntry & filename)
k.push_back(KeywordName(*t));
}
}
+ catch (const GotASetNotAPackageDepSpec &)
+ {
+ NamedSetMap::iterator i(_imp->set.insert(std::make_pair(SetName(tokens.at(0)), std::make_pair(
+ std::tr1::shared_ptr<SetSpecTree::ConstItem>(), KeywordsList()))).first);
+
+ for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
+ t != t_end ; ++t)
+ i->second.second.push_back(KeywordName(*t));
+ }
}
}
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 53d5c93..70fb479 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -104,20 +104,11 @@ LicensesConf::add(const FSEntry & filename)
tokens.at(0) = "*/*";
}
- if (std::string::npos == tokens.at(0).find("/"))
- {
- NamedSetMap::iterator i(_imp->set.insert(std::make_pair(SetName(tokens.at(0)), std::make_pair(
- std::tr1::shared_ptr<SetSpecTree::ConstItem>(), LicensesList()))).first);
-
- for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
- t != t_end ; ++t)
- i->second.second.push_back(*t);
- }
- else
+ try
{
std::tr1::shared_ptr<PackageDepSpec> d(new PackageDepSpec(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
- UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation)));
+ UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation + updso_throw_if_set)));
if (d->package_ptr())
{
LicensesList & k(_imp->qualified[*d->package_ptr()][d]);
@@ -133,6 +124,15 @@ LicensesConf::add(const FSEntry & filename)
k.push_back(*t);
}
}
+ catch (const GotASetNotAPackageDepSpec &)
+ {
+ NamedSetMap::iterator i(_imp->set.insert(std::make_pair(SetName(tokens.at(0)), std::make_pair(
+ std::tr1::shared_ptr<SetSpecTree::ConstItem>(), LicensesList()))).first);
+
+ for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
+ t != t_end ; ++t)
+ i->second.second.push_back(*t);
+ }
}
}
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index f0cd0a3..bdd029c 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.cc
@@ -82,12 +82,16 @@ PackageMaskConf::add(const FSEntry & filename)
for (LineConfigFile::ConstIterator line(f->begin()), line_end(f->end()) ;
line != line_end ; ++line)
{
- if (std::string::npos == line->find("/"))
- _imp->sets.push_back(std::make_pair(SetName(*line), std::tr1::shared_ptr<const SetSpecTree::ConstItem>()));
- else
+ try
+ {
_imp->masks.push_back(std::tr1::shared_ptr<PackageDepSpec>(new PackageDepSpec(parse_user_package_dep_spec(
*line, _imp->env,
- UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation))));
+ UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation + updso_throw_if_set))));
+ }
+ catch (const GotASetNotAPackageDepSpec &)
+ {
+ _imp->sets.push_back(std::make_pair(SetName(*line), std::tr1::shared_ptr<const SetSpecTree::ConstItem>()));
+ }
}
}
diff --git a/paludis/environments/paludis/use_conf.cc b/paludis/environments/paludis/use_conf.cc
index c1a3917..af10d18 100644
--- a/paludis/environments/paludis/use_conf.cc
+++ b/paludis/environments/paludis/use_conf.cc
@@ -107,35 +107,11 @@ UseConf::add(const FSEntry & filename)
tokens.at(0) = "*/*";
}
- if (std::string::npos == tokens.at(0).find("/"))
- {
- Sets::iterator i(_imp->sets.insert(std::make_pair(SetName(tokens.at(0)), DSWithUseInfo())).first);
- std::string prefix_upper, prefix_lower;
- for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
- t != t_end ; ++t)
- {
- if (*t == "-*")
- i->second.second.second.push_back(strip_trailing(prefix_lower, "_"));
- else if ('-' == t->at(0))
- i->second.second.first.insert(std::make_pair(
- UseFlagName(prefix_lower + t->substr(1)), use_disabled)).first->second = use_disabled;
- else if (':' == t->at(t->length() - 1))
- {
- std::transform(t->begin(), previous(t->end()), std::back_inserter(prefix_lower), &::tolower);
- std::transform(t->begin(), previous(t->end()), std::back_inserter(prefix_upper), &::toupper);
- prefix_lower.append("_");
- prefix_upper.append("_");
- }
- else
- i->second.second.first.insert(std::make_pair(
- UseFlagName(prefix_lower + *t), use_enabled)).first->second = use_enabled;
- }
- }
- else
+ try
{
std::tr1::shared_ptr<PackageDepSpec> d(new PackageDepSpec(parse_user_package_dep_spec(
tokens.at(0), _imp->env,
- UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation)));
+ UserPackageDepSpecOptions() + updso_allow_wildcards + updso_no_disambiguation + updso_throw_if_set)));
if (d->additional_requirements_ptr())
{
@@ -195,6 +171,30 @@ UseConf::add(const FSEntry & filename)
}
}
}
+ catch (const GotASetNotAPackageDepSpec &)
+ {
+ Sets::iterator i(_imp->sets.insert(std::make_pair(SetName(tokens.at(0)), DSWithUseInfo())).first);
+ std::string prefix_upper, prefix_lower;
+ for (std::vector<std::string>::const_iterator t(next(tokens.begin())), t_end(tokens.end()) ;
+ t != t_end ; ++t)
+ {
+ if (*t == "-*")
+ i->second.second.second.push_back(strip_trailing(prefix_lower, "_"));
+ else if ('-' == t->at(0))
+ i->second.second.first.insert(std::make_pair(
+ UseFlagName(prefix_lower + t->substr(1)), use_disabled)).first->second = use_disabled;
+ else if (':' == t->at(t->length() - 1))
+ {
+ std::transform(t->begin(), previous(t->end()), std::back_inserter(prefix_lower), &::tolower);
+ std::transform(t->begin(), previous(t->end()), std::back_inserter(prefix_upper), &::toupper);
+ prefix_lower.append("_");
+ prefix_upper.append("_");
+ }
+ else
+ i->second.second.first.insert(std::make_pair(
+ UseFlagName(prefix_lower + *t), use_enabled)).first->second = use_enabled;
+ }
+ }
}
}
diff --git a/paludis/user_dep_spec.cc b/paludis/user_dep_spec.cc
index adfa93a..d2c1c49 100644
--- a/paludis/user_dep_spec.cc
+++ b/paludis/user_dep_spec.cc
@@ -80,7 +80,8 @@ paludis::parse_user_package_dep_spec(const std::string & ss, const Environment *
if (options[updso_throw_if_set] && std::string::npos == ss.find_first_of("/:[<>=~"))
try
{
- if (env->set(SetName(ss)))
+ SetName sn(ss);
+ if (options[updso_no_disambiguation] || env->set(sn))
throw GotASetNotAPackageDepSpec(ss);
}
catch (const SetNameError &)