aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-27 06:01:56 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-27 06:01:56 +0000
commit67cac6253a3dc1e009e298f963747047019a4253 (patch)
tree0c5c342a0c4c9ef50c5d4a11d70ea2bf2db9acb0
parentc0a9b5c5e4297bef7c045891ef295cfd4e28de48 (diff)
downloadpaludis-67cac6253a3dc1e009e298f963747047019a4253.tar.gz
paludis-67cac6253a3dc1e009e298f963747047019a4253.tar.xz
Split out environment implementations into their own subdirs and libraries. Make a NoConfigEnvironment out of what used to be AdjutrixEnvironment.
-rw-r--r--configure.ac4
-rw-r--r--ebuild/Makefile.am1
-rw-r--r--paludis/Makefile.am.m43
-rw-r--r--paludis/args/Makefile.am2
-rw-r--r--paludis/dep_list_TEST.cc1
-rw-r--r--paludis/environment/Makefile.am6
-rw-r--r--paludis/environment/default/Makefile.am22
-rw-r--r--paludis/environment/default/default_config.cc (renamed from paludis/default_config.cc)2
-rw-r--r--paludis/environment/default/default_config.hh (renamed from paludis/default_config.hh)0
-rw-r--r--paludis/environment/default/default_environment.cc (renamed from paludis/default_environment.cc)4
-rw-r--r--paludis/environment/default/default_environment.hh (renamed from paludis/default_environment.hh)0
-rw-r--r--paludis/environment/default/default_environment_TEST.cc (renamed from paludis/default_environment_TEST.cc)0
-rwxr-xr-xpaludis/environment/default/default_environment_TEST_cleanup.sh (renamed from paludis/default_environment_TEST_cleanup.sh)0
-rwxr-xr-xpaludis/environment/default/default_environment_TEST_setup.sh (renamed from paludis/default_environment_TEST_setup.sh)0
-rw-r--r--paludis/environment/no_config/Makefile.am41
-rw-r--r--paludis/environment/no_config/no_config_environment.cc (renamed from src/adjutrix/adjutrix_environment.cc)33
-rw-r--r--paludis/environment/no_config/no_config_environment.hh (renamed from src/adjutrix/adjutrix_environment.hh)14
-rw-r--r--paludis/environment/no_config/no_config_environment.sr10
-rw-r--r--paludis/environment/test/Makefile.am21
-rw-r--r--paludis/environment/test/test_environment.cc (renamed from paludis/test_environment.cc)2
-rw-r--r--paludis/environment/test/test_environment.hh (renamed from paludis/test_environment.hh)0
-rw-r--r--paludis/files.m43
-rw-r--r--paludis/package_database_TEST.cc1
-rw-r--r--paludis/repositories/cran/Makefile.am1
-rw-r--r--paludis/repositories/cran/cran_dep_parser_TEST.cc2
-rw-r--r--paludis/repositories/cran/cran_repository_TEST.cc2
-rw-r--r--paludis/repositories/portage/Makefile.am1
-rw-r--r--paludis/repositories/portage/portage_repository_TEST.cc2
-rw-r--r--paludis/repositories/vdb/Makefile.am1
-rw-r--r--paludis/repositories/vdb/vdb_repository_TEST.cc2
-rw-r--r--ruby/Makefile.am11
-rw-r--r--ruby/default_environment.cc4
-rw-r--r--src/adjutrix/Makefile.am2
-rw-r--r--src/adjutrix/adjutrix.cc6
-rw-r--r--src/adjutrix/display_default_system_resolution.cc4
-rw-r--r--src/adjutrix/display_default_system_resolution.hh4
-rw-r--r--src/adjutrix/display_profiles_use.cc4
-rw-r--r--src/adjutrix/display_profiles_use.hh4
-rw-r--r--src/adjutrix/find_reverse_deps.cc8
-rw-r--r--src/adjutrix/find_reverse_deps.hh4
-rw-r--r--src/gtkpaludis/Makefile.am3
-rw-r--r--src/gtkpaludis/browse_tree.cc2
-rw-r--r--src/gtkpaludis/gtkpaludis.cc2
-rw-r--r--src/gtkpaludis/information_tree.cc2
-rw-r--r--src/gtkpaludis/sync.cc2
-rw-r--r--src/paludis/Makefile.am1
-rw-r--r--src/paludis/applets.cc1
-rw-r--r--src/paludis/contents.cc1
-rw-r--r--src/paludis/install.cc1
-rw-r--r--src/paludis/list.cc1
-rw-r--r--src/paludis/news.cc1
-rw-r--r--src/paludis/owner.cc1
-rw-r--r--src/paludis/paludis.cc2
-rw-r--r--src/paludis/query.cc1
-rw-r--r--src/paludis/sync.cc2
-rw-r--r--src/paludis/uninstall.cc2
-rwxr-xr-xtest/run_test.sh8
57 files changed, 205 insertions, 60 deletions
diff --git a/configure.ac b/configure.ac
index c39842a..1705dcf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -597,6 +597,10 @@ AC_OUTPUT(
paludis/about.hh
paludis/args/Makefile
paludis/digests/Makefile
+ paludis/environment/Makefile
+ paludis/environment/default/Makefile
+ paludis/environment/no_config/Makefile
+ paludis/environment/test/Makefile
paludis/hashed_containers.hh
paludis/qa/Makefile
paludis/repositories/Makefile
diff --git a/ebuild/Makefile.am b/ebuild/Makefile.am
index 731f2a8..915764f 100644
--- a/ebuild/Makefile.am
+++ b/ebuild/Makefile.am
@@ -41,6 +41,7 @@ libexecprog_SCRIPTS = \
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/ebuild/" \
+ PALUDIS_EBUILD_LOG_LEVEL="warning" \
TEST_SCRIPT_DIR="$(srcdir)/" \
bash $(top_srcdir)/ebuild/run_test.bash
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index fc7eb3e..80c686b 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -18,6 +18,7 @@ $1_TEST_LDADD = \
$(top_builddir)/test/libtest.a \
libpaludis.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/environment/test/libpaludistestenvironment.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
$(DYNAMIC_LD_LIBS)
$1_TEST_CXXFLAGS = -I$(top_srcdir)
@@ -62,7 +63,7 @@ DEFS= \
-DLIBDIR=\"$(libdir)\"
EXTRA_DIST = about.hh.in Makefile.am.m4 paludis.hh.m4 files.m4 \
hashed_containers.hh.in testscriptlist srlist srcleanlist
-SUBDIRS = digests util . repositories args qa selinux tasks
+SUBDIRS = digests util . repositories environment args qa selinux tasks
BUILT_SOURCES = srcleanlist
libpaludis_la_SOURCES = filelist
diff --git a/paludis/args/Makefile.am b/paludis/args/Makefile.am
index 41d135f..19ed608 100644
--- a/paludis/args/Makefile.am
+++ b/paludis/args/Makefile.am
@@ -34,6 +34,8 @@ libpaludisargs_la_SOURCES = $(paludis_args_include_HEADERS) \
man.cc
libpaludisargs_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
+libpaludisargs_la_LIBADD = \
+ $(top_builddir)/paludis/util/libpaludisutil.la
TESTS_ENVIRONMENT = env -u PALUDIS_OPTIONS \
TEST_SCRIPT_DIR="$(srcdir)/" \
diff --git a/paludis/dep_list_TEST.cc b/paludis/dep_list_TEST.cc
index 32442dc..b1a27af 100644
--- a/paludis/dep_list_TEST.cc
+++ b/paludis/dep_list_TEST.cc
@@ -20,6 +20,7 @@
#include <paludis/paludis.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
+#include <paludis/environment/test/test_environment.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <string>
diff --git a/paludis/environment/Makefile.am b/paludis/environment/Makefile.am
new file mode 100644
index 0000000..66c2ccb
--- /dev/null
+++ b/paludis/environment/Makefile.am
@@ -0,0 +1,6 @@
+SUBDIRS = default no_config test
+
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
+MAINTAINERCLEANFILES = Makefile.in
+
+
diff --git a/paludis/environment/default/Makefile.am b/paludis/environment/default/Makefile.am
new file mode 100644
index 0000000..59415ba
--- /dev/null
+++ b/paludis/environment/default/Makefile.am
@@ -0,0 +1,22 @@
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
+MAINTAINERCLEANFILES = Makefile.in
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+DEFS= \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DDATADIR=\"$(datadir)\" \
+ -DLIBDIR=\"$(libdir)\"
+
+libpaludisdefaultenvironment_la_SOURCES = \
+ default_config.cc default_config.hh \
+ default_environment.cc default_environment.hh
+
+libpaludisdefaultenvironment_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
+libpaludisdefaultenvironment_la_LIBADD = \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/libpaludis.la
+
+lib_LTLIBRARIES = libpaludisdefaultenvironment.la
+paludis_environment_default_includedir = $(includedir)/paludis/environment/test
+paludis_environment_default_include_HEADERS = default_config.hh default_environment.hh
+
diff --git a/paludis/default_config.cc b/paludis/environment/default/default_config.cc
index 636b4c4..a605280 100644
--- a/paludis/default_config.cc
+++ b/paludis/environment/default/default_config.cc
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
+#include <paludis/environment/default/default_config.hh>
#include <paludis/config_file.hh>
-#include <paludis/default_config.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/compare.hh>
#include <paludis/util/destringify.hh>
diff --git a/paludis/default_config.hh b/paludis/environment/default/default_config.hh
index 45e995d..45e995d 100644
--- a/paludis/default_config.hh
+++ b/paludis/environment/default/default_config.hh
diff --git a/paludis/default_environment.cc b/paludis/environment/default/default_environment.cc
index 76a3f20..6356b29 100644
--- a/paludis/default_environment.cc
+++ b/paludis/environment/default/default_environment.cc
@@ -19,8 +19,8 @@
#include <list>
#include <paludis/config_file.hh>
-#include <paludis/default_config.hh>
-#include <paludis/default_environment.hh>
+#include <paludis/environment/default/default_config.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <paludis/match_package.hh>
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
diff --git a/paludis/default_environment.hh b/paludis/environment/default/default_environment.hh
index c1d416d..c1d416d 100644
--- a/paludis/default_environment.hh
+++ b/paludis/environment/default/default_environment.hh
diff --git a/paludis/default_environment_TEST.cc b/paludis/environment/default/default_environment_TEST.cc
index 91f97c4..91f97c4 100644
--- a/paludis/default_environment_TEST.cc
+++ b/paludis/environment/default/default_environment_TEST.cc
diff --git a/paludis/default_environment_TEST_cleanup.sh b/paludis/environment/default/default_environment_TEST_cleanup.sh
index 3cd5c8d..3cd5c8d 100755
--- a/paludis/default_environment_TEST_cleanup.sh
+++ b/paludis/environment/default/default_environment_TEST_cleanup.sh
diff --git a/paludis/default_environment_TEST_setup.sh b/paludis/environment/default/default_environment_TEST_setup.sh
index bb19c8a..bb19c8a 100755
--- a/paludis/default_environment_TEST_setup.sh
+++ b/paludis/environment/default/default_environment_TEST_setup.sh
diff --git a/paludis/environment/no_config/Makefile.am b/paludis/environment/no_config/Makefile.am
new file mode 100644
index 0000000..f36efb0
--- /dev/null
+++ b/paludis/environment/no_config/Makefile.am
@@ -0,0 +1,41 @@
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda ihateautomake.cc ihateautomake.o
+DISTCLEANFILES = no_config_environment-sr.hh no_config_environment-sr.cc
+MAINTAINERCLEANFILES = Makefile.in
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+DEFS= \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DDATADIR=\"$(datadir)\" \
+ -DLIBDIR=\"$(libdir)\"
+
+libpaludisnoconfigenvironment_la_SOURCES = \
+ no_config_environment.cc no_config_environment.hh
+
+libpaludisnoconfigenvironment_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
+libpaludisnoconfigenvironment_la_LIBADD = \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/repositories/portage/libpaludisportagerepository.la
+
+lib_LTLIBRARIES = libpaludisnoconfigenvironment.la
+paludis_environment_no_config_includedir = $(includedir)/paludis/environment/no_config
+paludis_environment_no_config_include_HEADERS = \
+ no_config_environment.hh \
+ no_config_environment-sr.hh
+
+EXTRA_DIST = \
+ no_config_environment-sr.hh \
+ no_config_environment-sr.cc \
+ no_config_environment.sr
+
+BUILT_SOURCES = \
+ no_config_environment-sr.hh \
+ no_config_environment-sr.cc
+
+no_config_environment-sr.hh : no_config_environment.sr $(top_srcdir)/misc/make_sr.bash
+ $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/no_config_environment.sr > $@
+
+no_config_environment-sr.cc : no_config_environment.sr $(top_srcdir)/misc/make_sr.bash
+ $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/no_config_environment.sr > $@
+
+
diff --git a/src/adjutrix/adjutrix_environment.cc b/paludis/environment/no_config/no_config_environment.cc
index a78f1eb..ade332e 100644
--- a/src/adjutrix/adjutrix_environment.cc
+++ b/paludis/environment/no_config/no_config_environment.cc
@@ -17,35 +17,38 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "adjutrix_environment.hh"
-#include "command_line.hh"
+#include "no_config_environment.hh"
#include <paludis/util/collection_concrete.hh>
#include <paludis/repositories/portage/portage_repository.hh>
#include <set>
using namespace paludis;
+#include <paludis/environment/no_config/no_config_environment-sr.cc>
+
namespace paludis
{
template<>
- struct Implementation<AdjutrixEnvironment> :
- InternalCounted<Implementation<AdjutrixEnvironment> >
+ struct Implementation<NoConfigEnvironment> :
+ InternalCounted<Implementation<NoConfigEnvironment> >
{
const FSEntry top_level_dir;
+ bool accept_unstable;
PackageDatabase::Pointer db;
std::set<KeywordName> accepted_keywords;
- Implementation(Environment * const env, const FSEntry & d) :
- top_level_dir(d),
+ Implementation(Environment * const env, const NoConfigEnvironmentParams & params) :
+ top_level_dir(params.repository_dir),
+ accept_unstable(params.accept_unstable),
db(new PackageDatabase(env))
{
}
};
}
-AdjutrixEnvironment::AdjutrixEnvironment(const FSEntry & dir) :
- PrivateImplementationPattern<AdjutrixEnvironment>(
- new Implementation<AdjutrixEnvironment>(this, dir)),
+NoConfigEnvironment::NoConfigEnvironment(const NoConfigEnvironmentParams & params) :
+ PrivateImplementationPattern<NoConfigEnvironment>(
+ new Implementation<NoConfigEnvironment>(this, params)),
Environment(_imp->db)
{
AssociativeCollection<std::string, std::string>::Pointer keys(
@@ -63,24 +66,24 @@ AdjutrixEnvironment::AdjutrixEnvironment(const FSEntry & dir) :
_imp->db.raw_pointer(), AssociativeCollection<std::string, std::string>::Pointer(0)));
}
-AdjutrixEnvironment::~AdjutrixEnvironment()
+NoConfigEnvironment::~NoConfigEnvironment()
{
}
std::string
-AdjutrixEnvironment::paludis_command() const
+NoConfigEnvironment::paludis_command() const
{
return "false";
}
FSEntry
-AdjutrixEnvironment::main_repository_dir() const
+NoConfigEnvironment::main_repository_dir() const
{
return _imp->top_level_dir;
}
void
-AdjutrixEnvironment::set_profile(const FSEntry & location)
+NoConfigEnvironment::set_profile(const FSEntry & location)
{
PackageDatabase::Pointer db(new PackageDatabase(this));
@@ -100,14 +103,14 @@ AdjutrixEnvironment::set_profile(const FSEntry & location)
_imp->accepted_keywords.clear();
_imp->accepted_keywords.insert(KeywordName("*"));
_imp->accepted_keywords.insert(KeywordName(p->profile_variable("ARCH")));
- if (CommandLine::get_instance()->a_unstable.specified())
+ if (_imp->accept_unstable)
_imp->accepted_keywords.insert(KeywordName("~" + p->profile_variable("ARCH")));
change_package_database(db);
}
bool
-AdjutrixEnvironment::accept_keyword(const KeywordName & k, const PackageDatabaseEntry * const) const
+NoConfigEnvironment::accept_keyword(const KeywordName & k, const PackageDatabaseEntry * const) const
{
return _imp->accepted_keywords.end() != _imp->accepted_keywords.find(k);
}
diff --git a/src/adjutrix/adjutrix_environment.hh b/paludis/environment/no_config/no_config_environment.hh
index edb4cea..323b81d 100644
--- a/src/adjutrix/adjutrix_environment.hh
+++ b/paludis/environment/no_config/no_config_environment.hh
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_SRC_ARCHTOOL_ARCHTOOL_ENVIRONMENT_HH
-#define PALUDIS_GUARD_SRC_ARCHTOOL_ARCHTOOL_ENVIRONMENT_HH 1
+#ifndef PALUDIS_GUARD_PALUDIS_ENVIRONMENT_NO_CONFIG_NO_CONFIG_ENVIRONMENT_HH
+#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_NO_CONFIG_NO_CONFIG_ENVIRONMENT_HH 1
#include <paludis/environment.hh>
#include <paludis/util/fs_entry.hh>
@@ -26,14 +26,16 @@
namespace paludis
{
- class AdjutrixEnvironment :
- private PrivateImplementationPattern<AdjutrixEnvironment>,
+#include <paludis/environment/no_config/no_config_environment-sr.hh>
+
+ class NoConfigEnvironment :
+ private PrivateImplementationPattern<NoConfigEnvironment>,
public Environment
{
public:
- AdjutrixEnvironment(const FSEntry & dir);
+ NoConfigEnvironment(const NoConfigEnvironmentParams & params);
- virtual ~AdjutrixEnvironment();
+ virtual ~NoConfigEnvironment();
virtual std::string paludis_command() const;
diff --git a/paludis/environment/no_config/no_config_environment.sr b/paludis/environment/no_config/no_config_environment.sr
new file mode 100644
index 0000000..7138165
--- /dev/null
+++ b/paludis/environment/no_config/no_config_environment.sr
@@ -0,0 +1,10 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+make_class_NoConfigEnvironmentParams()
+{
+ key repository_dir "FSEntry"
+ key accept_unstable bool
+ allow_named_args
+}
+
diff --git a/paludis/environment/test/Makefile.am b/paludis/environment/test/Makefile.am
new file mode 100644
index 0000000..a69574e
--- /dev/null
+++ b/paludis/environment/test/Makefile.am
@@ -0,0 +1,21 @@
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda ihateautomake.cc ihateautomake.o
+MAINTAINERCLEANFILES = Makefile.in
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+DEFS= \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\" \
+ -DDATADIR=\"$(datadir)\" \
+ -DLIBDIR=\"$(libdir)\"
+
+libpaludistestenvironment_la_SOURCES = \
+ test_environment.cc test_environment.hh
+
+libpaludistestenvironment_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
+libpaludistestenvironment_la_LIBADD = \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/libpaludis.la
+
+lib_LTLIBRARIES = libpaludistestenvironment.la
+paludis_environment_test_includedir = $(includedir)/paludis/environment/test
+paludis_environment_test_include_HEADERS = test_environment.hh
+
diff --git a/paludis/test_environment.cc b/paludis/environment/test/test_environment.cc
index 496ab34..7e1ce46 100644
--- a/paludis/test_environment.cc
+++ b/paludis/environment/test/test_environment.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/test_environment.hh>
+#include <paludis/environment/test/test_environment.hh>
#include <paludis/util/collection_concrete.hh>
#include <map>
#include <string>
diff --git a/paludis/test_environment.hh b/paludis/environment/test/test_environment.hh
index 586aa10..586aa10 100644
--- a/paludis/test_environment.hh
+++ b/paludis/environment/test/test_environment.hh
diff --git a/paludis/files.m4 b/paludis/files.m4
index 11535b9..1bc9b9d 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -11,8 +11,6 @@ dnl on this file at present...
add(`about', `hh', `test')
add(`config_file', `hh', `cc', `test', `testscript')
add(`contents', `hh', `cc')
-add(`default_config', `hh', `cc')
-add(`default_environment', `hh', `cc', `test', `testscript')
add(`dep_atom', `hh', `cc', `test')
add(`dep_atom_flattener', `hh', `cc')
add(`dep_atom_pretty_printer', `hh', `cc')
@@ -36,7 +34,6 @@ add(`repository', `hh', `cc', `sr')
add(`repository_config_entry', `sr')
add(`repository_so_loader', `cc')
add(`syncer', `hh', `cc', `sr')
-add(`test_environment', `hh', `cc')
add(`use_config_entry', `sr')
add(`version_metadata', `hh', `cc', `sr')
add(`version_operator', `hh', `cc', `test')
diff --git a/paludis/package_database_TEST.cc b/paludis/package_database_TEST.cc
index 940242b..496f0f2 100644
--- a/paludis/package_database_TEST.cc
+++ b/paludis/package_database_TEST.cc
@@ -18,6 +18,7 @@
*/
#include <paludis/paludis.hh>
+#include <paludis/environment/test/test_environment.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/repositories/cran/Makefile.am b/paludis/repositories/cran/Makefile.am
index b67c1de..b70a133 100644
--- a/paludis/repositories/cran/Makefile.am
+++ b/paludis/repositories/cran/Makefile.am
@@ -51,6 +51,7 @@ cran_repository_TEST_LDADD = \
libpaludiscranrepository.la \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/environment/test/libpaludistestenvironment.la \
$(DYNAMIC_LD_LIBS)
cran_repository_TEST_CXXFLAGS = -I$(top_srcdir)
diff --git a/paludis/repositories/cran/cran_dep_parser_TEST.cc b/paludis/repositories/cran/cran_dep_parser_TEST.cc
index c2e5979..9308c8d 100644
--- a/paludis/repositories/cran/cran_dep_parser_TEST.cc
+++ b/paludis/repositories/cran/cran_dep_parser_TEST.cc
@@ -20,7 +20,7 @@
#include <paludis/dep_atom.hh>
#include <paludis/dep_atom_flattener.hh>
#include <paludis/repositories/cran/cran_dep_parser.hh>
-#include <paludis/test_environment.hh>
+#include <paludis/environment/test/test_environment.hh>
#include <paludis/util/system.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/repositories/cran/cran_repository_TEST.cc b/paludis/repositories/cran/cran_repository_TEST.cc
index 7b00f18..850b0c4 100644
--- a/paludis/repositories/cran/cran_repository_TEST.cc
+++ b/paludis/repositories/cran/cran_repository_TEST.cc
@@ -22,7 +22,7 @@
#include <paludis/repositories/cran/cran_dep_parser.hh>
#include <paludis/repositories/cran/cran_description.hh>
#include <paludis/repositories/cran/cran_repository.hh>
-#include <paludis/test_environment.hh>
+#include <paludis/environment/test/test_environment.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/system.hh>
#include <test/test_framework.hh>
diff --git a/paludis/repositories/portage/Makefile.am b/paludis/repositories/portage/Makefile.am
index ffeaebf..2083e58 100644
--- a/paludis/repositories/portage/Makefile.am
+++ b/paludis/repositories/portage/Makefile.am
@@ -54,6 +54,7 @@ portage_repository_TEST_SOURCES = portage_repository_TEST.cc
portage_repository_TEST_LDADD = \
libpaludisportagerepository.la \
$(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/environment/test/libpaludistestenvironment.la \
$(top_builddir)/test/libtest.a
portage_repository_TEST_CXXFLAGS = -I$(top_srcdir)
diff --git a/paludis/repositories/portage/portage_repository_TEST.cc b/paludis/repositories/portage/portage_repository_TEST.cc
index 401535b..1310d6e 100644
--- a/paludis/repositories/portage/portage_repository_TEST.cc
+++ b/paludis/repositories/portage/portage_repository_TEST.cc
@@ -20,7 +20,7 @@
#include <paludis/repositories/portage/portage_repository.hh>
#include <paludis/repositories/portage/make_ebuild_repository.hh>
#include <paludis/util/collection_concrete.hh>
-#include <paludis/test_environment.hh>
+#include <paludis/environment/test/test_environment.hh>
#include <paludis/util/system.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
diff --git a/paludis/repositories/vdb/Makefile.am b/paludis/repositories/vdb/Makefile.am
index 8ced530..6ecdd05 100644
--- a/paludis/repositories/vdb/Makefile.am
+++ b/paludis/repositories/vdb/Makefile.am
@@ -30,6 +30,7 @@ vdb_repository_TEST_SOURCES = vdb_repository_TEST.cc
vdb_repository_TEST_LDADD = \
$(top_builddir)/paludis/util/test_extras.o \
$(top_builddir)/test/libtest.a \
+ $(top_builddir)/paludis/environment/test/libpaludistestenvironment.la \
libpaludisvdbrepository.la
vdb_repository_TEST_CXXFLAGS = -I$(top_srcdir)
diff --git a/paludis/repositories/vdb/vdb_repository_TEST.cc b/paludis/repositories/vdb/vdb_repository_TEST.cc
index 48bfe29..15a8f46 100644
--- a/paludis/repositories/vdb/vdb_repository_TEST.cc
+++ b/paludis/repositories/vdb/vdb_repository_TEST.cc
@@ -19,7 +19,7 @@
#include <paludis/repositories/vdb/vdb_repository.hh>
#include <paludis/util/collection_concrete.hh>
-#include <paludis/test_environment.hh>
+#include <paludis/environment/test/test_environment.hh>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
#include <fstream>
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index 5dd1edf..38f210a 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -48,7 +48,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/ebuild/`" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \
SYSCONFDIR="$(sysconfdir)" \
- LD_LIBRARY_PATH="`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/.libs`" \
+ LD_LIBRARY_PATH="`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/.libs`:`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/util/.libs`:`$(top_srcdir)/ebuild/utils/canonicalise $(top_builddir)/paludis/environment/default/.libs`" \
bash $(top_srcdir)/test/run_test.sh "ruby -I ./.libs/"
if ENABLE_RUBY
@@ -108,8 +108,10 @@ repository.o : repository.cc paludis_ruby.hh
$(AM_LDFLAGS) $(LDFLAGS) \
-I@RUBY_SITEARCHDIR@ -l@RUBY_SONAME@ \
-o $@ \
+ $^ \
+ $(top_builddir)/paludis/util/.libs/libpaludisutil.so \
$(top_builddir)/paludis/.libs/libpaludis.so \
- $^
+ $(top_builddir)/paludis/environment/default/.libs/libpaludisdefaultenvironment.so
Paludis.so : $(OUR_OBJECTS)
mkdir -p .libs
@@ -117,10 +119,11 @@ Paludis.so : $(OUR_OBJECTS)
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) \
-I@RUBY_SITEARCHDIR@ -l@RUBY_SONAME@ \
+ -o $@ \
+ $^ \
-L$(top_builddir)/paludis/util/.libs/ -lpaludisutil \
-L$(top_builddir)/paludis/.libs/ -lpaludis \
- -o $@ \
- $^
+ -L$(top_builddir)/paludis/environment/default/.libs/ -lpaludisdefaultenvironment
endif
diff --git a/ruby/default_environment.cc b/ruby/default_environment.cc
index 234e8b7..ceb112f 100644
--- a/ruby/default_environment.cc
+++ b/ruby/default_environment.cc
@@ -18,8 +18,8 @@
*/
#include <paludis_ruby.hh>
-#include <paludis/default_environment.hh>
-#include <paludis/default_config.hh>
+#include <paludis/environment/default/default_environment.hh>
+#include <paludis/environment/default/default_config.hh>
#include <ruby.h>
using namespace paludis;
diff --git a/src/adjutrix/Makefile.am b/src/adjutrix/Makefile.am
index 04e9f01..f02d786 100644
--- a/src/adjutrix/Makefile.am
+++ b/src/adjutrix/Makefile.am
@@ -32,7 +32,6 @@ adjutrix_SOURCES = \
find_dropped_keywords.hh find_dropped_keywords.cc \
find_reverse_deps.hh find_reverse_deps.cc \
keywords_graph.hh keywords_graph.cc \
- adjutrix_environment.hh adjutrix_environment.cc \
display_profiles_use.hh display_profiles_use.cc \
display_default_system_resolution.hh display_default_system_resolution.cc \
adjutrix.cc
@@ -43,6 +42,7 @@ adjutrix_LDADD = \
$(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/repositories/portage/libpaludisportagerepository.la \
+ $(top_builddir)/paludis/environment/no_config/libpaludisnoconfigenvironment.la \
$(top_builddir)/src/libcolour.a \
$(DYNAMIC_LD_LIBS)
diff --git a/src/adjutrix/adjutrix.cc b/src/adjutrix/adjutrix.cc
index fc7c755..282485f 100644
--- a/src/adjutrix/adjutrix.cc
+++ b/src/adjutrix/adjutrix.cc
@@ -25,12 +25,12 @@
#include "keywords_graph.hh"
#include "display_profiles_use.hh"
#include "display_default_system_resolution.hh"
-#include "adjutrix_environment.hh"
#include <paludis/about.hh>
#include <paludis/util/join.hh>
#include <paludis/util/log.hh>
#include <paludis/util/fs_entry.hh>
+#include <paludis/environment/no_config/no_config_environment.hh>
#include <iostream>
using namespace paludis;
@@ -143,7 +143,9 @@ main(int argc, char *argv[])
))
throw DoHelp("you should specify exactly one action");
- AdjutrixEnvironment env(get_location_and_add_filters());
+ NoConfigEnvironment env(NoConfigEnvironmentParams::create()
+ .repository_dir(get_location_and_add_filters())
+ .accept_unstable(CommandLine::get_instance()->a_unstable.specified()));
if (CommandLine::get_instance()->a_find_stable_candidates.specified())
{
diff --git a/src/adjutrix/display_default_system_resolution.cc b/src/adjutrix/display_default_system_resolution.cc
index 2bf4690..053874e 100644
--- a/src/adjutrix/display_default_system_resolution.cc
+++ b/src/adjutrix/display_default_system_resolution.cc
@@ -45,7 +45,7 @@ using namespace paludis;
namespace
{
int
- display_default_system_resolution(const AdjutrixEnvironment & env, const std::string & desc,
+ display_default_system_resolution(const NoConfigEnvironment & env, const std::string & desc,
const FSEntry & profile)
{
int return_code(0);
@@ -104,7 +104,7 @@ namespace
}
}
-int do_display_default_system_resolution(AdjutrixEnvironment & env)
+int do_display_default_system_resolution(NoConfigEnvironment & env)
{
int return_code(0);
diff --git a/src/adjutrix/display_default_system_resolution.hh b/src/adjutrix/display_default_system_resolution.hh
index f645e2a..6d6c340 100644
--- a/src/adjutrix/display_default_system_resolution.hh
+++ b/src/adjutrix/display_default_system_resolution.hh
@@ -20,8 +20,8 @@
#ifndef PALUDIS_GUARD_SRC_ADJUTRIX_DISPLAY_DEFAULT_SYSTEM_RESOLUTION_HH
#define PALUDIS_GUARD_SRC_ADJUTRIX_DISPLAY_DEFAULT_SYSTEM_RESOLUTION_HH 1
-#include <adjutrix_environment.hh>
+#include <paludis/environment/no_config/no_config_environment.hh>
-int do_display_default_system_resolution(paludis::AdjutrixEnvironment & env);
+int do_display_default_system_resolution(paludis::NoConfigEnvironment & env);
#endif
diff --git a/src/adjutrix/display_profiles_use.cc b/src/adjutrix/display_profiles_use.cc
index 284d67a..80e0a50 100644
--- a/src/adjutrix/display_profiles_use.cc
+++ b/src/adjutrix/display_profiles_use.cc
@@ -52,7 +52,7 @@ namespace
}
void
- display_profiles_use(const AdjutrixEnvironment & env, const std::string & desc,
+ display_profiles_use(const NoConfigEnvironment & env, const std::string & desc,
const FSEntry & profile, const std::set<UseFlagName> & all_use,
const std::multimap<std::string, UseFlagName> & all_use_expand_flags)
{
@@ -97,7 +97,7 @@ namespace
}
}
-void do_display_profiles_use(AdjutrixEnvironment & env)
+void do_display_profiles_use(NoConfigEnvironment & env)
{
Context context("When performing display-profiles-use action:");
diff --git a/src/adjutrix/display_profiles_use.hh b/src/adjutrix/display_profiles_use.hh
index 288c489..8a5b4e0 100644
--- a/src/adjutrix/display_profiles_use.hh
+++ b/src/adjutrix/display_profiles_use.hh
@@ -20,8 +20,8 @@
#ifndef PALUDIS_GUARD_SRC_ADJUTRIX_DISPLAY_PROFILES_USE_HH
#define PALUDIS_GUARD_SRC_ADJUTRIX_DISPLAY_PROFILES_USE_HH 1
-#include <adjutrix_environment.hh>
+#include <paludis/environment/no_config/no_config_environment.hh>
-void do_display_profiles_use(paludis::AdjutrixEnvironment & env);
+void do_display_profiles_use(paludis::NoConfigEnvironment & env);
#endif
diff --git a/src/adjutrix/find_reverse_deps.cc b/src/adjutrix/find_reverse_deps.cc
index 7f05eff..9da58f4 100644
--- a/src/adjutrix/find_reverse_deps.cc
+++ b/src/adjutrix/find_reverse_deps.cc
@@ -180,6 +180,8 @@ namespace
{
Context context("When checking package '" + stringify(p) + "':");
+ cerr << xterm_title("Checking " + stringify(p) + " - adjutrix");
+
PackageDatabaseEntryCollection::Pointer p_entries(env.package_database()->query(
PackageDepAtom::Pointer(new PackageDepAtom(stringify(p))), is_uninstalled_only));
@@ -202,7 +204,9 @@ namespace
}
catch (Exception & exception)
{
- std::cerr << "Caught Exception (" << exception.what() << ")" << std::endl;
+ cerr << "Caught exception:" << endl;
+ cerr << " * " << exception.backtrace("\n * ") << endl;
+ cerr << " * " << exception.message() << " (" << exception.what() << ")" << endl;
return (found_matches ? 0 : 1) | 2;
}
}
@@ -211,7 +215,7 @@ namespace
}
}
-int do_find_reverse_deps(AdjutrixEnvironment & env)
+int do_find_reverse_deps(NoConfigEnvironment & env)
{
Context context("When performing find-reverse-deps action:");
diff --git a/src/adjutrix/find_reverse_deps.hh b/src/adjutrix/find_reverse_deps.hh
index f7e4ec4..048b1f5 100644
--- a/src/adjutrix/find_reverse_deps.hh
+++ b/src/adjutrix/find_reverse_deps.hh
@@ -20,9 +20,9 @@
#ifndef PALUDIS_GUARD_SRC_ARCHTOOL_FIND_REVERSE_DEPS_HH
#define PALUDIS_GUARD_SRC_ARCHTOOL_FIND_REVERSE_DEPS_HH 1
-#include <adjutrix_environment.hh>
+#include <paludis/environment/no_config/no_config_environment.hh>
-int do_find_reverse_deps(paludis::AdjutrixEnvironment & env);
+int do_find_reverse_deps(paludis::NoConfigEnvironment & env);
#endif
diff --git a/src/gtkpaludis/Makefile.am b/src/gtkpaludis/Makefile.am
index 23f08e3..e64e956 100644
--- a/src/gtkpaludis/Makefile.am
+++ b/src/gtkpaludis/Makefile.am
@@ -27,11 +27,12 @@ gtkpaludis_SOURCES = \
gtkpaludis.cc
gtkpaludis_LDADD = \
+ $(top_builddir)/src/gtkpaludis/vtemm/libvtemm.a \
$(top_builddir)/paludis/tasks/libpaludistasks.a \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
- $(top_builddir)/src/gtkpaludis/vtemm/libvtemm.a \
+ $(top_builddir)/paludis/environment/default/libpaludisdefaultenvironment.la \
$(GTKDEPS_LIBS) \
$(DYNAMIC_LD_LIBS)
diff --git a/src/gtkpaludis/browse_tree.cc b/src/gtkpaludis/browse_tree.cc
index c0aff35..fda7a3c 100644
--- a/src/gtkpaludis/browse_tree.cc
+++ b/src/gtkpaludis/browse_tree.cc
@@ -27,7 +27,7 @@
#include <gtkmm/menu.h>
#include <gtkmm/messagedialog.h>
-#include <paludis/default_environment.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <paludis/util/log.hh>
#include <paludis/syncer.hh>
diff --git a/src/gtkpaludis/gtkpaludis.cc b/src/gtkpaludis/gtkpaludis.cc
index 178654a..f5e1f93 100644
--- a/src/gtkpaludis/gtkpaludis.cc
+++ b/src/gtkpaludis/gtkpaludis.cc
@@ -18,6 +18,8 @@
*/
#include <paludis/paludis.hh>
+#include <paludis/environment/default/default_environment.hh>
+#include <paludis/environment/default/default_config.hh>
#include <paludis/util/log.hh>
#include <libebt/libebt_version.hh>
diff --git a/src/gtkpaludis/information_tree.cc b/src/gtkpaludis/information_tree.cc
index b1d0371..022be1c 100644
--- a/src/gtkpaludis/information_tree.cc
+++ b/src/gtkpaludis/information_tree.cc
@@ -19,7 +19,7 @@
#include "information_tree.hh"
#include <gtkmm/treestore.h>
-#include <paludis/default_environment.hh>
+#include <paludis/environment/default/default_environment.hh>
using namespace paludis;
diff --git a/src/gtkpaludis/sync.cc b/src/gtkpaludis/sync.cc
index 4c1a1ab..ef2a133 100644
--- a/src/gtkpaludis/sync.cc
+++ b/src/gtkpaludis/sync.cc
@@ -20,7 +20,7 @@
#include "sync.hh"
#include "main_window.hh"
-#include <paludis/default_environment.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <paludis/util/log.hh>
#include <paludis/syncer.hh>
diff --git a/src/paludis/Makefile.am b/src/paludis/Makefile.am
index e9dcad7..4185f88 100644
--- a/src/paludis/Makefile.am
+++ b/src/paludis/Makefile.am
@@ -46,6 +46,7 @@ paludis_LDADD = \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/environment/default/libpaludisdefaultenvironment.la \
$(top_builddir)/src/libcolour.a \
$(DYNAMIC_LD_LIBS)
diff --git a/src/paludis/applets.cc b/src/paludis/applets.cc
index 5252bec..43d8f00 100644
--- a/src/paludis/applets.cc
+++ b/src/paludis/applets.cc
@@ -23,6 +23,7 @@
#include <iomanip>
#include <iostream>
#include <paludis/paludis.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <string>
#include <set>
diff --git a/src/paludis/contents.cc b/src/paludis/contents.cc
index 35fec9c..ca9efc0 100644
--- a/src/paludis/contents.cc
+++ b/src/paludis/contents.cc
@@ -21,6 +21,7 @@
#include "colour.hh"
#include "command_line.hh"
#include <paludis/paludis.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <iostream>
#include <algorithm>
diff --git a/src/paludis/install.cc b/src/paludis/install.cc
index f0a3ff0..c9215c4 100644
--- a/src/paludis/install.cc
+++ b/src/paludis/install.cc
@@ -32,6 +32,7 @@
#include <paludis/tasks/install_task.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
+#include <paludis/environment/default/default_environment.hh>
/** \file
* Handle the --install action for the main paludis program.
diff --git a/src/paludis/list.cc b/src/paludis/list.cc
index 948e9e1..c6dfb17 100644
--- a/src/paludis/list.cc
+++ b/src/paludis/list.cc
@@ -25,6 +25,7 @@
#include <list>
#include <map>
#include <paludis/paludis.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <paludis/util/log.hh>
#include <paludis/util/visitor.hh>
diff --git a/src/paludis/news.cc b/src/paludis/news.cc
index e3147f3..17df87a 100644
--- a/src/paludis/news.cc
+++ b/src/paludis/news.cc
@@ -23,6 +23,7 @@
#include <iomanip>
#include <iostream>
#include <paludis/paludis.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <string>
/** \file
diff --git a/src/paludis/owner.cc b/src/paludis/owner.cc
index e1a7ee6..4d63bf1 100644
--- a/src/paludis/owner.cc
+++ b/src/paludis/owner.cc
@@ -21,6 +21,7 @@
#include "colour.hh"
#include "command_line.hh"
#include <paludis/paludis.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <iostream>
namespace p = paludis;
diff --git a/src/paludis/paludis.cc b/src/paludis/paludis.cc
index 44d370b..8dc15ee 100644
--- a/src/paludis/paludis.cc
+++ b/src/paludis/paludis.cc
@@ -32,6 +32,8 @@
#include <paludis/paludis.hh>
#include <paludis/util/util.hh>
+#include <paludis/environment/default/default_environment.hh>
+#include <paludis/environment/default/default_config.hh>
#include <libebt/libebt.hh>
#include <libwrapiter/libwrapiter.hh>
diff --git a/src/paludis/query.cc b/src/paludis/query.cc
index c0386d8..09b1725 100644
--- a/src/paludis/query.cc
+++ b/src/paludis/query.cc
@@ -26,6 +26,7 @@
#include <iostream>
#include <paludis/paludis.hh>
#include <paludis/util/collection_concrete.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <string>
/** \file
diff --git a/src/paludis/sync.cc b/src/paludis/sync.cc
index 0c1b8ce..89f08eb 100644
--- a/src/paludis/sync.cc
+++ b/src/paludis/sync.cc
@@ -20,7 +20,7 @@
#include "colour.hh"
#include "sync.hh"
#include <paludis/tasks/sync_task.hh>
-#include <paludis/default_environment.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <paludis/syncer.hh>
#include <iomanip>
#include <iostream>
diff --git a/src/paludis/uninstall.cc b/src/paludis/uninstall.cc
index 08666d1..b34268a 100644
--- a/src/paludis/uninstall.cc
+++ b/src/paludis/uninstall.cc
@@ -20,7 +20,7 @@
#include "colour.hh"
#include "uninstall.hh"
-#include <paludis/default_environment.hh>
+#include <paludis/environment/default/default_environment.hh>
#include <paludis/tasks/uninstall_task.hh>
#include <iostream>
diff --git a/test/run_test.sh b/test/run_test.sh
index bee8b37..c707978 100755
--- a/test/run_test.sh
+++ b/test/run_test.sh
@@ -4,6 +4,14 @@
testname=${2:-${1}}
testname=${testname%.rb}
+if test -f "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
+ echo ">>> cleanup for test ${testname}"
+ if ! "$TEST_SCRIPT_DIR""${testname}"_"cleanup.sh" ; then
+ echo ">>> exiting with error for test ${testname}"
+ exit 255
+ fi
+fi
+
if test -f "$TEST_SCRIPT_DIR""${testname}"_"setup.sh" ; then
echo ">>> setup for test ${testname}"
if ! "$TEST_SCRIPT_DIR""${testname}"_"setup.sh" ; then