aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/accounts
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-12 14:28:03 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-04-12 14:45:22 +0100
commit120c58323950219e16d8fe22693af221d2887f9b (patch)
tree2df48534abea1af807750dbbd0ce3ac9922bd44b /paludis/repositories/accounts
parent271074eb112e276d5ba25f91785431911ee3443f (diff)
downloadpaludis-120c58323950219e16d8fe22693af221d2887f9b.tar.gz
paludis-120c58323950219e16d8fe22693af221d2887f9b.tar.xz
MetadataKey value -> parse_value
Diffstat (limited to 'paludis/repositories/accounts')
-rw-r--r--paludis/repositories/accounts/accounts_dep_key.cc2
-rw-r--r--paludis/repositories/accounts/accounts_dep_key.hh2
-rw-r--r--paludis/repositories/accounts/accounts_id.cc6
-rw-r--r--paludis/repositories/accounts/accounts_repository.cc4
-rw-r--r--paludis/repositories/accounts/accounts_repository_store.cc2
-rw-r--r--paludis/repositories/accounts/passwd_accounts_handler.cc19
6 files changed, 18 insertions, 17 deletions
diff --git a/paludis/repositories/accounts/accounts_dep_key.cc b/paludis/repositories/accounts/accounts_dep_key.cc
index 633768286..0bc9bd574 100644
--- a/paludis/repositories/accounts/accounts_dep_key.cc
+++ b/paludis/repositories/accounts/accounts_dep_key.cc
@@ -113,7 +113,7 @@ AccountsDepKey::type() const
}
const std::shared_ptr<const DependencySpecTree>
-AccountsDepKey::value() const
+AccountsDepKey::parse_value() const
{
return _imp->tree;
}
diff --git a/paludis/repositories/accounts/accounts_dep_key.hh b/paludis/repositories/accounts/accounts_dep_key.hh
index d4c3decd0..49721cab2 100644
--- a/paludis/repositories/accounts/accounts_dep_key.hh
+++ b/paludis/repositories/accounts/accounts_dep_key.hh
@@ -42,7 +42,7 @@ namespace paludis
virtual const std::string human_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual MetadataKeyType type() const PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual const std::shared_ptr<const DependencySpecTree> value() const
+ virtual const std::shared_ptr<const DependencySpecTree> parse_value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const std::shared_ptr<const DependenciesLabelSequence> initial_labels() const
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index c84bf10ab..0a9b5fd6c 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -175,7 +175,7 @@ AccountsID::_need_file_keys() const
Lock lock(_imp->mutex);
- KeyValueConfigFile k(_imp->fs_location_key->value(), { },
+ KeyValueConfigFile k(_imp->fs_location_key->parse_value(), { },
&KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
/* also need to change the handlers if any of the raw names are changed */
@@ -507,7 +507,7 @@ AccountsID::perform_action(Action & action) const
n::build_start_time() = build_start_time,
n::check() = true,
n::environment_file() = FSPath("/dev/null"),
- n::image_dir() = fs_location_key()->value(),
+ n::image_dir() = fs_location_key()->parse_value(),
n::merged_entries() = std::make_shared<FSPathSet>(),
n::options() = MergerOptions() + mo_rewrite_symlinks + mo_allow_empty_dirs,
n::output_manager() = output_manager,
@@ -561,7 +561,7 @@ AccountsID::perform_action(Action & action) const
{
Context local_context("When cleaning '" + stringify(**i) + "':");
auto repo(_imp->env->fetch_repository((*i)->repository_name()));
- if (repo->format_key() && repo->format_key()->value() == "installed-accounts"
+ if (repo->format_key() && repo->format_key()->parse_value() == "installed-accounts"
&& (*i)->name() == name())
continue;
else
diff --git a/paludis/repositories/accounts/accounts_repository.cc b/paludis/repositories/accounts/accounts_repository.cc
index 55e8560a0..8ca6b7b0e 100644
--- a/paludis/repositories/accounts/accounts_repository.cc
+++ b/paludis/repositories/accounts/accounts_repository.cc
@@ -397,7 +397,7 @@ AccountsRepository::is_suitable_destination_for(const std::shared_ptr<const Pack
{
auto env(_imp->params_if_installed ? _imp->params_if_installed->environment() : _imp->params_if_not_installed->environment());
auto repo(env->fetch_repository(id->repository_name()));
- std::string f(repo->format_key() ? repo->format_key()->value() : "");
+ std::string f(repo->format_key() ? repo->format_key()->parse_value() : "");
return _imp->handler_if_installed && f == "accounts";
}
@@ -405,7 +405,7 @@ bool
AccountsRepository::is_default_destination() const
{
return _imp->handler_if_installed &&
- _imp->params_if_installed->environment()->preferred_root_key()->value() == installed_root_key()->value();
+ _imp->params_if_installed->environment()->preferred_root_key()->parse_value() == installed_root_key()->parse_value();
}
bool
diff --git a/paludis/repositories/accounts/accounts_repository_store.cc b/paludis/repositories/accounts/accounts_repository_store.cc
index 879c224c3..c9ecefa9f 100644
--- a/paludis/repositories/accounts/accounts_repository_store.cc
+++ b/paludis/repositories/accounts/accounts_repository_store.cc
@@ -121,7 +121,7 @@ AccountsRepositoryStore::_load(const RepositoryName & repository_name)
continue;
}
- FSPath dir(k->value());
+ FSPath dir(k->parse_value());
if (! dir.stat().is_directory_or_symlink_to_directory())
{
Log::get_instance()->message("accounts.empty_key_from_repository", ll_warning, lc_context) <<
diff --git a/paludis/repositories/accounts/passwd_accounts_handler.cc b/paludis/repositories/accounts/passwd_accounts_handler.cc
index bac2cb24b..15195adc7 100644
--- a/paludis/repositories/accounts/passwd_accounts_handler.cc
+++ b/paludis/repositories/accounts/passwd_accounts_handler.cc
@@ -66,7 +66,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'username' for '" + stringify(*params.package_id()) + "' is not a string key");
- username = k->value();
+ username = k->parse_value();
if (0 != getpwnam(username.c_str()))
throw ActionFailedError("User '" + username + "' already exists");
@@ -83,7 +83,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'gecos' for '" + stringify(*params.package_id()) + "' is not a string key");
- gecos = k->value();
+ gecos = k->parse_value();
if (std::string::npos != gecos.find('\''))
throw ActionFailedError("Value for key 'gecos' for '" + stringify(*params.package_id()) + "' must not contain a quote");
@@ -103,7 +103,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'preferred_uid' for '" + stringify(*params.package_id()) + "' is not a string key");
- preferred_uid = k->value();
+ preferred_uid = k->parse_value();
if (std::string::npos != preferred_uid.find_first_not_of("0123456789"))
throw ActionFailedError("Value for key 'preferred_uid' for '" + stringify(*params.package_id()) + "' must be a number");
@@ -130,7 +130,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'primary_group' for '" + stringify(*params.package_id()) + "' is not a string key");
- primary_group = k->value();
+ primary_group = k->parse_value();
if (std::string::npos != primary_group.find('\''))
throw ActionFailedError("Value for key 'primary_group' for '" + stringify(*params.package_id()) + "' must not contain a quote");
@@ -150,7 +150,8 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'extra_groups' for '" + stringify(*params.package_id()) + "' is not a string set key");
- extra_groups = join(k->value()->begin(), k->value()->end(), ",");
+ auto v(k->parse_value());
+ extra_groups = join(v->begin(), v->end(), ",");
if (std::string::npos != extra_groups.find('\''))
throw ActionFailedError("Value for key 'extra_groups' for '" + stringify(*params.package_id()) + "' must not contain a quote");
@@ -170,7 +171,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'shell' for '" + stringify(*params.package_id()) + "' is not a string key");
- shell = k->value();
+ shell = k->parse_value();
if (std::string::npos != shell.find('\''))
throw ActionFailedError("Value for key 'shell' for '" + stringify(*params.package_id()) + "' must not contain a quote");
@@ -190,7 +191,7 @@ PasswdAccountsHandler::merge_user(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'home' for '" + stringify(*params.package_id()) + "' is not a string key");
- home = k->value();
+ home = k->parse_value();
if (std::string::npos != home.find('\''))
throw ActionFailedError("Value for key 'home' for '" + stringify(*params.package_id()) + "' must not contain a quote");
@@ -222,7 +223,7 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'groupname' for '" + stringify(*params.package_id()) + "' is not a string key");
- groupname = k->value();
+ groupname = k->parse_value();
if (0 != getgrnam(groupname.c_str()))
throw ActionFailedError("Group '" + groupname + "' already exists");
@@ -239,7 +240,7 @@ PasswdAccountsHandler::merge_group(const MergeParams & params)
if (! k)
throw ActionFailedError("Key 'preferred_gid' for '" + stringify(*params.package_id()) + "' is not a string key");
- preferred_gid = k->value();
+ preferred_gid = k->parse_value();
if (std::string::npos != preferred_gid.find_first_not_of("0123456789"))
throw ActionFailedError("Value for key 'preferred_gid' for '" + stringify(*params.package_id()) + "' must be a number");