aboutsummaryrefslogtreecommitdiff
path: root/paludis
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-03-09 14:07:05 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-03-09 14:07:05 +0000
commita297ce7c92fc48b2e5f7df4a2624c25ddab3b81d (patch)
treef3d4c5c11709d26bebdf0e7e424b569dcd992253 /paludis
parent410f8b38e6bb0feb13e2d5e5c3ac34c4e87c0fee (diff)
downloadpaludis-a297ce7c92fc48b2e5f7df4a2624c25ddab3b81d.tar.gz
paludis-a297ce7c92fc48b2e5f7df4a2624c25ddab3b81d.tar.xz
world is now in env, not repos. Fixes: ticket:421
Diffstat (limited to 'paludis')
-rw-r--r--paludis/environment.hh27
-rw-r--r--paludis/environment_implementation.cc7
-rw-r--r--paludis/environment_implementation.hh5
-rw-r--r--paludis/environments/adapted/adapted_environment.cc26
-rw-r--r--paludis/environments/adapted/adapted_environment.hh10
-rw-r--r--paludis/environments/no_config/no_config_environment.cc26
-rw-r--r--paludis/environments/no_config/no_config_environment.hh14
-rw-r--r--paludis/environments/paludis/Makefile.am2
-rw-r--r--paludis/environments/paludis/paludis_config.cc19
-rw-r--r--paludis/environments/paludis/paludis_config.hh4
-rw-r--r--paludis/environments/paludis/paludis_environment.cc31
-rw-r--r--paludis/environments/paludis/paludis_environment.hh13
-rw-r--r--paludis/environments/paludis/world.cc180
-rw-r--r--paludis/environments/paludis/world.hh57
-rw-r--r--paludis/environments/portage/portage_environment.cc119
-rw-r--r--paludis/environments/portage/portage_environment.hh16
-rw-r--r--paludis/environments/test/test_environment.cc28
-rw-r--r--paludis/environments/test/test_environment.hh13
-rw-r--r--paludis/install_task.cc13
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc107
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh10
-rw-r--r--paludis/repositories/cran/cran_installed_repository.sr1
-rw-r--r--paludis/repositories/cran/cran_repository.cc1
-rw-r--r--paludis/repositories/e/e_installed_repository.cc92
-rw-r--r--paludis/repositories/e/e_installed_repository.hh14
-rw-r--r--paludis/repositories/e/e_installed_repository.sr2
-rw-r--r--paludis/repositories/e/e_repository.cc1
-rw-r--r--paludis/repositories/e/exndbam_repository.cc22
-rw-r--r--paludis/repositories/e/exndbam_repository.sr2
-rw-r--r--paludis/repositories/e/vdb_repository.cc20
-rw-r--r--paludis/repositories/e/vdb_repository.sr2
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc139
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc1
-rw-r--r--paludis/repositories/fake/fake_repository.cc2
-rw-r--r--paludis/repositories/gems/gems_repository.cc1
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc1
-rw-r--r--paludis/repositories/unpackaged/installed_repository.cc1
-rw-r--r--paludis/repositories/unpackaged/unpackaged_repository.cc1
-rw-r--r--paludis/repositories/virtuals/installed_virtuals_repository.cc1
-rw-r--r--paludis/repositories/virtuals/virtuals_repository.cc1
-rw-r--r--paludis/repository-fwd.hh2
-rw-r--r--paludis/repository.cc4
-rw-r--r--paludis/repository.hh38
-rw-r--r--paludis/uninstall_task.cc14
44 files changed, 621 insertions, 469 deletions
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 21f70f398..2d7351f7a 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 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
@@ -293,6 +293,31 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
///\}
+
+ ///\name World functionality
+ ///\{
+
+ /**
+ * Add this package to world.
+ */
+ virtual void add_to_world(const QualifiedPackageName &) const = 0;
+
+ /**
+ * Add this set to world.
+ */
+ virtual void add_to_world(const SetName &) const = 0;
+
+ /**
+ * Remove this package from world, if it is present.
+ */
+ virtual void remove_from_world(const QualifiedPackageName &) const = 0;
+
+ /**
+ * Remove this set from world, if it is present.
+ */
+ virtual void remove_from_world(const SetName &) const = 0;
+
+ ///\}
};
}
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index e30afd9f8..28a2fa69a 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -128,6 +128,13 @@ EnvironmentImplementation::set(const SetName & s) const
result->add(make_shared_ptr(new TreeLeaf<SetSpecTree, NamedSetDepSpec>(
make_shared_ptr(new NamedSetDepSpec(SetName("system"))))));
+ if ("world" == s.data())
+ {
+ tr1::shared_ptr<SetSpecTree::ConstItem> w(world_set());
+ if (w)
+ result->add(w);
+ }
+
if (! result)
Log::get_instance()->message(ll_debug, lc_context) << "No match for set '" << s << "'";
return result;
diff --git a/paludis/environment_implementation.hh b/paludis/environment_implementation.hh
index 14146a3d2..1d7b0b733 100644
--- a/paludis/environment_implementation.hh
+++ b/paludis/environment_implementation.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 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
@@ -53,6 +53,9 @@ namespace paludis
virtual tr1::shared_ptr<SetSpecTree::ConstItem> local_set(const SetName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<SetSpecTree::ConstItem> world_set() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
public:
///\name Basic operations
///\{
diff --git a/paludis/environments/adapted/adapted_environment.cc b/paludis/environments/adapted/adapted_environment.cc
index d4736ffb8..17e67cfa0 100644
--- a/paludis/environments/adapted/adapted_environment.cc
+++ b/paludis/environments/adapted/adapted_environment.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -238,3 +238,27 @@ AdaptedEnvironment::is_paludis_package(const QualifiedPackageName & q) const
return _imp->env->is_paludis_package(q);
}
+void
+AdaptedEnvironment::add_to_world(const QualifiedPackageName & q) const
+{
+ _imp->env->add_to_world(q);
+}
+
+void
+AdaptedEnvironment::add_to_world(const SetName & s) const
+{
+ _imp->env->add_to_world(s);
+}
+
+void
+AdaptedEnvironment::remove_from_world(const QualifiedPackageName & q) const
+{
+ _imp->env->remove_from_world(q);
+}
+
+void
+AdaptedEnvironment::remove_from_world(const SetName & s) const
+{
+ _imp->env->remove_from_world(s);
+}
+
diff --git a/paludis/environments/adapted/adapted_environment.hh b/paludis/environments/adapted/adapted_environment.hh
index 0683eb188..e64d0ff75 100644
--- a/paludis/environments/adapted/adapted_environment.hh
+++ b/paludis/environments/adapted/adapted_environment.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -127,6 +127,14 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
virtual bool is_paludis_package(const QualifiedPackageName &) const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void add_to_world(const QualifiedPackageName &) const;
+
+ virtual void add_to_world(const SetName &) const;
+
+ virtual void remove_from_world(const QualifiedPackageName &) const;
+
+ virtual void remove_from_world(const SetName &) const;
};
}
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index dd9657ff0..c75ecf3b5 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -364,6 +364,32 @@ NoConfigEnvironment::local_set(const SetName &) const
return tr1::shared_ptr<SetSpecTree::ConstItem>();
}
+tr1::shared_ptr<SetSpecTree::ConstItem>
+NoConfigEnvironment::world_set() const
+{
+ return tr1::shared_ptr<SetSpecTree::ConstItem>();
+}
+
+void
+NoConfigEnvironment::add_to_world(const QualifiedPackageName &) const
+{
+}
+
+void
+NoConfigEnvironment::remove_from_world(const QualifiedPackageName &) const
+{
+}
+
+void
+NoConfigEnvironment::add_to_world(const SetName &) const
+{
+}
+
+void
+NoConfigEnvironment::remove_from_world(const SetName &) const
+{
+}
+
bool
NoConfigEnvironment::unmasked_by_user(const PackageID &) const
{
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 9c49b0641..1946be2f1 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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,10 +58,12 @@ namespace paludis
private InstantiationPolicy<NoConfigEnvironment, instantiation_method::NonCopyableTag>
{
protected:
-
virtual tr1::shared_ptr<SetSpecTree::ConstItem> local_set(const SetName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<SetSpecTree::ConstItem> world_set() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
public:
///\name Basic operations
///\{
@@ -156,6 +158,14 @@ namespace paludis
virtual HookResult perform_hook(const Hook &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void add_to_world(const QualifiedPackageName &) const;
+
+ virtual void add_to_world(const SetName &) const;
+
+ virtual void remove_from_world(const QualifiedPackageName &) const;
+
+ virtual void remove_from_world(const SetName &) const;
};
}
diff --git a/paludis/environments/paludis/Makefile.am b/paludis/environments/paludis/Makefile.am
index 1bbd956ec..3c059b487 100644
--- a/paludis/environments/paludis/Makefile.am
+++ b/paludis/environments/paludis/Makefile.am
@@ -18,6 +18,7 @@ libpaludispaludisenvironment_la_SOURCES = \
package_mask_conf.cc package_mask_conf.hh \
use_conf.cc use_conf.hh \
mirrors_conf.cc mirrors_conf.hh \
+ world.cc world.hh \
paludis_config.cc paludis_config.hh \
paludis_environment.cc paludis_environment.hh \
registration.cc
@@ -55,6 +56,7 @@ paludis_environment_paludis_include_HEADERS = \
licenses_conf.hh \
bashable_conf.hh \
package_mask_conf.hh \
+ world.hh \
mirrors_conf.hh
EXTRA_DIST = \
diff --git a/paludis/environments/paludis/paludis_config.cc b/paludis/environments/paludis/paludis_config.cc
index 603f44b04..f8969d6cb 100644
--- a/paludis/environments/paludis/paludis_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -24,6 +24,7 @@
#include <paludis/environments/paludis/mirrors_conf.hh>
#include <paludis/environments/paludis/licenses_conf.hh>
#include <paludis/environments/paludis/package_mask_conf.hh>
+#include <paludis/environments/paludis/world.hh>
#include <paludis/util/config_file.hh>
#include <paludis/distribution.hh>
@@ -100,6 +101,7 @@ namespace paludis
tr1::shared_ptr<PackageMaskConf> package_mask_conf;
tr1::shared_ptr<PackageMaskConf> package_unmask_conf;
tr1::shared_ptr<MirrorsConf> mirrors_conf;
+ mutable tr1::shared_ptr<World> world;
mutable Mutex reduced_mutex;
mutable tr1::shared_ptr<uid_t> reduced_uid;
@@ -143,6 +145,7 @@ namespace paludis
Context context("When loading environment.conf:");
tr1::shared_ptr<KeyValueConfigFile> kv;
+ tr1::shared_ptr<FSEntry> world_file;
if ((FSEntry(config_dir) / "environment.conf").exists())
kv.reset(new KeyValueConfigFile(FSEntry(config_dir) / "environment.conf", KeyValueConfigFileOptions()));
@@ -182,8 +185,17 @@ namespace paludis
accept_breaks_portage = kv->get("portage_compatible").empty();
distribution = kv->get("distribution");
+
+ if (! kv->get("world").empty())
+ world_file.reset(new FSEntry(kv->get("world")));
}
+ if (! world_file)
+ Log::get_instance()->message(ll_warning, lc_context) << "No world file specified. You should "
+ "specify 'world = /path/to/world/file' in " << (FSEntry(config_dir) / "environment.conf")
+ << ". Any attempted updates to world will not be saved.";
+ world.reset(new World(env, world_file));
+
has_environment_conf = true;
}
}
@@ -705,6 +717,13 @@ PaludisConfig::mirrors_conf() const
return _imp->mirrors_conf;
}
+tr1::shared_ptr<const World>
+PaludisConfig::world() const
+{
+ _imp->need_environment_conf();
+ return _imp->world;
+}
+
std::string
PaludisConfig::distribution() const
{
diff --git a/paludis/environments/paludis/paludis_config.hh b/paludis/environments/paludis/paludis_config.hh
index 853480551..93d901ff3 100644
--- a/paludis/environments/paludis/paludis_config.hh
+++ b/paludis/environments/paludis/paludis_config.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2008 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
@@ -49,6 +49,7 @@ namespace paludis
struct LicensesConf;
struct PackageMaskConf;
struct MirrorsConf;
+ struct World;
/**
* A PaludisConfigError is thrown if a configuration error is encountered
@@ -119,6 +120,7 @@ namespace paludis
tr1::shared_ptr<const PackageMaskConf> package_mask_conf() const;
tr1::shared_ptr<const PackageMaskConf> package_unmask_conf() const;
tr1::shared_ptr<const MirrorsConf> mirrors_conf() const;
+ tr1::shared_ptr<const World> world() const;
///\}
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 892bf178a..555eb89e2 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -24,6 +24,7 @@
#include <paludis/environments/paludis/package_mask_conf.hh>
#include <paludis/environments/paludis/licenses_conf.hh>
#include <paludis/environments/paludis/mirrors_conf.hh>
+#include <paludis/environments/paludis/world.hh>
#include <paludis/repository_maker.hh>
@@ -386,6 +387,36 @@ PaludisEnvironment::local_set(const SetName & s) const
}
}
+tr1::shared_ptr<SetSpecTree::ConstItem>
+PaludisEnvironment::world_set() const
+{
+ return _imp->config->world()->world_set();
+}
+
+void
+PaludisEnvironment::add_to_world(const QualifiedPackageName & q) const
+{
+ _imp->config->world()->add_to_world(q);
+}
+
+void
+PaludisEnvironment::add_to_world(const SetName & s) const
+{
+ _imp->config->world()->add_to_world(s);
+}
+
+void
+PaludisEnvironment::remove_from_world(const QualifiedPackageName & q) const
+{
+ _imp->config->world()->remove_from_world(q);
+}
+
+void
+PaludisEnvironment::remove_from_world(const SetName & s) const
+{
+ _imp->config->world()->remove_from_world(s);
+}
+
tr1::shared_ptr<const SetNameSet>
PaludisEnvironment::set_names() const
{
diff --git a/paludis/environments/paludis/paludis_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index 148ec4427..af767695f 100644
--- a/paludis/environments/paludis/paludis_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 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
@@ -50,9 +50,10 @@ namespace paludis
private PrivateImplementationPattern<PaludisEnvironment>
{
protected:
-
virtual tr1::shared_ptr<SetSpecTree::ConstItem> local_set(const SetName & id) const;
+ virtual tr1::shared_ptr<SetSpecTree::ConstItem> world_set() const;
+
public:
///\name Basic operations
///\{
@@ -138,6 +139,14 @@ namespace paludis
virtual bool unmasked_by_user(const PackageID &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void add_to_world(const QualifiedPackageName &) const;
+
+ virtual void add_to_world(const SetName &) const;
+
+ virtual void remove_from_world(const QualifiedPackageName &) const;
+
+ virtual void remove_from_world(const SetName &) const;
};
}
#endif
diff --git a/paludis/environments/paludis/world.cc b/paludis/environments/paludis/world.cc
new file mode 100644
index 000000000..8388168f6
--- /dev/null
+++ b/paludis/environments/paludis/world.cc
@@ -0,0 +1,180 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/environments/paludis/world.hh>
+#include <paludis/util/private_implementation_pattern-impl.hh>
+#include <paludis/util/fs_entry.hh>
+#include <paludis/util/mutex.hh>
+#include <paludis/util/stringify.hh>
+#include <paludis/util/tr1_functional.hh>
+#include <paludis/util/log.hh>
+#include <paludis/set_file.hh>
+#include <paludis/user_dep_spec.hh>
+#include <paludis/dep_tag.hh>
+#include <fstream>
+
+using namespace paludis;
+using namespace paludis::paludis_environment;
+
+namespace paludis
+{
+ template <>
+ struct Implementation<World>
+ {
+ const Environment * const env;
+ const tr1::shared_ptr<const FSEntry> maybe_world_file;
+ mutable Mutex mutex;
+
+ Implementation(const Environment * const e, const tr1::shared_ptr<const FSEntry> & m) :
+ env(e),
+ maybe_world_file(m)
+ {
+ }
+ };
+}
+
+World::World(const Environment * const e, const tr1::shared_ptr<const FSEntry> & f) :
+ PrivateImplementationPattern<World>(new Implementation<World>(e, f))
+{
+}
+
+World::~World()
+{
+}
+
+void
+World::add_to_world(const SetName & s) const
+{
+ _add_string_to_world(stringify(s));
+}
+
+void
+World::add_to_world(const QualifiedPackageName & q) const
+{
+ _add_string_to_world(stringify(q));
+}
+
+void
+World::remove_from_world(const SetName & s) const
+{
+ _remove_string_from_world(stringify(s));
+}
+
+void
+World::remove_from_world(const QualifiedPackageName & q) const
+{
+ _remove_string_from_world(stringify(q));
+}
+
+void
+World::_add_string_to_world(const std::string & n) const
+{
+ using namespace tr1::placeholders;
+
+ if (! _imp->maybe_world_file)
+ {
+ Log::get_instance()->message(ll_warning, lc_context) << "Not adding '" << n << "' to world because "
+ "no world file has been configured. If you have recently upgraded from <paludis-0.26.0_alpha13, consult "
+ "the FAQ Upgrades section.";
+ return;
+ }
+
+ Lock l(_imp->mutex);
+
+ Context context("When adding '" + n + "' to world file '" + stringify(*_imp->maybe_world_file) + "':");
+
+ if (! _imp->maybe_world_file->exists())
+ {
+ std::ofstream f(stringify(*_imp->maybe_world_file).c_str());
+ if (! f)
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context, "Cannot create world file '"
+ + stringify(*_imp->maybe_world_file) + "'");
+ return;
+ }
+ }
+
+ SetFile world(SetFileParams::create()
+ .file_name(*_imp->maybe_world_file)
+ .type(sft_simple)
+ .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
+ .tag(tr1::shared_ptr<DepTag>())
+ .environment(_imp->env));
+ world.add(n);
+ world.rewrite();
+}
+
+void
+World::_remove_string_from_world(const std::string & n) const
+{
+ using namespace tr1::placeholders;
+
+ if (! _imp->maybe_world_file)
+ {
+ Log::get_instance()->message(ll_warning, lc_context) << "Not removing '" << n << "' from world because "
+ "no world file has been configured";
+ return;
+ }
+
+ Lock l(_imp->mutex);
+
+ Context context("When removing '" + n + "' from world file '" + stringify(*_imp->maybe_world_file) + "':");
+
+ if (_imp->maybe_world_file->exists())
+ {
+ SetFile world(SetFileParams::create()
+ .file_name(*_imp->maybe_world_file)
+ .type(sft_simple)
+ .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
+ .tag(tr1::shared_ptr<DepTag>())
+ .environment(_imp->env));
+
+ world.remove(n);
+ world.rewrite();
+ }
+}
+
+tr1::shared_ptr<SetSpecTree::ConstItem>
+World::world_set() const
+{
+ using namespace tr1::placeholders;
+
+ tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), "Environment"));
+
+ if (_imp->maybe_world_file)
+ {
+ if (_imp->maybe_world_file->exists())
+ {
+ SetFile world(SetFileParams::create()
+ .file_name(*_imp->maybe_world_file)
+ .type(sft_simple)
+ .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
+ .tag(tag)
+ .environment(_imp->env));
+ return world.contents();
+ }
+ else
+ Log::get_instance()->message(ll_warning, lc_no_context) << "World file '" << *_imp->maybe_world_file
+ << "' doesn't exist";
+ }
+
+ return tr1::shared_ptr<SetSpecTree::ConstItem>(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
+ tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
+}
+
diff --git a/paludis/environments/paludis/world.hh b/paludis/environments/paludis/world.hh
new file mode 100644
index 000000000..87b05a0b3
--- /dev/null
+++ b/paludis/environments/paludis/world.hh
@@ -0,0 +1,57 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2008 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_WORLD_HH
+#define PALUDIS_GUARD_PALUDIS_ENVIRONMENTS_PALUDIS_WORLD_HH 1
+
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/util/tr1_memory.hh>
+#include <paludis/name-fwd.hh>
+#include <paludis/dep_tree.hh>
+#include <paludis/environment-fwd.hh>
+#include <string>
+
+namespace paludis
+{
+ namespace paludis_environment
+ {
+ class World :
+ private PrivateImplementationPattern<World>
+ {
+ private:
+ void _add_string_to_world(const std::string &) const;
+ void _remove_string_from_world(const std::string &) const;
+
+ public:
+ World(const Environment * const, const tr1::shared_ptr<const FSEntry> &);
+ ~World();
+
+ tr1::shared_ptr<SetSpecTree::ConstItem> world_set() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ void add_to_world(const SetName &) const;
+ void add_to_world(const QualifiedPackageName &) const;
+
+ void remove_from_world(const SetName &) const;
+ void remove_from_world(const QualifiedPackageName &) const;
+ };
+ }
+}
+
+#endif
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index ccba73494..f66219c6d 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -44,14 +44,17 @@
#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
#include <paludis/user_dep_spec.hh>
-#include <algorithm>
+#include <paludis/set_file.hh>
+#include <paludis/dep_tag.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/mutex.hh>
#include <functional>
+#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <list>
+#include <fstream>
using namespace paludis;
using namespace paludis::portage_environment;
@@ -95,12 +98,16 @@ namespace paludis
tr1::shared_ptr<PackageDatabase> package_database;
+ const FSEntry world_file;
+ mutable Mutex world_mutex;
+
Implementation(Environment * const e, const std::string & s) :
conf_dir(FSEntry(s.empty() ? "/" : s) / SYSCONFDIR),
paludis_command("paludis"),
done_hooks(false),
overlay_importance(10),
- package_database(new PackageDatabase(e))
+ package_database(new PackageDatabase(e)),
+ world_file("/var/lib/portage/world")
{
}
@@ -420,7 +427,6 @@ PortageEnvironment::_add_vdb_repository()
keys->insert("format", "vdb");
keys->insert("names_cache", "/var/empty");
keys->insert("provides_cache", "/var/empty");
- keys->insert("world", "/var/lib/portage/world");
std::string builddir(_imp->vars->get("PORTAGE_TMPDIR"));
if (! builddir.empty())
builddir.append("/portage");
@@ -740,3 +746,110 @@ PortageEnvironment::reduced_uid() const
return getuid();
}
+void
+PortageEnvironment::add_to_world(const QualifiedPackageName & q) const
+{
+ _add_string_to_world(stringify(q));
+}
+
+void
+PortageEnvironment::add_to_world(const SetName & s) const
+{
+ _add_string_to_world(stringify(s));
+}
+
+void
+PortageEnvironment::remove_from_world(const QualifiedPackageName & q) const
+{
+ _remove_string_from_world(stringify(q));
+}
+
+void
+PortageEnvironment::remove_from_world(const SetName & s) const
+{
+ _remove_string_from_world(stringify(s));
+}
+
+void
+PortageEnvironment::_add_string_to_world(const std::string & s) const
+{
+ Lock l(_imp->world_mutex);
+
+ Context context("When adding '" + s + "' to world file '" + stringify(_imp->world_file) + "':");
+
+ using namespace tr1::placeholders;
+
+ if (! _imp->world_file.exists())
+ {
+ std::ofstream f(stringify(_imp->world_file).c_str());
+ if (! f)
+ {
+ Log::get_instance()->message(ll_warning, lc_no_context, "Cannot create world file '"
+ + stringify(_imp->world_file) + "'");
+ return;
+ }
+ }
+
+ SetFile world(SetFileParams::create()
+ .file_name(_imp->world_file)
+ .type(sft_simple)
+ .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
+ .tag(tr1::shared_ptr<DepTag>())
+ .environment(this));
+ world.add(s);
+ world.rewrite();
+}
+
+void
+PortageEnvironment::_remove_string_from_world(const std::string & s) const
+{
+ Lock l(_imp->world_mutex);
+
+ Context context("When removing '" + s + "' from world file '" + stringify(_imp->world_file) + "':");
+
+ using namespace tr1::placeholders;
+
+ if (_imp->world_file.exists())
+ {
+ SetFile world(SetFileParams::create()
+ .file_name(_imp->world_file)
+ .type(sft_simple)
+ .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
+ .tag(tr1::shared_ptr<DepTag>())
+ .environment(this));
+
+ world.remove(s);
+ world.rewrite();
+ }
+}
+
+tr1::shared_ptr<SetSpecTree::ConstItem>
+PortageEnvironment::world_set() const
+{
+ Context context("When fetching environment world set:");
+
+ tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), stringify("Environment")));
+
+ using namespace tr1::placeholders;
+
+ Lock l(_imp->world_mutex);
+
+ if (_imp->world_file.exists())
+ {
+ SetFile world(SetFileParams::create()
+ .file_name(_imp->world_file)
+ .type(sft_simple)
+ .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
+ .tag(tag)
+ .environment(this));
+ return world.contents();
+ }
+ else
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "World file '" + stringify(_imp->world_file) +
+ "' doesn't exist");
+
+ return tr1::shared_ptr<SetSpecTree::ConstItem>(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
+ tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
+}
+
diff --git a/paludis/environments/portage/portage_environment.hh b/paludis/environments/portage/portage_environment.hh
index faeeb3100..03702201f 100644
--- a/paludis/environments/portage/portage_environment.hh
+++ b/paludis/environments/portage/portage_environment.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2007 Ciaran McCreesh
+ * Copyright (c) 2007, 2008 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
@@ -74,10 +74,16 @@ namespace paludis
template<typename I_>
void _load_atom_file(const FSEntry &, I_, const std::string &);
+ void _add_string_to_world(const std::string &) const;
+ void _remove_string_from_world(const std::string &) const;
+
protected:
virtual tr1::shared_ptr<SetSpecTree::ConstItem> local_set(const SetName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<SetSpecTree::ConstItem> world_set() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
public:
///\name Basic operations
///\{
@@ -138,6 +144,14 @@ namespace paludis
virtual uid_t reduced_uid() const;
virtual gid_t reduced_gid() const;
+
+ virtual void add_to_world(const QualifiedPackageName &) const;
+
+ virtual void add_to_world(const SetName &) const;
+
+ virtual void remove_from_world(const QualifiedPackageName &) const;
+
+ virtual void remove_from_world(const SetName &) const;
};
}
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index 18e4fabae..0243fbf1f 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 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
@@ -189,3 +189,29 @@ TestEnvironment::known_use_expand_names(const UseFlagName &, const PackageID &)
return make_shared_ptr(new UseFlagNameSet);
}
+tr1::shared_ptr<SetSpecTree::ConstItem>
+TestEnvironment::world_set() const
+{
+ return tr1::shared_ptr<SetSpecTree::ConstItem>();
+}
+
+void
+TestEnvironment::add_to_world(const QualifiedPackageName &) const
+{
+}
+
+void
+TestEnvironment::remove_from_world(const QualifiedPackageName &) const
+{
+}
+
+void
+TestEnvironment::add_to_world(const SetName &) const
+{
+}
+
+void
+TestEnvironment::remove_from_world(const SetName &) const
+{
+}
+
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index a79121ecc..d4a9dcc99 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2005, 2006, 2007 Ciaran McCreesh
+ * Copyright (c) 2005, 2006, 2007, 2008 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
@@ -47,6 +47,9 @@ namespace paludis
virtual tr1::shared_ptr<SetSpecTree::ConstItem> local_set(const SetName &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<SetSpecTree::ConstItem> world_set() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
public:
///\name Basic operations
///\{
@@ -110,6 +113,14 @@ namespace paludis
virtual HookResult perform_hook(const Hook &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual void add_to_world(const QualifiedPackageName &) const;
+
+ virtual void add_to_world(const SetName &) const;
+
+ virtual void remove_from_world(const QualifiedPackageName &) const;
+
+ virtual void remove_from_world(const SetName &) const;
};
}
diff --git a/paludis/install_task.cc b/paludis/install_task.cc
index a23142aa5..881c914b0 100644
--- a/paludis/install_task.cc
+++ b/paludis/install_task.cc
@@ -1183,11 +1183,7 @@ InstallTask::world_update_set(const SetName & s)
return;
}
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ;
- r != r_end ; ++r)
- if ((**r)[k::world_interface()])
- (**r)[k::world_interface()]->add_to_world(s);
+ _imp->env->add_to_world(s);
on_update_world(s);
}
@@ -1217,11 +1213,8 @@ namespace
task->on_update_world_skip(a, "version restrictions");
else
{
- for (PackageDatabase::RepositoryConstIterator r(env->package_database()->begin_repositories()),
- r_end(env->package_database()->end_repositories()) ;
- r != r_end ; ++r)
- if ((**r)[k::world_interface()] && a.package_ptr())
- (**r)[k::world_interface()]->add_to_world(*a.package_ptr());
+ if (a.package_ptr())
+ env->add_to_world(*a.package_ptr());
task->on_update_world(a);
}
}
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 842918e31..1f1dc3435 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -158,7 +158,6 @@ CRANInstalledRepository::CRANInstalledRepository(const CRANInstalledRepositoryPa
(k::sets_interface(), this)
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::world_interface(), this)
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
@@ -385,14 +384,13 @@ CRANInstalledRepository::make_cran_installed_repository(
root = stringify(env->root());
std::string world;
- if (m->end() == m->find("world") || ((world = m->find("world")->second)).empty())
- world = location + "/world";
+ if (m->end() != m->find("world") && ! ((world = m->find("world")->second)).empty())
+ throw CRANInstalledRepositoryConfigurationError("Key 'world' is no longer supported.");
return tr1::shared_ptr<Repository>(new CRANInstalledRepository(CRANInstalledRepositoryParams::create()
.environment(env)
.location(location)
- .root(root)
- .world(world)));
+ .root(root)));
}
CRANInstalledRepositoryConfigurationError::CRANInstalledRepositoryConfigurationError(
@@ -452,30 +450,6 @@ CRANInstalledRepository::package_set(const SetName & s) const
return result;
}
- else if ("world" == s.data())
- {
- tr1::shared_ptr<ConstTreeSequence<SetSpecTree, AllDepSpec> > result(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
- tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
- tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), stringify(name())));
-
- if (_imp->params.world.exists())
- {
- using namespace tr1::placeholders;
- SetFile world(SetFileParams::create()
- .file_name(_imp->params.world)
- .type(sft_simple)
- .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
- .tag(tag)
- .environment(_imp->params.environment));
-
- return world.contents();
- }
- else
- {
- Log::get_instance()->message(ll_warning, lc_no_context) << "World file '" << _imp->params.world << "' doesn't exist";
- return result;
- }
- }
else
return tr1::shared_ptr<SetSpecTree::ConstItem>();
}
@@ -487,7 +461,6 @@ CRANInstalledRepository::sets_list() const
tr1::shared_ptr<SetNameSet> result(new SetNameSet);
result->insert(SetName("everything"));
- result->insert(SetName("world"));
return result;
}
@@ -503,86 +476,12 @@ CRANInstalledRepository::invalidate_masks()
{
}
-void
-CRANInstalledRepository::add_string_to_world(const std::string & n) const
-{
- using namespace tr1::placeholders;
-
- Context context("When adding '" + n + "' to world file '" + stringify(_imp->params.world) + "':");
-
- if (! _imp->params.world.exists())
- {
- std::ofstream f(stringify(_imp->params.world).c_str());
- if (! f)
- {
- Log::get_instance()->message(ll_warning, lc_no_context, "Cannot create world file '"
- + stringify(_imp->params.world) + "'");
- return;
- }
- }
-
- SetFile world(SetFileParams::create()
- .file_name(_imp->params.world)
- .type(sft_simple)
- .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
- .tag(tr1::shared_ptr<DepTag>())
- .environment(_imp->params.environment));
- world.add(n);
- world.rewrite();
-}
-
-void
-CRANInstalledRepository::remove_string_from_world(const std::string & n) const
-{
- using namespace tr1::placeholders;
-
- Context context("When removing '" + n + "' from world file '" + stringify(_imp->params.world) + "':");
-
- if (_imp->params.world.exists())
- {
- SetFile world(SetFileParams::create()
- .file_name(_imp->params.world)
- .type(sft_simple)
- .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
- .tag(tr1::shared_ptr<DepTag>())
- .environment(_imp->params.environment));
-
- world.remove(n);
- world.rewrite();
- }
-}
-
bool
CRANInstalledRepository::is_suitable_destination_for(const PackageID & e) const
{
std::string f(e.repository()->format_key() ? e.repository()->format_key()->value() : "");
return f == "cran";
}
-
-void
-CRANInstalledRepository::add_to_world(const QualifiedPackageName & n) const
-{
- add_string_to_world(stringify(n));
-}
-
-void
-CRANInstalledRepository::remove_from_world(const QualifiedPackageName & n) const
-{
- remove_string_from_world(stringify(n));
-}
-
-void
-CRANInstalledRepository::add_to_world(const SetName & n) const
-{
- add_string_to_world(stringify(n));
-}
-
-void
-CRANInstalledRepository::remove_from_world(const SetName & n) const
-{
- remove_string_from_world(stringify(n));
-}
-
bool
CRANInstalledRepository::is_default_destination() const
{
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index d3f784096..1ca3ea975 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -47,7 +47,6 @@ namespace paludis
class PALUDIS_VISIBLE CRANInstalledRepository :
public Repository,
public RepositorySetsInterface,
- public RepositoryWorldInterface,
public RepositoryDestinationInterface,
public PrivateImplementationPattern<CRANInstalledRepository>
{
@@ -56,8 +55,6 @@ namespace paludis
void _add_metadata_keys() const;
void need_ids() const;
- void add_string_to_world(const std::string & n) const;
- void remove_string_from_world(const std::string &) const;
protected:
virtual void need_keys_added() const;
@@ -88,13 +85,6 @@ namespace paludis
virtual tr1::shared_ptr<const SetNameSet> sets_list() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- /* RepositoryWorldInterface */
-
- virtual void add_to_world(const QualifiedPackageName &) const;
- virtual void add_to_world(const SetName &) const;
- virtual void remove_from_world(const QualifiedPackageName &) const;
- virtual void remove_from_world(const SetName &) const;
-
/* RepositoryDestinationInterface */
virtual bool is_suitable_destination_for(const PackageID &) const
diff --git a/paludis/repositories/cran/cran_installed_repository.sr b/paludis/repositories/cran/cran_installed_repository.sr
index 150c7d97e..c892bb2c6 100644
--- a/paludis/repositories/cran/cran_installed_repository.sr
+++ b/paludis/repositories/cran/cran_installed_repository.sr
@@ -8,7 +8,6 @@ make_class_CRANInstalledRepositoryParams()
key environment "const Environment *"
key location FSEntry
key root FSEntry
- key world FSEntry
doxygen_comment << "END"
/**
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index a86d6aa84..12c2ff9c9 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -103,7 +103,6 @@ CRANRepository::CRANRepository(const CRANRepositoryParams & p) :
(k::sets_interface(), this)
(k::syncable_interface(), this)
(k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::make_virtuals_interface(), static_cast<RepositoryMakeVirtualsInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
diff --git a/paludis/repositories/e/e_installed_repository.cc b/paludis/repositories/e/e_installed_repository.cc
index 177c0683c..a7cec5cbf 100644
--- a/paludis/repositories/e/e_installed_repository.cc
+++ b/paludis/repositories/e/e_installed_repository.cc
@@ -147,83 +147,6 @@ EInstalledRepository::want_pre_post_phases() const
return true;
}
-void
-EInstalledRepository::add_string_to_world(const std::string & n) const
-{
- using namespace tr1::placeholders;
-
- Lock l(_imp->world_mutex);
-
- Context context("When adding '" + n + "' to world file '" + stringify(_imp->params.world) + "':");
-
- if (! _imp->params.world.exists())
- {
- std::ofstream f(stringify(_imp->params.world).c_str());
- if (! f)
- {
- Log::get_instance()->message(ll_warning, lc_no_context, "Cannot create world file '"
- + stringify(_imp->params.world) + "'");
- return;
- }
- }
-
- SetFile world(SetFileParams::create()
- .file_name(_imp->params.world)
- .type(sft_simple)
- .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
- .tag(tr1::shared_ptr<DepTag>())
- .environment(_imp->params.environment));
- world.add(n);
- world.rewrite();
-}
-
-void
-EInstalledRepository::remove_string_from_world(const std::string & n) const
-{
- using namespace tr1::placeholders;
-
- Lock l(_imp->world_mutex);
-
- Context context("When removing '" + n + "' from world file '" + stringify(_imp->params.world) + "':");
-
- if (_imp->params.world.exists())
- {
- SetFile world(SetFileParams::create()
- .file_name(_imp->params.world)
- .type(sft_simple)
- .parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
- .tag(tr1::shared_ptr<DepTag>())
- .environment(_imp->params.environment));
-
- world.remove(n);
- world.rewrite();
- }
-}
-
-void
-EInstalledRepository::add_to_world(const QualifiedPackageName & n) const
-{
- add_string_to_world(stringify(n));
-}
-
-void
-EInstalledRepository::add_to_world(const SetName & n) const
-{
- add_string_to_world(stringify(n));
-}
-
-void
-EInstalledRepository::remove_from_world(const QualifiedPackageName & n) const
-{
- remove_string_from_world(stringify(n));
-}
-
-void
-EInstalledRepository::remove_from_world(const SetName & n) const
-{
- remove_string_from_world(stringify(n));
-}
-
UseFlagState
EInstalledRepository::query_use(const UseFlagName & f, const PackageID & e) const
{
@@ -316,22 +239,18 @@ EInstalledRepository::package_set(const SetName & s) const
}
else if ("world" == s.data())
{
- tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), stringify(name())));
-
- if (_imp->params.world.exists())
+ if (_imp->params.deprecated_world.exists())
{
+ tr1::shared_ptr<GeneralSetDepTag> tag(new GeneralSetDepTag(SetName("world"), stringify(name())));
+
SetFile world(SetFileParams::create()
- .file_name(_imp->params.world)
+ .file_name(_imp->params.deprecated_world)
.type(sft_simple)
.parser(tr1::bind(&parse_user_package_dep_spec, _1, UserPackageDepSpecOptions()))
.tag(tag)
.environment(_imp->params.environment));
return world.contents();
}
- else
- Log::get_instance()->message(ll_warning, lc_no_context,
- "World file '" + stringify(_imp->params.world) +
- "' doesn't exist");
return tr1::shared_ptr<SetSpecTree::ConstItem>(new ConstTreeSequence<SetSpecTree, AllDepSpec>(
tr1::shared_ptr<AllDepSpec>(new AllDepSpec)));
@@ -347,7 +266,8 @@ EInstalledRepository::sets_list() const
tr1::shared_ptr<SetNameSet> result(new SetNameSet);
result->insert(SetName("everything"));
- result->insert(SetName("world"));
+ if (_imp->params.deprecated_world.exists())
+ result->insert(SetName("world"));
return result;
}
diff --git a/paludis/repositories/e/e_installed_repository.hh b/paludis/repositories/e/e_installed_repository.hh
index 4a1a3cb10..342bffb9c 100644
--- a/paludis/repositories/e/e_installed_repository.hh
+++ b/paludis/repositories/e/e_installed_repository.hh
@@ -34,16 +34,12 @@ namespace paludis
public Repository,
public RepositoryUseInterface,
public RepositorySetsInterface,
- public RepositoryWorldInterface,
public RepositoryEnvironmentVariableInterface,
public RepositoryDestinationInterface,
public RepositoryHookInterface,
private PrivateImplementationPattern<EInstalledRepository>
{
private:
- void add_string_to_world(const std::string & n) const;
- void remove_string_from_world(const std::string &) const;
-
PrivateImplementationPattern<EInstalledRepository>::ImpPtr & _imp;
protected:
@@ -89,16 +85,6 @@ namespace paludis
virtual tr1::shared_ptr<const SetNameSet> sets_list() const
PALUDIS_ATTRIBUTE((warn_unused_result));
- /* RepositoryWorldInterface */
-
- virtual void add_to_world(const QualifiedPackageName &) const;
-
- virtual void add_to_world(const SetName &) const;
-
- virtual void remove_from_world(const QualifiedPackageName &) const;
-
- virtual void remove_from_world(const SetName &) const;
-
/* RepositoryEnvironmentVariableInterface */
virtual std::string get_environment_variable(
diff --git a/paludis/repositories/e/e_installed_repository.sr b/paludis/repositories/e/e_installed_repository.sr
index a56ace37c..c9914dbee 100644
--- a/paludis/repositories/e/e_installed_repository.sr
+++ b/paludis/repositories/e/e_installed_repository.sr
@@ -6,7 +6,7 @@ make_class_EInstalledRepositoryParams()
visible
key environment "Environment *"
- key world "FSEntry"
+ key deprecated_world "FSEntry"
key root "FSEntry"
key builddir "FSEntry"
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 9296d167e..93e9581a2 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -457,7 +457,6 @@ ERepository::ERepository(const ERepositoryParams & p) :
(k::sets_interface(), this)
(k::syncable_interface(), this)
(k::use_interface(), this)
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::environment_variable_interface(), this)
(k::mirrors_interface(), this)
(k::virtuals_interface(), (*DistributionData::get_instance()->distribution_from_string(
diff --git a/paludis/repositories/e/exndbam_repository.cc b/paludis/repositories/e/exndbam_repository.cc
index b4d93670a..06e364373 100644
--- a/paludis/repositories/e/exndbam_repository.cc
+++ b/paludis/repositories/e/exndbam_repository.cc
@@ -69,7 +69,6 @@ namespace paludis
tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
- tr1::shared_ptr<const MetadataValueKey<FSEntry> > world_key;
tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
Implementation(const ExndbamRepositoryParams & p) :
@@ -81,8 +80,6 @@ namespace paludis
mkt_normal, params.root)),
format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "vdb")),
- world_key(new LiteralMetadataValueKey<FSEntry> ("world", "world",
- mkt_normal, params.world)),
builddir_key(new LiteralMetadataValueKey<FSEntry> ("builddir", "builddir",
mkt_normal, params.builddir))
{
@@ -93,15 +90,14 @@ namespace paludis
ExndbamRepository::ExndbamRepository(const RepositoryName & n, const ExndbamRepositoryParams & p) :
EInstalledRepository(
EInstalledRepositoryParams::create()
+ .deprecated_world(p.deprecated_world)
.environment(p.environment)
- .world(p.world)
.builddir(p.builddir)
.root(p.root),
n, RepositoryCapabilities::named_create()
(k::sets_interface(), this)
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), this)
- (k::world_interface(), this)
(k::environment_variable_interface(), this)
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
@@ -129,7 +125,6 @@ ExndbamRepository::_add_metadata_keys() const
add_metadata_key(_imp->location_key);
add_metadata_key(_imp->root_key);
add_metadata_key(_imp->format_key);
- add_metadata_key(_imp->world_key);
add_metadata_key(_imp->builddir_key);
}
@@ -150,10 +145,6 @@ ExndbamRepository::make_exndbam_repository(
if (m->end() == m->find("root") || ((root = m->find("root")->second)).empty())
root = "/";
- std::string world;
- if (m->end() == m->find("world") || ((world = m->find("world")->second)).empty())
- world = location + "/world";
-
std::string builddir;
if (m->end() == m->find("builddir") || ((builddir = m->find("builddir")->second)).empty())
{
@@ -168,13 +159,22 @@ ExndbamRepository::make_exndbam_repository(
if (m->end() == m->find("name") || ((name = m->find("name")->second)).empty())
name = "installed";
+ std::string deprecated_world;
+ if (m->end() == m->find("world") || ((deprecated_world = m->find("world")->second)).empty())
+ deprecated_world = "/DOESNOTEXIST";
+ else
+ Log::get_instance()->message(ll_warning, lc_context) << "Specifying world location " <<
+ "in repository configuration files is deprecated. File '" << deprecated_world << "' will be "
+ "read but not updated. If you have recently upgraded from <paludis-0.26.0_alpha13, consult "
+ "the FAQ Upgrades section.";
+
return tr1::shared_ptr<Repository>(new ExndbamRepository(
RepositoryName(name),
ExndbamRepositoryParams::create()
.environment(env)
.location(location)
.root(root)
- .world(world)
+ .deprecated_world(deprecated_world)
.builddir(builddir)));
}
diff --git a/paludis/repositories/e/exndbam_repository.sr b/paludis/repositories/e/exndbam_repository.sr
index e63f68d32..5f1d6fe0f 100644
--- a/paludis/repositories/e/exndbam_repository.sr
+++ b/paludis/repositories/e/exndbam_repository.sr
@@ -8,7 +8,7 @@ make_class_ExndbamRepositoryParams()
key environment "Environment *"
key location FSEntry
key root FSEntry
- key world FSEntry
+ key deprecated_world FSEntry
key builddir FSEntry
allow_named_args
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index e5278e271..447eb1b17 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -105,7 +105,6 @@ namespace paludis
tr1::shared_ptr<const MetadataValueKey<FSEntry> > location_key;
tr1::shared_ptr<const MetadataValueKey<FSEntry> > root_key;
tr1::shared_ptr<const MetadataValueKey<std::string> > format_key;
- tr1::shared_ptr<const MetadataValueKey<FSEntry> > world_key;
tr1::shared_ptr<const MetadataValueKey<FSEntry> > provides_cache_key;
tr1::shared_ptr<const MetadataValueKey<FSEntry> > names_cache_key;
tr1::shared_ptr<const MetadataValueKey<FSEntry> > builddir_key;
@@ -123,8 +122,6 @@ namespace paludis
mkt_normal, params.root)),
format_key(new LiteralMetadataValueKey<std::string> ("format", "format",
mkt_significant, "vdb")),
- world_key(new LiteralMetadataValueKey<FSEntry> ("world", "world",
- mkt_normal, params.world)),
provides_cache_key(new LiteralMetadataValueKey<FSEntry> ("provides_cache", "provides_cache",
mkt_normal, params.provides_cache)),
names_cache_key(new LiteralMetadataValueKey<FSEntry> ("names_cache", "names_cache",
@@ -145,13 +142,12 @@ VDBRepository::VDBRepository(const VDBRepositoryParams & p) :
.environment(p.environment)
.root(p.root)
.builddir(p.builddir)
- .world(p.world),
+ .deprecated_world(p.deprecated_world),
p.name,
RepositoryCapabilities::named_create()
(k::sets_interface(), this)
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), this)
- (k::world_interface(), this)
(k::environment_variable_interface(), this)
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::provides_interface(), this)
@@ -179,7 +175,6 @@ VDBRepository::_add_metadata_keys() const
add_metadata_key(_imp->location_key);
add_metadata_key(_imp->root_key);
add_metadata_key(_imp->format_key);
- add_metadata_key(_imp->world_key);
add_metadata_key(_imp->provides_cache_key);
add_metadata_key(_imp->names_cache_key);
add_metadata_key(_imp->builddir_key);
@@ -288,9 +283,14 @@ VDBRepository::make_vdb_repository(
if (m->end() == m->find("root") || ((root = m->find("root")->second)).empty())
root = "/";
- std::string world;
- if (m->end() == m->find("world") || ((world = m->find("world")->second)).empty())
- world = location + "/world";
+ std::string deprecated_world;
+ if (m->end() == m->find("world") || ((deprecated_world = m->find("world")->second)).empty())
+ deprecated_world = "/DOESNOTEXIST";
+ else
+ Log::get_instance()->message(ll_warning, lc_context) << "Specifying world location " <<
+ "in repository configuration files is deprecated. File '" << deprecated_world << "' will be "
+ "read but not updated. If you have recently upgraded from <paludis-0.26.0_alpha13, consult "
+ "the FAQ Upgrades section.";
std::string provides_cache;
if (m->end() == m->find("provides_cache") || ((provides_cache = m->find("provides_cache")->second)).empty())
@@ -338,7 +338,7 @@ VDBRepository::make_vdb_repository(
.environment(env)
.location(location)
.root(root)
- .world(world)
+ .deprecated_world(deprecated_world)
.builddir(builddir)
.provides_cache(provides_cache)
.name(RepositoryName(name))
diff --git a/paludis/repositories/e/vdb_repository.sr b/paludis/repositories/e/vdb_repository.sr
index cfa8adac9..f18fe1391 100644
--- a/paludis/repositories/e/vdb_repository.sr
+++ b/paludis/repositories/e/vdb_repository.sr
@@ -8,7 +8,7 @@ make_class_VDBRepositoryParams()
key environment "Environment *"
key location FSEntry
key root FSEntry
- key world FSEntry
+ key deprecated_world FSEntry
key provides_cache FSEntry
key names_cache FSEntry
key builddir FSEntry
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index a44624e0e..bb2a4c017 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -131,145 +131,6 @@ namespace test_cases
} test_vdb_repository_query_use;
/**
- * \test Test VDBRepository add_to_world.
- */
- struct VDBRepositoryAddToWorldNewFileTest : TestCase
- {
- VDBRepositoryAddToWorldNewFileTest() : TestCase("add to world (new file)") { }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- tr1::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
- keys->insert("format", "vdb");
- keys->insert("names_cache", "/var/empty");
- keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("world", "vdb_repository_TEST_dir/world-new-file");
- tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
- &env, keys));
- (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
- std::ifstream world("vdb_repository_TEST_dir/world-new-file");
- std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
- TEST_CHECK_EQUAL(world_content, "cat-one/foofoo\n");
- }
- } test_vdb_repository_add_to_world_new_file;
-
- /**
- * \test Test VDBRepository add_to_world.
- */
- struct VDBRepositoryAddToWorldEmptyFileTest : TestCase
- {
- VDBRepositoryAddToWorldEmptyFileTest() : TestCase("add to world (empty file)") { }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- tr1::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
- keys->insert("format", "vdb");
- keys->insert("names_cache", "/var/empty");
- keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("world", "vdb_repository_TEST_dir/world-empty");
- tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
- &env, keys));
- (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
- std::ifstream world("vdb_repository_TEST_dir/world-empty");
- std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
- TEST_CHECK_EQUAL(world_content, "cat-one/foofoo\n");
- }
- } test_vdb_repository_add_to_world_empty_file;
-
- /**
- * \test Test VDBRepository add_to_world.
- */
- struct VDBRepositoryAddToWorldNoMatchTest : TestCase
- {
- VDBRepositoryAddToWorldNoMatchTest() : TestCase("add to world (no match)") { }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- tr1::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
- keys->insert("format", "vdb");
- keys->insert("names_cache", "/var/empty");
- keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("world", "vdb_repository_TEST_dir/world-no-match");
- tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
- &env, keys));
- (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
- std::ifstream world("vdb_repository_TEST_dir/world-no-match");
- std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
- TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/bar\ncat-one/oink\ncat-one/foofoo\n");
- }
- } test_vdb_repository_add_to_world_no_match;
-
- /**
- * \test Test VDBRepository add_to_world.
- */
- struct VDBRepositoryAddToWorldMatchTest : TestCase
- {
- VDBRepositoryAddToWorldMatchTest() : TestCase("add to world (match)") { }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- tr1::shared_ptr<Map<std::string, std::string> > keys(
- new Map<std::string, std::string>);
- keys->insert("format", "vdb");
- keys->insert("names_cache", "/var/empty");
- keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("world", "vdb_repository_TEST_dir/world-match");
- tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
- &env, keys));
- (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
- std::ifstream world("vdb_repository_TEST_dir/world-match");
- std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
- TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/foofoo\ncat-one/bar\n");
- }
- } test_vdb_repository_add_to_world_match;
-
- /**
- * \test Test VDBRepository add_to_world.
- */
- struct VDBRepositoryAddToWorldNoMatchNoEOLTest : TestCase
- {
- VDBRepositoryAddToWorldNoMatchNoEOLTest() : TestCase("add to world (no match, no trailing eol)") { }
-
- void run()
- {
- TestEnvironment env;
- env.set_paludis_command("/bin/false");
- tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
- keys->insert("format", "vdb");
- keys->insert("names_cache", "/var/empty");
- keys->insert("provides_cache", "/var/empty");
- keys->insert("location", "vdb_repository_TEST_dir/repo1");
- keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("world", "vdb_repository_TEST_dir/world-no-match-no-eol");
- tr1::shared_ptr<Repository> repo(VDBRepository::make_vdb_repository(
- &env, keys));
- (*repo)[k::world_interface()]->add_to_world(QualifiedPackageName("cat-one/foofoo"));
- std::ifstream world("vdb_repository_TEST_dir/world-no-match-no-eol");
- std::string world_content((std::istreambuf_iterator<char>(world)), std::istreambuf_iterator<char>());
- TEST_CHECK_EQUAL(world_content, "cat-one/foo\ncat-one/bar\ncat-one/oink\ncat-one/foofoo\n");
- }
- } test_vdb_repository_add_to_world_no_match_no_eol;
-
- /**
* \test Test VDBRepository CONTENTS.
*/
struct VDBRepositoryContentsTest : TestCase
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 29cb158bc..9ec7edb8c 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -57,7 +57,6 @@ FakeInstalledRepository::FakeInstalledRepository(const Environment * const e, co
(k::sets_interface(), this)
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), this)
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::provides_interface(), this)
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index c62704807..128e450e1 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -64,7 +64,6 @@ FakeRepository::FakeRepository(const Environment * const e, const RepositoryName
(k::sets_interface(), this)
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), this)
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::mirrors_interface(), this)
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
@@ -88,7 +87,6 @@ FakeRepository::FakeRepository(const FakeRepositoryParams & params) :
(k::sets_interface(), this)
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), this)
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::mirrors_interface(), this)
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index b206cc29b..23c116e76 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -89,7 +89,6 @@ GemsRepository::GemsRepository(const gems::RepositoryParams & params) :
(k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index b826cd5c0..151d7f828 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -89,7 +89,6 @@ InstalledGemsRepository::InstalledGemsRepository(const gems::InstalledRepository
(k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
diff --git a/paludis/repositories/unpackaged/installed_repository.cc b/paludis/repositories/unpackaged/installed_repository.cc
index 3f79d2246..aeca2f7dd 100644
--- a/paludis/repositories/unpackaged/installed_repository.cc
+++ b/paludis/repositories/unpackaged/installed_repository.cc
@@ -87,7 +87,6 @@ InstalledUnpackagedRepository::InstalledUnpackagedRepository(
(k::sets_interface(), this)
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
diff --git a/paludis/repositories/unpackaged/unpackaged_repository.cc b/paludis/repositories/unpackaged/unpackaged_repository.cc
index de09f1f03..58f4f29f7 100644
--- a/paludis/repositories/unpackaged/unpackaged_repository.cc
+++ b/paludis/repositories/unpackaged/unpackaged_repository.cc
@@ -90,7 +90,6 @@ UnpackagedRepository::UnpackagedRepository(const RepositoryName & n,
(k::sets_interface(), static_cast<RepositorySetsInterface *>(0))
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::use_interface(), static_cast<RepositoryUseInterface *>(0))
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
(k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
diff --git a/paludis/repositories/virtuals/installed_virtuals_repository.cc b/paludis/repositories/virtuals/installed_virtuals_repository.cc
index 5441beb17..f1c52800a 100644
--- a/paludis/repositories/virtuals/installed_virtuals_repository.cc
+++ b/paludis/repositories/virtuals/installed_virtuals_repository.cc
@@ -112,7 +112,6 @@ InstalledVirtualsRepository::InstalledVirtualsRepository(const Environment * con
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
(k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
(k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
diff --git a/paludis/repositories/virtuals/virtuals_repository.cc b/paludis/repositories/virtuals/virtuals_repository.cc
index 0f1c6f449..bb582a41b 100644
--- a/paludis/repositories/virtuals/virtuals_repository.cc
+++ b/paludis/repositories/virtuals/virtuals_repository.cc
@@ -119,7 +119,6 @@ VirtualsRepository::VirtualsRepository(const Environment * const env) :
(k::syncable_interface(), static_cast<RepositorySyncableInterface *>(0))
(k::mirrors_interface(), static_cast<RepositoryMirrorsInterface *>(0))
(k::environment_variable_interface(), static_cast<RepositoryEnvironmentVariableInterface *>(0))
- (k::world_interface(), static_cast<RepositoryWorldInterface *>(0))
(k::provides_interface(), static_cast<RepositoryProvidesInterface *>(0))
(k::virtuals_interface(), static_cast<RepositoryVirtualsInterface *>(0))
(k::destination_interface(), static_cast<RepositoryDestinationInterface *>(0))
diff --git a/paludis/repository-fwd.hh b/paludis/repository-fwd.hh
index 9ddfab9a0..37bcb952d 100644
--- a/paludis/repository-fwd.hh
+++ b/paludis/repository-fwd.hh
@@ -51,7 +51,6 @@ namespace paludis
class RepositorySetsInterface;
class RepositorySyncableInterface;
class RepositoryUseInterface;
- class RepositoryWorldInterface;
class RepositoryEnvironmentVariableInterface;
class RepositoryMirrorsInterface;
class RepositoryProvidesInterface;
@@ -83,7 +82,6 @@ namespace paludis
kc::Field<k::sets_interface, RepositorySetsInterface *>,
kc::Field<k::syncable_interface, RepositorySyncableInterface *>,
kc::Field<k::use_interface, RepositoryUseInterface *>,
- kc::Field<k::world_interface, RepositoryWorldInterface *>,
kc::Field<k::mirrors_interface, RepositoryMirrorsInterface *>,
kc::Field<k::environment_variable_interface, RepositoryEnvironmentVariableInterface *>,
kc::Field<k::provides_interface, RepositoryProvidesInterface *>,
diff --git a/paludis/repository.cc b/paludis/repository.cc
index 9b5a22f33..5eaa0fc07 100644
--- a/paludis/repository.cc
+++ b/paludis/repository.cc
@@ -163,10 +163,6 @@ RepositoryUseInterface::~RepositoryUseInterface()
{
}
-RepositoryWorldInterface::~RepositoryWorldInterface()
-{
-}
-
RepositoryEnvironmentVariableInterface::~RepositoryEnvironmentVariableInterface()
{
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index aa47391e9..f92a89db6 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -383,44 +383,6 @@ namespace paludis
};
/**
- * Interface for world handling for repositories.
- *
- * \see Repository
- * \ingroup g_repository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE RepositoryWorldInterface
- {
- public:
- ///\name World functionality
- ///\{
-
- /**
- * Add this package to world.
- */
- virtual void add_to_world(const QualifiedPackageName &) const = 0;
-
- /**
- * Add this set to world.
- */
- virtual void add_to_world(const SetName &) const = 0;
-
- /**
- * Remove this package from world, if it is present.
- */
- virtual void remove_from_world(const QualifiedPackageName &) const = 0;
-
- /**
- * Remove this set from world, if it is present.
- */
- virtual void remove_from_world(const SetName &) const = 0;
-
- ///\}
-
- virtual ~RepositoryWorldInterface();
- };
-
- /**
* Interface for environment variable querying for repositories.
*
* \see Repository
diff --git a/paludis/uninstall_task.cc b/paludis/uninstall_task.cc
index 1b84f65c9..9e26fdb71 100644
--- a/paludis/uninstall_task.cc
+++ b/paludis/uninstall_task.cc
@@ -409,12 +409,7 @@ UninstallTask::set_all_versions(const bool value)
void
UninstallTask::world_remove_set(const SetName & s)
{
- for (PackageDatabase::RepositoryConstIterator r(_imp->env->package_database()->begin_repositories()),
- r_end(_imp->env->package_database()->end_repositories()) ;
- r != r_end ; ++r)
- if ((**r)[k::world_interface()])
- (**r)[k::world_interface()]->remove_from_world(s);
-
+ _imp->env->remove_from_world(s);
on_update_world(s);
}
@@ -439,11 +434,8 @@ namespace
{
if (! (a.slot_requirement_ptr() || (a.version_requirements_ptr() && ! a.version_requirements_ptr()->empty())))
{
- for (PackageDatabase::RepositoryConstIterator r(env->package_database()->begin_repositories()),
- r_end(env->package_database()->end_repositories()) ;
- r != r_end ; ++r)
- if ((**r)[k::world_interface()] && a.package_ptr())
- (**r)[k::world_interface()]->remove_from_world(*a.package_ptr());
+ if (a.package_ptr())
+ env->remove_from_world(*a.package_ptr());
task->on_update_world(a);
}