aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-07 00:19:41 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-01-07 00:19:41 +0000
commitdf660234fbbe8ff2d7df41f0ca5063fec9380b29 (patch)
tree4a18fe348ab8c6c3cb651c40abf100ea8125ce0a
parent6e2cdf0d30c4ba6c86d6fa67cf47001506e12677 (diff)
parent50c8ed8ce6dc9a06e892360fa2c7839a000d92ac (diff)
downloadpaludis-df660234fbbe8ff2d7df41f0ca5063fec9380b29.tar.gz
paludis-df660234fbbe8ff2d7df41f0ca5063fec9380b29.tar.xz
Merge branch 'fix-exheres-profiles'
-rw-r--r--paludis/choice.cc8
-rw-r--r--paludis/paludislike_options_conf.cc4
-rw-r--r--paludis/repositories/e/e_repository.cc15
-rw-r--r--paludis/repositories/e/exheres_profile.cc36
4 files changed, 39 insertions, 24 deletions
diff --git a/paludis/choice.cc b/paludis/choice.cc
index 4fb1593..1747b18 100644
--- a/paludis/choice.cc
+++ b/paludis/choice.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -77,7 +77,7 @@ ChoicePrefixNameValidator::validate(const std::string & s)
if (s[0] >= 'A' && s[0] <= 'Z')
throw ChoicePrefixNameError(s);
- if (std::string::npos != s.find(" \t\r\n"))
+ if (std::string::npos != s.find(" \t\r\n()"))
throw ChoicePrefixNameError(s);
}
}
@@ -110,7 +110,7 @@ ChoiceNameWithPrefixValidator::validate(const std::string & s)
break;
};
- if (std::string::npos != s.find(" \t\r\n"))
+ if (std::string::npos != s.find(" \t\r\n()"))
throw ChoiceNameWithPrefixError(s);
}
@@ -142,7 +142,7 @@ UnprefixedChoiceNameValidator::validate(const std::string & s)
break;
};
- if (std::string::npos != s.find(" \t\r\n"))
+ if (std::string::npos != s.find(" \t\r\n()"))
throw ChoiceNameWithPrefixError(s);
}
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index d868df0..0c1ec2b 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2009 Ciaran McCreesh
+ * Copyright (c) 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -292,7 +292,7 @@ PaludisLikeOptionsConf::add_file(const FSEntry & f)
*t = t->substr(1, t->length() - 2);
}
- else if ('-' == t->at(0))
+ if ('-' == t->at(0))
{
/* -bar */
values_group->values().insert(make_named_values<Value>(
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index d25f260..2a3a724 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -225,6 +225,7 @@ namespace paludis
std::tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
std::tr1::shared_ptr<const MetadataValueKey<std::string> > layout_key;
+ std::tr1::shared_ptr<const MetadataValueKey<std::string> > profile_layout_key;
std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
std::tr1::shared_ptr<const MetadataCollectionKey<FSEntrySequence> > profiles_key;
std::tr1::shared_ptr<const MetadataValueKey<FSEntry> > cache_key;
@@ -275,6 +276,8 @@ namespace paludis
mkt_significant, params.entry_format())),
layout_key(new LiteralMetadataValueKey<std::string> ("layout", "layout",
mkt_normal, params.layout())),
+ profile_layout_key(new LiteralMetadataValueKey<std::string> ("profile_layout", "profile_layout",
+ mkt_normal, params.profile_layout())),
location_key(new LiteralMetadataValueKey<FSEntry> ("location", "location",
mkt_significant, params.location())),
profiles_key(new LiteralMetadataFSEntrySequenceKey(
@@ -513,6 +516,7 @@ ERepository::_add_metadata_keys() const
clear_metadata_keys();
add_metadata_key(_imp->format_key);
add_metadata_key(_imp->layout_key);
+ add_metadata_key(_imp->profile_layout_key);
add_metadata_key(_imp->location_key);
add_metadata_key(_imp->profiles_key);
add_metadata_key(_imp->cache_key);
@@ -1436,9 +1440,14 @@ ERepository::repository_factory_create(
{
if (! layout_conf
|| (profile_layout = layout_conf->get("profile_layout")).empty())
- profile_layout = EExtraDistributionData::get_instance()->data_from_distribution(
- *DistributionData::get_instance()->distribution_from_string(
- env->distribution()))->default_profile_layout();
+ {
+ if (master_repositories)
+ profile_layout = (*master_repositories->begin())->params().profile_layout();
+ else
+ profile_layout = EExtraDistributionData::get_instance()->data_from_distribution(
+ *DistributionData::get_instance()->distribution_from_string(
+ env->distribution()))->default_profile_layout();
+ }
}
UseManifest use_manifest(manifest_use);
diff --git a/paludis/repositories/e/exheres_profile.cc b/paludis/repositories/e/exheres_profile.cc
index ed70ed4..ed3f646 100644
--- a/paludis/repositories/e/exheres_profile.cc
+++ b/paludis/repositories/e/exheres_profile.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -131,13 +131,19 @@ ExheresProfile::ExheresProfile(
const std::tr1::shared_ptr<const Set<UnprefixedChoiceName> > s(_imp->options_conf.known_choice_value_names(
make_null_shared_ptr(), ChoicePrefixName("suboptions")));
- std::transform(s->begin(), s->end(), _imp->use_expand->inserter(),
- paludis::stringify<UnprefixedChoiceName>);
+ for (Set<UnprefixedChoiceName>::ConstIterator f(s->begin()), f_end(s->end()) ;
+ f != f_end ; ++f)
+ if (_imp->options_conf.want_choice_enabled_locked(make_null_shared_ptr(),
+ ChoicePrefixName("suboptions"), *f).first.is_true())
+ _imp->use_expand->insert(stringify(*f));
const std::tr1::shared_ptr<const Set<UnprefixedChoiceName> > sh(_imp->options_conf.known_choice_value_names(
make_null_shared_ptr(), ChoicePrefixName("hidden_suboptions")));
- std::transform(sh->begin(), sh->end(), _imp->use_expand_hidden->inserter(),
- paludis::stringify<UnprefixedChoiceName>);
+ for (Set<UnprefixedChoiceName>::ConstIterator f(sh->begin()), f_end(sh->end()) ;
+ f != f_end ; ++f)
+ if (_imp->options_conf.want_choice_enabled_locked(make_null_shared_ptr(),
+ ChoicePrefixName("hidden_suboptions"), *f).first.is_true())
+ _imp->use_expand_hidden->insert(stringify(*f));
if (! _imp->repository->params().master_repositories())
for (ProfileFile<LineConfigFile>::ConstIterator i(_imp->packages_file.begin()),
@@ -172,6 +178,14 @@ ExheresProfile::_load_dir(const FSEntry & f)
return;
}
+ if ((f / "parents.conf").exists())
+ {
+ LineConfigFile file(f / "parents.conf", LineConfigFileOptions());
+ for (LineConfigFile::ConstIterator line(file.begin()), line_end(file.end()) ;
+ line != line_end ; ++line)
+ _load_dir((f / *line).realpath());
+ }
+
if ((f / "options.conf").exists())
_imp->options_conf.add_file(f / "options.conf");
@@ -198,14 +212,6 @@ ExheresProfile::_load_dir(const FSEntry & f)
k != k_end ; ++k)
_imp->environment_variables[k->first] = k->second;
}
-
- if ((f / "parents.conf").exists())
- {
- LineConfigFile file(f / "parents.conf", LineConfigFileOptions());
- for (LineConfigFile::ConstIterator line(file.begin()), line_end(file.end()) ;
- line != line_end ; ++line)
- _load_dir((f / *line).realpath());
- }
}
bool
@@ -218,7 +224,7 @@ ExheresProfile::use_masked(
{
std::pair<Tribool, bool> enabled_locked(_imp->options_conf.want_choice_enabled_locked(
id, choice->prefix(), value_unprefixed));
- return enabled_locked.first.is_true() && enabled_locked.second;
+ return enabled_locked.first.is_false() && enabled_locked.second;
}
bool
@@ -231,7 +237,7 @@ ExheresProfile::use_forced(
{
std::pair<Tribool, bool> enabled_locked(_imp->options_conf.want_choice_enabled_locked(
id, choice->prefix(), value_unprefixed));
- return enabled_locked.first.is_false() && enabled_locked.second;
+ return enabled_locked.first.is_true() && enabled_locked.second;
}
Tribool