aboutsummaryrefslogtreecommitdiff
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
parent410f8b38e6bb0feb13e2d5e5c3ac34c4e87c0fee (diff)
downloadpaludis-a297ce7c92fc48b2e5f7df4a2624c25ddab3b81d.tar.gz
paludis-a297ce7c92fc48b2e5f7df4a2624c25ddab3b81d.tar.xz
world is now in env, not repos. Fixes: ticket:421
-rw-r--r--NEWS4
-rw-r--r--doc/configuration/environment.html.part.in5
-rw-r--r--doc/configuration/vdb.html.part.in3
-rw-r--r--doc/faq/Makefile.am12
-rw-r--r--doc/faq/index.html.part6
-rw-r--r--doc/faq/toplinks.html.part.in2
-rw-r--r--doc/faq/upgrades.html.part24
-rw-r--r--doc/index.html.part.in1
-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
-rwxr-xr-xpython/dep_list_TEST_setup.sh4
-rw-r--r--python/environment.cc44
-rwxr-xr-xpython/environment_TEST_setup.sh4
-rwxr-xr-xpython/mask_TEST_setup.sh4
-rwxr-xr-xpython/package_database_TEST_setup.sh4
-rw-r--r--python/repository.cc21
-rwxr-xr-xpython/repository_TEST.py4
-rwxr-xr-xpython/repository_TEST_setup.sh4
-rwxr-xr-xruby/action_TEST_setup.sh4
-rwxr-xr-xruby/dep_list_TEST_setup.sh4
-rwxr-xr-xruby/dep_spec_TEST_setup.sh4
-rwxr-xr-xruby/dep_tag_TEST_setup.sh4
-rwxr-xr-xruby/environment_TEST_setup.sh4
-rwxr-xr-xruby/package_database_TEST_setup.sh4
-rwxr-xr-xruby/paludis_ruby_TEST_setup.sh6
-rw-r--r--ruby/repository.cc9
-rw-r--r--ruby/repository_TEST.rb2
-rwxr-xr-xruby/repository_TEST_setup.sh4
-rwxr-xr-xsrc/clients/paludis/continue_on_failure_TEST_setup.sh4
-rwxr-xr-xsrc/clients/paludis/install_TEST4
-rwxr-xr-xsrc/clients/paludis/install_TEST_setup.sh4
-rw-r--r--vim/syntax/paludis-environment-conf.vim4
-rw-r--r--vim/syntax/paludis-repositories-conf.vim8
75 files changed, 786 insertions, 519 deletions
diff --git a/NEWS b/NEWS
index 02060bd..3310088 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,10 @@ News for Paludis
This file lists the major changes between versions. For a more detailed list
of every change, see the ChangeLog.
+trunk/:
+ * World is now handled by environment, not individual repositories. Consult
+ the FAQ 'Upgrades' section for migration instructions.
+
0.26.0_alpha12:
* The merger is able to detect hardlinks and tries to merge them as such.
diff --git a/doc/configuration/environment.html.part.in b/doc/configuration/environment.html.part.in
index 5698491..8a44ac5 100644
--- a/doc/configuration/environment.html.part.in
+++ b/doc/configuration/environment.html.part.in
@@ -4,10 +4,13 @@
###PALUDISENVIRONMENTONLY###
-<p>The optional file <code>environment.conf</code> can be used to control general environment settings. It is a standard
+<p>The <code>environment.conf</code> file can be used to control general environment settings. It is a standard
key=value configuration file, and may optionally be in bash format. Recognised keys are as follows:</p>
<dl>
+ <dt>world</dt>
+ <dd>The location of the world file.</dd>
+
<dt>reduced_username</dt>
<dd>If set, Paludis will use this username rather than <code>paludisbuild</code> when a reduced privilege user is
required.</dd>
diff --git a/doc/configuration/vdb.html.part.in b/doc/configuration/vdb.html.part.in
index 1247a6e..7a1d4ba 100644
--- a/doc/configuration/vdb.html.part.in
+++ b/doc/configuration/vdb.html.part.in
@@ -12,9 +12,6 @@ repositories:</p>
<dd>The location of the repository. Mandatory. On Gentoo systems, this must be <code>${root}/var/db/pkg</code> to
avoid problems with broken ebuilds that illegally access the VDB.</dd>
- <dt><code>world</code></dt>
- <dd>The location of the world file. Optional.</dd>
-
<dt><code>provides_cache</code></dt>
<dd>The directory to use for reading and writing a cache of providers of old-style virtuals. See <a
href="../overview/gettingstarted.html">Getting Started</a> for notes. Optional, set to <code>/var/empty</code>
diff --git a/doc/faq/Makefile.am b/doc/faq/Makefile.am
index c1e3e60..7e53795 100644
--- a/doc/faq/Makefile.am
+++ b/doc/faq/Makefile.am
@@ -11,7 +11,8 @@ CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda \
misfunctionality.html \
operation.html \
stricter.html \
- repositories.html
+ repositories.html \
+ upgrades.html
EXTRA_DIST = \
toplinks.html.part.in \
@@ -22,7 +23,8 @@ EXTRA_DIST = \
misfunctionality.html.part \
operation.html.part \
stricter.html.part \
- repositories.html.part
+ repositories.html.part \
+ upgrades.html.part
paludisfaqhtmldir = $(htmldir)/faq
@@ -34,7 +36,8 @@ paludisfaqhtml_DATA = \
misfunctionality.html \
operation.html \
stricter.html \
- repositories.html
+ repositories.html \
+ upgrades.html
if HAVE_HTMLTIDY
@@ -67,6 +70,9 @@ stricter.html : header.html.part $(srcdir)/stricter.html.part footer.html.part
repositories.html : header.html.part $(srcdir)/repositories.html.part footer.html.part
cat header.html.part $(srcdir)/repositories.html.part footer.html.part > $@
+upgrades.html : header.html.part $(srcdir)/upgrades.html.part footer.html.part
+ cat header.html.part $(srcdir)/upgrades.html.part footer.html.part > $@
+
header.html.part : $(srcdir)/../header.html.part.in toplinks.html.part
sed \
-e 's,###TOPURI###,../,g' \
diff --git a/doc/faq/index.html.part b/doc/faq/index.html.part
index 502f706..a222248 100644
--- a/doc/faq/index.html.part
+++ b/doc/faq/index.html.part
@@ -79,3 +79,9 @@ functionality. Pestering anyone about these is liable to get you hurt a lot.</p>
<li><a href="repositories.html#repo_name">Repository names</a></li>
</ul>
+<h2>Upgrades, Old Bugs and Migration</h2>
+
+<ul>
+ <li><a href="upgrades.html#world-0.26.0_alpha13">World changes in 0.26.0_alpha13</a></li>
+</ul>
+
diff --git a/doc/faq/toplinks.html.part.in b/doc/faq/toplinks.html.part.in
index 419cd40..7adc034 100644
--- a/doc/faq/toplinks.html.part.in
+++ b/doc/faq/toplinks.html.part.in
@@ -74,7 +74,7 @@
</td>
<td class="currentpage">
- &nbsp;
+ <a href="###TOPURI###faq/upgrades.html">Upgrades, Old Bugs, Migration</a>
</td>
</tr>
</table>
diff --git a/doc/faq/upgrades.html.part b/doc/faq/upgrades.html.part
new file mode 100644
index 0000000..8c0963c
--- /dev/null
+++ b/doc/faq/upgrades.html.part
@@ -0,0 +1,24 @@
+<!-- vim: set tw=120 ft=html sw=4 sts=4 et : -->
+
+<h1>FAQ: Upgrades, Old Bugs and Migration</h1>
+
+<ul>
+ <li><a href="upgrades.html#world-0.26.0_alpha13">World changes in 0.26.0_alpha13</a></li>
+</ul>
+
+<h2 id="world-0.26.0_alpha13">World changes in 0.26.0_alpha13</h2>
+
+<p>Before 0.26.0_alpha13, every installed package repository had its own individual <code>world</code>
+set handling code. Now instead there is a single global <code>world</code> file maintained by the
+environment.</p>
+
+<p>If you are using the Portage configuration format, <code>/var/lib/portage/world</code> will continue
+to be used, and there is no need to change anything.</p>
+
+<p>If you are using the Paludis configuration format, you must specify the <code>world</code> key
+in <a href="../configuration/environment.html">environment.conf</a>. If this key is not specified,
+no file will be written to for world updates.</p>
+
+<p>To ease the upgrade, any <code>world</code> key explicitly specified for a VDB repository will
+continue to be used for reading but not writing.</p>
+
diff --git a/doc/index.html.part.in b/doc/index.html.part.in
index 6dbc6e0..3061ff7 100644
--- a/doc/index.html.part.in
+++ b/doc/index.html.part.in
@@ -29,6 +29,7 @@
things.</li>
<li><a href="faq/different.html">Things Paludis does differently</a>: why Paludis does some things differently.</li>
<li><a href="faq/repositories.html">Repository questions</a>.</li>
+ <li><a href="faq/upgrades.html">Upgrades, old bugs and migration</a>.</li>
</ul>
<h2>Configuration</h2>
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 21f70f3..2d7351f 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 e30afd9..28a2fa6 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 14146a3..1d7b0b7 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 d4736ff..17e67cf 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 0683eb1..e64d0ff 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 dd9657f..c75ecf3 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 9c49b06..1946be2 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 1bbd956..3c059b4 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 603f44b..f8969d6 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 8534805..93d901f 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 892bf17..555eb89 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 148ec44..af76769 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 0000000..8388168
--- /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 0000000..87b05a0
--- /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 ccba734..f66219c 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 faeeb31..0370220 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 18e4fab..0243fbf 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 a79121e..d4a9dcc 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 a23142a..881c914 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 842918e..1f1dc34 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 d3f7840..1ca3ea9 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 150c7d9..c892bb2 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 a86d6aa..12c2ff9 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 177c068..a7cec5c 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 4a1a3cb..342bffb 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 a56ace3..c9914db 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 9296d16..93e9581 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 b4d9367..06e3643 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 e63f68d..5f1d6fe 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 e5278e2..447eb1b 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 cfa8ada..f18fe13 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 a44624e..bb2a4c0 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 29cb158..9ec7edb 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 c627048..128e450 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 b206cc2..23c116e 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 b826cd5..151d7f8 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 3f79d22..aeca2f7 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 de09f1f..58f4f29 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 5441beb..f1c5280 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 0f1c6f4..bb582a4 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 9ddfab9..37bcb95 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 9b5a22f..5eaa0fc 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 aa47391..f92a89d 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 1b84f65..9e26fdb 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);
}
diff --git a/python/dep_list_TEST_setup.sh b/python/dep_list_TEST_setup.sh
index 79e0238..f54929d 100755
--- a/python/dep_list_TEST_setup.sh
+++ b/python/dep_list_TEST_setup.sh
@@ -39,6 +39,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,sets,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
diff --git a/python/environment.cc b/python/environment.cc
index d8751f9..84c21d8 100644
--- a/python/environment.cc
+++ b/python/environment.cc
@@ -344,6 +344,50 @@ class EnvironmentImplementationWrapper :
return EnvironmentImplementation::default_distribution();
}
+ virtual void add_to_world(const QualifiedPackageName & s) const
+ {
+ Lock l(get_mutex());
+ if (bp::override f = get_override("add_to_world"))
+ f(s);
+ else
+ throw PythonMethodNotImplemented("EnvironmentImplementation", "add_to_world");
+ }
+
+ virtual void add_to_world(const SetName & s) const
+ {
+ Lock l(get_mutex());
+ if (bp::override f = get_override("add_to_world"))
+ f(s);
+ else
+ throw PythonMethodNotImplemented("EnvironmentImplementation", "add_to_world");
+ }
+
+ virtual void remove_from_world(const QualifiedPackageName & s) const
+ {
+ Lock l(get_mutex());
+ if (bp::override f = get_override("remove_from_world"))
+ f(s);
+ else
+ throw PythonMethodNotImplemented("EnvironmentImplementation", "remove_from_world");
+ }
+
+ virtual void remove_from_world(const SetName & s) const
+ {
+ Lock l(get_mutex());
+ if (bp::override f = get_override("remove_from_world"))
+ f(s);
+ else
+ throw PythonMethodNotImplemented("EnvironmentImplementation", "remove_from_world");
+ }
+
+ virtual tr1::shared_ptr<SetSpecTree::ConstItem> world_set() const
+ {
+ Lock l(get_mutex());
+ if (bp::override f = get_override("world_set"))
+ return f();
+ else
+ throw PythonMethodNotImplemented("EnvironmentImplementation", "world_set");
+ }
};
struct NoConfigEnvironmentWrapper :
diff --git a/python/environment_TEST_setup.sh b/python/environment_TEST_setup.sh
index f83a38a..e3c2314 100755
--- a/python/environment_TEST_setup.sh
+++ b/python/environment_TEST_setup.sh
@@ -36,6 +36,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
diff --git a/python/mask_TEST_setup.sh b/python/mask_TEST_setup.sh
index ff53c62..66f050f 100755
--- a/python/mask_TEST_setup.sh
+++ b/python/mask_TEST_setup.sh
@@ -82,3 +82,7 @@ cat <<END > home/.paludis/keywords.conf
*/* test
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
diff --git a/python/package_database_TEST_setup.sh b/python/package_database_TEST_setup.sh
index 0d758cf..4abeb7b 100755
--- a/python/package_database_TEST_setup.sh
+++ b/python/package_database_TEST_setup.sh
@@ -28,6 +28,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files,foo/baz/files,quux/baz/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
diff --git a/python/repository.cc b/python/repository.cc
index 7db6de7..90ce6c9 100644
--- a/python/repository.cc
+++ b/python/repository.cc
@@ -57,12 +57,6 @@ struct RepositoryWrapper :
return self[k::use_interface()];
}
- static RepositoryWorldInterface *
- get_world_interface(const Repository & self)
- {
- return self[k::world_interface()];
- }
-
static RepositoryMirrorsInterface *
get_mirrors_interface(const Repository & self)
{
@@ -233,11 +227,6 @@ void expose_repository()
"[ro] RepositorySyncableInterface"
)
- .add_property("world_interface", bp::make_function(&RepositoryWrapper::get_world_interface,
- bp::return_internal_reference<>()),
- "[ro] RepositoryWorldInterface"
- )
-
.add_property("environment_variable_interface",
bp::make_function(&RepositoryWrapper::get_environment_variable_interface,
bp::return_internal_reference<>()),
@@ -350,16 +339,6 @@ void expose_repository()
);
/**
- * RepositoryWorldInterface
- */
- bp::class_<RepositoryWorldInterface, boost::noncopyable>
- (
- "RepositoryWorldInterface",
- "Interface for world handling for repositories.",
- bp::no_init
- );
-
- /**
* RepositoryEnvironmentVariableInterface
*/
bp::class_<RepositoryEnvironmentVariableInterface, boost::noncopyable>
diff --git a/python/repository_TEST.py b/python/repository_TEST.py
index 0e3ca76..aab5d54 100755
--- a/python/repository_TEST.py
+++ b/python/repository_TEST.py
@@ -142,10 +142,6 @@ class TestCase_02_RepositoryInterfaces(unittest.TestCase):
self.assert_(ui.describe_use_flag("test1", pid), "A test use flag")
- def test_05_world_interface(self):
- wi = irepo.world_interface
- self.assert_(isinstance(wi, RepositoryWorldInterface))
-
def test_06_environment_variable_interface(self):
evi = repo.environment_variable_interface
self.assert_(isinstance(evi, RepositoryEnvironmentVariableInterface))
diff --git a/python/repository_TEST_setup.sh b/python/repository_TEST_setup.sh
index 638fd82..cbe51eb 100755
--- a/python/repository_TEST_setup.sh
+++ b/python/repository_TEST_setup.sh
@@ -35,6 +35,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,licenses,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1
diff --git a/ruby/action_TEST_setup.sh b/ruby/action_TEST_setup.sh
index 2611b94..2a2fc91 100755
--- a/ruby/action_TEST_setup.sh
+++ b/ruby/action_TEST_setup.sh
@@ -35,6 +35,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1
diff --git a/ruby/dep_list_TEST_setup.sh b/ruby/dep_list_TEST_setup.sh
index bdd939d..c2c1689 100755
--- a/ruby/dep_list_TEST_setup.sh
+++ b/ruby/dep_list_TEST_setup.sh
@@ -39,6 +39,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
diff --git a/ruby/dep_spec_TEST_setup.sh b/ruby/dep_spec_TEST_setup.sh
index 02d2b3a..9f90744 100755
--- a/ruby/dep_spec_TEST_setup.sh
+++ b/ruby/dep_spec_TEST_setup.sh
@@ -14,6 +14,10 @@ cache = /var/empty
profiles = \${location}/profiles/testprofile
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files,bar/foo/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
diff --git a/ruby/dep_tag_TEST_setup.sh b/ruby/dep_tag_TEST_setup.sh
index af9a8dd..738fd96 100755
--- a/ruby/dep_tag_TEST_setup.sh
+++ b/ruby/dep_tag_TEST_setup.sh
@@ -14,6 +14,10 @@ cache = /var/empty
profiles = \${location}/profiles/testprofile
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
diff --git a/ruby/environment_TEST_setup.sh b/ruby/environment_TEST_setup.sh
index 1ee52e1..12c0f5d 100755
--- a/ruby/environment_TEST_setup.sh
+++ b/ruby/environment_TEST_setup.sh
@@ -37,6 +37,10 @@ foo/bar GPL-2
foo/baz *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files,foo/baz/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
diff --git a/ruby/package_database_TEST_setup.sh b/ruby/package_database_TEST_setup.sh
index 9182e80..5cc400a 100755
--- a/ruby/package_database_TEST_setup.sh
+++ b/ruby/package_database_TEST_setup.sh
@@ -28,6 +28,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files,foo/baz/files,quux/baz/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
diff --git a/ruby/paludis_ruby_TEST_setup.sh b/ruby/paludis_ruby_TEST_setup.sh
index 4897c83..13b07dd 100755
--- a/ruby/paludis_ruby_TEST_setup.sh
+++ b/ruby/paludis_ruby_TEST_setup.sh
@@ -35,6 +35,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = `pwd`/world
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1
echo "testrepo" > profiles/repo_name || exit 1
@@ -73,6 +77,6 @@ cd ..
mkdir -p installed || exit 1
-echo "foo/bar" > installed/world
+echo "foo/bar" > world
diff --git a/ruby/repository.cc b/ruby/repository.cc
index 537e2bf..6c54699 100644
--- a/ruby/repository.cc
+++ b/ruby/repository.cc
@@ -330,14 +330,6 @@ namespace
* Returns self if the repository supports the interface, otherwise Nil.
*/
/*
- * Document-method: world_interface
- *
- * call-seq:
- * world_interface -> self or Nil
- *
- * Returns self if the repository supports the interface, otherwise Nil.
- */
- /*
* Document-method: mirrors_interface
*
* call-seq:
@@ -928,7 +920,6 @@ namespace
rb_define_method(c_repository, "sets_interface", RUBY_FUNC_CAST((&Interface< k::sets_interface>::fetch)), 0);
rb_define_method(c_repository, "syncable_interface", RUBY_FUNC_CAST((&Interface< k::syncable_interface>::fetch)), 0);
rb_define_method(c_repository, "use_interface", RUBY_FUNC_CAST((&Interface< k::use_interface>::fetch)), 0);
- rb_define_method(c_repository, "world_interface", RUBY_FUNC_CAST((&Interface< k::world_interface>::fetch)), 0);
rb_define_method(c_repository, "mirrors_interface", RUBY_FUNC_CAST((&Interface< k::mirrors_interface>::fetch)), 0);
rb_define_method(c_repository, "environment_variable_interface", RUBY_FUNC_CAST((&Interface<
k::environment_variable_interface>::fetch)), 0);
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 94e7662..f1416c7 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -170,7 +170,7 @@ module Paludis
def test_responds
repo = no_config_testrepo.main_repository
[:sets_interface, :syncable_interface, :use_interface,
- :world_interface, :mirrors_interface, :environment_variable_interface,
+ :mirrors_interface, :environment_variable_interface,
:provides_interface, :virtuals_interface, :e_interface,
:qa_interface].each do |sym|
assert_respond_to repo, sym
diff --git a/ruby/repository_TEST_setup.sh b/ruby/repository_TEST_setup.sh
index d16e4ef..1ba3472 100755
--- a/ruby/repository_TEST_setup.sh
+++ b/ruby/repository_TEST_setup.sh
@@ -35,6 +35,10 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
+cat <<END > home/.paludis/environment.conf
+world = /dev/null
+END
+
mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
cd testrepo || exit 1
diff --git a/src/clients/paludis/continue_on_failure_TEST_setup.sh b/src/clients/paludis/continue_on_failure_TEST_setup.sh
index eab7a79..6efbd0f 100755
--- a/src/clients/paludis/continue_on_failure_TEST_setup.sh
+++ b/src/clients/paludis/continue_on_failure_TEST_setup.sh
@@ -24,6 +24,10 @@ cat <<END > root/${SYSCONFDIR}/paludis/keywords.conf
*/* test
END
+cat <<END > root/${SYSCONFDIR}/paludis/environment.conf
+world = `pwd`/root/world
+END
+
cat <<END > root/${SYSCONFDIR}/paludis/bashrc
export CHOST="my-chost"
END
diff --git a/src/clients/paludis/install_TEST b/src/clients/paludis/install_TEST
index af71109..20a0b26 100755
--- a/src/clients/paludis/install_TEST
+++ b/src/clients/paludis/install_TEST
@@ -17,7 +17,7 @@ for c in vdb_config exndbam_config ; do
cat install_TEST_dir/fixedresume
PALUDIS_HOME=./install_TEST_dir/config/ bash `pwd`/install_TEST_dir/fixedresume --checks none || exit 3
./install_TEST_dir/root/usr/bin/testbin | grep success >/dev/null || exit 4
- grep target install_TEST_dir/root/var/db/$([[ $c == vdb_config ]] && echo pkg || echo exndbam )/world >/dev/null || exit 5
+ grep target install_TEST_dir/root/world-${c%_config} || exit 5
PALUDIS_HOME=./install_TEST_dir/config/ ./paludis --environment :install-test-$c \
--has-version test-category/target || exit 6
PALUDIS_HOME=./install_TEST_dir/config/ ./paludis --environment :install-test-$c \
@@ -27,7 +27,7 @@ for c in vdb_config exndbam_config ; do
[[ -f ./install_TEST_dir/root/usr/bin/testbin ]] && exit 8
PALUDIS_HOME=./install_TEST_dir/config/ ./paludis --environment :install-test-$c \
--has-version test-category/target && exit 9
- grep target install_TEST_dir/root/var/db/$([[ $c == vdb_config ]] && echo pkg || echo exndbam )/world >/dev/null && exit 10
+ grep target install_TEST_dir/root/world-${c%_config} >/dev/null && exit 10
PALUDIS_HOME=./install_TEST_dir/config/ ./paludis --environment :install-test-$c \
-qMD test-category/target || exit 11
diff --git a/src/clients/paludis/install_TEST_setup.sh b/src/clients/paludis/install_TEST_setup.sh
index 697dd8b..7750221 100755
--- a/src/clients/paludis/install_TEST_setup.sh
+++ b/src/clients/paludis/install_TEST_setup.sh
@@ -24,6 +24,10 @@ for c in vdb exndbam ; do
*/* foo
END
+ cat <<END > root/${SYSCONFDIR}/paludis${c}/environment.conf
+world = `pwd`/root/world-${c}
+END
+
cat <<END > root/${SYSCONFDIR}/paludis${c}/licenses.conf
*/* *
END
diff --git a/vim/syntax/paludis-environment-conf.vim b/vim/syntax/paludis-environment-conf.vim
index 9b671e3..6318746 100644
--- a/vim/syntax/paludis-environment-conf.vim
+++ b/vim/syntax/paludis-environment-conf.vim
@@ -1,7 +1,7 @@
" Vim syntax file
" Language: Paludis environment.conf files
" Author: Ciaran McCreesh
-" Copyright: Copyright (c) 2007 Ciaran McCreesh
+" Copyright: Copyright (c) 2007, 2008 Ciaran McCreesh
" Licence: You may redistribute this under the same terms as Vim itself
"
" Syntax highlighting for Paludis environment.conf files.
@@ -38,7 +38,7 @@ syn region PaludisEnvironmentConfString contained start=/"/ end=/"/
\ skipwhite
syn keyword PaludisEnvironmentConfKnownKey contained
- \ reduced_username portage_compatible distribution
+ \ reduced_username portage_compatible distribution world
syn match PaludisEnvironmentConfVariable contained /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite
diff --git a/vim/syntax/paludis-repositories-conf.vim b/vim/syntax/paludis-repositories-conf.vim
index fe4ad89..598db18 100644
--- a/vim/syntax/paludis-repositories-conf.vim
+++ b/vim/syntax/paludis-repositories-conf.vim
@@ -18,7 +18,7 @@ endif
syn region PaludisRepositoriesConfComment start=/^\s*#/ end=/$/
syn region PaludisRepositoriesConfKey start=/^\(\s*[^#]\)\@=/ end=/=\@=/
- \ contains=PaludisRepositoriesConfKnownKey
+ \ contains=PaludisRepositoriesConfKnownKey,PaludisRepositoriesConfBadKey
syn match PaludisRepositoriesConfEquals /=/ skipwhite
\ nextgroup=PaludisRepositoriesConfValue
@@ -42,17 +42,21 @@ syn keyword PaludisRepositoriesConfKnownKey contained
\ location distdir format builddir library sync root yaml_uri
\ master_repository profiles pkgdir setsdir securitydir newsdir
\ names_cache sync sync_options eclassdirs cache write_cache
- \ world provides_cache importance layout use_manifest
+ \ provides_cache importance layout use_manifest
\ binary_uri_prefix binary_keywords binary_destination
\ eapi_when_unspecified eapi_when_unknown profile_eapi
\ name
+syn keyword PaludisRepositoriesConfBadKey contained
+ \ world
+
syn keyword PaludisRepositoriesConfKnownValue contained
\ use require ignore
syn match PaludisRepositoriesConfVariable contained /\$\({[^}]\+}\|[a-zA-Z0-9_]\+\)/ skipwhite
hi def link PaludisRepositoriesConfKnownKey Keyword
+hi def link PaludisRepositoriesConfBadKey Error
hi def link PaludisRepositoriesConfKnownValue Keyword
hi def link PaludisRepositoriesConfString String
hi def link PaludisRepositoriesConfUnquoted Constant