aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 18:29:17 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-23 18:29:17 +0100
commitc3802f0aec7d89a518cf74145aa73bf2ea688e35 (patch)
tree9b6aab4b3d06e2e54afa10b2448af4f7819c6acd
parent8ea8866114c450dec08322c57f8002b29eee19d3 (diff)
downloadpaludis-c3802f0aec7d89a518cf74145aa73bf2ea688e35.tar.gz
paludis-c3802f0aec7d89a518cf74145aa73bf2ea688e35.tar.xz
Avoid sptr.reset(new ...)
-rw-r--r--paludis/args/args_handler.cc2
-rw-r--r--paludis/args/dep_list_args_group.cc6
-rw-r--r--paludis/dep_list_TEST.cc4
-rw-r--r--paludis/dep_spec.cc20
-rw-r--r--paludis/environment_implementation.cc4
-rw-r--r--paludis/environments/paludis/bashable_conf.cc19
-rw-r--r--paludis/environments/paludis/keywords_conf.cc2
-rw-r--r--paludis/environments/paludis/licenses_conf.cc2
-rw-r--r--paludis/environments/paludis/package_mask_conf.cc2
-rw-r--r--paludis/environments/paludis/paludis_config.cc64
-rw-r--r--paludis/environments/paludis/paludis_environment.cc2
-rw-r--r--paludis/environments/portage/portage_environment.cc18
-rw-r--r--paludis/hooker.cc4
-rw-r--r--paludis/install_task.cc26
-rw-r--r--paludis/ipc_output_manager.cc12
-rw-r--r--paludis/merger_TEST.cc2
-rw-r--r--paludis/ndbam.cc10
-rw-r--r--paludis/ndbam_merger.cc2
-rw-r--r--paludis/output_manager_from_environment.cc2
-rw-r--r--paludis/paludislike_options_conf.cc2
-rw-r--r--paludis/range_rewriter.cc2
-rw-r--r--paludis/report_task.cc2
-rw-r--r--paludis/repositories/accounts/accounts_id.cc38
-rw-r--r--paludis/repositories/accounts/accounts_repository_store.cc4
-rw-r--r--paludis/repositories/accounts/installed_accounts_id.cc2
-rw-r--r--paludis/repositories/cran/cran_package_id.cc28
-rw-r--r--paludis/repositories/cran/package_dep_spec.cc6
-rw-r--r--paludis/repositories/e/e_choices_key.cc2
-rw-r--r--paludis/repositories/e/e_installed_repository_id.cc178
-rw-r--r--paludis/repositories/e/e_key.cc8
-rw-r--r--paludis/repositories/e/e_repository.cc26
-rw-r--r--paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc2
-rw-r--r--paludis/repositories/e/e_repository_mask_file.cc2
-rw-r--r--paludis/repositories/e/ebuild.cc4
-rw-r--r--paludis/repositories/e/ebuild_id.cc78
-rw-r--r--paludis/repositories/e/exheres_layout.cc2
-rw-r--r--paludis/repositories/e/exndbam_id.cc2
-rw-r--r--paludis/repositories/e/exndbam_repository.cc4
-rw-r--r--paludis/repositories/e/exndbam_repository_TEST.cc2
-rw-r--r--paludis/repositories/e/fix_locked_dependencies.cc2
-rw-r--r--paludis/repositories/e/info_metadata_key.cc8
-rw-r--r--paludis/repositories/e/traditional_layout.cc2
-rw-r--r--paludis/repositories/e/vdb_merger.cc2
-rw-r--r--paludis/repositories/e/vdb_repository.cc6
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc18
-rw-r--r--paludis/repositories/e/vdb_unmerger_TEST.cc4
-rw-r--r--paludis/repositories/fake/fake_package_id.cc46
-rw-r--r--paludis/repositories/gems/gem_specification.cc16
-rw-r--r--paludis/repositories/unavailable/unavailable_repository_store.cc20
-rw-r--r--paludis/repositories/unpackaged/installed_id.cc26
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc4
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.cc2
-rw-r--r--paludis/repositories/unwritten/unwritten_repository_file.cc18
-rw-r--r--paludis/resolver/decider.cc8
-rw-r--r--paludis/resolver/decision.cc6
-rw-r--r--paludis/resolver/package_or_block_dep_spec.cc2
-rw-r--r--paludis/resolver/resolver_test.cc6
-rw-r--r--paludis/set_file.cc12
-rw-r--r--paludis/util/fs_entry.cc4
-rw-r--r--paludis/util/system.cc14
-rw-r--r--paludis/util/wrapped_value-impl.hh2
-rw-r--r--ruby/dep_spec.cc22
-rw-r--r--src/clients/accerso/accerso.cc2
-rw-r--r--src/clients/adjutrix/find_reverse_deps.cc4
-rw-r--r--src/clients/adjutrix/what_needs_keywording.cc2
-rw-r--r--src/clients/cave/cmd_fix_linkage.cc2
-rw-r--r--src/clients/cave/cmd_perform.cc8
-rw-r--r--src/clients/cave/cmd_sync.cc2
-rw-r--r--src/clients/cave/man_cave.cc6
-rw-r--r--src/clients/cave/resolve_common.cc16
-rw-r--r--src/clients/instruo/instruo.cc2
-rw-r--r--src/output/console_install_task.cc8
72 files changed, 447 insertions, 452 deletions
diff --git a/paludis/args/args_handler.cc b/paludis/args/args_handler.cc
index 7e0b15b..82b993a 100644
--- a/paludis/args/args_handler.cc
+++ b/paludis/args/args_handler.cc
@@ -443,7 +443,7 @@ ArgsSection *
ArgsHandler::main_options_section()
{
if (! _imp->main_options_section)
- _imp->main_options_section.reset(new ArgsSection(this, "Options"));
+ _imp->main_options_section = std::make_shared<ArgsSection>(this, "Options");
return _imp->main_options_section.get();
}
diff --git a/paludis/args/dep_list_args_group.cc b/paludis/args/dep_list_args_group.cc
index 90a21e2..1bc0a2a 100644
--- a/paludis/args/dep_list_args_group.cc
+++ b/paludis/args/dep_list_args_group.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
* Copyright (c) 2007 David Leverton
*
* This file is part of the Paludis package manager. Paludis is free software;
@@ -231,7 +231,7 @@ DepListArgsGroup::populate_dep_list_options(const Environment * env, DepListOpti
throw args::DoHelp("bad value for --dl-blocks");
if (! options.override_masks())
- options.override_masks().reset(new DepListOverrideMasksFunctions);
+ options.override_masks() = std::make_shared<DepListOverrideMasksFunctions>();
options.override_masks()->push_back(std::bind(&override_tilde_keywords, env, _1, _2));
options.override_masks()->push_back(std::bind(&override_license, _2));
@@ -240,7 +240,7 @@ DepListArgsGroup::populate_dep_list_options(const Environment * env, DepListOpti
for (args::StringSetArg::ConstIterator a(dl_override_masks.begin_args()),
a_end(dl_override_masks.end_args()) ; a != a_end ; ++a)
if (*a == "none")
- options.override_masks().reset(new DepListOverrideMasksFunctions);
+ options.override_masks() = std::make_shared<DepListOverrideMasksFunctions>();
for (args::StringSetArg::ConstIterator a(dl_override_masks.begin_args()),
a_end(dl_override_masks.end_args()) ; a != a_end ; ++a)
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index b18e8a8..14df29f 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -1350,7 +1350,7 @@ namespace test_cases
void set_options(DepListOptions & opts)
{
using namespace std::placeholders;
- opts.override_masks().reset(new DepListOverrideMasksFunctions);
+ opts.override_masks() = std::make_shared<DepListOverrideMasksFunctions>();
opts.override_masks()->push_back(std::bind(&override_tilde_keywords, &env, _1, _2));
}
@@ -1422,7 +1422,7 @@ namespace test_cases
void set_options(DepListOptions & opts)
{
using namespace std::placeholders;
- opts.override_masks().reset(new DepListOverrideMasksFunctions);
+ opts.override_masks() = std::make_shared<DepListOverrideMasksFunctions>();
opts.override_masks()->push_back(std::bind(&override_tilde_keywords, &env, _1, _2));
}
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index daa2362..e247a31 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -1109,7 +1109,7 @@ PartiallyMadePackageDepSpec::~PartiallyMadePackageDepSpec()
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::package(const QualifiedPackageName & name)
{
- _imp->data->package.reset(new QualifiedPackageName(name));
+ _imp->data->package = std::make_shared<QualifiedPackageName>(name);
return *this;
}
@@ -1123,49 +1123,49 @@ PartiallyMadePackageDepSpec::slot_requirement(const std::shared_ptr<const SlotRe
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::in_repository(const RepositoryName & s)
{
- _imp->data->in_repository.reset(new RepositoryName(s));
+ _imp->data->in_repository = std::make_shared<RepositoryName>(s);
return *this;
}
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::from_repository(const RepositoryName & s)
{
- _imp->data->from_repository.reset(new RepositoryName(s));
+ _imp->data->from_repository = std::make_shared<RepositoryName>(s);
return *this;
}
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::installable_to_repository(const InstallableToRepository & s)
{
- _imp->data->installable_to_repository.reset(new InstallableToRepository(s));
+ _imp->data->installable_to_repository = std::make_shared<InstallableToRepository>(s);
return *this;
}
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::installed_at_path(const FSEntry & s)
{
- _imp->data->installed_at_path.reset(new FSEntry(s));
+ _imp->data->installed_at_path = std::make_shared<FSEntry>(s);
return *this;
}
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::installable_to_path(const InstallableToPath & s)
{
- _imp->data->installable_to_path.reset(new InstallableToPath(s));
+ _imp->data->installable_to_path = std::make_shared<InstallableToPath>(s);
return *this;
}
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::package_name_part(const PackageNamePart & part)
{
- _imp->data->package_name_part.reset(new PackageNamePart(part));
+ _imp->data->package_name_part = std::make_shared<PackageNamePart>(part);
return *this;
}
PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::category_name_part(const CategoryNamePart & part)
{
- _imp->data->category_name_part.reset(new CategoryNamePart(part));
+ _imp->data->category_name_part = std::make_shared<CategoryNamePart>(part);
return *this;
}
@@ -1173,7 +1173,7 @@ PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::version_requirement(const VersionRequirement & req)
{
if (! _imp->data->version_requirements)
- _imp->data->version_requirements.reset(new VersionRequirements);
+ _imp->data->version_requirements = std::make_shared<VersionRequirements>();
_imp->data->version_requirements->push_back(req);
return *this;
}
@@ -1189,7 +1189,7 @@ PartiallyMadePackageDepSpec &
PartiallyMadePackageDepSpec::additional_requirement(const std::shared_ptr<const AdditionalPackageDepSpecRequirement> & req)
{
if (! _imp->data->additional_requirements)
- _imp->data->additional_requirements.reset(new AdditionalPackageDepSpecRequirements);
+ _imp->data->additional_requirements = std::make_shared<AdditionalPackageDepSpecRequirements>();
_imp->data->additional_requirements->push_back(req);
return *this;
}
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index 29f2fb4..548806b 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -91,7 +91,7 @@ namespace
typename F_::result_type operator() ()
{
if (! result)
- result.reset(new typename std::remove_reference<typename F_::result_type>::type(func()));
+ result = std::make_shared<typename std::remove_reference<typename F_::result_type>::type>(func());
return *result;
}
};
@@ -306,7 +306,7 @@ EnvironmentImplementation::_need_sets() const
populate_sets();
populate_standard_sets();
- _imp->set_names.reset(new SetNameSet);
+ _imp->set_names = std::make_shared<SetNameSet>();
std::copy(first_iterator(_imp->sets.begin()), first_iterator(_imp->sets.end()), _imp->set_names->inserter());
_imp->loaded_sets = true;
diff --git a/paludis/environments/paludis/bashable_conf.cc b/paludis/environments/paludis/bashable_conf.cc
index b7095f9..f3a87a4 100644
--- a/paludis/environments/paludis/bashable_conf.cc
+++ b/paludis/environments/paludis/bashable_conf.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 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
@@ -58,7 +58,7 @@ paludis::paludis_environment::make_bashable_conf(const FSEntry & f, const LineCo
.with_stderr_prefix(f.basename() + "> ")
.with_captured_stdout_stream(&s));
int exit_status(run_command(cmd));
- result.reset(new LineConfigFile(s, o));
+ result = std::make_shared<LineConfigFile>(s, o);
if (exit_status != 0)
{
@@ -68,7 +68,7 @@ paludis::paludis_environment::make_bashable_conf(const FSEntry & f, const LineCo
}
}
else
- result.reset(new LineConfigFile(f, o));
+ result = std::make_shared<LineConfigFile>(f, o);
return result;
}
@@ -94,8 +94,7 @@ paludis::paludis_environment::make_bashable_kv_conf(const FSEntry & f,
end(predefined_variables->end()); i != end; ++i)
cmd.with_setenv(i->first, i->second);
int exit_status(run_command(cmd));
- result.reset(new KeyValueConfigFile(s, o, &KeyValueConfigFile::no_defaults,
- &KeyValueConfigFile::no_transformation));
+ result = std::make_shared<KeyValueConfigFile>(s, o, &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
if (exit_status != 0)
{
@@ -106,13 +105,9 @@ paludis::paludis_environment::make_bashable_kv_conf(const FSEntry & f,
}
else
{
- result.reset(new KeyValueConfigFile(f, o,
- std::bind(
- &defined_vars_to_kv_func,
- predefined_variables,
- std::placeholders::_1,
- std::placeholders::_2),
- &KeyValueConfigFile::no_transformation));
+ result = std::make_shared<KeyValueConfigFile>(f, o,
+ std::bind(&defined_vars_to_kv_func, predefined_variables, std::placeholders::_1, std::placeholders::_2),
+ &KeyValueConfigFile::no_transformation);
}
return result;
diff --git a/paludis/environments/paludis/keywords_conf.cc b/paludis/environments/paludis/keywords_conf.cc
index ac750f8..3f75a1b 100644
--- a/paludis/environments/paludis/keywords_conf.cc
+++ b/paludis/environments/paludis/keywords_conf.cc
@@ -186,7 +186,7 @@ KeywordsConf::query(const std::shared_ptr<const KeywordNameSet> & k, const Packa
{
Log::get_instance()->message("paludis_environment.keywords_conf.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< i->first << "' does not exist";
- i->second.first.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ i->second.first = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
}
diff --git a/paludis/environments/paludis/licenses_conf.cc b/paludis/environments/paludis/licenses_conf.cc
index 5230cbe..05866f9 100644
--- a/paludis/environments/paludis/licenses_conf.cc
+++ b/paludis/environments/paludis/licenses_conf.cc
@@ -178,7 +178,7 @@ LicensesConf::query(const std::string & t, const PackageID & e) const
{
Log::get_instance()->message("paludis_environment.licenses_conf.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< i->first << "' does not exist";
- i->second.first.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ i->second.first = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
}
diff --git a/paludis/environments/paludis/package_mask_conf.cc b/paludis/environments/paludis/package_mask_conf.cc
index a36ceb3..f25ef0d 100644
--- a/paludis/environments/paludis/package_mask_conf.cc
+++ b/paludis/environments/paludis/package_mask_conf.cc
@@ -120,7 +120,7 @@ PackageMaskConf::query(const PackageID & e) const
{
Log::get_instance()->message("paludis_environment.package_mask.unknown_set", ll_warning, lc_no_context) << "Set name '"
<< it->first << "' does not exist";
- it->second.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ it->second = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
}
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 3f8f63b..0a4be66 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -247,11 +247,11 @@ namespace paludis
if ((FSEntry(config_dir) / "general.conf").exists())
{
- kv.reset(new KeyValueConfigFile(
- FSEntry(config_dir) / "general.conf",
- KeyValueConfigFileOptions(),
- def_predefined,
- &KeyValueConfigFile::no_transformation));
+ kv = std::make_shared<KeyValueConfigFile>(
+ FSEntry(config_dir) / "general.conf",
+ KeyValueConfigFileOptions(),
+ def_predefined,
+ &KeyValueConfigFile::no_transformation);
}
else if ((FSEntry(config_dir) / "general.bash").exists())
{
@@ -262,11 +262,11 @@ namespace paludis
.with_stderr_prefix("general.bash> ")
.with_captured_stdout_stream(&s));
int exit_status(run_command(cmd));
- kv.reset(new KeyValueConfigFile(
+ kv = std::make_shared<KeyValueConfigFile>(
s,
KeyValueConfigFileOptions(),
def_predefined,
- &KeyValueConfigFile::no_transformation));
+ &KeyValueConfigFile::no_transformation);
if (exit_status != 0)
{
@@ -282,11 +282,11 @@ namespace paludis
<< "The file '" << (FSEntry(config_dir) / "environment.conf") << "' should be renamed to '"
<< (FSEntry(config_dir) / "general.conf") << "'.";
- kv.reset(new KeyValueConfigFile(
+ kv = std::make_shared<KeyValueConfigFile>(
FSEntry(config_dir) / "environment.conf",
KeyValueConfigFileOptions(),
def_predefined,
- &KeyValueConfigFile::no_transformation));
+ &KeyValueConfigFile::no_transformation);
}
else if ((FSEntry(config_dir) / "general.bash").exists())
{
@@ -301,11 +301,11 @@ namespace paludis
.with_stderr_prefix("general.bash> ")
.with_captured_stdout_stream(&s));
int exit_status(run_command(cmd));
- kv.reset(new KeyValueConfigFile(
+ kv = std::make_shared<KeyValueConfigFile>(
s,
KeyValueConfigFileOptions(),
def_predefined,
- &KeyValueConfigFile::no_transformation));
+ &KeyValueConfigFile::no_transformation);
if (exit_status != 0)
{
@@ -320,11 +320,11 @@ namespace paludis
Log::get_instance()->message("paludis_environment.no_general_conf", ll_debug, lc_context)
<< "No general.conf or general.bash in '" << config_dir << "'";
std::stringstream str;
- kv.reset(new KeyValueConfigFile(
+ kv = std::make_shared<KeyValueConfigFile>(
str,
KeyValueConfigFileOptions(),
def_predefined,
- &KeyValueConfigFile::no_transformation));
+ &KeyValueConfigFile::no_transformation);
}
if (! kv->get("PALUDIS_NO_WRITE_CACHE_CLEAN").empty())
@@ -353,14 +353,14 @@ namespace paludis
distribution = kv->get("distribution");
if (! kv->get("world").empty())
- world_file.reset(new FSEntry(kv->get("world")));
+ world_file = std::make_shared<FSEntry>(kv->get("world"));
if (! world_file)
Log::get_instance()->message("paludis_environment.world.no_world", ll_warning, lc_context)
<< "No world file specified. You should specify 'world = /path/to/world/file' in "
<< (FSEntry(config_dir) / "general.conf")
<< ". Any attempted updates to world will not be saved.";
- world.reset(new World(env, world_file));
+ world = std::make_shared<World>(env, world_file);
has_general_conf = true;
}
@@ -440,20 +440,20 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
if ((local_config_dir / "specpath.conf").exists())
{
- specpath.reset(new KeyValueConfigFile(
+ specpath = std::make_shared<KeyValueConfigFile>(
local_config_dir / "specpath.conf",
KeyValueConfigFileOptions(),
def_predefined,
- &KeyValueConfigFile::no_transformation));
+ &KeyValueConfigFile::no_transformation);
}
else if (_imp->commandline_environment->end() != _imp->commandline_environment->find("root"))
{
std::istringstream strm;
- specpath.reset(new KeyValueConfigFile(
+ specpath = std::make_shared<KeyValueConfigFile>(
strm,
KeyValueConfigFileOptions(),
def_predefined,
- &KeyValueConfigFile::no_transformation));
+ &KeyValueConfigFile::no_transformation);
}
if (specpath)
@@ -491,8 +491,8 @@ PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & s
<< "Cannot access configuration directory '" << local_config_dir
<< "' using userpriv, so userpriv will be disabled. Generally Paludis "
"configuration directories and files should be world readable.";
- _imp->reduced_uid.reset(new uid_t(getuid()));
- _imp->reduced_gid.reset(new gid_t(getgid()));
+ _imp->reduced_uid = std::make_shared<uid_t>(getuid());
+ _imp->reduced_gid = std::make_shared<gid_t>(getgid());
}
if (dist->mandatory_userpriv() && ((0 == *_imp->reduced_uid || 0 == *_imp->reduced_gid)))
@@ -859,9 +859,9 @@ PaludisConfig::repo_func_from_file(const FSEntry & repo_file)
.with_stderr_prefix(repo_file.basename() + "> ")
.with_captured_stdout_stream(&s));
int exit_status(run_command(cmd));
- kv.reset(new KeyValueConfigFile(s, KeyValueConfigFileOptions(),
+ kv = std::make_shared<KeyValueConfigFile>(s, KeyValueConfigFileOptions(),
std::bind(&to_kv_func, _imp->predefined_conf_vars_func, std::placeholders::_1, std::placeholders::_2),
- &KeyValueConfigFile::no_transformation));
+ &KeyValueConfigFile::no_transformation);
if (exit_status != 0)
{
@@ -871,9 +871,9 @@ PaludisConfig::repo_func_from_file(const FSEntry & repo_file)
}
}
else
- kv.reset(new KeyValueConfigFile(repo_file, KeyValueConfigFileOptions(),
- std::bind(&to_kv_func, _imp->predefined_conf_vars_func, std::placeholders::_1, std::placeholders::_2),
- &KeyValueConfigFile::no_transformation));
+ kv = std::make_shared<KeyValueConfigFile>(repo_file, KeyValueConfigFileOptions(),
+ std::bind(&to_kv_func, _imp->predefined_conf_vars_func, std::placeholders::_1, std::placeholders::_2),
+ &KeyValueConfigFile::no_transformation);
std::function<std::string (const std::string &)> repo_func(
std::bind(&from_kv, kv, std::placeholders::_1));
@@ -925,7 +925,7 @@ PaludisConfig::reduced_uid() const
Context context("When determining reduced UID:");
if (0 != getuid())
- _imp->reduced_uid.reset(new uid_t(getuid()));
+ _imp->reduced_uid = std::make_shared<uid_t>(getuid());
else
{
struct passwd * p(getpwnam(reduced_username().c_str()));
@@ -933,10 +933,10 @@ PaludisConfig::reduced_uid() const
{
Log::get_instance()->message("paludis_environment.reduced_uid.unknown", ll_warning, lc_no_context)
<< "Couldn't determine uid for user '" << reduced_username() << "'";
- _imp->reduced_uid.reset(new uid_t(getuid()));
+ _imp->reduced_uid = std::make_shared<uid_t>(getuid());
}
else
- _imp->reduced_uid.reset(new uid_t(p->pw_uid));
+ _imp->reduced_uid = std::make_shared<uid_t>(p->pw_uid);
}
Log::get_instance()->message("paludis_environment.reduced_uid.value", ll_debug, lc_context)
@@ -954,7 +954,7 @@ PaludisConfig::reduced_gid() const
if (! _imp->reduced_gid)
{
if (0 != getuid())
- _imp->reduced_gid.reset(new gid_t(getgid()));
+ _imp->reduced_gid = std::make_shared<gid_t>(getgid());
else
{
struct passwd * p(getpwnam(reduced_username().c_str()));
@@ -962,10 +962,10 @@ PaludisConfig::reduced_gid() const
{
Log::get_instance()->message("paludis_environment.reduced_gid.unknown", ll_warning, lc_no_context)
<< "Couldn't determine gid for user '" << reduced_username() << "'";
- _imp->reduced_gid.reset(new gid_t(getgid()));
+ _imp->reduced_gid = std::make_shared<gid_t>(getgid());
}
else
- _imp->reduced_gid.reset(new gid_t(p->pw_gid));
+ _imp->reduced_gid = std::make_shared<gid_t>(p->pw_gid);
}
}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index db2d293..184ab91 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -214,7 +214,7 @@ PaludisEnvironment::perform_hook(const Hook & hook) const
if (! _imp->hooker)
{
_imp->need_hook_dirs(_imp->config->config_dir());
- _imp->hooker.reset(new Hooker(this));
+ _imp->hooker = std::make_shared<Hooker>(this);
for (std::list<std::pair<FSEntry, bool> >::const_iterator h(_imp->hook_dirs.begin()),
h_end(_imp->hook_dirs.end()) ; h != h_end ; ++h)
_imp->hooker->add_dir(h->first, h->second);
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index da96abb..3e3f4dc 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -234,20 +234,20 @@ PortageEnvironment::PortageEnvironment(const std::string & s) :
"functionality. Full support for Portage configuration formats is not "
"guaranteed; issues should be reported via trac.";
- _imp->vars.reset(new KeyValueConfigFile(FSEntry("/dev/null"), KeyValueConfigFileOptions(),
- &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation));
+ _imp->vars = std::make_shared<KeyValueConfigFile>(FSEntry("/dev/null"), KeyValueConfigFileOptions(),
+ &KeyValueConfigFile::no_defaults, &KeyValueConfigFile::no_transformation);
_load_profile((_imp->conf_dir / "make.profile").realpath());
if ((_imp->conf_dir / "make.globals").exists())
- _imp->vars.reset(new KeyValueConfigFile(_imp->conf_dir / "make.globals", KeyValueConfigFileOptions() +
+ _imp->vars = std::make_shared<KeyValueConfigFile>(_imp->conf_dir / "make.globals", KeyValueConfigFileOptions() +
kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
- &do_incremental));
+ &do_incremental);
if ((_imp->conf_dir / "make.conf").exists())
- _imp->vars.reset(new KeyValueConfigFile(_imp->conf_dir / "make.conf", KeyValueConfigFileOptions() +
+ _imp->vars = std::make_shared<KeyValueConfigFile>(_imp->conf_dir / "make.conf", KeyValueConfigFileOptions() +
kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
- &do_incremental));
+ &do_incremental);
/* TODO: load USE etc from env? */
@@ -440,10 +440,10 @@ PortageEnvironment::_load_profile(const FSEntry & d)
}
if ((d / "make.defaults").exists())
- _imp->vars.reset(new KeyValueConfigFile(d / "make.defaults", KeyValueConfigFileOptions()
+ _imp->vars = std::make_shared<KeyValueConfigFile>(d / "make.defaults", KeyValueConfigFileOptions()
+ kvcfo_disallow_source + kvcfo_disallow_space_inside_unquoted_values + kvcfo_allow_inline_comments + kvcfo_allow_multiple_assigns_per_line,
std::bind(&predefined, _imp->vars, std::placeholders::_1, std::placeholders::_2),
- &do_incremental));
+ &do_incremental);
}
@@ -711,7 +711,7 @@ PortageEnvironment::perform_hook(const Hook & hook) const
if (! _imp->hooker)
{
_imp->need_hook_dirs();
- _imp->hooker.reset(new Hooker(this));
+ _imp->hooker = std::make_shared<Hooker>(this);
std::for_each(_imp->hook_dirs.begin(), _imp->hook_dirs.end(),
std::bind(std::mem_fn(&Hooker::add_dir), _imp->hooker.get(), _1, false));
}
diff --git a/paludis/hooker.cc b/paludis/hooker.cc
index dd51ddf..f753551 100644
--- a/paludis/hooker.cc
+++ b/paludis/hooker.cc
@@ -476,12 +476,12 @@ namespace paludis
if (is_file_with_extension(*e, ".hook", IsFileWithOptions()))
{
- hook_file.reset(new FancyHookFile(*e, d->second, env));
+ hook_file = std::make_shared<FancyHookFile>(*e, d->second, env);
name = strip_trailing_string(e->basename(), ".hook");
}
else if (is_file_with_extension(*e, so_suffix, IsFileWithOptions()))
{
- hook_file.reset(new SoHookFile(*e, d->second, env));
+ hook_file = std::make_shared<SoHookFile>(*e, d->second, env);
name = strip_trailing_string(e->basename(), so_suffix);
}
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index ad2eb46..f4af427 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -193,7 +193,7 @@ InstallTask::~InstallTask()
void
InstallTask::clear()
{
- _imp->targets.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ _imp->targets = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
_imp->had_set_targets = false;
_imp->had_package_targets = false;
_imp->dep_list.clear();
@@ -753,7 +753,7 @@ InstallTask::_pretend()
{
pretend_failed = true;
success = false;
- dep->handled().reset(new DepListEntryHandledFailed);
+ dep->handled() = std::make_shared<DepListEntryHandledFailed>();
}
}
@@ -887,21 +887,21 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
SupportsActionTest<FetchAction> test_fetch;
if (dep->package_id()->supports_action(test_fetch))
{
- output_manager_holder.reset(new OutputManagerFromEnvironment(_imp->env, dep->package_id(), oe_exclusive,
- ClientOutputFeatures()));
+ output_manager_holder = std::make_shared<OutputManagerFromEnvironment>(_imp->env, dep->package_id(), oe_exclusive,
+ ClientOutputFeatures());
FetchActionOptions fetch_options(make_fetch_action_options(*dep, *output_manager_holder));
FetchAction fetch_action(fetch_options);
dep->package_id()->perform_action(fetch_action);
if (output_manager_holder->output_manager_if_constructed())
output_manager_holder->output_manager_if_constructed()->succeeded();
output_manager_holder.reset();
- dep->handled().reset(new DepListEntryHandledFetchSuccess);
+ dep->handled() = std::make_shared<DepListEntryHandledFetchSuccess>();
}
if (! _imp->fetch_only)
{
- output_manager_holder.reset(new OutputManagerFromEnvironment(_imp->env, dep->package_id(),
- oe_exclusive, ClientOutputFeatures()));
+ output_manager_holder = std::make_shared<OutputManagerFromEnvironment>(_imp->env, dep->package_id(),
+ oe_exclusive, ClientOutputFeatures());
std::shared_ptr<PackageIDSequence> replacing;
@@ -913,7 +913,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
filter::SupportsAction<UninstallAction>() |
filter::SameSlot(dep->package_id()))];
else
- replacing.reset(new PackageIDSequence);
+ replacing = std::make_shared<PackageIDSequence>();
InstallActionOptions install_options(make_named_values<InstallActionOptions>(
n::destination() = dep->destination(),
@@ -987,7 +987,7 @@ InstallTask::_one(const DepList::Iterator dep, const int x, const int y, const i
r_end(_imp->env->package_database()->end_repositories()) ; r != r_end ; ++r)
(*r)->invalidate();
- dep->handled().reset(new DepListEntryHandledSuccess);
+ dep->handled() = std::make_shared<DepListEntryHandledSuccess>();
/* if we installed paludis and a re-exec is available, use it. */
if (_imp->env->is_paludis_package(dep->package_id()->name()))
@@ -1069,7 +1069,7 @@ InstallTask::_main_actions_all(const int y, const DepList::Iterator dep_last_pac
std::shared_ptr<const PackageDepSpec> d(_unsatisfied(*dep));
if (! d)
break;
- dep->handled().reset(new DepListEntryHandledSkippedUnsatisfied(*d));
+ dep->handled() = std::make_shared<DepListEntryHandledSkippedUnsatisfied>(*d);
on_skip_unsatisfied(*dep, *d, x, y, s, f);
++s;
continue;
@@ -1080,7 +1080,7 @@ InstallTask::_main_actions_all(const int y, const DepList::Iterator dep_last_pac
std::shared_ptr<const PackageID> d(_dependent(*dep));
if (! d)
break;
- dep->handled().reset(new DepListEntryHandledSkippedDependent(d));
+ dep->handled() = std::make_shared<DepListEntryHandledSkippedDependent>(d);
on_skip_dependent(*dep, d, x, y, s, f);
++s;
continue;
@@ -1101,7 +1101,7 @@ InstallTask::_main_actions_all(const int y, const DepList::Iterator dep_last_pac
}
catch (const ActionFailedError & e)
{
- dep->handled().reset(new DepListEntryHandledFailed);
+ dep->handled() = std::make_shared<DepListEntryHandledFailed>();
if (output_manager_holder && output_manager_holder->output_manager_if_constructed())
on_non_fetch_action_error(output_manager_holder->output_manager_if_constructed(), e);
else
@@ -1341,7 +1341,7 @@ InstallTask::set_preserve_world(const bool value)
void
InstallTask::set_add_to_world_spec(const std::string & value)
{
- _imp->add_to_world_spec.reset(new std::string(value));
+ _imp->add_to_world_spec = std::make_shared<std::string>(value);
}
InstallTask::TargetsConstIterator
diff --git a/paludis/ipc_output_manager.cc b/paludis/ipc_output_manager.cc
index a255fa4..494d7a4 100644
--- a/paludis/ipc_output_manager.cc
+++ b/paludis/ipc_output_manager.cc
@@ -66,7 +66,7 @@ namespace paludis
{
*pipe_command_write_stream << "PING 1 GOAT" << '\0' << std::flush;
- pipe_command_read_stream.reset(new SafeIFStream(r));
+ pipe_command_read_stream = std::make_shared<SafeIFStream>(r);
std::string response;
if (! std::getline(*pipe_command_read_stream, response, '\0'))
throw InternalError(PALUDIS_HERE, "couldn't get a pipe command response");
@@ -95,8 +95,8 @@ IPCOutputManager::IPCOutputManager(const int r, const int w, const CreateOutputM
throw InternalError(PALUDIS_HERE, "got response '" + response + "'");
int stdout_fd(destringify<int>(tokens[2])), stderr_fd(destringify<int>(tokens[3]));
- _imp->stdout_stream.reset(new SafeOFStream(stdout_fd));
- _imp->stderr_stream.reset(new SafeOFStream(stderr_fd));
+ _imp->stdout_stream = std::make_shared<SafeOFStream>(stdout_fd);
+ _imp->stderr_stream = std::make_shared<SafeOFStream>(stderr_fd);
if (0 != ::fcntl(stdout_fd, F_SETFD, FD_CLOEXEC))
throw InternalError(PALUDIS_HERE, "fcntl failed");
@@ -260,7 +260,7 @@ IPCInputManager::_pipe_command_handler(const std::string & s)
_imp->on_create(_imp->output_manager);
}
- _imp->copy_thread.reset(new Thread(std::bind(&IPCInputManager::_copy_thread, this)));
+ _imp->copy_thread = std::make_shared<Thread>(std::bind(&IPCInputManager::_copy_thread, this));
return "O 1 " + stringify(_imp->stdout_pipe.write_fd()) + " " + stringify(_imp->stderr_pipe.write_fd());
}
@@ -421,7 +421,7 @@ OutputManagerFromIPC::operator() (const Action & a)
if (! _imp->result)
{
CreateOutputManagerForPackageIDActionInfo info(_imp->id, a, _imp->exclusivity, _imp->client_output_features);
- _imp->result.reset(new IPCOutputManager(_imp->read_fd, _imp->write_fd, info));
+ _imp->result = std::make_shared<IPCOutputManager>(_imp->read_fd, _imp->write_fd, info);
}
return _imp->result;
}
@@ -439,7 +439,7 @@ OutputManagerFromIPC::construct_standard_if_unconstructed()
{
Log::get_instance()->message("output_manager_from_ipc.constructed_standard", ll_warning, lc_context)
<< "No output manager available, creating a standard output manager. This is probably a bug.";
- _imp->result.reset(new StandardOutputManager);
+ _imp->result = std::make_shared<StandardOutputManager>();
}
}
diff --git a/paludis/merger_TEST.cc b/paludis/merger_TEST.cc
index 27f98c2..864cb1f 100644
--- a/paludis/merger_TEST.cc
+++ b/paludis/merger_TEST.cc
@@ -87,7 +87,7 @@ namespace paludis
{
if (! hooker)
{
- hooker.reset(new Hooker(this));
+ hooker = std::make_shared<Hooker>(this);
for (std::list<std::pair<FSEntry, bool> >::const_iterator h(hook_dirs.begin()),
h_end(hook_dirs.end()) ; h != h_end ; ++h)
hooker->add_dir(h->first, h->second);
diff --git a/paludis/ndbam.cc b/paludis/ndbam.cc
index 9f4fe8f..87cc2b6 100644
--- a/paludis/ndbam.cc
+++ b/paludis/ndbam.cc
@@ -146,7 +146,7 @@ NDBAM::category_names()
if (! _imp->category_names)
{
Context context("When loading category names for NDBAM at '" + stringify(_imp->location) + "':");
- _imp->category_names.reset(new CategoryNamePartSet);
+ _imp->category_names = std::make_shared<CategoryNamePartSet>();
for (DirIterator d(_imp->location / "indices" / "categories"), d_end ;
d != d_end ; ++d)
{
@@ -191,7 +191,7 @@ NDBAM::package_names(const CategoryNamePart & c)
if (! cc.package_names)
{
Context context("When loading package names in '" + stringify(c) + "' for NDBAM at '" + stringify(_imp->location) + "':");
- cc.package_names.reset(new QualifiedPackageNameSet);
+ cc.package_names = std::make_shared<QualifiedPackageNameSet>();
for (DirIterator d(_imp->location / "indices" / "categories" / stringify(c)), d_end ;
d != d_end ; ++d)
{
@@ -302,9 +302,9 @@ NDBAM::entries(const QualifiedPackageName & q)
if (! pc.entries)
{
- pc.entries.reset(new NDBAMEntrySequence);
+ pc.entries = std::make_shared<NDBAMEntrySequence>();
Context context("When loading versions in '" + stringify(q) + "' for NDBAM at '" + stringify(_imp->location) + "':");
- pc.entries.reset(new NDBAMEntrySequence);
+ pc.entries = std::make_shared<NDBAMEntrySequence>();
for (DirIterator d(_imp->location / "indices" / "categories" / stringify(q.category()) / stringify(q.package())), d_end ;
d != d_end ; ++d)
{
@@ -606,7 +606,7 @@ NDBAM::category_names_containing_package(const PackageNamePart & p) const
Context c("When finding category names containing package '" + stringify(p) +
"' in NDBAM at '" + stringify(_imp->location) + "':");
- cncp.category_names_containing_package.reset(new CategoryNamePartSet);
+ cncp.category_names_containing_package = std::make_shared<CategoryNamePartSet>();
FSEntry dd(_imp->location / "indices" / "packages" / stringify(p));
if (dd.is_directory_or_symlink_to_directory())
{
diff --git a/paludis/ndbam_merger.cc b/paludis/ndbam_merger.cc
index 03c3a01..68fa02d 100644
--- a/paludis/ndbam_merger.cc
+++ b/paludis/ndbam_merger.cc
@@ -341,7 +341,7 @@ void
NDBAMMerger::merge()
{
display_override(">>> Merging to " + stringify(_imp->params.root()));
- _imp->contents_file.reset(new SafeOFStream(_imp->params.contents_file()));
+ _imp->contents_file = std::make_shared<SafeOFStream>(_imp->params.contents_file());
Merger::merge();
}
diff --git a/paludis/output_manager_from_environment.cc b/paludis/output_manager_from_environment.cc
index b4b2b8b..8f09209 100644
--- a/paludis/output_manager_from_environment.cc
+++ b/paludis/output_manager_from_environment.cc
@@ -88,7 +88,7 @@ OutputManagerFromEnvironment::construct_standard_if_unconstructed()
{
Log::get_instance()->message("output_manager_from_environment.constructed_standard", ll_warning, lc_context)
<< "No output manager available, creating a standard output manager. This is probably a bug.";
- _imp->result.reset(new StandardOutputManager);
+ _imp->result = std::make_shared<StandardOutputManager>();
}
}
diff --git a/paludis/paludislike_options_conf.cc b/paludis/paludislike_options_conf.cc
index cd8bab3..0c23f36 100644
--- a/paludis/paludislike_options_conf.cc
+++ b/paludis/paludislike_options_conf.cc
@@ -140,7 +140,7 @@ namespace
{
Log::get_instance()->message("paludislike_options_conf.bad_set", ll_warning, lc_context)
<< "Set '" << name << "' in '" << from << "' does not exist";
- result.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ result = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
return result;
diff --git a/paludis/range_rewriter.cc b/paludis/range_rewriter.cc
index a38dc9e..3965e52 100644
--- a/paludis/range_rewriter.cc
+++ b/paludis/range_rewriter.cc
@@ -280,7 +280,7 @@ RangeRewriter::visit(const DependencySpecTree::NodeType<PackageDepSpec>::Type &
}
else
{
- _imp->spec_data.reset(new RangeRewrittenPackageDepSpecData(a));
+ _imp->spec_data = std::make_shared<RangeRewrittenPackageDepSpecData>(a);
}
}
diff --git a/paludis/report_task.cc b/paludis/report_task.cc
index d7a7c9c..efa2a23 100644
--- a/paludis/report_task.cc
+++ b/paludis/report_task.cc
@@ -223,7 +223,7 @@ ReportTask::execute()
{
is_missing = false;
if (! origins)
- origins.reset(new PackageIDSequence);
+ origins = std::make_shared<PackageIDSequence>();
origins->push_back(*installable->last());
}
}
diff --git a/paludis/repositories/accounts/accounts_id.cc b/paludis/repositories/accounts/accounts_id.cc
index 8609483..2929580 100644
--- a/paludis/repositories/accounts/accounts_id.cc
+++ b/paludis/repositories/accounts/accounts_id.cc
@@ -161,24 +161,24 @@ AccountsID::_need_file_keys() const
if (_imp->is_user)
{
- _imp->username_key.reset(new LiteralMetadataValueKey<std::string>("username", "Username",
- mkt_significant, stringify(name().package())));
+ _imp->username_key = std::make_shared<LiteralMetadataValueKey<std::string>>("username", "Username",
+ mkt_significant, stringify(name().package()));
if (! k.get("gecos").empty())
- _imp->gecos_key.reset(new LiteralMetadataValueKey<std::string>("gecos", "Description",
- mkt_significant, k.get("gecos")));
+ _imp->gecos_key = std::make_shared<LiteralMetadataValueKey<std::string>>("gecos", "Description",
+ mkt_significant, k.get("gecos"));
if (! k.get("preferred_uid").empty())
- _imp->preferred_uid_key.reset(new LiteralMetadataValueKey<std::string>("preferred_uid", "Preferred UID",
- mkt_normal, k.get("preferred_uid")));
+ _imp->preferred_uid_key = std::make_shared<LiteralMetadataValueKey<std::string>>("preferred_uid", "Preferred UID",
+ mkt_normal, k.get("preferred_uid"));
if (! k.get("shell").empty())
- _imp->shell_key.reset(new LiteralMetadataValueKey<std::string>("shell", "Shell",
- mkt_normal, k.get("shell")));
+ _imp->shell_key = std::make_shared<LiteralMetadataValueKey<std::string>>("shell", "Shell",
+ mkt_normal, k.get("shell"));
if (! k.get("home").empty())
- _imp->home_key.reset(new LiteralMetadataValueKey<std::string>("home", "Home Directory",
- mkt_normal, k.get("home")));
+ _imp->home_key = std::make_shared<LiteralMetadataValueKey<std::string>>("home", "Home Directory",
+ mkt_normal, k.get("home"));
std::shared_ptr<Set<std::string> > all_groups_s(new Set<std::string>);
@@ -187,28 +187,28 @@ AccountsID::_need_file_keys() const
std::shared_ptr<Set<std::string> > groups_s(new Set<std::string>);
tokenise_whitespace(k.get("extra_groups"), groups_s->inserter());
std::copy(groups_s->begin(), groups_s->end(), all_groups_s->inserter());
- _imp->extra_groups_key.reset(new LiteralMetadataStringSetKey("extra_groups", "Extra Groups",
- mkt_normal, groups_s));
+ _imp->extra_groups_key = std::make_shared<LiteralMetadataStringSetKey>("extra_groups", "Extra Groups",
+ mkt_normal, groups_s);
}
if (! k.get("primary_group").empty())
{
- _imp->primary_group_key.reset(new LiteralMetadataValueKey<std::string>("primary_group", "Default Group",
- mkt_normal, k.get("primary_group")));
+ _imp->primary_group_key = std::make_shared<LiteralMetadataValueKey<std::string>>("primary_group", "Default Group",
+ mkt_normal, k.get("primary_group"));
all_groups_s->insert(k.get("primary_group"));
}
if (! all_groups_s->empty())
- _imp->dependencies_key.reset(new AccountsDepKey(_imp->env, all_groups_s));
+ _imp->dependencies_key = std::make_shared<AccountsDepKey>(_imp->env, all_groups_s);
}
else
{
- _imp->groupname_key.reset(new LiteralMetadataValueKey<std::string>("groupname", "Groupname",
- mkt_significant, stringify(name().package())));
+ _imp->groupname_key = std::make_shared<LiteralMetadataValueKey<std::string>>("groupname", "Groupname",
+ mkt_significant, stringify(name().package()));
if (! k.get("preferred_gid").empty())
- _imp->preferred_gid_key.reset(new LiteralMetadataValueKey<std::string>("preferred_gid", "Preferred GID",
- mkt_normal, k.get("preferred_gid")));
+ _imp->preferred_gid_key = std::make_shared<LiteralMetadataValueKey<std::string>>("preferred_gid", "Preferred GID",
+ mkt_normal, k.get("preferred_gid"));
}
_imp->has_file_keys = true;
diff --git a/paludis/repositories/accounts/accounts_repository_store.cc b/paludis/repositories/accounts/accounts_repository_store.cc
index 72b1684..029f887 100644
--- a/paludis/repositories/accounts/accounts_repository_store.cc
+++ b/paludis/repositories/accounts/accounts_repository_store.cc
@@ -207,7 +207,7 @@ AccountsRepositoryStore::_load_one_user(
if (q == _imp->ids.end())
q = _imp->ids.insert(std::make_pair(qpn, std::make_shared<PackageIDSequence>())).first;
else
- q->second.reset(new PackageIDSequence);
+ q->second = std::make_shared<PackageIDSequence>();
if (_imp->installed)
q->second->push_back(std::make_shared<InstalledAccountsID>(_imp->env, qpn, repo, true));
@@ -263,7 +263,7 @@ AccountsRepositoryStore::_load_one_group(
if (q == _imp->ids.end())
q = _imp->ids.insert(std::make_pair(qpn, std::make_shared<PackageIDSequence>())).first;
else
- q->second.reset(new PackageIDSequence);
+ q->second = std::make_shared<PackageIDSequence>();
if (_imp->installed)
q->second->push_back(std::make_shared<InstalledAccountsID>(_imp->env, qpn, repo, false));
diff --git a/paludis/repositories/accounts/installed_accounts_id.cc b/paludis/repositories/accounts/installed_accounts_id.cc
index ee90149..017f858 100644
--- a/paludis/repositories/accounts/installed_accounts_id.cc
+++ b/paludis/repositories/accounts/installed_accounts_id.cc
@@ -161,7 +161,7 @@ InstalledAccountsID::need_keys_added() const
/* first person who gets annoyed by this not existing gets to implement it. */
}
- _imp->dependencies_key.reset(new AccountsDepKey(_imp->env, groups));
+ _imp->dependencies_key = std::make_shared<AccountsDepKey>(_imp->env, groups);
add_metadata_key(_imp->dependencies_key);
}
}
diff --git a/paludis/repositories/cran/cran_package_id.cc b/paludis/repositories/cran/cran_package_id.cc
index a2fb66e..66fc6a5 100644
--- a/paludis/repositories/cran/cran_package_id.cc
+++ b/paludis/repositories/cran/cran_package_id.cc
@@ -120,8 +120,8 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
return;
}
- _imp->fs_location_key.reset(new LiteralMetadataValueKey<FSEntry> ("DescriptionFileLocation", "Description File Location",
- mkt_internal, f));
+ _imp->fs_location_key = std::make_shared<LiteralMetadataValueKey<FSEntry> >("DescriptionFileLocation", "Description File Location",
+ mkt_internal, f);
add_metadata_key(_imp->fs_location_key);
try
@@ -166,7 +166,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
{
/* License often isn't in the format the spec requires, so we can't parse it. */
Context local_context("When handling License: key:");
- _imp->license_key.reset(new LiteralMetadataValueKey<std::string>("License", "License", mkt_dependencies, file.get("License")));
+ _imp->license_key = std::make_shared<LiteralMetadataValueKey<std::string>>("License", "License", mkt_dependencies, file.get("License"));
add_metadata_key(_imp->license_key);
}
@@ -174,28 +174,28 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
{
/* URL is also in stupid formats */
Context local_context("When handling URL: key:");
- _imp->url_key.reset(new LiteralMetadataValueKey<std::string>("URL", "URL", mkt_significant, file.get("URL")));
+ _imp->url_key = std::make_shared<LiteralMetadataValueKey<std::string>>("URL", "URL", mkt_significant, file.get("URL"));
add_metadata_key(_imp->url_key);
}
if (! file.get("Title").empty())
{
Context local_context("When handling Title: key:");
- _imp->short_description_key.reset(new LiteralMetadataValueKey<std::string>("Title", "Title", mkt_significant, file.get("Title")));
+ _imp->short_description_key = std::make_shared<LiteralMetadataValueKey<std::string>>("Title", "Title", mkt_significant, file.get("Title"));
add_metadata_key(_imp->short_description_key);
}
if (! file.get("Description").empty())
{
Context local_context("When handling Description: key:");
- _imp->long_description_key.reset(new LiteralMetadataValueKey<std::string>("Description", "Description", mkt_normal, file.get("Description")));
+ _imp->long_description_key = std::make_shared<LiteralMetadataValueKey<std::string>>("Description", "Description", mkt_normal, file.get("Description"));
add_metadata_key(_imp->long_description_key);
}
else if (! file.get("BundleDescription").empty())
{
Context local_context("When handling BundleDescription: key:");
- _imp->long_description_key.reset(new LiteralMetadataValueKey<std::string>("BundleDescription", "Bundle Description",
- mkt_normal, file.get("BundleDescription")));
+ _imp->long_description_key = std::make_shared<LiteralMetadataValueKey<std::string>>("BundleDescription", "Bundle Description",
+ mkt_normal, file.get("BundleDescription"));
}
if (! file.get("Date").empty())
@@ -222,7 +222,7 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
Context local_context("When handling Contains: key:");
std::list<std::string> tokens;
tokenise_whitespace(file.get("Contains"), std::back_inserter(tokens));
- _imp->contains_key.reset(new PackageIDSequenceKey(_imp->env, "Contains", "Contains", mkt_normal));
+ _imp->contains_key = std::make_shared<PackageIDSequenceKey>(_imp->env, "Contains", "Contains", mkt_normal);
add_metadata_key(_imp->contains_key);
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
@@ -241,8 +241,8 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
if (! file.get("Suggests").empty())
{
Context local_context("When handling Suggests: key:");
- _imp->suggests_key.reset(new DepKey(_imp->env, "Suggests", "Suggests", file.get("Suggests"),
- _imp->suggests_labels, mkt_dependencies));
+ _imp->suggests_key = std::make_shared<DepKey>(_imp->env, "Suggests", "Suggests", file.get("Suggests"),
+ _imp->suggests_labels, mkt_dependencies);
add_metadata_key(_imp->suggests_key);
}
@@ -256,11 +256,11 @@ CRANPackageID::CRANPackageID(const Environment * const env, const std::shared_pt
if (! file.get("Depends").empty())
{
Context local_context("When handling Depends: key:");
- _imp->depends_key.reset(new DepKey(_imp->env, "Depends", "Depends", file.get("Depends") + ", R",
- _imp->depends_labels, mkt_dependencies));
+ _imp->depends_key = std::make_shared<DepKey>(_imp->env, "Depends", "Depends", file.get("Depends") + ", R",
+ _imp->depends_labels, mkt_dependencies);
}
else
- _imp->depends_key.reset(new DepKey(_imp->env, "Depends", "Depends", "R", _imp->depends_labels, mkt_dependencies));
+ _imp->depends_key = std::make_shared<DepKey>(_imp->env, "Depends", "Depends", "R", _imp->depends_labels, mkt_dependencies);
add_metadata_key(_imp->depends_key);
}
catch (const InternalError &)
diff --git a/paludis/repositories/cran/package_dep_spec.cc b/paludis/repositories/cran/package_dep_spec.cc
index 442ac29..939ad0e 100644
--- a/paludis/repositories/cran/package_dep_spec.cc
+++ b/paludis/repositories/cran/package_dep_spec.cc
@@ -121,7 +121,7 @@ namespace
CRANPackageDepSpecData & version_requirement(const VersionRequirement & v)
{
if (! version_requirements_v)
- version_requirements_v.reset(new VersionRequirements);
+ version_requirements_v = std::make_shared<VersionRequirements>();
version_requirements_v->push_back(v);
return *this;
}
@@ -130,9 +130,9 @@ namespace
{
unnormalised_package_name = s;
if ("R" == s)
- package_v.reset(new QualifiedPackageName("dev-lang/R"));
+ package_v = std::make_shared<QualifiedPackageName>("dev-lang/R");
else
- package_v.reset(new QualifiedPackageName(CategoryNamePart("cran") + PackageNamePart(cran_name_to_internal(s))));
+ package_v = std::make_shared<QualifiedPackageName>(CategoryNamePart("cran") + PackageNamePart(cran_name_to_internal(s)));
return *this;
}
diff --git a/paludis/repositories/e/e_choices_key.cc b/paludis/repositories/e/e_choices_key.cc
index 5dd7a99..144c74c 100644
--- a/paludis/repositories/e/e_choices_key.cc
+++ b/paludis/repositories/e/e_choices_key.cc
@@ -276,7 +276,7 @@ EChoicesKey::value() const
Context context("When making Choices key for '" + stringify(*_imp->id) + "':");
- _imp->value.reset(new Choices);
+ _imp->value = std::make_shared<Choices>();
if (! _imp->id->eapi()->supported())
return _imp->value;
diff --git a/paludis/repositories/e/e_installed_repository_id.cc b/paludis/repositories/e/e_installed_repository_id.cc
index d409963..9afdf7c 100644
--- a/paludis/repositories/e/e_installed_repository_id.cc
+++ b/paludis/repositories/e/e_installed_repository_id.cc
@@ -179,14 +179,14 @@ EInstalledRepositoryID::need_keys_added() const
if (_imp->keys)
return;
- _imp->keys.reset(new EInstalledRepositoryIDKeys);
+ _imp->keys = std::make_shared<EInstalledRepositoryIDKeys>();
// fs_location key could have been loaded by the ::fs_location_key() already. keep this
// at the top, other keys use it.
if (! _imp->fs_location)
{
- _imp->fs_location.reset(new LiteralMetadataValueKey<FSEntry> (fs_location_raw_name(), fs_location_human_name(),
- mkt_internal, _imp->dir));
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >(fs_location_raw_name(), fs_location_human_name(),
+ mkt_internal, _imp->dir);
add_metadata_key(_imp->fs_location);
}
@@ -208,24 +208,24 @@ EInstalledRepositoryID::need_keys_added() const
if (! env->env_use().empty())
if ((_imp->dir / env->env_use()).exists())
{
- _imp->keys->raw_use.reset(new EStringSetKey(shared_from_this(), env->env_use(), env->description_use(),
- file_contents(_imp->dir / env->env_use()), mkt_internal));
+ _imp->keys->raw_use = std::make_shared<EStringSetKey>(shared_from_this(), env->env_use(), env->description_use(),
+ file_contents(_imp->dir / env->env_use()), mkt_internal);
add_metadata_key(_imp->keys->raw_use);
}
if (! vars->slot()->name().empty())
if ((_imp->dir / vars->slot()->name()).exists())
{
- _imp->keys->slot.reset(new LiteralMetadataValueKey<SlotName>(vars->slot()->name(), vars->slot()->description(),
- mkt_internal, SlotName(file_contents(_imp->dir / vars->slot()->name()))));
+ _imp->keys->slot = std::make_shared<LiteralMetadataValueKey<SlotName>>(vars->slot()->name(), vars->slot()->description(),
+ mkt_internal, SlotName(file_contents(_imp->dir / vars->slot()->name())));
add_metadata_key(_imp->keys->slot);
}
if (! vars->inherited()->name().empty())
if ((_imp->dir / vars->inherited()->name()).exists())
{
- _imp->keys->inherited.reset(new EStringSetKey(shared_from_this(), vars->inherited()->name(), vars->inherited()->description(),
- file_contents(_imp->dir / vars->inherited()->name()), mkt_internal));
+ _imp->keys->inherited = std::make_shared<EStringSetKey>(shared_from_this(), vars->inherited()->name(), vars->inherited()->description(),
+ file_contents(_imp->dir / vars->inherited()->name()), mkt_internal);
add_metadata_key(_imp->keys->inherited);
}
@@ -235,8 +235,8 @@ EInstalledRepositoryID::need_keys_added() const
std::string d(file_contents(_imp->dir / vars->defined_phases()->name()));
if (! d.empty())
{
- _imp->keys->defined_phases.reset(new EStringSetKey(shared_from_this(), vars->defined_phases()->name(), vars->defined_phases()->description(),
- d, mkt_internal));
+ _imp->keys->defined_phases = std::make_shared<EStringSetKey>(shared_from_this(), vars->defined_phases()->name(), vars->defined_phases()->description(),
+ d, mkt_internal);
add_metadata_key(_imp->keys->defined_phases);
}
}
@@ -244,14 +244,14 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->iuse()->name().empty())
{
if ((_imp->dir / vars->iuse()->name()).exists())
- _imp->keys->raw_iuse.reset(new EStringSetKey(shared_from_this(), vars->iuse()->name(), vars->iuse()->description(),
- file_contents(_imp->dir / vars->iuse()->name()), mkt_internal));
+ _imp->keys->raw_iuse = std::make_shared<EStringSetKey>(shared_from_this(), vars->iuse()->name(), vars->iuse()->description(),
+ file_contents(_imp->dir / vars->iuse()->name()), mkt_internal);
else
{
/* hack: if IUSE doesn't exist, we still need an iuse_key to make the choices
* code behave sanely. */
- _imp->keys->raw_iuse.reset(new EStringSetKey(shared_from_this(), vars->iuse()->name(), vars->iuse()->description(),
- "", mkt_internal));
+ _imp->keys->raw_iuse = std::make_shared<EStringSetKey>(shared_from_this(), vars->iuse()->name(), vars->iuse()->description(),
+ "", mkt_internal);
}
add_metadata_key(_imp->keys->raw_iuse);
}
@@ -260,9 +260,9 @@ EInstalledRepositoryID::need_keys_added() const
{
if ((_imp->dir / vars->iuse_effective()->name()).exists())
{
- _imp->keys->raw_iuse_effective.reset(new EStringSetKey(
+ _imp->keys->raw_iuse_effective = std::make_shared<EStringSetKey>(
shared_from_this(), vars->iuse_effective()->name(), vars->iuse_effective()->description(),
- file_contents(_imp->dir / vars->iuse_effective()->name()), mkt_internal));
+ file_contents(_imp->dir / vars->iuse_effective()->name()), mkt_internal);
add_metadata_key(_imp->keys->raw_iuse_effective);
}
}
@@ -270,40 +270,40 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->myoptions()->name().empty())
if ((_imp->dir / vars->myoptions()->name()).exists())
{
- _imp->keys->raw_myoptions.reset(new EMyOptionsKey(_imp->environment, shared_from_this(), vars->myoptions()->name(),
- vars->myoptions()->description(), file_contents(_imp->dir / vars->myoptions()->name()), mkt_internal));
+ _imp->keys->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, shared_from_this(), vars->myoptions()->name(),
+ vars->myoptions()->description(), file_contents(_imp->dir / vars->myoptions()->name()), mkt_internal);
add_metadata_key(_imp->keys->raw_myoptions);
}
if (! vars->use_expand()->name().empty())
if ((_imp->dir / vars->use_expand()->name()).exists())
{
- _imp->keys->raw_use_expand.reset(new EStringSetKey(shared_from_this(), vars->use_expand()->name(), vars->use_expand()->description(),
- file_contents(_imp->dir / vars->use_expand()->name()), mkt_internal));
+ _imp->keys->raw_use_expand = std::make_shared<EStringSetKey>(shared_from_this(), vars->use_expand()->name(), vars->use_expand()->description(),
+ file_contents(_imp->dir / vars->use_expand()->name()), mkt_internal);
add_metadata_key(_imp->keys->raw_use_expand);
}
if (! vars->use_expand_hidden()->name().empty())
if ((_imp->dir / vars->use_expand_hidden()->name()).exists())
{
- _imp->keys->raw_use_expand_hidden.reset(new EStringSetKey(shared_from_this(), vars->use_expand_hidden()->name(), vars->use_expand_hidden()->description(),
- file_contents(_imp->dir / vars->use_expand_hidden()->name()), mkt_internal));
+ _imp->keys->raw_use_expand_hidden = std::make_shared<EStringSetKey>(shared_from_this(), vars->use_expand_hidden()->name(), vars->use_expand_hidden()->description(),
+ file_contents(_imp->dir / vars->use_expand_hidden()->name()), mkt_internal);
add_metadata_key(_imp->keys->raw_use_expand_hidden);
}
if (! vars->license()->name().empty())
if ((_imp->dir / vars->license()->name()).exists())
{
- _imp->keys->license.reset(new ELicenseKey(_imp->environment, shared_from_this(), vars->license(),
- file_contents(_imp->dir / vars->license()->name()), mkt_normal));
+ _imp->keys->license = std::make_shared<ELicenseKey>(_imp->environment, shared_from_this(), vars->license(),
+ file_contents(_imp->dir / vars->license()->name()), mkt_normal);
add_metadata_key(_imp->keys->license);
}
if (! vars->provide()->name().empty())
if ((_imp->dir / vars->provide()->name()).exists())
{
- _imp->keys->provide.reset(new EProvideKey(_imp->environment, shared_from_this(), vars->provide()->name(), vars->provide()->description(),
- file_contents(_imp->dir / vars->provide()->name()), mkt_internal));
+ _imp->keys->provide = std::make_shared<EProvideKey>(_imp->environment, shared_from_this(), vars->provide()->name(), vars->provide()->description(),
+ file_contents(_imp->dir / vars->provide()->name()), mkt_internal);
add_metadata_key(_imp->keys->provide);
}
@@ -317,20 +317,20 @@ EInstalledRepositoryID::need_keys_added() const
_imp->environment, shared_from_this(), *eapi()));
raw_deps->root()->accept(rewriter);
- _imp->keys->raw_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->dependencies()->name(),
- vars->dependencies()->description(), raw_deps_str, _imp->build_dependencies_labels, mkt_dependencies));
+ _imp->keys->raw_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->dependencies()->name(),
+ vars->dependencies()->description(), raw_deps_str, _imp->build_dependencies_labels, mkt_dependencies);
add_metadata_key(_imp->keys->raw_dependencies);
- _imp->keys->build_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->dependencies()->name() + ".DEPEND",
- vars->dependencies()->description() + " (build)", rewriter.depend(), _imp->build_dependencies_labels, mkt_internal));
+ _imp->keys->build_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->dependencies()->name() + ".DEPEND",
+ vars->dependencies()->description() + " (build)", rewriter.depend(), _imp->build_dependencies_labels, mkt_internal);
add_metadata_key(_imp->keys->build_dependencies);
- _imp->keys->run_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->dependencies()->name() + ".RDEPEND",
- vars->dependencies()->description() + " (run)", rewriter.rdepend(), _imp->build_dependencies_labels, mkt_internal));
+ _imp->keys->run_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->dependencies()->name() + ".RDEPEND",
+ vars->dependencies()->description() + " (run)", rewriter.rdepend(), _imp->build_dependencies_labels, mkt_internal);
add_metadata_key(_imp->keys->run_dependencies);
- _imp->keys->post_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->dependencies()->name() + ".PDEPEND",
- vars->dependencies()->description() + " (post)", rewriter.pdepend(), _imp->build_dependencies_labels, mkt_internal));
+ _imp->keys->post_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->dependencies()->name() + ".PDEPEND",
+ vars->dependencies()->description() + " (post)", rewriter.pdepend(), _imp->build_dependencies_labels, mkt_internal);
add_metadata_key(_imp->keys->post_dependencies);
}
}
@@ -339,27 +339,27 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->build_depend()->name().empty())
if ((_imp->dir / vars->build_depend()->name()).exists())
{
- _imp->keys->build_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->build_depend()->name(),
+ _imp->keys->build_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->build_depend()->name(),
vars->build_depend()->description(), file_contents(_imp->dir / vars->build_depend()->name()),
- _imp->build_dependencies_labels, mkt_dependencies));
+ _imp->build_dependencies_labels, mkt_dependencies);
add_metadata_key(_imp->keys->build_dependencies);
}
if (! vars->run_depend()->name().empty())
if ((_imp->dir / vars->run_depend()->name()).exists())
{
- _imp->keys->run_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->run_depend()->name(),
+ _imp->keys->run_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->run_depend()->name(),
vars->run_depend()->description(), file_contents(_imp->dir / vars->run_depend()->name()),
- _imp->run_dependencies_labels, mkt_dependencies));
+ _imp->run_dependencies_labels, mkt_dependencies);
add_metadata_key(_imp->keys->run_dependencies);
}
if (! vars->pdepend()->name().empty())
if ((_imp->dir / vars->pdepend()->name()).exists())
{
- _imp->keys->post_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), vars->pdepend()->name(),
+ _imp->keys->post_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), vars->pdepend()->name(),
vars->pdepend()->description(), file_contents(_imp->dir / vars->pdepend()->name()),
- _imp->post_dependencies_labels, mkt_dependencies));
+ _imp->post_dependencies_labels, mkt_dependencies);
add_metadata_key(_imp->keys->post_dependencies);
}
}
@@ -367,32 +367,32 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->restrictions()->name().empty())
if ((_imp->dir / vars->restrictions()->name()).exists())
{
- _imp->keys->restrictions.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(), vars->restrictions(),
- file_contents(_imp->dir / vars->restrictions()->name()), mkt_internal));
+ _imp->keys->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), vars->restrictions(),
+ file_contents(_imp->dir / vars->restrictions()->name()), mkt_internal);
add_metadata_key(_imp->keys->restrictions);
}
if (! vars->properties()->name().empty())
if ((_imp->dir / vars->properties()->name()).exists())
{
- _imp->keys->properties.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(), vars->properties(),
- file_contents(_imp->dir / vars->properties()->name()), mkt_internal));
+ _imp->keys->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), vars->properties(),
+ file_contents(_imp->dir / vars->properties()->name()), mkt_internal);
add_metadata_key(_imp->keys->properties);
}
if (! vars->src_uri()->name().empty())
if ((_imp->dir / vars->src_uri()->name()).exists())
{
- _imp->keys->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), vars->src_uri(),
- file_contents(_imp->dir / vars->src_uri()->name()), mkt_dependencies));
+ _imp->keys->src_uri = std::make_shared<EFetchableURIKey>(_imp->environment, shared_from_this(), vars->src_uri(),
+ file_contents(_imp->dir / vars->src_uri()->name()), mkt_dependencies);
add_metadata_key(_imp->keys->src_uri);
}
if (! vars->short_description()->name().empty())
if ((_imp->dir / vars->short_description()->name()).exists())
{
- _imp->keys->short_description.reset(new LiteralMetadataValueKey<std::string> (vars->short_description()->name(),
- vars->short_description()->description(), mkt_significant, file_contents(_imp->dir / vars->short_description()->name())));
+ _imp->keys->short_description = std::make_shared<LiteralMetadataValueKey<std::string> >(vars->short_description()->name(),
+ vars->short_description()->description(), mkt_significant, file_contents(_imp->dir / vars->short_description()->name()));
add_metadata_key(_imp->keys->short_description);
}
@@ -402,8 +402,8 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->long_description()->name()));
if (! value.empty())
{
- _imp->keys->long_description.reset(new LiteralMetadataValueKey<std::string> (vars->long_description()->name(),
- vars->long_description()->description(), mkt_significant, value));
+ _imp->keys->long_description = std::make_shared<LiteralMetadataValueKey<std::string> >(vars->long_description()->name(),
+ vars->long_description()->description(), mkt_significant, value);
add_metadata_key(_imp->keys->long_description);
}
}
@@ -414,9 +414,9 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->upstream_changelog()->name()));
if (! value.empty())
{
- _imp->keys->upstream_changelog.reset(new ESimpleURIKey(_imp->environment, shared_from_this(),
+ _imp->keys->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(),
vars->upstream_changelog()->name(),
- vars->upstream_changelog()->description(), value, mkt_normal));
+ vars->upstream_changelog()->description(), value, mkt_normal);
add_metadata_key(_imp->keys->upstream_changelog);
}
}
@@ -427,9 +427,9 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->upstream_release_notes()->name()));
if (! value.empty())
{
- _imp->keys->upstream_release_notes.reset(new ESimpleURIKey(_imp->environment, shared_from_this(),
+ _imp->keys->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(),
vars->upstream_release_notes()->name(),
- vars->upstream_release_notes()->description(), value, mkt_normal));
+ vars->upstream_release_notes()->description(), value, mkt_normal);
add_metadata_key(_imp->keys->upstream_release_notes);
}
}
@@ -440,9 +440,9 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->upstream_documentation()->name()));
if (! value.empty())
{
- _imp->keys->upstream_documentation.reset(new ESimpleURIKey(_imp->environment, shared_from_this(),
+ _imp->keys->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(),
vars->upstream_documentation()->name(),
- vars->upstream_documentation()->description(), value, mkt_normal));
+ vars->upstream_documentation()->description(), value, mkt_normal);
add_metadata_key(_imp->keys->upstream_documentation);
}
}
@@ -453,8 +453,8 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->bugs_to()->name()));
if (! value.empty())
{
- _imp->keys->bugs_to.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(),
- vars->bugs_to(), value, mkt_normal));
+ _imp->keys->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(),
+ vars->bugs_to(), value, mkt_normal);
add_metadata_key(_imp->keys->bugs_to);
}
}
@@ -465,8 +465,8 @@ EInstalledRepositoryID::need_keys_added() const
std::string value(file_contents(_imp->dir / vars->remote_ids()->name()));
if (! value.empty())
{
- _imp->keys->remote_ids.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(),
- vars->remote_ids(), value, mkt_internal));
+ _imp->keys->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(),
+ vars->remote_ids(), value, mkt_internal);
add_metadata_key(_imp->keys->remote_ids);
}
}
@@ -474,26 +474,26 @@ EInstalledRepositoryID::need_keys_added() const
if (! vars->homepage()->name().empty())
if ((_imp->dir / vars->homepage()->name()).exists())
{
- _imp->keys->homepage.reset(new ESimpleURIKey(_imp->environment, shared_from_this(), vars->homepage()->name(),
+ _imp->keys->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), vars->homepage()->name(),
vars->homepage()->description(),
- file_contents(_imp->dir / vars->homepage()->name()), mkt_significant));
+ file_contents(_imp->dir / vars->homepage()->name()), mkt_significant);
add_metadata_key(_imp->keys->homepage);
}
_imp->keys->contents = make_contents_key();
add_metadata_key(_imp->keys->contents);
- _imp->keys->installed_time.reset(new EMTimeKey(shared_from_this(), "INSTALLED_TIME", "Installed time",
- _imp->dir / contents_filename(), mkt_normal));
+ _imp->keys->installed_time = std::make_shared<EMTimeKey>(shared_from_this(), "INSTALLED_TIME", "Installed time",
+ _imp->dir / contents_filename(), mkt_normal);
add_metadata_key(_imp->keys->installed_time);
if (_imp->eapi->supported())
- _imp->keys->choices.reset(new EChoicesKey(_imp->environment, shared_from_this(), "PALUDIS_CHOICES",
+ _imp->keys->choices = std::make_shared<EChoicesKey>(_imp->environment, shared_from_this(), "PALUDIS_CHOICES",
_imp->eapi->supported()->ebuild_environment_variables()->description_choices(),
- mkt_normal, make_null_shared_ptr(), make_null_shared_ptr()));
+ mkt_normal, make_null_shared_ptr(), make_null_shared_ptr());
else
- _imp->keys->choices.reset(new EChoicesKey(_imp->environment, shared_from_this(), "PALUDIS_CHOICES", "Choices", mkt_normal,
- make_null_shared_ptr(), make_null_shared_ptr()));
+ _imp->keys->choices = std::make_shared<EChoicesKey>(_imp->environment, shared_from_this(), "PALUDIS_CHOICES", "Choices", mkt_normal,
+ make_null_shared_ptr(), make_null_shared_ptr());
add_metadata_key(_imp->keys->choices);
@@ -506,64 +506,64 @@ EInstalledRepositoryID::need_keys_added() const
from_repositories_value->insert(file_contents(_imp->dir / "BINARY_REPOSITORY"));
if (! from_repositories_value->empty())
{
- _imp->keys->from_repositories.reset(new LiteralMetadataStringSetKey("REPOSITORIES",
- "From repositories", mkt_normal, from_repositories_value));
+ _imp->keys->from_repositories = std::make_shared<LiteralMetadataStringSetKey>("REPOSITORIES",
+ "From repositories", mkt_normal, from_repositories_value);
add_metadata_key(_imp->keys->from_repositories);
}
if ((_imp->dir / "ASFLAGS").exists())
{
- _imp->keys->asflags.reset(new LiteralMetadataValueKey<std::string> ("ASFLAGS", "ASFLAGS",
- mkt_internal, file_contents(_imp->dir / "ASFLAGS")));
+ _imp->keys->asflags = std::make_shared<LiteralMetadataValueKey<std::string> >("ASFLAGS", "ASFLAGS",
+ mkt_internal, file_contents(_imp->dir / "ASFLAGS"));
add_metadata_key(_imp->keys->asflags);
}
if ((_imp->dir / "CBUILD").exists())
{
- _imp->keys->cbuild.reset(new LiteralMetadataValueKey<std::string> ("CBUILD", "CBUILD",
- mkt_internal, file_contents(_imp->dir / "CBUILD")));
+ _imp->keys->cbuild = std::make_shared<LiteralMetadataValueKey<std::string> >("CBUILD", "CBUILD",
+ mkt_internal, file_contents(_imp->dir / "CBUILD"));
add_metadata_key(_imp->keys->cbuild);
}
if ((_imp->dir / "CFLAGS").exists())
{
- _imp->keys->cflags.reset(new LiteralMetadataValueKey<std::string> ("CFLAGS", "CFLAGS",
- mkt_internal, file_contents(_imp->dir / "CFLAGS")));
+ _imp->keys->cflags = std::make_shared<LiteralMetadataValueKey<std::string> >("CFLAGS", "CFLAGS",
+ mkt_internal, file_contents(_imp->dir / "CFLAGS"));
add_metadata_key(_imp->keys->cflags);
}
if ((_imp->dir / "CHOST").exists())
{
- _imp->keys->chost.reset(new LiteralMetadataValueKey<std::string> ("CHOST", "CHOST",
- mkt_internal, file_contents(_imp->dir / "CHOST")));
+ _imp->keys->chost = std::make_shared<LiteralMetadataValueKey<std::string> >("CHOST", "CHOST",
+ mkt_internal, file_contents(_imp->dir / "CHOST"));
add_metadata_key(_imp->keys->chost);
}
if ((_imp->dir / "CXXFLAGS").exists())
{
- _imp->keys->cxxflags.reset(new LiteralMetadataValueKey<std::string> ("CXXFLAGS", "CXXFLAGS",
- mkt_internal, file_contents(_imp->dir / "CXXFLAGS")));
+ _imp->keys->cxxflags = std::make_shared<LiteralMetadataValueKey<std::string> >("CXXFLAGS", "CXXFLAGS",
+ mkt_internal, file_contents(_imp->dir / "CXXFLAGS"));
add_metadata_key(_imp->keys->cxxflags);
}
if ((_imp->dir / "LDFLAGS").exists())
{
- _imp->keys->ldflags.reset(new LiteralMetadataValueKey<std::string> ("LDFLAGS", "LDFLAGS",
- mkt_internal, file_contents(_imp->dir / "LDFLAGS")));
+ _imp->keys->ldflags = std::make_shared<LiteralMetadataValueKey<std::string> >("LDFLAGS", "LDFLAGS",
+ mkt_internal, file_contents(_imp->dir / "LDFLAGS"));
add_metadata_key(_imp->keys->ldflags);
}
if ((_imp->dir / "PKGMANAGER").exists())
{
- _imp->keys->pkgmanager.reset(new LiteralMetadataValueKey<std::string> ("PKGMANAGER", "Installed using",
- mkt_normal, file_contents(_imp->dir / "PKGMANAGER")));
+ _imp->keys->pkgmanager = std::make_shared<LiteralMetadataValueKey<std::string> >("PKGMANAGER", "Installed using",
+ mkt_normal, file_contents(_imp->dir / "PKGMANAGER"));
add_metadata_key(_imp->keys->pkgmanager);
}
if ((_imp->dir / "VDB_FORMAT").exists())
{
- _imp->keys->vdb_format.reset(new LiteralMetadataValueKey<std::string> ("VDB_FORMAT", "VDB Format",
- mkt_internal, file_contents(_imp->dir / "VDB_FORMAT")));
+ _imp->keys->vdb_format = std::make_shared<LiteralMetadataValueKey<std::string> >("VDB_FORMAT", "VDB Format",
+ mkt_internal, file_contents(_imp->dir / "VDB_FORMAT"));
add_metadata_key(_imp->keys->vdb_format);
}
}
@@ -859,8 +859,8 @@ EInstalledRepositoryID::fs_location_key() const
{
Lock l(_imp->mutex);
- _imp->fs_location.reset(new LiteralMetadataValueKey<FSEntry> (fs_location_raw_name(),
- fs_location_human_name(), mkt_internal, _imp->dir));
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >(fs_location_raw_name(),
+ fs_location_human_name(), mkt_internal, _imp->dir);
add_metadata_key(_imp->fs_location);
}
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 1e50699..c567aff 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -808,7 +808,7 @@ EKeywordsKey::value() const
if (_imp->value)
return _imp->value;
- _imp->value.reset(new KeywordNameSet);
+ _imp->value = std::make_shared<KeywordNameSet>();
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
tokenise_whitespace(_imp->string_value, create_inserter<KeywordName>(_imp->value->inserter()));
return _imp->value;
@@ -897,7 +897,7 @@ EStringSetKey::value() const
if (_imp->value)
return _imp->value;
- _imp->value.reset(new Set<std::string>);
+ _imp->value = std::make_shared<Set<std::string>>();
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
tokenise_whitespace(_imp->string_value, _imp->value->inserter());
return _imp->value;
@@ -982,7 +982,7 @@ EContentsKey::value() const
Context context("When creating contents for VDB key '" + stringify(*_imp->id) + "' from '" + stringify(_imp->filename) + "':");
- _imp->value.reset(new Contents);
+ _imp->value = std::make_shared<Contents>();
FSEntry f(_imp->filename);
if (! f.is_regular_file_or_symlink_to_regular_file())
@@ -1100,7 +1100,7 @@ EMTimeKey::value() const
if (_imp->value)
return *_imp->value;
- _imp->value.reset(new Timestamp(Timestamp::now()));
+ _imp->value = std::make_shared<Timestamp>(Timestamp::now());
try
{
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index e5e2ca7..81f5916 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -141,7 +141,7 @@ namespace
if (r)
{
- result.reset(new FSEntrySequence);
+ result = std::make_shared<FSEntrySequence>();
for (ERepositorySequence::ConstIterator e(r->begin()), e_end(r->end()) ;
e != e_end ; ++e)
result->push_back((*e)->location_key()->value());
@@ -157,7 +157,7 @@ namespace
if (r)
{
- result.reset(new Sequence<std::string>);
+ result = std::make_shared<Sequence<std::string>>();
for (ERepositorySequence::ConstIterator e(r->begin()), e_end(r->end()) ;
e != e_end ; ++e)
result->push_back(stringify((*e)->name()));
@@ -409,7 +409,7 @@ namespace paludis
if (profiles_desc == FSEntry("/dev/null"))
{
auto_profiles->push_back(FSEntry("/var/empty"));
- main_profile_path.reset(new FSEntry("/var/empty"));
+ main_profile_path = std::make_shared<FSEntry>("/var/empty");
}
else
{
@@ -425,16 +425,16 @@ namespace paludis
FSEntry p(profiles_desc.dirname().realpath().dirname() / "profiles" / tokens.at(1));
auto_profiles->push_back(p);
- main_profile_path.reset(new FSEntry(p));
+ main_profile_path = std::make_shared<FSEntry>(p);
break;
}
}
profiles = auto_profiles;
}
else if (params.profiles()->empty())
- main_profile_path.reset(new FSEntry("/var/empty"));
+ main_profile_path = std::make_shared<FSEntry>("/var/empty");
else
- main_profile_path.reset(new FSEntry(*params.profiles()->begin()));
+ main_profile_path = std::make_shared<FSEntry>(*params.profiles()->begin());
profile_ptr = ProfileFactory::get_instance()->create(
params.profile_layout(),
@@ -661,7 +661,7 @@ ERepository::arch_flags() const
if (! _imp->arch_flags)
{
Context context("When loading arch list:");
- _imp->arch_flags.reset(new Set<UnprefixedChoiceName>);
+ _imp->arch_flags = std::make_shared<Set<UnprefixedChoiceName>>();
bool found_one(false);
std::shared_ptr<const FSEntrySequence> arch_list_files(_imp->layout->arch_list_files());
@@ -874,7 +874,7 @@ ERepository::update_news() const
Lock l(_imp->mutexes->news_ptr_mutex);
if (! _imp->news_ptr)
- _imp->news_ptr.reset(new ERepositoryNews(_imp->params.environment(), this, _imp->params));
+ _imp->news_ptr = std::make_shared<ERepositoryNews>(_imp->params.environment(), this, _imp->params);
_imp->news_ptr->update_news();
}
@@ -1171,8 +1171,8 @@ ERepository::need_keys_added() const
k = _imp->profile_ptr->environment_variable(v);
}
- _imp->accept_keywords_key.reset(new LiteralMetadataValueKey<std::string>(v,
- "Default accepted keywords", mkt_internal, k));
+ _imp->accept_keywords_key = std::make_shared<LiteralMetadataValueKey<std::string>>(v,
+ "Default accepted keywords", mkt_internal, k);
add_metadata_key(_imp->accept_keywords_key);
}
@@ -1258,7 +1258,7 @@ ERepository::repository_factory_create(
throw ERepositoryConfigurationError("Master repository format is '" + stringify(format) + "', not 'ebuild'");
std::shared_ptr<ERepository> master_repository(std::static_pointer_cast<ERepository>(master_repository_uncasted));
- master_repositories.reset(new ERepositorySequence);
+ master_repositories = std::make_shared<ERepositorySequence>();
master_repositories->push_back(master_repository);
}
else if (layout_conf)
@@ -1285,7 +1285,7 @@ ERepository::repository_factory_create(
std::shared_ptr<ERepository> master_repository(std::static_pointer_cast<ERepository>(master_repository_uncasted));
if (! master_repositories)
- master_repositories.reset(new ERepositorySequence);
+ master_repositories = std::make_shared<ERepositorySequence>();
master_repositories->push_back(master_repository);
}
catch (const NoSuchRepositoryError &)
@@ -1574,7 +1574,7 @@ ERepository::use_desc() const
Lock l(_imp->mutexes->use_desc_mutex);
if (! _imp->use_desc)
{
- _imp->use_desc.reset(new UseDesc(_imp->layout->use_desc_files()));
+ _imp->use_desc = std::make_shared<UseDesc>(_imp->layout->use_desc_files());
}
return _imp->use_desc;
diff --git a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
index 47b11b6..4d232ad 100644
--- a/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
+++ b/paludis/repositories/e/e_repository_TEST_symlink_rewriting.cc
@@ -121,7 +121,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
diff --git a/paludis/repositories/e/e_repository_mask_file.cc b/paludis/repositories/e/e_repository_mask_file.cc
index 0c9e411..e46400a 100644
--- a/paludis/repositories/e/e_repository_mask_file.cc
+++ b/paludis/repositories/e/e_repository_mask_file.cc
@@ -65,7 +65,7 @@ MaskFile::MaskFile(const FSEntry & f, const LineConfigFileOptions & opts) :
{
if (it->empty())
{
- comment.reset(new Sequence<std::string>);
+ comment = std::make_shared<Sequence<std::string>>();
comment_used = false;
continue;
}
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 2b7b2cd..dd59558 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -409,7 +409,7 @@ bool
EbuildMetadataCommand::do_run_command(const Command & cmd)
{
bool ok(false);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
try
{
@@ -453,7 +453,7 @@ EbuildMetadataCommand::do_run_command(const Command & cmd)
{
Log::get_instance()->message("e.ebuild.cache_failure", ll_warning, lc_context) << "Could not generate cache for '"
<< *params.package_id() << "', stdout says '" << captured_stdout << "' and stderr says '" << captured_stderr << "'";
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("EAPI", EAPIData::get_instance()->unknown_eapi()->name());
return false;
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 3e9099d..03e55c5 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -182,8 +182,8 @@ EbuildID::need_keys_added() const
// fs_location key could have been loaded by the ::fs_location_key() already.
if (! _imp->fs_location)
{
- _imp->fs_location.reset(new LiteralMetadataValueKey<FSEntry> ("EBUILD", "Ebuild Location",
- mkt_internal, _imp->ebuild));
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >("EBUILD", "Ebuild Location",
+ mkt_internal, _imp->ebuild);
add_metadata_key(_imp->fs_location);
}
@@ -372,22 +372,22 @@ EbuildID::need_keys_added() const
}
}
- _imp->raw_iuse_effective.reset(new LiteralMetadataStringSetKey(
+ _imp->raw_iuse_effective = std::make_shared<LiteralMetadataStringSetKey>(
_imp->eapi->supported()->ebuild_metadata_variables()->iuse_effective()->name(),
_imp->eapi->supported()->ebuild_metadata_variables()->iuse_effective()->description(),
mkt_internal,
- iuse_effective));
+ iuse_effective);
add_metadata_key(_imp->raw_iuse_effective);
}
- _imp->choices.reset(new EChoicesKey(_imp->environment, shared_from_this(), "PALUDIS_CHOICES",
+ _imp->choices = std::make_shared<EChoicesKey>(_imp->environment, shared_from_this(), "PALUDIS_CHOICES",
_imp->eapi->supported()->ebuild_environment_variables()->description_choices(),
mkt_normal, e_repository(),
- maybe_use_descriptions));
+ maybe_use_descriptions);
}
else
- _imp->choices.reset(new EChoicesKey(_imp->environment, shared_from_this(), "PALUDIS_CHOICES", "Choices", mkt_normal,
- e_repository(), maybe_use_descriptions));
+ _imp->choices = std::make_shared<EChoicesKey>(_imp->environment, shared_from_this(), "PALUDIS_CHOICES", "Choices", mkt_normal,
+ e_repository(), maybe_use_descriptions);
add_metadata_key(_imp->choices);
}
@@ -833,7 +833,7 @@ EbuildID::fs_location_key() const
// Avoid loading whole metadata
if (! _imp->fs_location)
{
- _imp->fs_location.reset(new LiteralMetadataValueKey<FSEntry> ("EBUILD", "Ebuild Location", mkt_internal, _imp->ebuild));
+ _imp->fs_location = std::make_shared<LiteralMetadataValueKey<FSEntry> >("EBUILD", "Ebuild Location", mkt_internal, _imp->ebuild);
add_metadata_key(_imp->fs_location);
}
@@ -875,7 +875,7 @@ void
EbuildID::load_captured_stderr(const std::string & r, const std::string & h, const MetadataKeyType t, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->captured_stderr_key.reset(new LiteralMetadataValueKey<std::string> (r, h, t, v));
+ _imp->captured_stderr_key = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, t, v);
add_metadata_key(_imp->captured_stderr_key);
}
@@ -883,7 +883,7 @@ void
EbuildID::load_captured_stdout(const std::string & r, const std::string & h, const MetadataKeyType t, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->captured_stdout_key.reset(new LiteralMetadataValueKey<std::string> (r, h, t, v));
+ _imp->captured_stdout_key = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, t, v);
add_metadata_key(_imp->captured_stdout_key);
}
@@ -891,7 +891,7 @@ void
EbuildID::load_short_description(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->short_description.reset(new LiteralMetadataValueKey<std::string> (r, h, mkt_significant, v));
+ _imp->short_description = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, mkt_significant, v);
add_metadata_key(_imp->short_description);
}
@@ -899,7 +899,7 @@ void
EbuildID::load_long_description(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->long_description.reset(new LiteralMetadataValueKey<std::string> (r, h, mkt_normal, v));
+ _imp->long_description = std::make_shared<LiteralMetadataValueKey<std::string> >(r, h, mkt_normal, v);
add_metadata_key(_imp->long_description);
}
@@ -907,8 +907,8 @@ void
EbuildID::load_raw_depend(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->raw_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), r, h, v,
- _imp->raw_dependencies_labels, mkt_dependencies));
+ _imp->raw_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), r, h, v,
+ _imp->raw_dependencies_labels, mkt_dependencies);
add_metadata_key(_imp->raw_dependencies);
}
@@ -917,8 +917,8 @@ EbuildID::load_build_depend(const std::string & r, const std::string & h, const
bool rewritten) const
{
Lock l(_imp->mutex);
- _imp->build_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), r, h, v,
- _imp->build_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies));
+ _imp->build_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), r, h, v,
+ _imp->build_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies);
add_metadata_key(_imp->build_dependencies);
}
@@ -927,8 +927,8 @@ EbuildID::load_run_depend(const std::string & r, const std::string & h, const st
bool rewritten) const
{
Lock l(_imp->mutex);
- _imp->run_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), r, h, v,
- _imp->run_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies));
+ _imp->run_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), r, h, v,
+ _imp->run_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies);
add_metadata_key(_imp->run_dependencies);
}
@@ -937,8 +937,8 @@ EbuildID::load_post_depend(const std::string & r, const std::string & h, const s
bool rewritten) const
{
Lock l(_imp->mutex);
- _imp->post_dependencies.reset(new EDependenciesKey(_imp->environment, shared_from_this(), r, h, v,
- _imp->post_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies));
+ _imp->post_dependencies = std::make_shared<EDependenciesKey>(_imp->environment, shared_from_this(), r, h, v,
+ _imp->post_dependencies_labels, rewritten ? mkt_internal : mkt_dependencies);
add_metadata_key(_imp->post_dependencies);
}
@@ -946,7 +946,7 @@ void
EbuildID::load_src_uri(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->src_uri.reset(new EFetchableURIKey(_imp->environment, shared_from_this(), m, v, mkt_dependencies));
+ _imp->src_uri = std::make_shared<EFetchableURIKey>(_imp->environment, shared_from_this(), m, v, mkt_dependencies);
add_metadata_key(_imp->src_uri);
}
@@ -954,7 +954,7 @@ void
EbuildID::load_homepage(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->homepage.reset(new ESimpleURIKey(_imp->environment, shared_from_this(), r, h, v, mkt_significant));
+ _imp->homepage = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), r, h, v, mkt_significant);
add_metadata_key(_imp->homepage);
}
@@ -962,7 +962,7 @@ void
EbuildID::load_license(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->license.reset(new ELicenseKey(_imp->environment, shared_from_this(), m, v, mkt_internal));
+ _imp->license = std::make_shared<ELicenseKey>(_imp->environment, shared_from_this(), m, v, mkt_internal);
add_metadata_key(_imp->license);
}
@@ -970,7 +970,7 @@ void
EbuildID::load_restrict(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->restrictions.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(), m, v, mkt_internal));
+ _imp->restrictions = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), m, v, mkt_internal);
add_metadata_key(_imp->restrictions);
}
@@ -978,7 +978,7 @@ void
EbuildID::load_properties(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->properties.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(), m, v, mkt_internal));
+ _imp->properties = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), m, v, mkt_internal);
add_metadata_key(_imp->properties);
}
@@ -986,7 +986,7 @@ void
EbuildID::load_provide(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->provide.reset(new EProvideKey(_imp->environment, shared_from_this(), r, h, v, mkt_dependencies));
+ _imp->provide = std::make_shared<EProvideKey>(_imp->environment, shared_from_this(), r, h, v, mkt_dependencies);
add_metadata_key(_imp->provide);
}
@@ -994,7 +994,7 @@ void
EbuildID::load_iuse(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->raw_iuse.reset(new EStringSetKey(shared_from_this(), r, h, v, mkt_internal));
+ _imp->raw_iuse = std::make_shared<EStringSetKey>(shared_from_this(), r, h, v, mkt_internal);
add_metadata_key(_imp->raw_iuse);
}
@@ -1002,7 +1002,7 @@ void
EbuildID::load_myoptions(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->raw_myoptions.reset(new EMyOptionsKey(_imp->environment, shared_from_this(), r, h, v, mkt_internal));
+ _imp->raw_myoptions = std::make_shared<EMyOptionsKey>(_imp->environment, shared_from_this(), r, h, v, mkt_internal);
add_metadata_key(_imp->raw_myoptions);
}
@@ -1010,7 +1010,7 @@ void
EbuildID::load_use(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->raw_use.reset(new EStringSetKey(shared_from_this(), r, h, v, mkt_internal));
+ _imp->raw_use = std::make_shared<EStringSetKey>(shared_from_this(), r, h, v, mkt_internal);
add_metadata_key(_imp->raw_use);
}
@@ -1018,7 +1018,7 @@ void
EbuildID::load_keywords(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->keywords.reset(new EKeywordsKey(_imp->environment, shared_from_this(), r, h, v, mkt_internal));
+ _imp->keywords = std::make_shared<EKeywordsKey>(_imp->environment, shared_from_this(), r, h, v, mkt_internal);
add_metadata_key(_imp->keywords);
}
@@ -1026,7 +1026,7 @@ void
EbuildID::load_inherited(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->inherited.reset(new EStringSetKey(shared_from_this(), r, h, v, mkt_internal));
+ _imp->inherited = std::make_shared<EStringSetKey>(shared_from_this(), r, h, v, mkt_internal);
add_metadata_key(_imp->inherited);
}
@@ -1037,7 +1037,7 @@ EbuildID::load_defined_phases(const std::string & r, const std::string & h, cons
throw InternalError(PALUDIS_HERE, "v should not be empty");
Lock l(_imp->mutex);
- _imp->defined_phases.reset(new EStringSetKey(shared_from_this(), r, h, v, mkt_internal));
+ _imp->defined_phases = std::make_shared<EStringSetKey>(shared_from_this(), r, h, v, mkt_internal);
add_metadata_key(_imp->defined_phases);
}
@@ -1045,7 +1045,7 @@ void
EbuildID::load_upstream_changelog(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_changelog.reset(new ESimpleURIKey(_imp->environment, shared_from_this(), r, h, v, mkt_normal));
+ _imp->upstream_changelog = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), r, h, v, mkt_normal);
add_metadata_key(_imp->upstream_changelog);
}
@@ -1053,7 +1053,7 @@ void
EbuildID::load_upstream_documentation(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_documentation.reset(new ESimpleURIKey(_imp->environment, shared_from_this(), r, h, v, mkt_normal));
+ _imp->upstream_documentation = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), r, h, v, mkt_normal);
add_metadata_key(_imp->upstream_documentation);
}
@@ -1061,7 +1061,7 @@ void
EbuildID::load_upstream_release_notes(const std::string & r, const std::string & h, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->upstream_release_notes.reset(new ESimpleURIKey(_imp->environment, shared_from_this(), r, h, v, mkt_normal));
+ _imp->upstream_release_notes = std::make_shared<ESimpleURIKey>(_imp->environment, shared_from_this(), r, h, v, mkt_normal);
add_metadata_key(_imp->upstream_release_notes);
}
@@ -1069,7 +1069,7 @@ void
EbuildID::load_bugs_to(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->bugs_to.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(), m, v, mkt_normal));
+ _imp->bugs_to = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), m, v, mkt_normal);
add_metadata_key(_imp->bugs_to);
}
@@ -1077,7 +1077,7 @@ void
EbuildID::load_remote_ids(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->remote_ids.reset(new EPlainTextSpecKey(_imp->environment, shared_from_this(), m, v, mkt_internal));
+ _imp->remote_ids = std::make_shared<EPlainTextSpecKey>(_imp->environment, shared_from_this(), m, v, mkt_internal);
add_metadata_key(_imp->remote_ids);
}
@@ -1085,7 +1085,7 @@ void
EbuildID::load_slot(const std::shared_ptr<const EAPIMetadataVariable> & m, const std::string & v) const
{
Lock l(_imp->mutex);
- _imp->slot.reset(new ESlotKey(m, v, mkt_internal));
+ _imp->slot = std::make_shared<ESlotKey>(m, v, mkt_internal);
add_metadata_key(_imp->slot);
}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index c4c26d2..b97918e 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -325,7 +325,7 @@ ExheresLayout::need_category_names_collection() const
need_category_names();
- _imp->category_names_collection.reset(new CategoryNamePartSet);
+ _imp->category_names_collection = std::make_shared<CategoryNamePartSet>();
std::transform(_imp->category_names.begin(), _imp->category_names.end(),
_imp->category_names_collection->inserter(),
std::mem_fn(&std::pair<const CategoryNamePart, bool>::first));
diff --git a/paludis/repositories/e/exndbam_id.cc b/paludis/repositories/e/exndbam_id.cc
index 4b79c50..be5f6bd 100644
--- a/paludis/repositories/e/exndbam_id.cc
+++ b/paludis/repositories/e/exndbam_id.cc
@@ -54,7 +54,7 @@ namespace
return _v;
using namespace std::placeholders;
- _v.reset(new Contents);
+ _v = std::make_shared<Contents>();
_db->parse_contents(*_id,
std::bind(&Contents::add, _v.get(), std::placeholders::_1),
std::bind(&Contents::add, _v.get(), std::placeholders::_1),
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index 6ca2933..300d368 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -215,8 +215,8 @@ ExndbamRepository::package_ids(const QualifiedPackageName & q) const
{
Lock l(*(*e).mutex());
if (! (*e).package_id())
- (*e).package_id().reset(new ExndbamID((*e).name(), (*e).version(), _imp->params.environment(),
- shared_from_this(), (*e).fs_location(), &_imp->ndbam));
+ (*e).package_id() = std::make_shared<ExndbamID>((*e).name(), (*e).version(), _imp->params.environment(),
+ shared_from_this(), (*e).fs_location(), &_imp->ndbam);
result->push_back((*e).package_id());
}
diff --git a/paludis/repositories/e/exndbam_repository_TEST.cc b/paludis/repositories/e/exndbam_repository_TEST.cc
index dd91dcb..614d4bb 100644
--- a/paludis/repositories/e/exndbam_repository_TEST.cc
+++ b/paludis/repositories/e/exndbam_repository_TEST.cc
@@ -141,7 +141,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo1);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "exndbam");
keys->insert("location", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "postinsttest"));
keys->insert("builddir", stringify(FSEntry::cwd() / "exndbam_repository_TEST_dir" / "build"));
diff --git a/paludis/repositories/e/fix_locked_dependencies.cc b/paludis/repositories/e/fix_locked_dependencies.cc
index 23570bd..d38f35e 100644
--- a/paludis/repositories/e/fix_locked_dependencies.cc
+++ b/paludis/repositories/e/fix_locked_dependencies.cc
@@ -115,7 +115,7 @@ namespace
{
PackageDepSpec new_s(PartiallyMadePackageDepSpec(*node.spec()).slot_requirement(
std::make_shared<ELikeSlotExactRequirement>((*matches->last())->slot_key()->value(), true)));
- c.reset(new PackageDepSpec(new_s));
+ c = std::make_shared<PackageDepSpec>(new_s);
}
} while (false);
diff --git a/paludis/repositories/e/info_metadata_key.cc b/paludis/repositories/e/info_metadata_key.cc
index 2396412..7beddfa 100644
--- a/paludis/repositories/e/info_metadata_key.cc
+++ b/paludis/repositories/e/info_metadata_key.cc
@@ -100,7 +100,7 @@ InfoVarsMetadataKey::value() const
if (_imp->value)
return _imp->value;
- _imp->value.reset(new Set<std::string>);
+ _imp->value = std::make_shared<Set<std::string>>();
for (FSEntrySequence::ConstIterator location(_imp->locations->begin()), location_end(_imp->locations->end()) ;
location != location_end ; ++location)
@@ -189,18 +189,18 @@ InfoPkgsMetadataKey::need_keys_added() const
filter::InstalledAtRoot(_imp->env->root()))]);
if (q->empty())
- key.reset(new LiteralMetadataValueKey<std::string>(i->first, i->first, mkt_normal, "(none)"));
+ key = std::make_shared<LiteralMetadataValueKey<std::string>>(i->first, i->first, mkt_normal, "(none)");
else
{
using namespace std::placeholders;
std::shared_ptr<Set<std::string> > s(new Set<std::string>);
std::transform(indirect_iterator(q->begin()), indirect_iterator(q->end()), s->inserter(),
std::bind(std::mem_fn(&PackageID::canonical_form), _1, idcf_version));
- key.reset(new LiteralMetadataStringSetKey(i->first, i->first, mkt_normal, s));
+ key = std::make_shared<LiteralMetadataStringSetKey>(i->first, i->first, mkt_normal, s);
}
}
else
- key.reset(new LiteralMetadataValueKey<std::string>(i->first, i->first, mkt_normal, "(unknown EAPI)"));
+ key = std::make_shared<LiteralMetadataValueKey<std::string>>(i->first, i->first, mkt_normal, "(unknown EAPI)");
add_metadata_key(key);
}
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 05d6541..b0c114c 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -336,7 +336,7 @@ TraditionalLayout::need_category_names_collection() const
need_category_names();
- _imp->category_names_collection.reset(new CategoryNamePartSet);
+ _imp->category_names_collection = std::make_shared<CategoryNamePartSet>();
std::transform(_imp->category_names.begin(), _imp->category_names.end(),
_imp->category_names_collection->inserter(),
std::mem_fn(&std::pair<const CategoryNamePart, bool>::first));
diff --git a/paludis/repositories/e/vdb_merger.cc b/paludis/repositories/e/vdb_merger.cc
index 4ef716b..4d5ba23 100644
--- a/paludis/repositories/e/vdb_merger.cc
+++ b/paludis/repositories/e/vdb_merger.cc
@@ -271,7 +271,7 @@ void
VDBMerger::merge()
{
display_override(">>> Merging to " + stringify(_imp->params.root()));
- _imp->contents_file.reset(new SafeOFStream(_imp->params.contents_file()));
+ _imp->contents_file = std::make_shared<SafeOFStream>(_imp->params.contents_file());
Merger::merge();
}
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 0408d85..c4be416 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -590,7 +590,7 @@ VDBRepository::provided_packages() const
load_provided_the_slow_way();
}
- _imp->provides.reset(new RepositoryProvidesInterface::ProvidesSequence);
+ _imp->provides = std::make_shared<RepositoryProvidesInterface::ProvidesSequence>();
for (ProvidesMap::const_iterator it(_imp->provides_map->begin()),
it_end(_imp->provides_map->end()); it_end != it; ++it)
{
@@ -655,7 +655,7 @@ VDBRepository::load_provided_using_cache() const
return false;
}
- _imp->provides_map.reset(new ProvidesMap);
+ _imp->provides_map = std::make_shared<ProvidesMap>();
std::string line;
while (std::getline(provides_cache, line))
@@ -763,7 +763,7 @@ VDBRepository::load_provided_the_slow_way() const
Context context("When loading VDB PROVIDEs map the slow way:");
Log::get_instance()->message("e.vdb.provides.starting", ll_debug, lc_no_context) << "Starting VDB PROVIDEs map creation";
- _imp->provides_map.reset(new ProvidesMap);
+ _imp->provides_map = std::make_shared<ProvidesMap>();
need_category_names();
std::for_each(_imp->categories.begin(), _imp->categories.end(),
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index def11e7..ab36900 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -340,7 +340,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -470,7 +470,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -622,7 +622,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", stringify(names_cache.dirname()));
keys->insert("provides_cache", "/var/empty");
@@ -856,7 +856,7 @@ namespace test_cases
TestEnvironment env;
env.set_paludis_command("/bin/false");
std::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", stringify(provides_cache));
@@ -985,7 +985,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo1);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "providesincrtest_src2"));
@@ -1001,7 +1001,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(2, repo2);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", stringify(provides_cache));
@@ -1180,7 +1180,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo1);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "e");
keys->insert("names_cache", "/var/empty");
keys->insert("location", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "reinstalltest_src2"));
@@ -1196,7 +1196,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(2, repo2);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -1311,7 +1311,7 @@ namespace test_cases
std::bind(from_keys, keys, std::placeholders::_1)));
env.package_database()->add_repository(1, repo1);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
diff --git a/paludis/repositories/e/vdb_unmerger_TEST.cc b/paludis/repositories/e/vdb_unmerger_TEST.cc
index b6ed263..b02c711 100644
--- a/paludis/repositories/e/vdb_unmerger_TEST.cc
+++ b/paludis/repositories/e/vdb_unmerger_TEST.cc
@@ -121,7 +121,7 @@ namespace
repo = VDBRepository::repository_factory_create(&env, std::bind(from_keys, keys, std::placeholders::_1));
env.package_database()->add_repository(0, repo);
- unmerger.reset(new VDBUnmergerNoDisplay(make_named_values<VDBUnmergerOptions>(
+ unmerger = std::make_shared<VDBUnmergerNoDisplay>(make_named_values<VDBUnmergerOptions>(
n::config_protect() = "/protected_file /protected_dir",
n::config_protect_mask() = "/protected_dir/unprotected_file /protected_dir/unprotected_dir",
n::environment() = &env,
@@ -131,7 +131,7 @@ namespace
parse_user_package_dep_spec("cat/" + fix(what), &env, UserPackageDepSpecOptions()),
MatchPackageOptions()))]->begin(),
n::root() = root_dir
- )));
+ ));
main_run();
}
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index f70efeb..57e71c2 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -203,7 +203,7 @@ FakeMetadataKeywordSetKey::FakeMetadataKeywordSetKey(const std::string & r,
void
FakeMetadataKeywordSetKey::set_from_string(const std::string & s)
{
- _imp->collection.reset(new KeywordNameSet);
+ _imp->collection = std::make_shared<KeywordNameSet>();
tokenise_whitespace(s, create_inserter<KeywordName>(_imp->collection->inserter()));
}
@@ -996,49 +996,49 @@ FakePackageID::need_keys_added() const
{
using namespace std::placeholders;
- _imp->build_dependencies.reset(new FakeMetadataSpecTreeKey<DependencySpecTree>("DEPEND", "Build dependencies",
+ _imp->build_dependencies = std::make_shared<FakeMetadataSpecTreeKey<DependencySpecTree>>("DEPEND", "Build dependencies",
"", std::bind(&parse_depend, _1, _imp->env,
shared_from_this()),
- _imp->build_dependencies_labels, mkt_dependencies));
+ _imp->build_dependencies_labels, mkt_dependencies);
- _imp->run_dependencies.reset(new FakeMetadataSpecTreeKey<DependencySpecTree>("RDEPEND", "Run dependencies",
+ _imp->run_dependencies = std::make_shared<FakeMetadataSpecTreeKey<DependencySpecTree>>("RDEPEND", "Run dependencies",
"", std::bind(&parse_depend, _1, _imp->env,
shared_from_this()),
- _imp->run_dependencies_labels, mkt_dependencies)),
+ _imp->run_dependencies_labels, mkt_dependencies);
- _imp->post_dependencies.reset(new FakeMetadataSpecTreeKey<DependencySpecTree>("PDEPEND", "Post dependencies",
+ _imp->post_dependencies = std::make_shared<FakeMetadataSpecTreeKey<DependencySpecTree>>("PDEPEND", "Post dependencies",
"", std::bind(&parse_depend, _1, _imp->env,
shared_from_this()),
- _imp->post_dependencies_labels, mkt_dependencies)),
+ _imp->post_dependencies_labels, mkt_dependencies);
- _imp->suggested_dependencies.reset(new FakeMetadataSpecTreeKey<DependencySpecTree>("SDEPEND", "Suggested dependencies",
+ _imp->suggested_dependencies = std::make_shared<FakeMetadataSpecTreeKey<DependencySpecTree>>("SDEPEND", "Suggested dependencies",
"", std::bind(&parse_depend, _1, _imp->env,
shared_from_this()),
- _imp->suggested_dependencies_labels, mkt_dependencies)),
+ _imp->suggested_dependencies_labels, mkt_dependencies);
- _imp->src_uri.reset(new FakeMetadataSpecTreeKey<FetchableURISpecTree>("SRC_URI", "Source URI",
+ _imp->src_uri = std::make_shared<FakeMetadataSpecTreeKey<FetchableURISpecTree>>("SRC_URI", "Source URI",
"", std::bind(&parse_fetchable_uri, _1, _imp->env,
- shared_from_this()), mkt_normal));
+ shared_from_this()), mkt_normal);
- _imp->homepage.reset(new FakeMetadataSpecTreeKey<SimpleURISpecTree>("HOMEPAGE", "Homepage",
+ _imp->homepage = std::make_shared<FakeMetadataSpecTreeKey<SimpleURISpecTree>>("HOMEPAGE", "Homepage",
"", std::bind(&parse_simple_uri, _1, _imp->env,
- shared_from_this()), mkt_normal));
+ shared_from_this()), mkt_normal);
- _imp->license.reset(new FakeMetadataSpecTreeKey<LicenseSpecTree>("LICENSE", "License",
+ _imp->license = std::make_shared<FakeMetadataSpecTreeKey<LicenseSpecTree>>("LICENSE", "License",
"", std::bind(&parse_license, _1, _imp->env,
- shared_from_this()), mkt_normal));
+ shared_from_this()), mkt_normal);
- _imp->provide.reset(new FakeMetadataSpecTreeKey<ProvideSpecTree>("PROVIDE", "Provide",
+ _imp->provide = std::make_shared<FakeMetadataSpecTreeKey<ProvideSpecTree>>("PROVIDE", "Provide",
"", std::bind(&parse_provide, _1, _imp->env,
- shared_from_this()), mkt_normal));
+ shared_from_this()), mkt_normal);
- _imp->choices.reset(new FakeMetadataChoicesKey(_imp->env, shared_from_this()));
+ _imp->choices = std::make_shared<FakeMetadataChoicesKey>(_imp->env, shared_from_this());
- _imp->behaviours.reset(new LiteralMetadataStringSetKey("BEHAVIOURS", "Behaviours",
- mkt_internal, _imp->behaviours_set));
+ _imp->behaviours = std::make_shared<LiteralMetadataStringSetKey>("BEHAVIOURS", "Behaviours",
+ mkt_internal, _imp->behaviours_set);
- _imp->hitchhiker.reset(new FakeMetadataValueKey<long>("HITCHHIKER", "Hitchhiker",
- mkt_internal, 42));
+ _imp->hitchhiker = std::make_shared<FakeMetadataValueKey<long>>("HITCHHIKER", "Hitchhiker",
+ mkt_internal, 42);
add_metadata_key(_imp->slot);
add_metadata_key(_imp->build_dependencies);
@@ -1190,7 +1190,7 @@ void
FakePackageID::make_unsupported()
{
invalidate_masks();
- _imp->unsupported_mask.reset(new FakeUnsupportedMask);
+ _imp->unsupported_mask = std::make_shared<FakeUnsupportedMask>();
}
namespace
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index 961a01c..f57d40c 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -206,20 +206,20 @@ namespace
{
std::string summary(required_text_only_key(n, "summary"));
if (! summary.empty())
- _imp->summary_key.reset(new LiteralMetadataValueKey<std::string> ("summary", "Summary", mkt_significant, summary));
+ _imp->summary_key = std::make_shared<LiteralMetadataValueKey<std::string> >("summary", "Summary", mkt_significant, summary);
std::string description(optional_text_only_key(n, "description"));
if (! description.empty())
- _imp->description_key.reset(new LiteralMetadataValueKey<std::string> ("description", "Description", mkt_normal, description));
+ _imp->description_key = std::make_shared<LiteralMetadataValueKey<std::string> >("description", "Description", mkt_normal, description);
std::string authors(optional_text_sequence_key(n, "authors"));
if (! authors.empty())
- _imp->authors_key.reset(new LiteralMetadataValueKey<std::string> ("authors", "Authors", mkt_normal, authors));
+ _imp->authors_key = std::make_shared<LiteralMetadataValueKey<std::string> >("authors", "Authors", mkt_normal, authors);
std::string rubyforge_project(optional_text_sequence_key(n, "rubyforge_project"));
if (! rubyforge_project.empty())
- _imp->rubyforge_project_key.reset(new LiteralMetadataValueKey<std::string> ("rubyforge_project", "Rubyforge Project",
- mkt_normal, rubyforge_project));
+ _imp->rubyforge_project_key = std::make_shared<LiteralMetadataValueKey<std::string> >("rubyforge_project", "Rubyforge Project",
+ mkt_normal, rubyforge_project);
_imp->date = required_text_only_key(n, "date");
_imp->platform = required_text_only_key(n, "platform");
@@ -272,10 +272,10 @@ GemSpecification::GemSpecification(const Environment * const e, const std::share
{
_imp->name_part = stringify(q);
_imp->version = stringify(v);
- _imp->load_from_file.reset(new FSEntry(f));
- _imp->fs_location_key.reset(new LiteralMetadataValueKey<FSEntry> ("GEM", "Gem Location", mkt_internal, f));
+ _imp->load_from_file = std::make_shared<FSEntry>(f);
+ _imp->fs_location_key = std::make_shared<LiteralMetadataValueKey<FSEntry> >("GEM", "Gem Location", mkt_internal, f);
add_metadata_key(_imp->fs_location_key);
- _imp->slot_key.reset(new LiteralMetadataValueKey<SlotName>("SLOT", "Slot", mkt_internal, SlotName(stringify(v))));
+ _imp->slot_key = std::make_shared<LiteralMetadataValueKey<SlotName>>("SLOT", "Slot", mkt_internal, SlotName(stringify(v)));
add_metadata_key(_imp->slot_key);
}
diff --git a/paludis/repositories/unavailable/unavailable_repository_store.cc b/paludis/repositories/unavailable/unavailable_repository_store.cc
index 7d7cee7..1ef7804 100644
--- a/paludis/repositories/unavailable/unavailable_repository_store.cc
+++ b/paludis/repositories/unavailable/unavailable_repository_store.cc
@@ -125,17 +125,17 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
std::shared_ptr<MetadataValueKey<std::string> > repository_homepage, repository_description,
repository_format, repository_sync;
if (! file.homepage().empty())
- repository_homepage.reset(new LiteralMetadataValueKey<std::string>(
- "REPOSITORY_HOMEPAGE", "Repository homepage", mkt_normal, file.homepage()));
+ repository_homepage = std::make_shared<LiteralMetadataValueKey<std::string>>(
+ "REPOSITORY_HOMEPAGE", "Repository homepage", mkt_normal, file.homepage());
if (! file.description().empty())
- repository_description.reset(new LiteralMetadataValueKey<std::string>(
- "REPOSITORY_DESCRIPTION", "Repository description", mkt_normal, file.description()));
+ repository_description = std::make_shared<LiteralMetadataValueKey<std::string>>(
+ "REPOSITORY_DESCRIPTION", "Repository description", mkt_normal, file.description());
if (! file.repo_format().empty())
- repository_format.reset(new LiteralMetadataValueKey<std::string>(
- "REPOSITORY_FORMAT", "Repository format", mkt_normal, file.repo_format()));
+ repository_format = std::make_shared<LiteralMetadataValueKey<std::string>>(
+ "REPOSITORY_FORMAT", "Repository format", mkt_normal, file.repo_format());
if (! file.sync().empty())
- repository_sync.reset(new LiteralMetadataValueKey<std::string>(
- "REPOSITORY_SYNC", "Repository sync", mkt_normal, file.sync()));
+ repository_sync = std::make_shared<LiteralMetadataValueKey<std::string>>(
+ "REPOSITORY_SYNC", "Repository sync", mkt_normal, file.sync());
{
std::shared_ptr<Mask> mask(new UnavailableMask);
@@ -194,8 +194,8 @@ UnavailableRepositoryStore::_populate_one(const Environment * const env, const F
const std::shared_ptr<NoConfigurationInformationMask> no_configuration_mask(new NoConfigurationInformationMask);
std::shared_ptr<UnavailableRepositoryDependenciesKey> deps;
if (! file.dependencies().empty())
- deps.reset(new UnavailableRepositoryDependenciesKey(env, "dependencies", "Dependencies", mkt_dependencies,
- file.dependencies()));
+ deps = std::make_shared<UnavailableRepositoryDependenciesKey>(env, "dependencies", "Dependencies", mkt_dependencies,
+ file.dependencies());
const std::shared_ptr<UnavailableRepositoryID> id(new UnavailableRepositoryID(
make_named_values<UnavailableRepositoryIDParams>(
diff --git a/paludis/repositories/unpackaged/installed_id.cc b/paludis/repositories/unpackaged/installed_id.cc
index 1b0be76..c3dd4e4 100644
--- a/paludis/repositories/unpackaged/installed_id.cc
+++ b/paludis/repositories/unpackaged/installed_id.cc
@@ -130,7 +130,7 @@ namespace
return _v;
using namespace std::placeholders;
- _v.reset(new Contents);
+ _v = std::make_shared<Contents>();
_db->parse_contents(*_id,
std::bind(&Contents::add, _v.get(), std::placeholders::_1),
std::bind(&Contents::add, _v.get(), std::placeholders::_1),
@@ -217,8 +217,8 @@ namespace
Context context("When reading '" + stringify(_f) + "' as an InstalledUnpackagedStringKey:");
SafeIFStream f(_f);
- _v.reset(new std::string(
- strip_trailing(std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>()), "\n")));
+ _v = std::make_shared<std::string>(
+ strip_trailing(std::string((std::istreambuf_iterator<char>(f)), std::istreambuf_iterator<char>()), "\n"));
return *_v;
}
@@ -269,7 +269,7 @@ namespace
if (_v)
return _v;
- _v.reset(new Set<std::string>());
+ _v = std::make_shared<Set<std::string>>();
for (FSEntrySequence::ConstIterator a(_f.begin()), a_end(_f.end()) ;
a != a_end ; ++a)
{
@@ -437,29 +437,29 @@ namespace paludis
if ((l / "contents").exists())
{
- contents_key.reset(new InstalledUnpackagedContentsKey(id, d));
- installed_time_key.reset(new InstalledUnpackagedTimeKey(l / "contents"));
+ contents_key = std::make_shared<InstalledUnpackagedContentsKey>(id, d);
+ installed_time_key = std::make_shared<InstalledUnpackagedTimeKey>(l / "contents");
}
- from_repositories_key.reset(new InstalledUnpackagedStringSetKey("source_repository",
- "Source repository", mkt_normal));
+ from_repositories_key = std::make_shared<InstalledUnpackagedStringSetKey>("source_repository",
+ "Source repository", mkt_normal);
if ((l / "source_repository").exists())
from_repositories_key->add_source(l / "source_repository");
if ((l / "binary_repository").exists())
from_repositories_key->add_source(l / "binary_repository");
if ((l / "description").exists())
- description_key.reset(new InstalledUnpackagedStringKey("description", "Description", l / "description", mkt_significant));
+ description_key = std::make_shared<InstalledUnpackagedStringKey>("description", "Description", l / "description", mkt_significant);
if ((l / "build_dependencies").exists())
- build_dependencies_key.reset(new InstalledUnpackagedDependencyKey(env,
+ build_dependencies_key = std::make_shared<InstalledUnpackagedDependencyKey>(env,
"build_dependencies", "Build dependencies", l / "build_dependencies",
- build_dependencies_labels, mkt_dependencies));
+ build_dependencies_labels, mkt_dependencies);
if ((l / "run_dependencies").exists())
- run_dependencies_key.reset(new InstalledUnpackagedDependencyKey(env,
+ run_dependencies_key = std::make_shared<InstalledUnpackagedDependencyKey>(env,
"run_dependencies", "Run dependencies", l / "run_dependencies",
- run_dependencies_labels, mkt_dependencies));
+ run_dependencies_labels, mkt_dependencies);
}
};
}
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 42c7d9c..7568cbd 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -128,8 +128,8 @@ InstalledUnpackagedRepository::package_ids(const QualifiedPackageName & q) const
{
Lock l(*(*e).mutex());
if (! (*e).package_id())
- (*e).package_id().reset(new InstalledUnpackagedID(_imp->params.environment(), (*e).name(), (*e).version(),
- (*e).slot(), name(), (*e).fs_location(), (*e).magic(), installed_root_key()->value(), &_imp->ndbam));
+ (*e).package_id() = std::make_shared<InstalledUnpackagedID>(_imp->params.environment(), (*e).name(), (*e).version(),
+ (*e).slot(), name(), (*e).fs_location(), (*e).magic(), installed_root_key()->value(), &_imp->ndbam);
result->push_back((*e).package_id());
}
diff --git a/paludis/repositories/unpackaged/unpackaged_key.cc b/paludis/repositories/unpackaged/unpackaged_key.cc
index 7a4fe46..bd107fb 100644
--- a/paludis/repositories/unpackaged/unpackaged_key.cc
+++ b/paludis/repositories/unpackaged/unpackaged_key.cc
@@ -161,7 +161,7 @@ UnpackagedChoicesKey::value() const
Lock lock(_imp->mutex);
if (! _imp->value)
{
- _imp->value.reset(new Choices);
+ _imp->value = std::make_shared<Choices>();
std::shared_ptr<Choice> build_options(new Choice(make_named_values<ChoiceParams>(
n::consider_added_or_changed() = false,
n::contains_every_value() = false,
diff --git a/paludis/repositories/unwritten/unwritten_repository_file.cc b/paludis/repositories/unwritten/unwritten_repository_file.cc
index 5b19e37..16bca88 100644
--- a/paludis/repositories/unwritten/unwritten_repository_file.cc
+++ b/paludis/repositories/unwritten/unwritten_repository_file.cc
@@ -253,7 +253,7 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
(+simple_parser::any_of(" \t"))
))
{
- slot.reset(new LiteralMetadataValueKey<SlotName>("SLOT", "Slot", mkt_internal, SlotName(token)));
+ slot = std::make_shared<LiteralMetadataValueKey<SlotName>>("SLOT", "Slot", mkt_internal, SlotName(token));
if (line_parser.consume(
(+simple_parser::any_except(" \t") >> token)
@@ -287,7 +287,7 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
"Cannot parse body key = value line '" + line + " in '" + stringify(f) + "'");
if (! entry)
- entry.reset(new UnwrittenRepositoryFileEntry(make_named_values<UnwrittenRepositoryFileEntry>(
+ entry = std::make_shared<UnwrittenRepositoryFileEntry>(make_named_values<UnwrittenRepositoryFileEntry>(
n::added_by() = std::shared_ptr<const MetadataValueKey<std::string> >(),
n::bug_ids() = std::shared_ptr<const MetadataCollectionKey<Sequence<std::string> > >(),
n::comment() = std::shared_ptr<const MetadataValueKey<std::string> >(),
@@ -297,10 +297,10 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
n::remote_ids() = std::shared_ptr<const MetadataCollectionKey<Sequence<std::string> > >(),
n::slot() = slot,
n::version() = version
- )));
+ ));
if (token == "description")
- entry->description().reset(new LiteralMetadataValueKey<std::string>("description", "Description", mkt_significant, token2));
+ entry->description() = std::make_shared<LiteralMetadataValueKey<std::string>>("description", "Description", mkt_significant, token2);
else if (token == "homepage")
{
std::shared_ptr<AllDepSpec> all_spec(new AllDepSpec);
@@ -310,12 +310,12 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
tree->root()->append(std::make_shared<SimpleURIDepSpec>(*t));
- entry->homepage().reset(new UnwrittenHomepageKey("homepage", "Homepage", mkt_normal, tree));
+ entry->homepage() = std::make_shared<UnwrittenHomepageKey>("homepage", "Homepage", mkt_normal, tree);
}
else if (token == "comment")
- entry->comment().reset(new LiteralMetadataValueKey<std::string>("comment", "Comment", mkt_normal, token2));
+ entry->comment() = std::make_shared<LiteralMetadataValueKey<std::string>>("comment", "Comment", mkt_normal, token2);
else if (token == "added-by")
- entry->added_by().reset(new LiteralMetadataValueKey<std::string>("added-by", "Added by", mkt_author, token2));
+ entry->added_by() = std::make_shared<LiteralMetadataValueKey<std::string>>("added-by", "Added by", mkt_author, token2);
else if (token == "bug-ids")
{
std::shared_ptr<Sequence<std::string> > seq(new Sequence<std::string>);
@@ -324,7 +324,7 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
seq->push_back(*t);
- entry->bug_ids().reset(new LiteralMetadataStringSequenceKey("bug-ids", "Bug IDs", mkt_normal, seq));
+ entry->bug_ids() = std::make_shared<LiteralMetadataStringSequenceKey>("bug-ids", "Bug IDs", mkt_normal, seq);
}
else if (token == "remote-ids")
{
@@ -334,7 +334,7 @@ UnwrittenRepositoryFile::_load(const FSEntry & f)
for (std::list<std::string>::const_iterator t(tokens.begin()), t_end(tokens.end()) ;
t != t_end ; ++t)
seq->push_back(*t);
- entry->remote_ids().reset(new LiteralMetadataStringSequenceKey("remote-ids", "Remote IDs", mkt_internal, seq));
+ entry->remote_ids() = std::make_shared<LiteralMetadataStringSequenceKey>("remote-ids", "Remote IDs", mkt_internal, seq);
}
else
Log::get_instance()->message("unwritten_repository.file.unknown_key", ll_warning, lc_context)
diff --git a/paludis/resolver/decider.cc b/paludis/resolver/decider.cc
index c9e339c..208024d 100644
--- a/paludis/resolver/decider.cc
+++ b/paludis/resolver/decider.cc
@@ -1807,17 +1807,17 @@ Decider::_get_unmatching_constraints(
{
bool is_transient(id->behaviours_key() && id->behaviours_key()->value()->end() !=
id->behaviours_key()->value()->find("transient"));
- decision.reset(new ExistingNoChangeDecision(
+ decision = std::make_shared<ExistingNoChangeDecision>(
resolution->resolvent(),
id,
true,
true,
is_transient,
! (*c)->untaken()
- ));
+ );
}
else
- decision.reset(new ChangesToMakeDecision(
+ decision = std::make_shared<ChangesToMakeDecision>(
resolution->resolvent(),
id,
false,
@@ -1825,7 +1825,7 @@ Decider::_get_unmatching_constraints(
! (*c)->untaken(),
make_null_shared_ptr(),
std::function<void (const ChangesToMakeDecision &)>()
- ));
+ );
if (! _check_constraint(*c, decision))
result->add(*c);
}
diff --git a/paludis/resolver/decision.cc b/paludis/resolver/decision.cc
index fa990ea..23d0495 100644
--- a/paludis/resolver/decision.cc
+++ b/paludis/resolver/decision.cc
@@ -392,7 +392,7 @@ void
ChangesToMakeDecision::add_required_confirmation(const std::shared_ptr<const RequiredConfirmation> & r)
{
if (! _imp->required_confirmations)
- _imp->required_confirmations.reset(new RequiredConfirmations);
+ _imp->required_confirmations = std::make_shared<RequiredConfirmations>();
_imp->required_confirmations->push_back(r);
}
@@ -571,7 +571,7 @@ void
RemoveDecision::add_required_confirmation(const std::shared_ptr<const RequiredConfirmation> & r)
{
if (! _imp->required_confirmations)
- _imp->required_confirmations.reset(new RequiredConfirmations);
+ _imp->required_confirmations = std::make_shared<RequiredConfirmations>();
_imp->required_confirmations->push_back(r);
}
@@ -642,7 +642,7 @@ void
BreakDecision::add_required_confirmation(const std::shared_ptr<const RequiredConfirmation> & r)
{
if (! _imp->required_confirmations)
- _imp->required_confirmations.reset(new RequiredConfirmations);
+ _imp->required_confirmations = std::make_shared<RequiredConfirmations>();
_imp->required_confirmations->push_back(r);
}
diff --git a/paludis/resolver/package_or_block_dep_spec.cc b/paludis/resolver/package_or_block_dep_spec.cc
index 8d801d4..f8b40b2 100644
--- a/paludis/resolver/package_or_block_dep_spec.cc
+++ b/paludis/resolver/package_or_block_dep_spec.cc
@@ -136,7 +136,7 @@ PackageOrBlockDepSpec::deserialise(Deserialisation & d, const std::shared_ptr<co
}
if (! m->empty())
- annotations.reset(new ELikeAnnotations(m));
+ annotations = std::make_shared<ELikeAnnotations>(m);
if (block)
{
diff --git a/paludis/resolver/resolver_test.cc b/paludis/resolver/resolver_test.cc
index 820f77a..b86e2ca 100644
--- a/paludis/resolver/resolver_test.cc
+++ b/paludis/resolver/resolver_test.cc
@@ -345,7 +345,7 @@ ResolverTestCase::ResolverTestCase(const std::string & t, const std::string & s,
std::bind(from_keys, keys, std::placeholders::_1));
env.package_database()->add_repository(1, repo);
- keys.reset(new Map<std::string, std::string>);
+ keys = std::make_shared<Map<std::string, std::string>>();
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
@@ -355,13 +355,13 @@ ResolverTestCase::ResolverTestCase(const std::string & t, const std::string & s,
std::bind(from_keys, keys, std::placeholders::_1));
env.package_database()->add_repository(1, inst_repo);
- fake_inst_repo.reset(new FakeInstalledRepository(
+ fake_inst_repo = std::make_shared<FakeInstalledRepository>(
make_named_values<FakeInstalledRepositoryParams>(
n::environment() = &env,
n::name() = RepositoryName("fake-inst"),
n::suitable_destination() = true,
n::supports_uninstall() = true
- )));
+ ));
env.package_database()->add_repository(1, fake_inst_repo);
#ifdef ENABLE_VIRTUALS_REPOSITORY
diff --git a/paludis/set_file.cc b/paludis/set_file.cc
index 5875001..3a5e8a8 100644
--- a/paludis/set_file.cc
+++ b/paludis/set_file.cc
@@ -198,13 +198,13 @@ namespace
switch (params.set_operator_mode())
{
case sfsmo_natural:
- spec.reset(new NamedSetDepSpec(SetName(tokens.at(1))));
+ spec = std::make_shared<NamedSetDepSpec>(SetName(tokens.at(1)));
break;
case sfsmo_star:
{
std::pair<SetName, SetFileSetOperatorMode> s(find_base_set_name_and_suffix_mode(SetName(tokens.at(1))));
- spec.reset(new NamedSetDepSpec(SetName(stringify(s.first) + "*")));
+ spec = std::make_shared<NamedSetDepSpec>(SetName(stringify(s.first) + "*"));
}
break;
@@ -322,7 +322,7 @@ SimpleHandler::_create_contents() const
{
Context context("When parsing atoms in simple set file '" + stringify(_p.file_name()) + "':");
- _contents.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ _contents = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
for (std::list<std::string>::const_iterator i(_lines.begin()), i_end(_lines.end()) ;
i != i_end ; ++i)
{
@@ -451,7 +451,7 @@ PaludisConfHandler::_create_contents() const
{
Context context("When parsing atoms in paludis conf set file '" + stringify(_p.file_name()) + "':");
- _contents.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ _contents = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
for (std::list<std::string>::const_iterator i(_lines.begin()), i_end(_lines.end()) ;
i != i_end ; ++i)
do_one_conf_line(*i, _contents, _p);
@@ -532,7 +532,7 @@ PaludisBashHandler::PaludisBashHandler(const SetFileParams & p) :
_p(p)
{
Context context("When loading paludis bash set file '" + stringify(_p.file_name()) + "':");
- _contents.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ _contents = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
std::stringstream s;
Command cmd(Command("bash '" + stringify(_p.file_name()) + "'")
@@ -556,7 +556,7 @@ PaludisBashHandler::PaludisBashHandler(const SetFileParams & p) :
Log::get_instance()->message("set_file.script.failure", ll_warning, lc_context)
<< "Set file script '" << _p.file_name() << "' returned non-zero exit status '"
<< exit_status << "'";
- _contents.reset(new SetSpecTree(std::make_shared<AllDepSpec>()));
+ _contents = std::make_shared<SetSpecTree>(std::make_shared<AllDepSpec>());
}
}
diff --git a/paludis/util/fs_entry.cc b/paludis/util/fs_entry.cc
index d79b1aa..ec9f8bc 100644
--- a/paludis/util/fs_entry.cc
+++ b/paludis/util/fs_entry.cc
@@ -98,7 +98,7 @@ namespace paludis
#ifdef HAVE_DIRENT_DTYPE
if (DT_UNKNOWN != d_type)
{
- stat_info.reset(new struct ::stat);
+ stat_info = std::make_shared<struct ::stat>();
stat_info->st_mode = DTTOIF(d_type);
checked = ifse_type;
}
@@ -399,7 +399,7 @@ FSEntry::_stat() const
Context context("When calling stat() on '" + stringify(_imp->path) + "':");
- _imp->stat_info.reset(new struct stat);
+ _imp->stat_info = std::make_shared<struct stat>();
if (0 != lstat(_imp->path.c_str(), _imp->stat_info.get()))
{
if (errno != ENOENT && errno != ENOTDIR)
diff --git a/paludis/util/system.cc b/paludis/util/system.cc
index 2a48f49..17c7e11 100644
--- a/paludis/util/system.cc
+++ b/paludis/util/system.cc
@@ -311,8 +311,8 @@ Command::with_clearenv()
Command &
Command::with_uid_gid(const uid_t u, const gid_t g)
{
- _imp->uid.reset(new uid_t(u));
- _imp->gid.reset(new gid_t(g));
+ _imp->uid = std::make_shared<uid_t>(u);
+ _imp->gid = std::make_shared<gid_t>(g);
return *this;
}
@@ -567,18 +567,18 @@ paludis::run_command(const Command & cmd)
std::shared_ptr<Channel> captured_stdout, captured_stderr;
if (cmd.pipe_command_handler())
{
- pipe_command_reader.reset(new Pipe);
- pipe_command_response.reset(new Pipe);
+ pipe_command_reader = std::make_shared<Pipe>();
+ pipe_command_response = std::make_shared<Pipe>();
}
if (cmd.captured_stdout_stream())
captured_stdout.reset(cmd.ptys() ? static_cast<Channel *>(new Pty) : new Pipe);
if (cmd.captured_stderr_stream())
captured_stderr.reset(cmd.ptys() ? static_cast<Channel *>(new Pty) : new Pipe);
if (cmd.output_stream())
- output_stream.reset(new Pipe);
+ output_stream = std::make_shared<Pipe>();
if (cmd.input_stream())
{
- input_stream.reset(new Pipe);
+ input_stream = std::make_shared<Pipe>();
int arg(fcntl(input_stream->write_fd(), F_GETFL, NULL));
if (-1 == arg)
throw RunCommandError("fcntl F_GETFL failed: " + stringify(strerror(errno)));
@@ -1131,7 +1131,7 @@ paludis::become_command(const Command & cmd)
std::shared_ptr<Pipe> input_stream;
if (cmd.input_stream())
{
- input_stream.reset(new Pipe);
+ input_stream = std::make_shared<Pipe>();
int cmd_input_fd;
diff --git a/paludis/util/wrapped_value-impl.hh b/paludis/util/wrapped_value-impl.hh
index f8ef9be..a1f137c 100644
--- a/paludis/util/wrapped_value-impl.hh
+++ b/paludis/util/wrapped_value-impl.hh
@@ -48,7 +48,7 @@ namespace paludis
const typename WrappedValueDevoid<typename WrappedValueTraits<Tag_>::ValidationParamsType>::Type & p)
{
if (WrappedValueValidate<Tag_, typename WrappedValueTraits<Tag_>::ValidationParamsType>::Type::validate(v, p))
- _value.reset(new typename WrappedValueTraits<Tag_>::UnderlyingType(v));
+ _value = std::make_shared<typename WrappedValueTraits<Tag_>::UnderlyingType>(v);
else
throw typename WrappedValueTraits<Tag_>::ExceptionType(v);
}
diff --git a/ruby/dep_spec.cc b/ruby/dep_spec.cc
index 689954d..1f180e1 100644
--- a/ruby/dep_spec.cc
+++ b/ruby/dep_spec.cc
@@ -187,61 +187,61 @@ namespace
void visit(const GenericSpecTree::NodeType<PackageDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<PackageDepSpec>(std::static_pointer_cast<PackageDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<PackageDepSpec>>(std::static_pointer_cast<PackageDepSpec>(node.spec()->clone()));
klass = c_package_dep_spec;
}
void visit(const GenericSpecTree::NodeType<BlockDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<BlockDepSpec>(std::static_pointer_cast<BlockDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<BlockDepSpec>>(std::static_pointer_cast<BlockDepSpec>(node.spec()->clone()));
klass = c_block_dep_spec;
}
void visit(const GenericSpecTree::NodeType<PlainTextDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<PlainTextDepSpec>(std::static_pointer_cast<PlainTextDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<PlainTextDepSpec>>(std::static_pointer_cast<PlainTextDepSpec>(node.spec()->clone()));
klass = c_plain_text_dep_spec;
}
void visit(const GenericSpecTree::NodeType<SimpleURIDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<SimpleURIDepSpec>(std::static_pointer_cast<SimpleURIDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<SimpleURIDepSpec>>(std::static_pointer_cast<SimpleURIDepSpec>(node.spec()->clone()));
klass = c_simple_uri_dep_spec;
}
void visit(const GenericSpecTree::NodeType<FetchableURIDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<FetchableURIDepSpec>(std::static_pointer_cast<FetchableURIDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<FetchableURIDepSpec>>(std::static_pointer_cast<FetchableURIDepSpec>(node.spec()->clone()));
klass = c_fetchable_uri_dep_spec;
}
void visit(const GenericSpecTree::NodeType<URILabelsDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<URILabelsDepSpec>(std::static_pointer_cast<URILabelsDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<URILabelsDepSpec>>(std::static_pointer_cast<URILabelsDepSpec>(node.spec()->clone()));
klass = c_uri_labels_dep_spec;
}
void visit(const GenericSpecTree::NodeType<PlainTextLabelDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<PlainTextLabelDepSpec>(std::static_pointer_cast<PlainTextLabelDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<PlainTextLabelDepSpec>>(std::static_pointer_cast<PlainTextLabelDepSpec>(node.spec()->clone()));
klass = c_plain_text_label_dep_spec;
}
void visit(const GenericSpecTree::NodeType<DependenciesLabelsDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<DependenciesLabelsDepSpec>(std::static_pointer_cast<DependenciesLabelsDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<DependenciesLabelsDepSpec>>(std::static_pointer_cast<DependenciesLabelsDepSpec>(node.spec()->clone()));
klass = c_dependencies_labels_dep_spec;
}
void visit(const GenericSpecTree::NodeType<NamedSetDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<NamedSetDepSpec>(std::static_pointer_cast<NamedSetDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<NamedSetDepSpec>>(std::static_pointer_cast<NamedSetDepSpec>(node.spec()->clone()));
klass = c_named_set_dep_spec;
}
void visit(const GenericSpecTree::NodeType<LicenseDepSpec>::Type & node)
{
- wrapped.reset(new WrappedSpec<LicenseDepSpec>(std::static_pointer_cast<LicenseDepSpec>(node.spec()->clone())));
+ wrapped = std::make_shared<WrappedSpec<LicenseDepSpec>>(std::static_pointer_cast<LicenseDepSpec>(node.spec()->clone()));
klass = c_license_dep_spec;
}
@@ -354,7 +354,7 @@ namespace
{
static void handle(ValueToTree<H_> * const t, const WrappedSpec<AllDepSpec> & spec)
{
- t->result.reset(new H_(spec.spec()));
+ t->result = std::make_shared<H_>(spec.spec());
t->add_to = t->result->root();
}
};
diff --git a/src/clients/accerso/accerso.cc b/src/clients/accerso/accerso.cc
index baac1b7..69d4894 100644
--- a/src/clients/accerso/accerso.cc
+++ b/src/clients/accerso/accerso.cc
@@ -210,7 +210,7 @@ main(int argc, char *argv[])
std::shared_ptr<SafeOFStream> outf;
if (CommandLine::get_instance()->a_report_file.specified())
- outf.reset(new SafeOFStream(FSEntry(CommandLine::get_instance()->a_report_file.argument())));
+ outf = std::make_shared<SafeOFStream>(FSEntry(CommandLine::get_instance()->a_report_file.argument()));
std::ostream & out(outf ? *outf : cout);
diff --git a/src/clients/adjutrix/find_reverse_deps.cc b/src/clients/adjutrix/find_reverse_deps.cc
index 7ea1991..bd267fd 100644
--- a/src/clients/adjutrix/find_reverse_deps.cc
+++ b/src/clients/adjutrix/find_reverse_deps.cc
@@ -260,8 +260,8 @@ int do_find_reverse_deps(NoConfigEnvironment & env)
std::shared_ptr<PackageDepSpec> spec;
try
{
- spec.reset(new PackageDepSpec(parse_user_package_dep_spec(*CommandLine::get_instance()->begin_parameters(),
- &env, UserPackageDepSpecOptions())));
+ spec = std::make_shared<PackageDepSpec>(parse_user_package_dep_spec(*CommandLine::get_instance()->begin_parameters(),
+ &env, UserPackageDepSpecOptions()));
}
catch (const AmbiguousPackageNameError & e)
{
diff --git a/src/clients/adjutrix/what_needs_keywording.cc b/src/clients/adjutrix/what_needs_keywording.cc
index 013d00f..c387745 100644
--- a/src/clients/adjutrix/what_needs_keywording.cc
+++ b/src/clients/adjutrix/what_needs_keywording.cc
@@ -77,7 +77,7 @@ int do_what_needs_keywording(NoConfigEnvironment & env)
d_options.circular() = dl_circular_discard_silently;
d_options.use() = dl_use_deps_take_all;
d_options.blocks() = dl_blocks_discard_completely;
- d_options.override_masks().reset(new DepListOverrideMasksFunctions);
+ d_options.override_masks() = std::make_shared<DepListOverrideMasksFunctions>();
d_options.override_masks()->push_back(std::bind(&override_tilde_keywords, &env, _1, _2));
d_options.override_masks()->push_back(std::bind(&override_unkeyworded, &env, _1, _2));
d_options.override_masks()->push_back(std::bind(&override_repository_masks, _2));
diff --git a/src/clients/cave/cmd_fix_linkage.cc b/src/clients/cave/cmd_fix_linkage.cc
index 6036246..bcd33c5 100644
--- a/src/clients/cave/cmd_fix_linkage.cc
+++ b/src/clients/cave/cmd_fix_linkage.cc
@@ -171,7 +171,7 @@ FixLinkageCommand::run(
DisplayCallback display_callback("Searching: ");
ScopedNotifierCallback display_callback_holder(env.get(),
NotifierCallbackFunction(std::cref(display_callback)));
- finder.reset(new BrokenLinkageFinder(env.get(), cmdline.a_library.argument()));
+ finder = std::make_shared<BrokenLinkageFinder>(env.get(), cmdline.a_library.argument());
}
if (finder->begin_broken_packages() == finder->end_broken_packages())
diff --git a/src/clients/cave/cmd_perform.cc b/src/clients/cave/cmd_perform.cc
index 8722c28..b93611b 100644
--- a/src/clients/cave/cmd_perform.cc
+++ b/src/clients/cave/cmd_perform.cc
@@ -198,11 +198,11 @@ namespace
const std::shared_ptr<const PackageID> & id)
{
if (cmdline.a_managed_output.specified())
- manager_if_ipc.reset(new OutputManagerFromIPC(e, id, get_output_exclusivity(cmdline),
- ClientOutputFeatures() + cof_summary_at_end));
+ manager_if_ipc = std::make_shared<OutputManagerFromIPC>(e, id, get_output_exclusivity(cmdline),
+ ClientOutputFeatures() + cof_summary_at_end);
else
- manager_if_env.reset(new OutputManagerFromEnvironment(e, id, get_output_exclusivity(cmdline),
- ClientOutputFeatures() + cof_summary_at_end));
+ manager_if_env = std::make_shared<OutputManagerFromEnvironment>(e, id, get_output_exclusivity(cmdline),
+ ClientOutputFeatures() + cof_summary_at_end);
}
const std::shared_ptr<OutputManager> operator() (const Action & a)
diff --git a/src/clients/cave/cmd_sync.cc b/src/clients/cave/cmd_sync.cc
index 141a624..e50ee48 100644
--- a/src/clients/cave/cmd_sync.cc
+++ b/src/clients/cave/cmd_sync.cc
@@ -150,7 +150,7 @@ namespace
{
cout << format_general_spad(f::sync_repo_starting(), stringify(name), executor->pending(),
executor->active(), executor->done());
- output_manager.reset(new StandardOutputManager);
+ output_manager = std::make_shared<StandardOutputManager>();
if (0 != env->perform_hook(Hook("sync_pre")
("TARGET", stringify(name))
diff --git a/src/clients/cave/man_cave.cc b/src/clients/cave/man_cave.cc
index fbda254..a7a43d5 100644
--- a/src/clients/cave/man_cave.cc
+++ b/src/clients/cave/man_cave.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
@@ -69,9 +69,9 @@ main(int argc, char * argv[])
std::shared_ptr<paludis::args::DocWriter> w;
if (cmdline.a_html.specified())
- w.reset(new paludis::args::HtmlWriter(cout));
+ w = std::make_shared<paludis::args::HtmlWriter>(cout);
else
- w.reset(new paludis::args::ManWriter(cout));
+ w = std::make_shared<paludis::args::ManWriter>(cout);
if (cmdline.begin_parameters() == cmdline.end_parameters())
{
diff --git a/src/clients/cave/resolve_common.cc b/src/clients/cave/resolve_common.cc
index 608f0cb..cb1fdc1 100644
--- a/src/clients/cave/resolve_common.cc
+++ b/src/clients/cave/resolve_common.cc
@@ -1756,23 +1756,23 @@ paludis::cave::resolve_common(
if ((*r)->destination_interface())
{
if (all_binary_repos_generator)
- all_binary_repos_generator.reset(new generator::Union(*all_binary_repos_generator,
- generator::InRepository((*r)->name())));
+ all_binary_repos_generator = std::make_shared<generator::Union>(*all_binary_repos_generator,
+ generator::InRepository((*r)->name()));
else
- all_binary_repos_generator.reset(new generator::InRepository((*r)->name()));
+ all_binary_repos_generator = std::make_shared<generator::InRepository>((*r)->name());
}
else
{
if (not_binary_repos_generator)
- not_binary_repos_generator.reset(new generator::Union(*not_binary_repos_generator,
- generator::InRepository((*r)->name())));
+ not_binary_repos_generator = std::make_shared<generator::Union>(*not_binary_repos_generator,
+ generator::InRepository((*r)->name()));
else
- not_binary_repos_generator.reset(new generator::InRepository((*r)->name()));
+ not_binary_repos_generator = std::make_shared<generator::InRepository>((*r)->name());
}
}
if (! all_binary_repos_generator)
- all_binary_repos_generator.reset(new generator::Nothing());
+ all_binary_repos_generator = std::make_shared<generator::Nothing>();
for (args::StringSetArg::ConstIterator i(resolution_options.a_preset.begin_args()),
i_end(resolution_options.a_preset.end_args()) ;
@@ -1876,7 +1876,7 @@ paludis::cave::resolve_common(
if (purge)
{
resolver->purge();
- targets_cleaned_up.reset(new Sequence<std::string>);
+ targets_cleaned_up = std::make_shared<Sequence<std::string>>();
} else
targets_cleaned_up = add_resolver_targets(env, resolver, resolution_options, targets_if_not_purge, is_set);
resolver->resolve();
diff --git a/src/clients/instruo/instruo.cc b/src/clients/instruo/instruo.cc
index aae3bae..638e34a 100644
--- a/src/clients/instruo/instruo.cc
+++ b/src/clients/instruo/instruo.cc
@@ -359,7 +359,7 @@ main(int argc, char *argv[])
std::shared_ptr<SafeOFStream> outf;
if (CommandLine::get_instance()->a_report_file.specified())
- outf.reset(new SafeOFStream(FSEntry(CommandLine::get_instance()->a_report_file.argument())));
+ outf = std::make_shared<SafeOFStream>(FSEntry(CommandLine::get_instance()->a_report_file.argument()));
std::ostream & out(outf ? *outf : cout);
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index 12b0f75..1a809e9 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -301,10 +301,10 @@ ConsoleInstallTask::on_build_deplist_pre()
output_activity_start_message("Building dependency list: ");
output_xterm_title("Building dependency list");
- _callback_displayer.reset(new CallbackDisplayer(output_stream()));
- _notifier_callback.reset(new NotifierCallbackID(environment()->add_notifier_callback(
+ _callback_displayer = std::make_shared<CallbackDisplayer>(output_stream());
+ _notifier_callback = std::make_shared<NotifierCallbackID>(environment()->add_notifier_callback(
std::bind(std::mem_fn(&ConsoleInstallTask::_notifier_callback_fn),
- this, std::placeholders::_1))));
+ this, std::placeholders::_1)));
}
void
@@ -507,7 +507,7 @@ ConsoleInstallTask::on_display_merge_list_entry(const DepListEntry & d)
std::shared_ptr<RepositoryName> repo;
if (d.destination())
- repo.reset(new RepositoryName(d.destination()->name()));
+ repo = std::make_shared<RepositoryName>(d.destination()->name());
std::shared_ptr<const PackageIDSequence> existing_repo((*environment())[selection::AllVersionsSorted(repo ?
generator::Matches(make_package_dep_spec(PartiallyMadePackageDepSpecOptions())