aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-27 08:57:33 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-02-27 08:57:33 +0000
commit28c55bddf6933c7698daf209c8435aab17cbf781 (patch)
tree28cc5aadc003f9d66e15c7c927571df629a69d38
parenta04702912561544b329e0fecafa9702d46e6a148 (diff)
downloadpaludis-28c55bddf6933c7698daf209c8435aab17cbf781.tar.gz
paludis-28c55bddf6933c7698daf209c8435aab17cbf781.tar.xz
Move over to dynamic environment framework. Remove gtkpaludis.
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac84
-rw-r--r--doc/examples/Makefile.am2
-rw-r--r--doc/examples/pwp_basic_cplusplus_app.cc10
-rw-r--r--paludis/environment.hh16
-rw-r--r--paludis/environments/Makefile.am3
-rwxr-xr-xpaludis/environments/default/default_environment_TEST_cleanup.sh11
-rw-r--r--paludis/environments/environment_maker.cc22
-rw-r--r--paludis/environments/environment_maker.hh2
-rw-r--r--paludis/environments/no_config/Makefile.am3
-rw-r--r--paludis/environments/no_config/no_config_environment.cc24
-rw-r--r--paludis/environments/no_config/no_config_environment.hh9
-rw-r--r--paludis/environments/no_config/registration.cc (renamed from src/clients/gtkpaludis/queue_options.hh)26
-rw-r--r--paludis/environments/paludis/Makefile.am (renamed from paludis/environments/default/Makefile.am)45
-rw-r--r--paludis/environments/paludis/paludis_config.cc (renamed from paludis/environments/default/default_config.cc)309
-rw-r--r--paludis/environments/paludis/paludis_config.hh (renamed from paludis/environments/default/default_config.hh)105
-rw-r--r--paludis/environments/paludis/paludis_environment.cc (renamed from paludis/environments/default/default_environment.cc)263
-rw-r--r--paludis/environments/paludis/paludis_environment.hh (renamed from paludis/environments/default/default_environment.hh)34
-rw-r--r--paludis/environments/paludis/paludis_environment_TEST.cc (renamed from paludis/environments/default/default_environment_TEST.cc)42
-rwxr-xr-xpaludis/environments/paludis/paludis_environment_TEST_cleanup.sh11
-rwxr-xr-xpaludis/environments/paludis/paludis_environment_TEST_setup.sh (renamed from paludis/environments/default/default_environment_TEST_setup.sh)4
-rw-r--r--paludis/environments/paludis/registration.cc (renamed from src/clients/gtkpaludis/messages.hh)36
-rw-r--r--paludis/environments/paludis/repository_config_entry.sr (renamed from paludis/environments/default/repository_config_entry.sr)6
-rw-r--r--paludis/environments/paludis/use_config_entry.sr (renamed from paludis/environments/default/use_config_entry.sr)36
-rw-r--r--paludis/environments/test/Makefile.am3
-rw-r--r--paludis/environments/test/registration.cc (renamed from src/clients/gtkpaludis/set_overview.hh)26
-rw-r--r--paludis/environments/test/test_environment.cc11
-rw-r--r--paludis/environments/test/test_environment.hh15
-rw-r--r--paludis/qa/qa_environment.cc29
-rw-r--r--paludis/qa/qa_environment.hh9
-rw-r--r--paludis/qa/qa_environment_TEST.cc4
-rw-r--r--ruby/Makefile.am7
-rw-r--r--ruby/dep_list_TEST.rb2
-rw-r--r--ruby/environment.cc125
-rw-r--r--ruby/environment_TEST.rb133
-rw-r--r--ruby/package_database_TEST.rb24
-rw-r--r--ruby/paludis_ruby.hh5
-rw-r--r--ruby/paludis_ruby_TEST.rb4
-rw-r--r--ruby/repository_TEST.rb6
-rw-r--r--src/clients/contrarius/Makefile.am2
-rw-r--r--src/clients/contrarius/contrarius.cc21
-rw-r--r--src/clients/contrarius/contrarius_stage_options.sr5
-rw-r--r--src/clients/contrarius/install.cc75
-rw-r--r--src/clients/contrarius/install.hh5
-rw-r--r--src/clients/contrarius/stage.cc109
-rw-r--r--src/clients/contrarius/stage.hh2
-rw-r--r--src/clients/contrarius/stage_builder.hh5
-rw-r--r--src/clients/gtkpaludis/Makefile.am107
-rw-r--r--src/clients/gtkpaludis/categories_list.cc163
-rw-r--r--src/clients/gtkpaludis/categories_list.hh45
-rw-r--r--src/clients/gtkpaludis/cellrendererbutton/Makefile.am32
-rw-r--r--src/clients/gtkpaludis/cellrendererbutton/cellrendererbutton.cc189
-rw-r--r--src/clients/gtkpaludis/cellrendererbutton/cellrendererbutton.hh91
-rw-r--r--src/clients/gtkpaludis/command_line.cc71
-rw-r--r--src/clients/gtkpaludis/command_line.hh101
-rwxr-xr-xsrc/clients/gtkpaludis/config_suffix_TEST.py20
-rw-r--r--src/clients/gtkpaludis/gtkpaludis.cc317
-rwxr-xr-xsrc/clients/gtkpaludis/help_TEST4
-rw-r--r--src/clients/gtkpaludis/install.cc210
-rw-r--r--src/clients/gtkpaludis/install.hh97
-rw-r--r--src/clients/gtkpaludis/main_window.cc244
-rw-r--r--src/clients/gtkpaludis/main_window.hh76
-rw-r--r--src/clients/gtkpaludis/menu.cc84
-rw-r--r--src/clients/gtkpaludis/menu.hh45
-rw-r--r--src/clients/gtkpaludis/messages.cc132
-rw-r--r--src/clients/gtkpaludis/package_info.cc100
-rw-r--r--src/clients/gtkpaludis/package_info.hh44
-rw-r--r--src/clients/gtkpaludis/package_overview.cc225
-rw-r--r--src/clients/gtkpaludis/package_overview.hh41
-rw-r--r--src/clients/gtkpaludis/packages_list.cc219
-rw-r--r--src/clients/gtkpaludis/packages_list.hh47
-rw-r--r--src/clients/gtkpaludis/packages_list.sr6
-rw-r--r--src/clients/gtkpaludis/packages_page.cc124
-rw-r--r--src/clients/gtkpaludis/packages_page.hh50
-rw-r--r--src/clients/gtkpaludis/paludis_thread.cc162
-rw-r--r--src/clients/gtkpaludis/paludis_thread.hh81
-rw-r--r--src/clients/gtkpaludis/prod-x-server.cc25
-rw-r--r--src/clients/gtkpaludis/queue_list.cc398
-rw-r--r--src/clients/gtkpaludis/queue_list.hh54
-rw-r--r--src/clients/gtkpaludis/queue_options.cc198
-rw-r--r--src/clients/gtkpaludis/queue_page.cc123
-rw-r--r--src/clients/gtkpaludis/queue_page.hh47
-rwxr-xr-xsrc/clients/gtkpaludis/quit_TEST.py13
-rwxr-xr-xsrc/clients/gtkpaludis/quit_TEST_cleanup.sh14
-rwxr-xr-xsrc/clients/gtkpaludis/quit_TEST_setup.sh69
-rw-r--r--src/clients/gtkpaludis/repositories_list.cc132
-rw-r--r--src/clients/gtkpaludis/repositories_list.hh43
-rw-r--r--src/clients/gtkpaludis/repositories_page.cc168
-rw-r--r--src/clients/gtkpaludis/repositories_page.hh46
-rw-r--r--src/clients/gtkpaludis/repository_overview.cc146
-rw-r--r--src/clients/gtkpaludis/repository_overview.hh41
-rw-r--r--src/clients/gtkpaludis/set_overview.cc226
-rw-r--r--src/clients/gtkpaludis/sets_list.cc171
-rw-r--r--src/clients/gtkpaludis/sets_list.hh46
-rwxr-xr-xsrc/clients/gtkpaludis/sets_list_TEST.py27
-rwxr-xr-xsrc/clients/gtkpaludis/sets_list_TEST_cleanup.sh13
-rwxr-xr-xsrc/clients/gtkpaludis/sets_list_TEST_setup.sh68
-rw-r--r--src/clients/gtkpaludis/sets_page.cc121
-rw-r--r--src/clients/gtkpaludis/sets_page.hh48
-rw-r--r--src/clients/gtkpaludis/sync.cc84
-rw-r--r--src/clients/gtkpaludis/sync.hh48
-rw-r--r--src/clients/gtkpaludis/tasks_page.cc209
-rw-r--r--src/clients/gtkpaludis/tasks_page.hh48
-rwxr-xr-xsrc/clients/gtkpaludis/test_helper.bash36
-rwxr-xr-xsrc/clients/gtkpaludis/version_TEST4
-rw-r--r--src/clients/gtkpaludis/vtemm/Makefile.am77
-rw-r--r--src/clients/gtkpaludis/vtemm/converts/Makefile.am9
-rw-r--r--src/clients/gtkpaludis/vtemm/converts/convert.m430
-rw-r--r--src/clients/gtkpaludis/vtemm/converts/convert_base.m469
-rw-r--r--src/clients/gtkpaludis/vtemm/defs/Makefile.am55
-rw-r--r--src/clients/gtkpaludis/vtemm/defs/enum.pl230
-rw-r--r--src/clients/gtkpaludis/vtemm/defs/generate_defs_vte.cc36
-rw-r--r--src/clients/gtkpaludis/vtemm/reaper.ccg65
-rw-r--r--src/clients/gtkpaludis/vtemm/reaper.hg50
-rw-r--r--src/clients/gtkpaludis/vtemm/terminal_widget.ccg159
-rw-r--r--src/clients/gtkpaludis/vtemm/terminal_widget.hg181
-rwxr-xr-xsrc/clients/gtkpaludis/yay_spi_TEST.py20
-rw-r--r--src/clients/inquisitio/Makefile.am2
-rw-r--r--src/clients/inquisitio/command_line.cc8
-rw-r--r--src/clients/inquisitio/command_line.hh10
-rw-r--r--src/clients/inquisitio/inquisitio.cc21
-rw-r--r--src/clients/paludis/Makefile.am5
-rw-r--r--src/clients/paludis/applets.cc19
-rw-r--r--src/clients/paludis/applets.hh19
-rw-r--r--src/clients/paludis/command_line.cc6
-rw-r--r--src/clients/paludis/command_line.hh6
-rw-r--r--src/clients/paludis/do_config.cc8
-rw-r--r--src/clients/paludis/do_config.hh9
-rw-r--r--src/clients/paludis/do_contents.cc8
-rw-r--r--src/clients/paludis/do_contents.hh11
-rwxr-xr-xsrc/clients/paludis/exception_TEST2
-rw-r--r--src/clients/paludis/install.cc59
-rw-r--r--src/clients/paludis/install.hh9
-rw-r--r--src/clients/paludis/list.cc13
-rw-r--r--src/clients/paludis/list.hh15
-rw-r--r--src/clients/paludis/news.cc12
-rw-r--r--src/clients/paludis/news.hh9
-rw-r--r--src/clients/paludis/owner.cc6
-rw-r--r--src/clients/paludis/owner.hh11
-rw-r--r--src/clients/paludis/paludis.cc119
-rw-r--r--src/clients/paludis/query.cc14
-rw-r--r--src/clients/paludis/query.hh9
-rw-r--r--src/clients/paludis/report.cc9
-rw-r--r--src/clients/paludis/report.hh7
-rw-r--r--src/clients/paludis/sync.cc11
-rw-r--r--src/clients/paludis/sync.hh9
-rw-r--r--src/clients/paludis/uninstall.cc17
-rw-r--r--src/clients/paludis/uninstall.hh11
-rw-r--r--tr1/Makefile.am2
149 files changed, 1087 insertions, 7895 deletions
diff --git a/Makefile.am b/Makefile.am
index ac380a9..bf2abde 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@ SUBDIRS = misc tr1 test paludis cran ruby src doc hooks eselect bash-completion
DISTCHECK_CONFIGURE_FLAGS = --enable-qa --enable-ruby --enable-glsa \
--with-ruby-install-dir='$${DESTDIR}$${prefix}/ruby_dir' \
--with-repositories=default \
- --with-clients=default,contrarius
+ --with-clients=default,contrarius,inquisitio
automake-deps-built-hack.tmp : built-sources-subdirs
touch $@
diff --git a/configure.ac b/configure.ac
index 85b1680..6394377 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,76 +547,6 @@ AC_SUBST(DYNAMIC_LD_LIBS)
dnl }}}
-dnl {{{ gtk support
-AC_MSG_CHECKING([whether to build the gtk+ client])
-AC_ARG_ENABLE([gtk],
- AS_HELP_STRING([--enable-gtk], [Enable gtk+ client (default: disable) (UNUSABLE)]),
- enable_gtk=$enableval,
- enable_gtk=no)
-AC_MSG_RESULT($enable_gtk)
-
-if test "x$enable_gtk" = "xyes"; then
- AC_CHECK_FUNCS([posix_openpt], [], [AC_MSG_ERROR([I need posix_openpt])])
- GLIBMM_LIBDIR=`pkg-config --variable=libdir glibmm-2.4`
- GMMPROC_DIR=$GLIBMM_LIBDIR/glibmm-2.4/proc
- AC_SUBST(GMMPROC_DIR)
- GMMPROC=$GMMPROC_DIR/gmmproc
- AC_SUBST(GMMPROC)
- PKG_CHECK_MODULES(GTKDEPS, [gtkmm-2.4 >= 2.6.0 glibmm-2.4 >= 2.6.0 pangomm-1.4 gdkmm-2.4 gthread-2.0 >= 2.6.0 vte >= 0.12.1],
- [], [AC_MSG_ERROR([gtkmm-2.4 and vte-0.12.1 or later are required if --enable-gtk is used])])
- AC_SUBST(GTKDEPS_CFLAGS)
- AC_SUBST(GTKDEPS_LIBS)
-
- # for vte
- PKG_CHECK_MODULES(PYGTKDEPS, [pygtk-2.0 >= 2.6.0],
- [], [AC_MSG_ERROR([pygtk-2.6 is required if --enable-gtk is used])])
-
- AC_MSG_CHECKING([whether Gtk::TreeView::set_grid_lines is available])
- old_CXXFLAGS=$CXXFLAGS
- CXXFLAGS="$CXXFLAGS $GTKDEPS_CFLAGS"
- AC_COMPILE_IFELSE([
-#include <gtkmm/treeview.h>
-int main(int, char *[])
-{
- Gtk::TreeViewGridLines g;
- g = Gtk::TREE_VIEW_GRID_LINES_VERTICAL;
-}
-],
- [have_tree_view_grid_lines=yes],
- [have_tree_view_grid_lines=no])
- CXXFLAGS="$old_CXXFLAGS"
- AC_MSG_RESULT([$have_tree_view_grid_lines])
- if test "x$have_tree_view_grid_lines" = "xyes" ; then
- AC_MSG_CHECKING([whether Gtk::TreeView::set_grid_lines works])
- PKG_CHECK_MODULES(GTKTREEVIEWDEPS, [gtk+-2.0 >= 2.11],
- [have_tree_view_grid_lines=yes],
- [have_tree_view_grid_lines=no])
- AC_MSG_RESULT([$have_tree_view_grid_lines])
- fi
- HAVE_TREE_VIEW_GRID_LINES=$have_tree_view_grid_lines
- if test "x$have_tree_view_grid_lines" = "xyes" ; then
- AC_DEFINE_UNQUOTED([HAVE_TREE_VIEW_GRID_LINES], 1, [Do we have Gtk::TreeView::set_grid_lines?])
- fi
- AC_SUBST([HAVE_TREE_VIEW_GRID_LINES])
-fi
-AM_CONDITIONAL([ENABLE_GTK], test "x$enable_gtk" = "xyes")
-
-enable_gtk_tests=monkey
-AC_MSG_CHECKING([whether to build tests for the gtk+ client])
-AC_ARG_ENABLE([gtktests],
- AS_HELP_STRING([--enable-gtktests], [Enable tests for the gtk+ client (default: disable)]),
- enable_gtk_tests=$enableval,
- enable_gtk_tests=no)
-AC_MSG_RESULT($enable_gtk_tests)
-AM_CONDITIONAL([ENABLE_GTK_TESTS], test "x$enable_gtk_tests" = "xyes")
-if test "x$enable_gtk_tests" = "xyes"; then
- PKG_CHECK_MODULES(GTKTESTDEPS, [atkmm-1.6 >= 2.6.0 gtkmm-2.4 >= 2.10.0],
- [], [AC_MSG_ERROR([atkmm-2.6 or later and gtkmm-2.10 or later is required if --enable-gtk-tests is used])])
- AC_SUBST(GTKTESTDEPS_CFLAGS)
- AC_SUBST(GTKTESTDEPS_LIBS)
-fi
-dnl }}}
-
dnl {{{ ruby interface
AC_ARG_VAR(RUBY,path to ruby interpreter)
AC_MSG_CHECKING([whether to build the ruby interface])
@@ -716,25 +646,20 @@ fi
dnl }}}
dnl {{{ clients
-ALL_CLIENTS="adjutrix contrarius gtkpaludis inquisitio paludis qualudis"
+ALL_CLIENTS="adjutrix contrarius inquisitio paludis qualudis"
DEFAULT_CLIENTS="adjutrix paludis"
if test x"$ENABLE_QA" = "xyes" ; then
DEFAULT_CLIENTS="$DEFAULT_CLIENTS qualudis"
fi
-if test "x$enable_gtk" = "xyes"; then
- DEFAULT_CLIENTS="$DEFAULT_CLIENTS gtkpaludis"
-fi
AC_MSG_CHECKING([which clients to build...])
AC_ARG_WITH([clients],
[ --with-clients=foo,bar,...
Build the specified repositories:
default Equivalent to adjutrix,paludis
Also includes qualudis if --enable-qa
- Also includes gtkpaludis if --enable-gtk
adjutrix A tool for tree querying
contrarius The cross toolchain creator
- gtkpaludis The Gtk+ client (UNUSABLE)
inquisitio A search client
paludis The Paludis console client
qualudis The QA console client],
@@ -871,7 +796,7 @@ AC_OUTPUT(
paludis/dep_list/Makefile
paludis/digests/Makefile
paludis/environments/Makefile
- paludis/environments/default/Makefile
+ paludis/environments/paludis/Makefile
paludis/environments/no_config/Makefile
paludis/environments/test/Makefile
paludis/fetchers/Makefile
@@ -903,11 +828,6 @@ AC_OUTPUT(
src/clients/contrarius/Makefile
src/clients/inquisitio/Makefile
src/clients/paludis/Makefile
- src/clients/gtkpaludis/Makefile
- src/clients/gtkpaludis/cellrendererbutton/Makefile
- src/clients/gtkpaludis/vtemm/Makefile
- src/clients/gtkpaludis/vtemm/converts/Makefile
- src/clients/gtkpaludis/vtemm/defs/Makefile
src/clients/qualudis/Makefile
src/clients/adjutrix/Makefile
test/Makefile
diff --git a/doc/examples/Makefile.am b/doc/examples/Makefile.am
index 1188452..35bf9a3 100644
--- a/doc/examples/Makefile.am
+++ b/doc/examples/Makefile.am
@@ -24,7 +24,7 @@ EXTRA_DIST = $(noinst_SCRIPTS)
pwp_basic_cplusplus_app_SOURCES = pwp_basic_cplusplus_app.cc
pwp_basic_cplusplus_app_LDFLAGS = \
$(top_builddir)/paludis/libpaludis.la \
- $(top_builddir)/paludis/environments/default/libpaludisdefaultenvironment.la
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
diff --git a/doc/examples/pwp_basic_cplusplus_app.cc b/doc/examples/pwp_basic_cplusplus_app.cc
index 05931e9..194b285 100644
--- a/doc/examples/pwp_basic_cplusplus_app.cc
+++ b/doc/examples/pwp_basic_cplusplus_app.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
#include <paludis/paludis.hh>
-#include <paludis/environments/default/default_environment.hh>
+#include <paludis/environments/environment_maker.hh>
#include <iostream>
#include <tr1/memory>
@@ -15,9 +15,13 @@ int main(int, char *[])
{
try
{
+ std::tr1::shared_ptr<paludis::Environment> env(
+ paludis::EnvironmentMaker::get_instance()->make_from_spec(""));
+
std::tr1::shared_ptr<const paludis::PackageDatabaseEntryCollection> packages(
- paludis::DefaultEnvironment::get_instance()->package_database()->query(
- paludis::PackageDepSpec("app-editors/vim"), paludis::is_installed_only, paludis::qo_order_by_version));
+ env->package_database()->query(
+ paludis::query::Matches(paludis::PackageDepSpec("app-editors/vim")) &
+ paludis::query::InstalledAtRoot(env->root()), paludis::qo_order_by_version));
if (packages->empty())
cout << "Vim is not installed" << endl;
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 0e23ebc..d9a100a 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -129,6 +129,17 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
/**
+ * Force a use flag.
+ */
+ virtual void force_use(std::tr1::shared_ptr<const PackageDepSpec>, const UseFlagName &,
+ const UseFlagState) = 0;
+
+ /**
+ * Clear forced use flags.
+ */
+ virtual void clear_forced_use() = 0;
+
+ /**
* Fetch any known use expand names (excluding prefix) that start with a
* given prefix.
*
@@ -242,6 +253,11 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
/**
+ * Change how to run paludis.
+ */
+ virtual void set_paludis_command(const std::string &) = 0;
+
+ /**
* Destructor.
*/
virtual ~Environment();
diff --git a/paludis/environments/Makefile.am b/paludis/environments/Makefile.am
index e92b39f..31b0b00 100644
--- a/paludis/environments/Makefile.am
+++ b/paludis/environments/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = default no_config test
+SUBDIRS = paludis no_config test
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
@@ -20,6 +20,7 @@ libpaludisenvironments_la_SOURCES = \
libpaludisenvironments_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
libpaludisenvironments_la_LIBADD = \
+ $(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludis.la \
@DYNAMIC_LD_LIBS@
diff --git a/paludis/environments/default/default_environment_TEST_cleanup.sh b/paludis/environments/default/default_environment_TEST_cleanup.sh
deleted file mode 100755
index 3cd5c8d..0000000
--- a/paludis/environments/default/default_environment_TEST_cleanup.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-if [ -d default_environment_TEST_dir ] ; then
- rm -fr default_environment_TEST_dir
-else
- true
-fi
-
-
-
diff --git a/paludis/environments/environment_maker.cc b/paludis/environments/environment_maker.cc
index a984d35..302e4a9 100644
--- a/paludis/environments/environment_maker.cc
+++ b/paludis/environments/environment_maker.cc
@@ -122,6 +122,28 @@ EnvironmentMaker::~EnvironmentMaker()
{
}
+std::tr1::shared_ptr<Environment>
+EnvironmentMaker::make_from_spec(const std::string & s) const
+{
+ Context context("When making environment from specification '" + s + "':");
+
+ std::string key, suffix;
+ std::string::size_type p(s.find(':'));
+
+ if (std::string::npos == p)
+ key = s;
+ else
+ {
+ key = s.substr(0, p);
+ suffix = s.substr(p + 1);
+ }
+
+ if (key.empty())
+ key = "paludis";
+
+ return (*find_maker(key))(suffix);
+}
+
extern "C"
{
void register_environments(EnvironmentMaker * maker);
diff --git a/paludis/environments/environment_maker.hh b/paludis/environments/environment_maker.hh
index 0be0688..371dfec 100644
--- a/paludis/environments/environment_maker.hh
+++ b/paludis/environments/environment_maker.hh
@@ -101,6 +101,8 @@ namespace paludis
public:
~EnvironmentMaker();
+
+ std::tr1::shared_ptr<Environment> make_from_spec(const std::string &) const;
};
}
diff --git a/paludis/environments/no_config/Makefile.am b/paludis/environments/no_config/Makefile.am
index 13235ef..9a6e545 100644
--- a/paludis/environments/no_config/Makefile.am
+++ b/paludis/environments/no_config/Makefile.am
@@ -9,7 +9,8 @@ DEFS= \
-DLIBDIR=\"$(libdir)\"
libpaludisnoconfigenvironment_la_SOURCES = \
- no_config_environment.cc no_config_environment.hh
+ no_config_environment.cc no_config_environment.hh \
+ registration.cc
libpaludisnoconfigenvironment_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index ae31ca6..93d0593 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -44,6 +44,8 @@ namespace paludis
std::tr1::shared_ptr<PortageRepository> portage_repo;
std::tr1::shared_ptr<PortageRepository> master_repo;
+ std::string paludis_command;
+
Implementation(Environment * const env, const NoConfigEnvironmentParams & params);
};
@@ -111,7 +113,8 @@ Implementation<NoConfigEnvironment>::Implementation(
top_level_dir(params.repository_dir),
write_cache(params.write_cache),
accept_unstable(params.accept_unstable),
- is_vdb(is_vdb_repository(params.repository_dir, params.repository_type))
+ is_vdb(is_vdb_repository(params.repository_dir, params.repository_type)),
+ paludis_command("false")
{
Context context("When initialising NoConfigEnvironment at '" + stringify(params.repository_dir) + "':");
@@ -193,7 +196,13 @@ NoConfigEnvironment::~NoConfigEnvironment()
std::string
NoConfigEnvironment::paludis_command() const
{
- return "false";
+ return _imp->paludis_command;
+}
+
+void
+NoConfigEnvironment::set_paludis_command(const std::string & s)
+{
+ _imp->paludis_command = s;
}
FSEntry
@@ -269,4 +278,15 @@ NoConfigEnvironment::master_repository() const
return _imp->master_repo;
}
+void
+NoConfigEnvironment::force_use(std::tr1::shared_ptr<const PackageDepSpec>,
+ const UseFlagName &, const UseFlagState)
+{
+ throw InternalError(PALUDIS_HERE, "force_use not currently available for NoConfigEnvironment");
+}
+
+void
+NoConfigEnvironment::clear_forced_use()
+{
+}
diff --git a/paludis/environments/no_config/no_config_environment.hh b/paludis/environments/no_config/no_config_environment.hh
index 129348d..833217d 100644
--- a/paludis/environments/no_config/no_config_environment.hh
+++ b/paludis/environments/no_config/no_config_environment.hh
@@ -52,7 +52,8 @@ namespace paludis
*/
class PALUDIS_VISIBLE NoConfigEnvironment :
public Environment,
- private PrivateImplementationPattern<NoConfigEnvironment>
+ private PrivateImplementationPattern<NoConfigEnvironment>,
+ private InstantiationPolicy<NoConfigEnvironment, instantiation_method::NonCopyableTag>
{
public:
///\name Basic operations
@@ -65,6 +66,7 @@ namespace paludis
///\}
virtual std::string paludis_command() const;
+ virtual void set_paludis_command(const std::string &);
/**
* What is our top level directory for our main repository?
@@ -83,6 +85,11 @@ namespace paludis
std::tr1::shared_ptr<PortageRepository> master_repository();
std::tr1::shared_ptr<const PortageRepository> master_repository() const;
+
+ virtual void force_use(std::tr1::shared_ptr<const PackageDepSpec>, const UseFlagName &,
+ const UseFlagState) PALUDIS_ATTRIBUTE((noreturn));
+
+ virtual void clear_forced_use();
};
}
diff --git a/src/clients/gtkpaludis/queue_options.hh b/paludis/environments/no_config/registration.cc
index 6a5ae35..e027b70 100644
--- a/src/clients/gtkpaludis/queue_options.hh
+++ b/paludis/environments/no_config/registration.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -17,22 +17,18 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_QUEUE_OPTIONS_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_QUEUE_OPTIONS_HH 1
+#include <paludis/environments/environment_maker.hh>
+#include <paludis/environments/no_config/no_config_environment.hh>
-#include <gtkmm/notebook.h>
-#include <paludis/util/private_implementation_pattern.hh>
+using namespace paludis;
-namespace gtkpaludis
+extern "C"
{
- class QueueOptions :
- public Gtk::Notebook,
- private paludis::PrivateImplementationPattern<QueueOptions>
- {
- public:
- QueueOptions();
- virtual ~QueueOptions();
- };
+ void register_environments(EnvironmentMaker * maker);
}
-#endif
+void register_environments(EnvironmentMaker *)
+{
+}
+
+
diff --git a/paludis/environments/default/Makefile.am b/paludis/environments/paludis/Makefile.am
index 521e50d..8654bd6 100644
--- a/paludis/environments/default/Makefile.am
+++ b/paludis/environments/paludis/Makefile.am
@@ -11,47 +11,50 @@ DEFS= \
-DDATADIR=\"$(datadir)\" \
-DLIBDIR=\"$(libdir)\"
-libpaludisdefaultenvironment_la_SOURCES = \
- default_config.cc default_config.hh \
- default_environment.cc default_environment.hh
+libpaludispaludisenvironment_la_SOURCES = \
+ paludis_config.cc paludis_config.hh \
+ paludis_environment.cc paludis_environment.hh \
+ registration.cc
-libpaludisdefaultenvironment_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
+libpaludispaludisenvironment_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
if ! MONOLITHIC
-libpaludisdefaultenvironment_la_LIBADD = \
+libpaludispaludisenvironment_la_LIBADD = \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/libpaludis.la
endif
+libenvdir = $(libdir)/paludis/environments/
+
if MONOLITHIC
-noinst_LTLIBRARIES = libpaludisdefaultenvironment.la
+noinst_LTLIBRARIES = libpaludispaludisenvironment.la
else
-lib_LTLIBRARIES = libpaludisdefaultenvironment.la
+libenv_LTLIBRARIES = libpaludispaludisenvironment.la
endif
-paludis_environment_default_includedir = $(includedir)/paludis/environments/default
-paludis_environment_default_include_HEADERS = \
- default_config.hh \
- default_environment.hh \
+paludis_environment_paludis_includedir = $(includedir)/paludis/environments/paludis
+paludis_environment_paludis_include_HEADERS = \
+ paludis_config.hh \
+ paludis_environment.hh \
use_config_entry-sr.hh \
repository_config_entry-sr.hh
EXTRA_DIST = \
- default_environment_TEST_setup.sh \
- default_environment_TEST.cc \
- default_environment_TEST_cleanup.sh \
+ paludis_environment_TEST_setup.sh \
+ paludis_environment_TEST.cc \
+ paludis_environment_TEST_cleanup.sh \
$(BUILT_SOURCES) \
use_config_entry.sr \
repository_config_entry.sr
-TESTS = default_environment_TEST
+TESTS = paludis_environment_TEST
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/ebuild/" \
@@ -61,16 +64,16 @@ TESTS_ENVIRONMENT = env \
bash $(top_srcdir)/test/run_test.sh
check_PROGRAMS = $(TESTS)
-check_SCRIPTS = default_environment_TEST_setup.sh default_environment_TEST_cleanup.sh
+check_SCRIPTS = paludis_environment_TEST_setup.sh paludis_environment_TEST_cleanup.sh
-default_environment_TEST_SOURCES = default_environment_TEST.cc
+paludis_environment_TEST_SOURCES = paludis_environment_TEST.cc
if MONOLITHIC
-default_environment_TEST_LDADD = \
+paludis_environment_TEST_LDADD = \
$(top_builddir)/paludis/util/test_extras.o \
$(top_builddir)/test/libtest.a \
- libpaludisdefaultenvironment.la \
+ libpaludispaludisenvironment.la \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
@@ -78,8 +81,8 @@ default_environment_TEST_LDADD = \
else
-default_environment_TEST_LDADD = \
- libpaludisdefaultenvironment.la \
+paludis_environment_TEST_LDADD = \
+ libpaludispaludisenvironment.la \
$(top_builddir)/paludis/util/test_extras.o \
$(top_builddir)/test/libtest.a \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
diff --git a/paludis/environments/default/default_config.cc b/paludis/environments/paludis/paludis_config.cc
index 8c5b1b2..5ffdea3 100644
--- a/paludis/environments/default/default_config.cc
+++ b/paludis/environments/paludis/paludis_config.cc
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/environments/default/default_config.hh>
-#include <paludis/environments/default/default_environment.hh>
+#include <paludis/environments/paludis/paludis_config.hh>
+#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/config_file.hh>
#include <paludis/util/collection_concrete.hh>
#include <paludis/util/compare.hh>
@@ -44,28 +44,28 @@
#include <pwd.h>
/** \file
- * Implementation of default_config.hh classes.
+ * Implementation of paludis_config.hh classes.
*
- * \ingroup grpdefaultconfig
+ * \ingroup grppaludisconfig
*/
using namespace paludis;
-#include <paludis/environments/default/use_config_entry-sr.cc>
-#include <paludis/environments/default/repository_config_entry-sr.cc>
+#include <paludis/environments/paludis/use_config_entry-sr.cc>
+#include <paludis/environments/paludis/repository_config_entry-sr.cc>
namespace paludis
{
/**
- * Implementation data for DefaultConfig.
+ * Implementation data for PaludisConfig.
*
- * \ingroup grpdefaultconfig
+ * \ingroup grppaludisconfig
*/
template<>
- struct Implementation<DefaultConfig>
+ struct Implementation<PaludisConfig>
{
- static std::string config_suffix;
- static bool config_suffix_can_be_set;
+ PaludisEnvironment * const env;
+
std::string paludis_command;
std::string root;
std::string config_dir;
@@ -121,17 +121,16 @@ namespace paludis
std::multimap<std::string, std::string> mirrors;
- std::vector<UseConfigEntry> forced_use_config;
-
mutable std::tr1::shared_ptr<uid_t> reduced_uid;
mutable std::tr1::shared_ptr<gid_t> reduced_gid;
- Implementation();
+ Implementation(PaludisEnvironment * const);
void need_sets_expanded() const;
};
- Implementation<DefaultConfig>::Implementation() :
+ Implementation<PaludisConfig>::Implementation(PaludisEnvironment * e) :
+ env(e),
paludis_command("paludis"),
config_dir("(unset)"),
sets_expanded(false)
@@ -139,7 +138,7 @@ namespace paludis
}
void
- Implementation<DefaultConfig>::need_sets_expanded() const
+ Implementation<PaludisConfig>::need_sets_expanded() const
{
if (sets_expanded)
return;
@@ -151,7 +150,7 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ s->dep_spec = env->package_set(s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
@@ -164,7 +163,7 @@ namespace paludis
s_end(set_use_prefixes_that_have_minus_star.end()) ; s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ s->dep_spec = env->package_set(s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
@@ -181,7 +180,7 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ s->dep_spec = env->package_set(s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
@@ -198,7 +197,7 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ s->dep_spec = env->package_set(s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
@@ -215,7 +214,7 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ s->dep_spec = env->package_set(s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
@@ -232,7 +231,7 @@ namespace paludis
s != s_end ; ++s)
if (! s->dep_spec)
{
- s->dep_spec = DefaultEnvironment::get_instance()->package_set(s->set_name);
+ s->dep_spec = env->package_set(s->set_name);
if (! s->dep_spec)
{
Log::get_instance()->message(ll_warning, lc_context, "Set '" +
@@ -244,42 +243,33 @@ namespace paludis
sets_expanded = true;
}
-
- std::string Implementation<DefaultConfig>::config_suffix;
- bool Implementation<DefaultConfig>::config_suffix_can_be_set(true);
}
-DefaultConfigError::DefaultConfigError(const std::string & msg) throw () :
- ConfigurationError("Default configuration error: " + msg)
+PaludisConfigError::PaludisConfigError(const std::string & msg) throw () :
+ ConfigurationError("Paludis configuration error: " + msg)
{
}
-DefaultConfig::DefaultConfig() :
- PrivateImplementationPattern<DefaultConfig>(new Implementation<DefaultConfig>)
+PaludisConfig::PaludisConfig(PaludisEnvironment * const e, const std::string & suffix) :
+ PrivateImplementationPattern<PaludisConfig>(new Implementation<PaludisConfig>(e))
{
- Context context("When loading default configuration:");
-
- if (! getenv_with_default("PALUDIS_SKIP_CONFIG", "").empty())
- {
- _imp->config_suffix_can_be_set = false;
- return;
- }
+ Context context("When loading paludis configuration:");
/* indirection */
std::string root_prefix;
std::string local_config_suffix;
- if (! _imp->config_suffix.empty())
- local_config_suffix = "-" + _imp->config_suffix;
+ if (! suffix.empty())
+ local_config_suffix = "-" + suffix;
FSEntry local_config_dir(FSEntry(getenv_with_default("PALUDIS_HOME", getenv_or_error("HOME"))) /
(".paludis" + local_config_suffix)), old_config_dir(local_config_dir);
if (! local_config_dir.exists())
local_config_dir = (FSEntry(SYSCONFDIR) / ("paludis" + local_config_suffix));
if (! local_config_dir.exists())
- throw DefaultConfigError("Can't find configuration directory (tried '"
+ throw PaludisConfigError("Can't find configuration directory (tried '"
+ stringify(old_config_dir) + "', '" + stringify(local_config_dir) + "')");
- Log::get_instance()->message(ll_debug, lc_no_context, "DefaultConfig initial directory is '"
+ Log::get_instance()->message(ll_debug, lc_no_context, "PaludisConfig initial directory is '"
+ stringify(local_config_dir) + "'");
if ((local_config_dir / "specpath").exists())
@@ -292,7 +282,7 @@ DefaultConfig::DefaultConfig() :
{
local_config_dir = FSEntry(root_prefix) / SYSCONFDIR / ("paludis" + local_config_suffix);
if (! local_config_dir.exists())
- throw DefaultConfigError("Can't find configuration directory under root ("
+ throw PaludisConfigError("Can't find configuration directory under root ("
"tried '" + stringify(local_config_dir) + "'");
}
}
@@ -304,7 +294,7 @@ DefaultConfig::DefaultConfig() :
new AssociativeCollection<std::string, std::string>::Concrete);
conf_vars->insert("ROOT", root_prefix);
- Log::get_instance()->message(ll_debug, lc_no_context, "DefaultConfig real directory is '"
+ Log::get_instance()->message(ll_debug, lc_no_context, "PaludisConfig real directory is '"
+ stringify(local_config_dir) + "', root prefix is '" + root_prefix +
"', config suffix is '" + local_config_suffix + "'");
@@ -341,7 +331,7 @@ DefaultConfig::DefaultConfig() :
std::string format(k.get("format"));
if (format.empty())
- throw DefaultConfigError("Key 'format' not specified or empty");
+ throw PaludisConfigError("Key 'format' not specified or empty");
int importance(k.get("master_repository").empty() ? 0 : 10);
if (! k.get("importance").empty())
@@ -371,7 +361,7 @@ DefaultConfig::DefaultConfig() :
destringify<int>((*k)->find("importance")->second), *k));
if (_imp->repos.empty())
- throw DefaultConfigError("No repositories specified");
+ throw PaludisConfigError("No repositories specified");
/* add virtuals repositories */
@@ -431,7 +421,7 @@ DefaultConfig::DefaultConfig() :
}
if (_imp->default_keywords.empty())
- throw DefaultConfigError("No default keywords specified (a keywords.conf file should "
+ throw PaludisConfigError("No default keywords specified (a keywords.conf file should "
"contain an entry in the form '* keyword')");
}
@@ -472,7 +462,7 @@ DefaultConfig::DefaultConfig() :
}
if (_imp->default_licenses.empty())
- throw DefaultConfigError("No default licenses specified (a licenses.conf file should "
+ throw PaludisConfigError("No default licenses specified (a licenses.conf file should "
"contain an entry in the form '* license license', or '* *' if you don't want any "
"license filtering)");
}
@@ -660,7 +650,7 @@ DefaultConfig::DefaultConfig() :
}
if (_imp->default_keywords.empty())
- throw DefaultConfigError("No default keywords specified (a keywords.conf file should "
+ throw PaludisConfigError("No default keywords specified (a keywords.conf file should "
"contain an entry in the form '* keyword')");
}
@@ -696,87 +686,32 @@ DefaultConfig::DefaultConfig() :
}
_imp->bashrc_files = stringify(local_config_dir / "bashrc");
-
- _imp->config_suffix_can_be_set = false;
-}
-
-DefaultConfig::~DefaultConfig()
-{
-}
-
-void
-DefaultConfig::add_forced_use_config(const UseConfigEntry & e)
-{
- _imp->forced_use_config.push_back(e);
-}
-
-void
-DefaultConfig::clear_forced_use_config()
-{
- _imp->forced_use_config.clear();
-}
-
-DefaultConfig::UseConfigIterator
-DefaultConfig::begin_forced_use_config() const
-{
- return UseConfigIterator(_imp->forced_use_config.begin());
}
-
-DefaultConfig::UseConfigIterator
-DefaultConfig::end_forced_use_config() const
+PaludisConfig::~PaludisConfig()
{
- return UseConfigIterator(_imp->forced_use_config.end());
-}
-
-void
-DefaultConfig::set_config_suffix(const std::string & s)
-{
- if (! Implementation<DefaultConfig>::config_suffix_can_be_set)
- throw InternalError(PALUDIS_HERE, "DefaultConfig::set_config_suffix called after "
- "DefaultConfig has been instantiated.");
-
- static const std::string allowed_chars(
- "abcdefghijklmnopqrstuvwxyz"
- "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
- "0123456789-_+:");
-
- if (std::string::npos != s.find_first_not_of(allowed_chars))
- throw DefaultConfigError("Invalid config suffix '" + s + "'");
-
- if (! s.empty())
- if ('-' == s.at(0) || '-' == s.at(s.length() - 1))
- throw DefaultConfigError("Invalid config suffix '" + s + "'");
-
- Implementation<DefaultConfig>::config_suffix = s;
}
std::string
-DefaultConfig::bashrc_files() const
+PaludisConfig::bashrc_files() const
{
return _imp->bashrc_files;
}
-std::string
-DefaultConfig::config_suffix()
-{
- return Implementation<DefaultConfig>::config_suffix;
-}
-
-DefaultConfig::RepositoryIterator
-DefaultConfig::begin_repositories() const
+PaludisConfig::RepositoryIterator
+PaludisConfig::begin_repositories() const
{
return RepositoryIterator(_imp->repos.begin());
}
-DefaultConfig::RepositoryIterator
-DefaultConfig::end_repositories() const
+PaludisConfig::RepositoryIterator
+PaludisConfig::end_repositories() const
{
return RepositoryIterator(_imp->repos.end());
}
-DefaultConfig::PackageKeywordsIterator
-DefaultConfig::begin_package_keywords(const QualifiedPackageName & d) const
+PaludisConfig::PackageKeywordsIterator
+PaludisConfig::begin_package_keywords(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<
std::pair<std::tr1::shared_ptr<const PackageDepSpec>, KeywordName> > >::const_iterator r;
@@ -786,8 +721,8 @@ DefaultConfig::begin_package_keywords(const QualifiedPackageName & d) const
return PackageKeywordsIterator(_imp->empty_keywords.begin());
}
-DefaultConfig::PackageKeywordsIterator
-DefaultConfig::end_package_keywords(const QualifiedPackageName & d) const
+PaludisConfig::PackageKeywordsIterator
+PaludisConfig::end_package_keywords(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<
std::pair<std::tr1::shared_ptr<const PackageDepSpec>, KeywordName> > >::const_iterator r;
@@ -797,20 +732,20 @@ DefaultConfig::end_package_keywords(const QualifiedPackageName & d) const
return PackageKeywordsIterator(_imp->empty_keywords.end());
}
-DefaultConfig::DefaultKeywordsIterator
-DefaultConfig::begin_default_keywords() const
+PaludisConfig::DefaultKeywordsIterator
+PaludisConfig::begin_default_keywords() const
{
return DefaultKeywordsIterator(_imp->default_keywords.begin());
}
-DefaultConfig::DefaultKeywordsIterator
-DefaultConfig::end_default_keywords() const
+PaludisConfig::DefaultKeywordsIterator
+PaludisConfig::end_default_keywords() const
{
return DefaultKeywordsIterator(_imp->default_keywords.end());
}
-DefaultConfig::PackageLicensesIterator
-DefaultConfig::begin_package_licenses(const QualifiedPackageName & d) const
+PaludisConfig::PackageLicensesIterator
+PaludisConfig::begin_package_licenses(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<
std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >::const_iterator r;
@@ -820,8 +755,8 @@ DefaultConfig::begin_package_licenses(const QualifiedPackageName & d) const
return PackageLicensesIterator(_imp->empty_licenses.begin());
}
-DefaultConfig::PackageLicensesIterator
-DefaultConfig::end_package_licenses(const QualifiedPackageName & d) const
+PaludisConfig::PackageLicensesIterator
+PaludisConfig::end_package_licenses(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<
std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >::const_iterator r;
@@ -831,20 +766,20 @@ DefaultConfig::end_package_licenses(const QualifiedPackageName & d) const
return PackageLicensesIterator(_imp->empty_licenses.end());
}
-DefaultConfig::DefaultLicensesIterator
-DefaultConfig::begin_default_licenses() const
+PaludisConfig::DefaultLicensesIterator
+PaludisConfig::begin_default_licenses() const
{
return DefaultLicensesIterator(_imp->default_licenses.begin());
}
-DefaultConfig::DefaultLicensesIterator
-DefaultConfig::end_default_licenses() const
+PaludisConfig::DefaultLicensesIterator
+PaludisConfig::end_default_licenses() const
{
return DefaultLicensesIterator(_imp->default_licenses.end());
}
-DefaultConfig::UserMasksIterator
-DefaultConfig::begin_user_masks(const QualifiedPackageName & d) const
+PaludisConfig::UserMasksIterator
+PaludisConfig::begin_user_masks(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator r;
if (_imp->user_masks.end() != ((r = _imp->user_masks.find(d))))
@@ -853,8 +788,8 @@ DefaultConfig::begin_user_masks(const QualifiedPackageName & d) const
return UserMasksIterator(indirect_iterator<const PackageDepSpec>(_imp->empty_masks.begin()));
}
-DefaultConfig::UserMasksIterator
-DefaultConfig::end_user_masks(const QualifiedPackageName & d) const
+PaludisConfig::UserMasksIterator
+PaludisConfig::end_user_masks(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator r;
if (_imp->user_masks.end() != ((r = _imp->user_masks.find(d))))
@@ -863,8 +798,8 @@ DefaultConfig::end_user_masks(const QualifiedPackageName & d) const
return UserMasksIterator(indirect_iterator<const PackageDepSpec>(_imp->empty_masks.end()));
}
-DefaultConfig::UserUnmasksIterator
-DefaultConfig::begin_user_unmasks(const QualifiedPackageName & d) const
+PaludisConfig::UserUnmasksIterator
+PaludisConfig::begin_user_unmasks(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator r;
if (_imp->user_unmasks.end() != ((r = _imp->user_unmasks.find(d))))
@@ -873,8 +808,8 @@ DefaultConfig::begin_user_unmasks(const QualifiedPackageName & d) const
return UserUnmasksIterator(indirect_iterator<const PackageDepSpec>(_imp->empty_masks.begin()));
}
-DefaultConfig::UserUnmasksIterator
-DefaultConfig::end_user_unmasks(const QualifiedPackageName & d) const
+PaludisConfig::UserUnmasksIterator
+PaludisConfig::end_user_unmasks(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<std::tr1::shared_ptr<const PackageDepSpec> > >::const_iterator r;
if (_imp->user_unmasks.end() != ((r = _imp->user_unmasks.find(d))))
@@ -883,8 +818,8 @@ DefaultConfig::end_user_unmasks(const QualifiedPackageName & d) const
return UserUnmasksIterator(indirect_iterator<const PackageDepSpec>(_imp->empty_masks.end()));
}
-DefaultConfig::UseConfigIterator
-DefaultConfig::begin_use_config(const QualifiedPackageName & q) const
+PaludisConfig::UseConfigIterator
+PaludisConfig::begin_use_config(const QualifiedPackageName & q) const
{
std::map<QualifiedPackageName, std::vector<UseConfigEntry> >::const_iterator r;
if (_imp->use.end() != ((r = _imp->use.find(q))))
@@ -893,8 +828,8 @@ DefaultConfig::begin_use_config(const QualifiedPackageName & q) const
return UseConfigIterator(_imp->empty_use.begin());
}
-DefaultConfig::UseConfigIterator
-DefaultConfig::end_use_config(const QualifiedPackageName & q) const
+PaludisConfig::UseConfigIterator
+PaludisConfig::end_use_config(const QualifiedPackageName & q) const
{
std::map<QualifiedPackageName, std::vector<UseConfigEntry> >::const_iterator r;
if (_imp->use.end() != ((r = _imp->use.find(q))))
@@ -903,68 +838,56 @@ DefaultConfig::end_use_config(const QualifiedPackageName & q) const
return UseConfigIterator(_imp->empty_use.end());
}
-DefaultConfig::DefaultUseIterator
-DefaultConfig::begin_default_use() const
+PaludisConfig::DefaultUseIterator
+PaludisConfig::begin_default_use() const
{
return DefaultUseIterator(_imp->default_use.begin());
}
-DefaultConfig::DefaultUseIterator
-DefaultConfig::end_default_use() const
+PaludisConfig::DefaultUseIterator
+PaludisConfig::end_default_use() const
{
return DefaultUseIterator(_imp->default_use.end());
}
std::string
-DefaultConfig::paludis_command() const
-{
- return _imp->paludis_command;
-}
-
-void
-DefaultConfig::set_paludis_command(const std::string & s)
-{
- _imp->paludis_command = s;
-}
-
-std::string
-DefaultConfig::root() const
+PaludisConfig::root() const
{
return _imp->root;
}
std::string
-DefaultConfig::config_dir() const
+PaludisConfig::config_dir() const
{
return _imp->config_dir;
}
-DefaultConfig::MirrorIterator
-DefaultConfig::begin_mirrors(const std::string & m) const
+PaludisConfig::MirrorIterator
+PaludisConfig::begin_mirrors(const std::string & m) const
{
return MirrorIterator(_imp->mirrors.lower_bound(m));
}
-DefaultConfig::MirrorIterator
-DefaultConfig::end_mirrors(const std::string & m) const
+PaludisConfig::MirrorIterator
+PaludisConfig::end_mirrors(const std::string & m) const
{
return MirrorIterator(_imp->mirrors.upper_bound(m));
}
-DefaultConfig::UseMinusStarIterator
-DefaultConfig::begin_use_prefixes_with_minus_star() const
+PaludisConfig::UseMinusStarIterator
+PaludisConfig::begin_use_prefixes_with_minus_star() const
{
return UseMinusStarIterator(_imp->default_use_prefixes_that_have_minus_star.begin());
}
-DefaultConfig::UseMinusStarIterator
-DefaultConfig::end_use_prefixes_with_minus_star() const
+PaludisConfig::UseMinusStarIterator
+PaludisConfig::end_use_prefixes_with_minus_star() const
{
return UseMinusStarIterator(_imp->default_use_prefixes_that_have_minus_star.end());
}
-DefaultConfig::PackageUseMinusStarIterator
-DefaultConfig::begin_package_use_prefixes_with_minus_star(const QualifiedPackageName & d) const
+PaludisConfig::PackageUseMinusStarIterator
+PaludisConfig::begin_package_use_prefixes_with_minus_star(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >::const_iterator r;
if (_imp->use_prefixes_that_have_minus_star.end() != ((r = _imp->use_prefixes_that_have_minus_star.find(d))))
@@ -973,8 +896,8 @@ DefaultConfig::begin_package_use_prefixes_with_minus_star(const QualifiedPackage
return PackageUseMinusStarIterator(_imp->empty_use_prefixes.begin());
}
-DefaultConfig::PackageUseMinusStarIterator
-DefaultConfig::end_package_use_prefixes_with_minus_star(const QualifiedPackageName & d) const
+PaludisConfig::PackageUseMinusStarIterator
+PaludisConfig::end_package_use_prefixes_with_minus_star(const QualifiedPackageName & d) const
{
std::map<QualifiedPackageName, std::vector<std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > >::const_iterator r;
if (_imp->use_prefixes_that_have_minus_star.end() != ((r = _imp->use_prefixes_that_have_minus_star.find(d))))
@@ -983,92 +906,92 @@ DefaultConfig::end_package_use_prefixes_with_minus_star(const QualifiedPackageNa
return PackageUseMinusStarIterator(_imp->empty_use_prefixes.end());
}
-DefaultConfig::SetUseMinusStarIterator
-DefaultConfig::begin_set_use_prefixes_with_minus_star() const
+PaludisConfig::SetUseMinusStarIterator
+PaludisConfig::begin_set_use_prefixes_with_minus_star() const
{
_imp->need_sets_expanded();
return SetUseMinusStarIterator(_imp->set_use_prefixes_that_have_minus_star.begin());
}
-DefaultConfig::SetUseMinusStarIterator
-DefaultConfig::end_set_use_prefixes_with_minus_star() const
+PaludisConfig::SetUseMinusStarIterator
+PaludisConfig::end_set_use_prefixes_with_minus_star() const
{
_imp->need_sets_expanded();
return SetUseMinusStarIterator(_imp->set_use_prefixes_that_have_minus_star.end());
}
-DefaultConfig::SetUseConfigIterator
-DefaultConfig::begin_set_use_config() const
+PaludisConfig::SetUseConfigIterator
+PaludisConfig::begin_set_use_config() const
{
_imp->need_sets_expanded();
return SetUseConfigIterator(_imp->set_use.begin());
}
-DefaultConfig::SetUseConfigIterator
-DefaultConfig::end_set_use_config() const
+PaludisConfig::SetUseConfigIterator
+PaludisConfig::end_set_use_config() const
{
_imp->need_sets_expanded();
return SetUseConfigIterator(_imp->set_use.end());
}
-DefaultConfig::SetKeywordsIterator
-DefaultConfig::begin_set_keywords() const
+PaludisConfig::SetKeywordsIterator
+PaludisConfig::begin_set_keywords() const
{
_imp->need_sets_expanded();
return SetKeywordsIterator(_imp->set_keywords.begin());
}
-DefaultConfig::SetKeywordsIterator
-DefaultConfig::end_set_keywords() const
+PaludisConfig::SetKeywordsIterator
+PaludisConfig::end_set_keywords() const
{
_imp->need_sets_expanded();
return SetKeywordsIterator(_imp->set_keywords.end());
}
-DefaultConfig::SetLicensesIterator
-DefaultConfig::begin_set_licenses() const
+PaludisConfig::SetLicensesIterator
+PaludisConfig::begin_set_licenses() const
{
_imp->need_sets_expanded();
return SetLicensesIterator(_imp->set_licenses.begin());
}
-DefaultConfig::SetLicensesIterator
-DefaultConfig::end_set_licenses() const
+PaludisConfig::SetLicensesIterator
+PaludisConfig::end_set_licenses() const
{
_imp->need_sets_expanded();
return SetLicensesIterator(_imp->set_licenses.end());
}
-DefaultConfig::UserMasksSetsIterator
-DefaultConfig::begin_user_masks_sets() const
+PaludisConfig::UserMasksSetsIterator
+PaludisConfig::begin_user_masks_sets() const
{
_imp->need_sets_expanded();
return UserMasksSetsIterator(_imp->set_masks.begin());
}
-DefaultConfig::UserMasksSetsIterator
-DefaultConfig::end_user_masks_sets() const
+PaludisConfig::UserMasksSetsIterator
+PaludisConfig::end_user_masks_sets() const
{
_imp->need_sets_expanded();
return UserMasksSetsIterator(_imp->set_masks.end());
}
-DefaultConfig::UserMasksSetsIterator
-DefaultConfig::begin_user_unmasks_sets() const
+PaludisConfig::UserMasksSetsIterator
+PaludisConfig::begin_user_unmasks_sets() const
{
_imp->need_sets_expanded();
return UserMasksSetsIterator(_imp->set_unmasks.begin());
}
-DefaultConfig::UserMasksSetsIterator
-DefaultConfig::end_user_unmasks_sets() const
+PaludisConfig::UserMasksSetsIterator
+PaludisConfig::end_user_unmasks_sets() const
{
_imp->need_sets_expanded();
return UserMasksSetsIterator(_imp->set_unmasks.end());
}
uid_t
-DefaultConfig::reduced_uid() const
+PaludisConfig::reduced_uid() const
{
if (! _imp->reduced_uid)
{
@@ -1087,7 +1010,7 @@ DefaultConfig::reduced_uid() const
}
gid_t
-DefaultConfig::reduced_gid() const
+PaludisConfig::reduced_gid() const
{
if (! _imp->reduced_gid)
{
@@ -1106,7 +1029,7 @@ DefaultConfig::reduced_gid() const
}
std::string
-DefaultConfig::reduced_username() const
+PaludisConfig::reduced_username() const
{
return "paludisbuild";
}
diff --git a/paludis/environments/default/default_config.hh b/paludis/environments/paludis/paludis_config.hh
index 2f86613..29c4438 100644
--- a/paludis/environments/default/default_config.hh
+++ b/paludis/environments/paludis/paludis_config.hh
@@ -30,14 +30,15 @@
#include <string>
/** \file
- * Declarations for the DefaultConfig class and related utilities.
+ * Declarations for the PaludisConfig class and related utilities.
*
- * \ingroup grpdefaultconfig
+ * \ingroup grppaludisconfig
*/
namespace paludis
{
struct EnvironmentMirrorIteratorTag;
+ struct PaludisEnvironment;
/**
* Iterate over environment mirrors.
@@ -49,58 +50,43 @@ namespace paludis
const std::pair<const std::string, std::string> > EnvironmentMirrorIterator;
/**
- * A DefaultConfigError is thrown if a configuration error is encountered
- * by DefaultConfig.
+ * A PaludisConfigError is thrown if a configuration error is encountered
+ * by PaludisConfig.
*
* \ingroup grpexceptions
- * \ingroup grpdefaultconfig
+ * \ingroup grppaludisconfig
*/
- class PALUDIS_VISIBLE DefaultConfigError : public ConfigurationError
+ class PALUDIS_VISIBLE PaludisConfigError : public ConfigurationError
{
public:
/**
* Constructor.
*/
- DefaultConfigError(const std::string & msg) throw ();
+ PaludisConfigError(const std::string & msg) throw ();
};
-#include <paludis/environments/default/use_config_entry-sr.hh>
-#include <paludis/environments/default/repository_config_entry-sr.hh>
+#include <paludis/environments/paludis/use_config_entry-sr.hh>
+#include <paludis/environments/paludis/repository_config_entry-sr.hh>
/**
- * DefaultConfig is used by DefaultEnvironment to access the user's
+ * PaludisConfig is used by PaludisEnvironment to access the user's
* configuration settings from on-disk configuration files.
*
- * \ingroup grpdefaultconfig
+ * \ingroup grppaludisconfig
* \nosubgrouping
*/
- class PALUDIS_VISIBLE DefaultConfig :
- public InstantiationPolicy<DefaultConfig, instantiation_method::SingletonTag>,
- private PrivateImplementationPattern<DefaultConfig>
+ class PALUDIS_VISIBLE PaludisConfig :
+ private PrivateImplementationPattern<PaludisConfig>
{
- friend class InstantiationPolicy<DefaultConfig, instantiation_method::SingletonTag>;
-
- private:
- DefaultConfig();
-
- ~DefaultConfig();
-
public:
- /**
- * Set config suffix. Must be called before we do anything, or not
- * at all.
- */
- static void set_config_suffix(const std::string &);
+ PaludisConfig(PaludisEnvironment * const, const std::string & suffix);
- /**
- * Get config suffix.
- */
- static std::string config_suffix();
+ ~PaludisConfig();
///\name Iterate over our repositories
///\{
- typedef libwrapiter::ForwardIterator<DefaultConfig, const RepositoryConfigEntry> RepositoryIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const RepositoryConfigEntry> RepositoryIterator;
RepositoryIterator begin_repositories() const;
@@ -111,20 +97,20 @@ namespace paludis
///\name Iterate over our default, set and per-package keywords
///\{
- typedef libwrapiter::ForwardIterator<DefaultConfig,
+ typedef libwrapiter::ForwardIterator<PaludisConfig,
const std::pair<std::tr1::shared_ptr<const PackageDepSpec>, KeywordName> > PackageKeywordsIterator;
PackageKeywordsIterator begin_package_keywords(const QualifiedPackageName & d) const;
PackageKeywordsIterator end_package_keywords(const QualifiedPackageName & d) const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, const KeywordName> DefaultKeywordsIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const KeywordName> DefaultKeywordsIterator;
DefaultKeywordsIterator begin_default_keywords() const;
DefaultKeywordsIterator end_default_keywords() const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, SetKeywordConfigEntry> SetKeywordsIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, SetKeywordConfigEntry> SetKeywordsIterator;
SetKeywordsIterator begin_set_keywords() const;
SetKeywordsIterator end_set_keywords() const;
@@ -134,20 +120,20 @@ namespace paludis
///\name Iterate over our default, set and per-package licenses
///\{
- typedef libwrapiter::ForwardIterator<DefaultConfig,
+ typedef libwrapiter::ForwardIterator<PaludisConfig,
const std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > PackageLicensesIterator;
PackageLicensesIterator begin_package_licenses(const QualifiedPackageName & d) const;
PackageLicensesIterator end_package_licenses(const QualifiedPackageName & d) const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, const std::string> DefaultLicensesIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const std::string> DefaultLicensesIterator;
DefaultLicensesIterator begin_default_licenses() const;
DefaultLicensesIterator end_default_licenses() const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, SetLicenseConfigEntry> SetLicensesIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, SetLicenseConfigEntry> SetLicensesIterator;
SetLicensesIterator begin_set_licenses() const;
SetLicensesIterator end_set_licenses() const;
@@ -157,19 +143,19 @@ namespace paludis
///\name Iterate over our masks and unmasks
///\{
- typedef libwrapiter::ForwardIterator<DefaultConfig, const PackageDepSpec> UserMasksIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const PackageDepSpec> UserMasksIterator;
UserMasksIterator begin_user_masks(const QualifiedPackageName & d) const;
UserMasksIterator end_user_masks(const QualifiedPackageName & d) const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, const PackageDepSpec> UserUnmasksIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const PackageDepSpec> UserUnmasksIterator;
UserUnmasksIterator begin_user_unmasks(const QualifiedPackageName & d) const;
UserUnmasksIterator end_user_unmasks(const QualifiedPackageName & d) const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, SetMaskConfigEntry> UserMasksSetsIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, SetMaskConfigEntry> UserMasksSetsIterator;
UserMasksSetsIterator begin_user_masks_sets() const;
UserMasksSetsIterator end_user_masks_sets() const;
@@ -181,36 +167,36 @@ namespace paludis
///\name Iterate over our default and per-package and per-set use flags
///\{
- typedef libwrapiter::ForwardIterator<DefaultConfig, const UseConfigEntry> UseConfigIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const UseConfigEntry> UseConfigIterator;
UseConfigIterator begin_use_config(const QualifiedPackageName & q) const;
UseConfigIterator end_use_config(const QualifiedPackageName & q) const;
- typedef libwrapiter::ForwardIterator<DefaultConfig,
+ typedef libwrapiter::ForwardIterator<PaludisConfig,
const std::pair<UseFlagName, UseFlagState> > DefaultUseIterator;
DefaultUseIterator begin_default_use() const;
DefaultUseIterator end_default_use() const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, const std::string> UseMinusStarIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const std::string> UseMinusStarIterator;
UseMinusStarIterator begin_use_prefixes_with_minus_star() const;
UseMinusStarIterator end_use_prefixes_with_minus_star() const;
- typedef libwrapiter::ForwardIterator<DefaultConfig,
+ typedef libwrapiter::ForwardIterator<PaludisConfig,
const std::pair<std::tr1::shared_ptr<const PackageDepSpec>, std::string> > PackageUseMinusStarIterator;
PackageUseMinusStarIterator begin_package_use_prefixes_with_minus_star(const QualifiedPackageName &) const;
PackageUseMinusStarIterator end_package_use_prefixes_with_minus_star(const QualifiedPackageName &) const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, const SetUseConfigEntry> SetUseConfigIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const SetUseConfigEntry> SetUseConfigIterator;
SetUseConfigIterator begin_set_use_config() const;
SetUseConfigIterator end_set_use_config() const;
- typedef libwrapiter::ForwardIterator<DefaultConfig, const SetUseConfigMinusStarEntry> SetUseMinusStarIterator;
+ typedef libwrapiter::ForwardIterator<PaludisConfig, const SetUseConfigMinusStarEntry> SetUseMinusStarIterator;
SetUseMinusStarIterator begin_set_use_prefixes_with_minus_star() const;
SetUseMinusStarIterator end_set_use_prefixes_with_minus_star() const;
@@ -218,38 +204,11 @@ namespace paludis
///\}
/**
- * Add a forced USE flag to this configuration.
- */
- void add_forced_use_config(const UseConfigEntry & e);
-
- /**
- * Clear all forced USE flags.
- */
- void clear_forced_use_config();
-
- ///\name Iterate over our forced USE flags
- ///\{
- UseConfigIterator begin_forced_use_config() const;
- UseConfigIterator end_forced_use_config() const;
- ///\}
-
-
- /**
* Our bashrc files.
*/
std::string bashrc_files() const;
/**
- * The paludis command.
- */
- std::string paludis_command() const;
-
- /**
- * Set the paludis command.
- */
- void set_paludis_command(const std::string & s);
-
- /**
* The ROOT.
*/
std::string root() const;
diff --git a/paludis/environments/default/default_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 0f3faa4..8d46509 100644
--- a/paludis/environments/default/default_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -20,8 +20,8 @@
#include <list>
#include <paludis/config_file.hh>
#include <paludis/hashed_containers.hh>
-#include <paludis/environments/default/default_config.hh>
-#include <paludis/environments/default/default_environment.hh>
+#include <paludis/environments/paludis/paludis_config.hh>
+#include <paludis/environments/paludis/paludis_environment.hh>
#include <paludis/match_package.hh>
#include <paludis/package_database.hh>
#include <paludis/query.hh>
@@ -44,30 +44,40 @@ typedef MakeHashedMap<std::string, bool>::Type HookPresentCache;
namespace paludis
{
template<>
- struct Implementation<DefaultEnvironment>
+ struct Implementation<PaludisEnvironment>
{
mutable HookPresentCache hook_cache;
+ std::tr1::shared_ptr<PaludisConfig> config;
+ std::string paludis_command;
+ std::list<UseConfigEntry> forced_use;
+
+ Implementation(std::tr1::shared_ptr<PaludisConfig> c) :
+ config(c),
+ paludis_command("paludis")
+ {
+ }
};
}
-DefaultEnvironment::DefaultEnvironment() :
+PaludisEnvironment::PaludisEnvironment(const std::string & s) :
Environment(std::tr1::shared_ptr<PackageDatabase>(new PackageDatabase(this))),
- PrivateImplementationPattern<DefaultEnvironment>(new Implementation<DefaultEnvironment>)
+ PrivateImplementationPattern<PaludisEnvironment>(new Implementation<PaludisEnvironment>(
+ std::tr1::shared_ptr<PaludisConfig>(new PaludisConfig(this, s))))
{
- Context context("When loading default environment:");
+ Context context("When loading paludis environment:");
- for (DefaultConfig::RepositoryIterator r(DefaultConfig::get_instance()->begin_repositories()),
- r_end(DefaultConfig::get_instance()->end_repositories()) ; r != r_end ; ++r)
+ for (PaludisConfig::RepositoryIterator r(_imp->config->begin_repositories()),
+ r_end(_imp->config->end_repositories()) ; r != r_end ; ++r)
package_database()->add_repository(
RepositoryMaker::get_instance()->find_maker(r->format)(this, r->keys));
}
-DefaultEnvironment::~DefaultEnvironment()
+PaludisEnvironment::~PaludisEnvironment()
{
}
bool
-DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry * e) const
+PaludisEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry * e) const
{
/* first check package database use masks... */
const Repository * const repo((e ? package_database()->fetch_repository(e->repository).get() : 0));
@@ -81,10 +91,8 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
}
/* check use: forced use config */
- for (DefaultConfig::UseConfigIterator
- u(DefaultConfig::get_instance()->begin_forced_use_config()),
- u_end(DefaultConfig::get_instance()->end_forced_use_config()) ;
- u != u_end ; ++u)
+ for (std::list<UseConfigEntry>::const_iterator
+ u(_imp->forced_use.begin()), u_end(_imp->forced_use.end()) ; u != u_end ; ++u)
{
if (u->flag_name != f)
continue;
@@ -104,9 +112,9 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
{
UseFlagState s(use_unspecified);
- for (DefaultConfig::UseConfigIterator
- u(DefaultConfig::get_instance()->begin_use_config(e->name)),
- u_end(DefaultConfig::get_instance()->end_use_config(e->name)) ;
+ for (PaludisConfig::UseConfigIterator
+ u(_imp->config->begin_use_config(e->name)),
+ u_end(_imp->config->end_use_config(e->name)) ;
u != u_end ; ++u)
{
if (f != u->flag_name)
@@ -149,9 +157,9 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
} while (false);
/* and the -* bit */
- for (DefaultConfig::PackageUseMinusStarIterator
- i(DefaultConfig::get_instance()->begin_package_use_prefixes_with_minus_star(e->name)),
- i_end(DefaultConfig::get_instance()->end_package_use_prefixes_with_minus_star(e->name)) ;
+ for (PaludisConfig::PackageUseMinusStarIterator
+ i(_imp->config->begin_package_use_prefixes_with_minus_star(e->name)),
+ i_end(_imp->config->end_package_use_prefixes_with_minus_star(e->name)) ;
i != i_end ; ++i)
{
if (! match_package(*this, *i->first, *e))
@@ -167,9 +175,9 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
{
UseFlagState s(use_unspecified);
- for (DefaultConfig::SetUseConfigIterator
- u(DefaultConfig::get_instance()->begin_set_use_config()),
- u_end(DefaultConfig::get_instance()->end_set_use_config()) ;
+ for (PaludisConfig::SetUseConfigIterator
+ u(_imp->config->begin_set_use_config()),
+ u_end(_imp->config->end_set_use_config()) ;
u != u_end ; ++u)
{
if (f != u->flag_name)
@@ -212,9 +220,9 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
} while (false);
/* and the -* bit */
- for (DefaultConfig::SetUseMinusStarIterator
- i(DefaultConfig::get_instance()->begin_set_use_prefixes_with_minus_star()),
- i_end(DefaultConfig::get_instance()->end_set_use_prefixes_with_minus_star()) ;
+ for (PaludisConfig::SetUseMinusStarIterator
+ i(_imp->config->begin_set_use_prefixes_with_minus_star()),
+ i_end(_imp->config->end_set_use_prefixes_with_minus_star()) ;
i != i_end ; ++i)
{
if (! match_package_in_heirarchy(*this, *i->dep_spec, *e))
@@ -230,9 +238,9 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
{
UseFlagState state(use_unspecified);
- for (DefaultConfig::DefaultUseIterator
- u(DefaultConfig::get_instance()->begin_default_use()),
- u_end(DefaultConfig::get_instance()->end_default_use()) ;
+ for (PaludisConfig::DefaultUseIterator
+ u(_imp->config->begin_default_use()),
+ u_end(_imp->config->end_default_use()) ;
u != u_end ; ++u)
if (f == u->first)
state = u->second;
@@ -267,9 +275,9 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
}
}
- for (DefaultConfig::UseMinusStarIterator
- i(DefaultConfig::get_instance()->begin_use_prefixes_with_minus_star()),
- i_end(DefaultConfig::get_instance()->end_use_prefixes_with_minus_star()) ;
+ for (PaludisConfig::UseMinusStarIterator
+ i(_imp->config->begin_use_prefixes_with_minus_star()),
+ i_end(_imp->config->end_use_prefixes_with_minus_star()) ;
i != i_end ; ++i)
{
if ((! consider_minus_star) && i->empty())
@@ -300,7 +308,7 @@ DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry
}
bool
-DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDatabaseEntry * const d,
+PaludisEnvironment::accept_keyword(const KeywordName & keyword, const PackageDatabaseEntry * const d,
const bool override_tilde_keywords) const
{
static KeywordName star_keyword("*");
@@ -316,22 +324,22 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
if (keyword != minus_star_keyword)
{
- result |= DefaultConfig::get_instance()->end_default_keywords() !=
- std::find(DefaultConfig::get_instance()->begin_default_keywords(),
- DefaultConfig::get_instance()->end_default_keywords(),
+ result |= _imp->config->end_default_keywords() !=
+ std::find(_imp->config->begin_default_keywords(),
+ _imp->config->end_default_keywords(),
keyword);
}
- result |= DefaultConfig::get_instance()->end_default_keywords() !=
- std::find(DefaultConfig::get_instance()->begin_default_keywords(),
- DefaultConfig::get_instance()->end_default_keywords(),
+ result |= _imp->config->end_default_keywords() !=
+ std::find(_imp->config->begin_default_keywords(),
+ _imp->config->end_default_keywords(),
star_keyword);
if (d)
{
- for (DefaultConfig::SetKeywordsIterator
- k(DefaultConfig::get_instance()->begin_set_keywords()),
- k_end(DefaultConfig::get_instance()->end_set_keywords()) ;
+ for (PaludisConfig::SetKeywordsIterator
+ k(_imp->config->begin_set_keywords()),
+ k_end(_imp->config->end_set_keywords()) ;
k != k_end ; ++k)
{
if (! match_package_in_heirarchy(*this, *k->dep_spec, *d))
@@ -346,9 +354,9 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
}
}
- for (DefaultConfig::PackageKeywordsIterator
- k(DefaultConfig::get_instance()->begin_package_keywords(d->name)),
- k_end(DefaultConfig::get_instance()->end_package_keywords(d->name)) ;
+ for (PaludisConfig::PackageKeywordsIterator
+ k(_imp->config->begin_package_keywords(d->name)),
+ k_end(_imp->config->end_package_keywords(d->name)) ;
k != k_end ; ++k)
{
if (! match_package(*this, *k->first, *d))
@@ -372,7 +380,7 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
}
bool
-DefaultEnvironment::accept_license(const std::string & license, const PackageDatabaseEntry * const d) const
+PaludisEnvironment::accept_license(const std::string & license, const PackageDatabaseEntry * const d) const
{
if (license == "*")
return true;
@@ -384,21 +392,21 @@ DefaultEnvironment::accept_license(const std::string & license, const PackageDat
bool result(false);
- result |= DefaultConfig::get_instance()->end_default_licenses() !=
- std::find(DefaultConfig::get_instance()->begin_default_licenses(),
- DefaultConfig::get_instance()->end_default_licenses(),
+ result |= _imp->config->end_default_licenses() !=
+ std::find(_imp->config->begin_default_licenses(),
+ _imp->config->end_default_licenses(),
license);
- result |= DefaultConfig::get_instance()->end_default_licenses() !=
- std::find(DefaultConfig::get_instance()->begin_default_licenses(),
- DefaultConfig::get_instance()->end_default_licenses(),
+ result |= _imp->config->end_default_licenses() !=
+ std::find(_imp->config->begin_default_licenses(),
+ _imp->config->end_default_licenses(),
"*");
if (d)
{
- for (DefaultConfig::SetLicensesIterator
- k(DefaultConfig::get_instance()->begin_set_licenses()),
- k_end(DefaultConfig::get_instance()->end_set_licenses()) ;
+ for (PaludisConfig::SetLicensesIterator
+ k(_imp->config->begin_set_licenses()),
+ k_end(_imp->config->end_set_licenses()) ;
k != k_end ; ++k)
{
if (! match_package_in_heirarchy(*this, *k->dep_spec, *d))
@@ -413,9 +421,9 @@ DefaultEnvironment::accept_license(const std::string & license, const PackageDat
}
}
- for (DefaultConfig::PackageLicensesIterator
- k(DefaultConfig::get_instance()->begin_package_licenses(d->name)),
- k_end(DefaultConfig::get_instance()->end_package_licenses(d->name)) ;
+ for (PaludisConfig::PackageLicensesIterator
+ k(_imp->config->begin_package_licenses(d->name)),
+ k_end(_imp->config->end_package_licenses(d->name)) ;
k != k_end ; ++k)
{
if (! match_package(*this, *k->first, *d))
@@ -435,11 +443,11 @@ DefaultEnvironment::accept_license(const std::string & license, const PackageDat
}
bool
-DefaultEnvironment::query_user_masks(const PackageDatabaseEntry & d) const
+PaludisEnvironment::query_user_masks(const PackageDatabaseEntry & d) const
{
- for (DefaultConfig::UserMasksIterator
- k(DefaultConfig::get_instance()->begin_user_masks(d.name)),
- k_end(DefaultConfig::get_instance()->end_user_masks(d.name)) ;
+ for (PaludisConfig::UserMasksIterator
+ k(_imp->config->begin_user_masks(d.name)),
+ k_end(_imp->config->end_user_masks(d.name)) ;
k != k_end ; ++k)
{
if (! match_package(*this, *k, d))
@@ -448,9 +456,9 @@ DefaultEnvironment::query_user_masks(const PackageDatabaseEntry & d) const
return true;
}
- for (DefaultConfig::UserMasksSetsIterator
- k(DefaultConfig::get_instance()->begin_user_masks_sets()),
- k_end(DefaultConfig::get_instance()->end_user_masks_sets()) ;
+ for (PaludisConfig::UserMasksSetsIterator
+ k(_imp->config->begin_user_masks_sets()),
+ k_end(_imp->config->end_user_masks_sets()) ;
k != k_end ; ++k)
{
if (! match_package_in_heirarchy(*this, *k->dep_spec, d))
@@ -463,11 +471,11 @@ DefaultEnvironment::query_user_masks(const PackageDatabaseEntry & d) const
}
bool
-DefaultEnvironment::query_user_unmasks(const PackageDatabaseEntry & d) const
+PaludisEnvironment::query_user_unmasks(const PackageDatabaseEntry & d) const
{
- for (DefaultConfig::UserMasksIterator
- k(DefaultConfig::get_instance()->begin_user_unmasks(d.name)),
- k_end(DefaultConfig::get_instance()->end_user_unmasks(d.name)) ;
+ for (PaludisConfig::UserMasksIterator
+ k(_imp->config->begin_user_unmasks(d.name)),
+ k_end(_imp->config->end_user_unmasks(d.name)) ;
k != k_end ; ++k)
{
if (! match_package(*this, *k, d))
@@ -476,9 +484,9 @@ DefaultEnvironment::query_user_unmasks(const PackageDatabaseEntry & d) const
return true;
}
- for (DefaultConfig::UserMasksSetsIterator
- k(DefaultConfig::get_instance()->begin_user_unmasks_sets()),
- k_end(DefaultConfig::get_instance()->end_user_unmasks_sets()) ;
+ for (PaludisConfig::UserMasksSetsIterator
+ k(_imp->config->begin_user_unmasks_sets()),
+ k_end(_imp->config->end_user_unmasks_sets()) ;
k != k_end ; ++k)
{
if (! match_package_in_heirarchy(*this, *k->dep_spec, d))
@@ -491,15 +499,21 @@ DefaultEnvironment::query_user_unmasks(const PackageDatabaseEntry & d) const
}
std::string
-DefaultEnvironment::bashrc_files() const
+PaludisEnvironment::bashrc_files() const
{
- return DefaultConfig::get_instance()->bashrc_files();
+ return _imp->config->bashrc_files();
}
std::string
-DefaultEnvironment::paludis_command() const
+PaludisEnvironment::paludis_command() const
+{
+ return _imp->paludis_command;
+}
+
+void
+PaludisEnvironment::set_paludis_command(const std::string & s)
{
- return DefaultConfig::get_instance()->paludis_command();
+ _imp->paludis_command = s;
}
namespace
@@ -527,13 +541,13 @@ namespace
}
}
- const std::list<FSEntry> & get_hook_dirs()
+ const std::list<FSEntry> & get_hook_dirs(const std::string & c)
{
static std::list<FSEntry> result;
static bool done_hooks(false);
if (! done_hooks)
{
- add_one_hook(DefaultConfig::get_instance()->config_dir() + "/hooks", result);
+ add_one_hook(c + "/hooks", result);
if (getenv_with_default("PALUDIS_NO_GLOBAL_HOOKS", "").empty())
{
add_one_hook(LIBEXECDIR "/paludis/hooks", result);
@@ -548,10 +562,12 @@ namespace
{
Hook hook;
std::string paludis_command;
+ std::string root;
- Hooker(const Hook & h, const std::string & p) :
+ Hooker(const Hook & h, const std::string & p, const std::string & r) :
hook(h),
- paludis_command(p)
+ paludis_command(p),
+ root(r)
{
}
@@ -567,10 +583,9 @@ namespace
stringify(f) + "' for '" + hook.name() + "'");
Command cmd(Command("bash '" + stringify(f) + "'")
- .with_setenv("ROOT", DefaultConfig::get_instance()->root())
+ .with_setenv("ROOT", root)
.with_setenv("HOOK", hook.name())
.with_setenv("HOOK_LOG_LEVEL", stringify(Log::get_instance()->log_level()))
- .with_setenv("HOOK_CONFIG_SUFFIX", DefaultConfig::config_suffix())
.with_setenv("PALUDIS_EBUILD_DIR", getenv_with_default("PALUDIS_EBUILD_DIR", LIBEXECDIR "/paludis"))
.with_setenv("PALUDIS_COMMAND", paludis_command));
@@ -589,7 +604,7 @@ namespace
}
int
-DefaultEnvironment::perform_hook(const Hook & hook) const
+PaludisEnvironment::perform_hook(const Hook & hook) const
{
HookPresentCache::iterator cache_entry(_imp->hook_cache.end());
if (_imp->hook_cache.end() != ((cache_entry = _imp->hook_cache.find(hook.name()))))
@@ -599,7 +614,7 @@ DefaultEnvironment::perform_hook(const Hook & hook) const
Context context("When triggering hook '" + hook.name() + "'");
Log::get_instance()->message(ll_debug, lc_no_context, "Starting hook '" + hook.name() + "'");
- const std::list<FSEntry> & hook_dirs_ref(get_hook_dirs());
+ const std::list<FSEntry> & hook_dirs_ref(get_hook_dirs(_imp->config->config_dir()));
bool had_hook(false);
int max_exit_status(0);
@@ -619,7 +634,8 @@ DefaultEnvironment::perform_hook(const Hook & hook) const
for (std::list<FSEntry>::const_iterator hk(hooks.begin()),
hk_end(hooks.end()) ; hk != hk_end ; ++hk)
- max_exit_status = std::max(max_exit_status, Hooker(hook, paludis_command())(*hk));
+ max_exit_status = std::max(max_exit_status, Hooker(hook, paludis_command(),
+ stringify(root()))(*hk));
}
if (_imp->hook_cache.end() == cache_entry)
@@ -629,36 +645,36 @@ DefaultEnvironment::perform_hook(const Hook & hook) const
}
std::string
-DefaultEnvironment::hook_dirs() const
+PaludisEnvironment::hook_dirs() const
{
- const std::list<FSEntry> & hook_dirs_ref(get_hook_dirs());
+ const std::list<FSEntry> & hook_dirs_ref(get_hook_dirs(_imp->config->config_dir()));
return join(hook_dirs_ref.begin(), hook_dirs_ref.end(), " ");
}
std::string
-DefaultEnvironment::fetchers_dirs() const
+PaludisEnvironment::fetchers_dirs() const
{
- std::string dirs(stringify(FSEntry(DefaultConfig::get_instance()->config_dir()) / "fetchers"));
+ std::string dirs(stringify(FSEntry(_imp->config->config_dir()) / "fetchers"));
if (getenv_with_default("PALUDIS_NO_GLOBAL_FETCHERS", "").empty())
dirs += " " + Environment::fetchers_dirs();
return dirs;
}
std::string
-DefaultEnvironment::syncers_dirs() const
+PaludisEnvironment::syncers_dirs() const
{
- std::string dirs(stringify(FSEntry(DefaultConfig::get_instance()->config_dir()) / "syncers"));
+ std::string dirs(stringify(FSEntry(_imp->config->config_dir()) / "syncers"));
if (getenv_with_default("PALUDIS_NO_GLOBAL_SYNCERS", "").empty())
dirs += " " + Environment::syncers_dirs();
return dirs;
}
std::tr1::shared_ptr<CompositeDepSpec>
-DefaultEnvironment::local_package_set(const SetName & s) const
+PaludisEnvironment::local_package_set(const SetName & s) const
{
- Context context("When looking for package set '" + stringify(s) + "' in default environment:");
+ Context context("When looking for package set '" + stringify(s) + "' in paludis environment:");
- FSEntry ff(FSEntry(DefaultConfig::get_instance()->config_dir()) / "sets" / (stringify(s) + ".conf"));
+ FSEntry ff(FSEntry(_imp->config->config_dir()) / "sets" / (stringify(s) + ".conf"));
if (ff.exists())
{
LineConfigFile f(ff);
@@ -712,12 +728,12 @@ DefaultEnvironment::local_package_set(const SetName & s) const
}
std::tr1::shared_ptr<const SetsCollection>
-DefaultEnvironment::sets_list() const
+PaludisEnvironment::sets_list() const
{
std::tr1::shared_ptr<SetsCollection> result(new SetsCollection::Concrete);
- if ((FSEntry(DefaultConfig::get_instance()->config_dir()) / "sets").exists())
- for (DirIterator d(FSEntry(DefaultConfig::get_instance()->config_dir()) / "sets"), d_end ;
+ if ((FSEntry(_imp->config->config_dir()) / "sets").exists())
+ for (DirIterator d(FSEntry(_imp->config->config_dir()) / "sets"), d_end ;
d != d_end ; ++d)
{
if (! IsFileWithExtension(".conf")(*d))
@@ -729,35 +745,35 @@ DefaultEnvironment::sets_list() const
return result;
}
-DefaultEnvironment::MirrorIterator
-DefaultEnvironment::begin_mirrors(const std::string & mirror) const
+PaludisEnvironment::MirrorIterator
+PaludisEnvironment::begin_mirrors(const std::string & mirror) const
{
- return DefaultConfig::get_instance()->begin_mirrors(mirror);
+ return _imp->config->begin_mirrors(mirror);
}
-DefaultEnvironment::MirrorIterator
-DefaultEnvironment::end_mirrors(const std::string & mirror) const
+PaludisEnvironment::MirrorIterator
+PaludisEnvironment::end_mirrors(const std::string & mirror) const
{
- return DefaultConfig::get_instance()->end_mirrors(mirror);
+ return _imp->config->end_mirrors(mirror);
}
std::tr1::shared_ptr<const UseFlagNameCollection>
-DefaultEnvironment::known_use_expand_names(const UseFlagName & prefix, const PackageDatabaseEntry * pde) const
+PaludisEnvironment::known_use_expand_names(const UseFlagName & prefix, const PackageDatabaseEntry * pde) const
{
std::tr1::shared_ptr<UseFlagNameCollection> result(new UseFlagNameCollection::Concrete);
std::string prefix_lower;
std::transform(prefix.data().begin(), prefix.data().end(), std::back_inserter(prefix_lower), &::tolower);
- for (DefaultConfig::DefaultUseIterator i(DefaultConfig::get_instance()->begin_default_use()),
- i_end(DefaultConfig::get_instance()->end_default_use()) ; i != i_end ; ++i)
+ for (PaludisConfig::DefaultUseIterator i(_imp->config->begin_default_use()),
+ i_end(_imp->config->end_default_use()) ; i != i_end ; ++i)
if (i->first.data().length() > prefix_lower.length() &&
0 == i->first.data().compare(0, prefix_lower.length(), prefix_lower, 0, prefix_lower.length()))
result->insert(i->first);
if (pde)
{
- for (DefaultConfig::UseConfigIterator i(DefaultConfig::get_instance()->begin_forced_use_config()),
- i_end(DefaultConfig::get_instance()->end_forced_use_config()) ; i != i_end ; ++i)
+ for (std::list<UseConfigEntry>::const_iterator i(_imp->forced_use.begin()),
+ i_end(_imp->forced_use.end()) ; i != i_end ; ++i)
{
if (! i->dep_spec)
continue;
@@ -770,42 +786,55 @@ DefaultEnvironment::known_use_expand_names(const UseFlagName & prefix, const Pac
result->insert(i->flag_name);
}
- for (DefaultConfig::UseConfigIterator i(DefaultConfig::get_instance()->begin_use_config(pde->name)),
- i_end(DefaultConfig::get_instance()->end_use_config(pde->name)) ; i != i_end ; ++i)
+ for (PaludisConfig::UseConfigIterator i(_imp->config->begin_use_config(pde->name)),
+ i_end(_imp->config->end_use_config(pde->name)) ; i != i_end ; ++i)
if (i->flag_name.data().length() > prefix_lower.length() &&
0 == i->flag_name.data().compare(0, prefix_lower.length(), prefix_lower, 0, prefix_lower.length()))
result->insert(i->flag_name);
}
- Log::get_instance()->message(ll_debug, lc_no_context, "DefaultEnvironment::known_use_expand_names("
+ Log::get_instance()->message(ll_debug, lc_no_context, "PaludisEnvironment::known_use_expand_names("
+ stringify(prefix) + ", " + (pde ? stringify(*pde) : stringify("0")) + ") -> ("
+ join(result->begin(), result->end(), ", ") + ")");
return result;
}
FSEntry
-DefaultEnvironment::root() const
+PaludisEnvironment::root() const
{
- return DefaultConfig::get_instance()->root();
+ return _imp->config->root();
}
uid_t
-DefaultEnvironment::reduced_uid() const
+PaludisEnvironment::reduced_uid() const
{
uid_t u(getuid());
if (0 == u)
- return DefaultConfig::get_instance()->reduced_uid();
+ return _imp->config->reduced_uid();
else
return u;
}
gid_t
-DefaultEnvironment::reduced_gid() const
+PaludisEnvironment::reduced_gid() const
{
gid_t g(getgid());
if (0 == g)
- return DefaultConfig::get_instance()->reduced_gid();
+ return _imp->config->reduced_gid();
else
return g;
}
+void
+PaludisEnvironment::force_use(std::tr1::shared_ptr<const PackageDepSpec> a,
+ const UseFlagName & f, const UseFlagState s)
+{
+ _imp->forced_use.push_back(UseConfigEntry(a, f, s));
+}
+
+void
+PaludisEnvironment::clear_forced_use()
+{
+ _imp->forced_use.clear();
+}
+
diff --git a/paludis/environments/default/default_environment.hh b/paludis/environments/paludis/paludis_environment.hh
index f8650db..546cad2 100644
--- a/paludis/environments/default/default_environment.hh
+++ b/paludis/environments/paludis/paludis_environment.hh
@@ -24,35 +24,34 @@
#include <paludis/environment.hh>
/** \file
- * Declarations for the DefaultEnvironment class.
+ * Declarations for the PaludisEnvironment class.
*
- * \ingroup grpdefaultenvironment
+ * \ingroup grppaludisenvironment
*/
namespace paludis
{
+ class PaludisConfig;
+
/**
- * The DefaultEnvironment is an Environment that corresponds to the normal
+ * The PaludisEnvironment is an Environment that corresponds to the normal
* operating evironment.
*
- * \ingroup grpdefaultenvironment
+ * \ingroup grppaludisenvironment
*/
- class PALUDIS_VISIBLE DefaultEnvironment :
+ class PALUDIS_VISIBLE PaludisEnvironment :
public Environment,
- public InstantiationPolicy<DefaultEnvironment, instantiation_method::SingletonTag>,
- private PrivateImplementationPattern<DefaultEnvironment>
+ public InstantiationPolicy<PaludisEnvironment, instantiation_method::SingletonTag>,
+ private PrivateImplementationPattern<PaludisEnvironment>
{
- friend class InstantiationPolicy<DefaultEnvironment, instantiation_method::SingletonTag>;
-
- private:
- DefaultEnvironment();
-
- ~DefaultEnvironment();
-
protected:
std::tr1::shared_ptr<CompositeDepSpec> local_package_set(const SetName &) const;
public:
+ PaludisEnvironment(const std::string &);
+
+ ~PaludisEnvironment();
+
virtual std::tr1::shared_ptr<const SetsCollection> sets_list() const;
virtual bool query_use(const UseFlagName &, const PackageDatabaseEntry *) const;
@@ -76,6 +75,8 @@ namespace paludis
virtual std::string paludis_command() const;
+ virtual void set_paludis_command(const std::string &);
+
virtual std::tr1::shared_ptr<const UseFlagNameCollection> known_use_expand_names(const UseFlagName &,
const PackageDatabaseEntry *) const;
@@ -89,6 +90,11 @@ namespace paludis
virtual uid_t reduced_uid() const;
virtual gid_t reduced_gid() const;
+
+ void force_use(std::tr1::shared_ptr<const PackageDepSpec>, const UseFlagName &,
+ const UseFlagState);
+
+ virtual void clear_forced_use();
};
}
#endif
diff --git a/paludis/environments/default/default_environment_TEST.cc b/paludis/environments/paludis/paludis_environment_TEST.cc
index fcad357..bede2e1 100644
--- a/paludis/environments/default/default_environment_TEST.cc
+++ b/paludis/environments/paludis/paludis_environment_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -17,8 +17,8 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "default_environment.hh"
-#include "default_config.hh"
+#include "paludis_environment.hh"
+#include "paludis_config.hh"
#include <paludis/util/fs_entry.hh>
#include <test/test_runner.hh>
#include <test/test_framework.hh>
@@ -29,18 +29,16 @@ using namespace test;
namespace test_cases
{
- struct TestDefaultEnvironmentUse : TestCase
+ struct TestPaludisEnvironmentUse : TestCase
{
- TestDefaultEnvironmentUse() : TestCase("use") { }
+ TestPaludisEnvironmentUse() : TestCase("use") { }
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "default_environment_TEST_dir" / "home1").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home1").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
- DefaultConfig::destroy_instance();
- DefaultEnvironment::destroy_instance();
- Environment * env(DefaultEnvironment::get_instance());
+ std::tr1::shared_ptr<Environment> env(new PaludisEnvironment(""));
TEST_CHECK(env->query_use(UseFlagName("foo"), 0));
TEST_CHECK(! env->query_use(UseFlagName("foofoo"), 0));
@@ -60,20 +58,18 @@ namespace test_cases
TEST_CHECK(env->query_use(UseFlagName("third_exp_one"), &f));
TEST_CHECK(env->query_use(UseFlagName("third_exp_two"), &f));
}
- } default_environment_use_test;
+ } paludis_environment_use_test;
- struct TestDefaultEnvironmentUseMinusStar : TestCase
+ struct TestPaludisEnvironmentUseMinusStar : TestCase
{
- TestDefaultEnvironmentUseMinusStar() : TestCase("use -*") { }
+ TestPaludisEnvironmentUseMinusStar() : TestCase("use -*") { }
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "default_environment_TEST_dir" / "home2").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home2").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
- DefaultConfig::destroy_instance();
- DefaultEnvironment::destroy_instance();
- Environment * env(DefaultEnvironment::get_instance());
+ std::tr1::shared_ptr<Environment> env(new PaludisEnvironment(""));
TEST_CHECK(env->query_use(UseFlagName("foo"), 0));
TEST_CHECK(! env->query_use(UseFlagName("foofoo"), 0));
@@ -93,20 +89,18 @@ namespace test_cases
TEST_CHECK(! env->query_use(UseFlagName("third_exp_one"), &f));
TEST_CHECK(env->query_use(UseFlagName("third_exp_two"), &f));
}
- } default_environment_use_test_minus_star;
+ } paludis_environment_use_test_minus_star;
- struct TestDefaultEnvironmentUseMinusPartialStar : TestCase
+ struct TestPaludisEnvironmentUseMinusPartialStar : TestCase
{
- TestDefaultEnvironmentUseMinusPartialStar() : TestCase("use -* partial") { }
+ TestPaludisEnvironmentUseMinusPartialStar() : TestCase("use -* partial") { }
void run()
{
- setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "default_environment_TEST_dir" / "home3").c_str(), 1);
+ setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "paludis_environment_TEST_dir" / "home3").c_str(), 1);
unsetenv("PALUDIS_SKIP_CONFIG");
- DefaultConfig::destroy_instance();
- DefaultEnvironment::destroy_instance();
- Environment * env(DefaultEnvironment::get_instance());
+ std::tr1::shared_ptr<Environment> env(new PaludisEnvironment(""));
TEST_CHECK(env->query_use(UseFlagName("foo"), 0));
TEST_CHECK(! env->query_use(UseFlagName("foofoo"), 0));
@@ -126,6 +120,6 @@ namespace test_cases
TEST_CHECK(! env->query_use(UseFlagName("third_exp_one"), &f));
TEST_CHECK(env->query_use(UseFlagName("third_exp_two"), &f));
}
- } default_environment_use_test_minus_star_partial;
+ } paludis_environment_use_test_minus_star_partial;
}
diff --git a/paludis/environments/paludis/paludis_environment_TEST_cleanup.sh b/paludis/environments/paludis/paludis_environment_TEST_cleanup.sh
new file mode 100755
index 0000000..043f533
--- /dev/null
+++ b/paludis/environments/paludis/paludis_environment_TEST_cleanup.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d paludis_environment_TEST_dir ] ; then
+ rm -fr paludis_environment_TEST_dir
+else
+ true
+fi
+
+
+
diff --git a/paludis/environments/default/default_environment_TEST_setup.sh b/paludis/environments/paludis/paludis_environment_TEST_setup.sh
index 9b40b8e..9ebe187 100755
--- a/paludis/environments/default/default_environment_TEST_setup.sh
+++ b/paludis/environments/paludis/paludis_environment_TEST_setup.sh
@@ -1,8 +1,8 @@
#!/bin/bash
# vim: set ft=sh sw=4 sts=4 et :
-mkdir default_environment_TEST_dir || exit 2
-cd default_environment_TEST_dir || exit 3
+mkdir paludis_environment_TEST_dir || exit 2
+cd paludis_environment_TEST_dir || exit 3
mkdir -p repo/{profile,profiles,cat-one/pkg-one}
cat <<END > repo/profiles/repo_name
diff --git a/src/clients/gtkpaludis/messages.hh b/paludis/environments/paludis/registration.cc
index 0f6ee81..8cde7b0 100644
--- a/src/clients/gtkpaludis/messages.hh
+++ b/paludis/environments/paludis/registration.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -17,27 +17,29 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_MESSAGES_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_MESSAGES_HH 1
+#include <paludis/environments/environment_maker.hh>
+#include <paludis/environments/paludis/paludis_environment.hh>
-#include <gtkmm/scrolledwindow.h>
-#include <paludis/util/private_implementation_pattern.hh>
+using namespace paludis;
-namespace gtkpaludis
+namespace
{
- class Messages :
- private paludis::PrivateImplementationPattern<Messages>,
- public Gtk::ScrolledWindow
+ std::tr1::shared_ptr<Environment>
+ make_paludis_environment(const std::string & s)
{
- private:
- void _install_signal_handlers();
+ return std::tr1::shared_ptr<Environment>(new PaludisEnvironment(s));
+ }
+}
- public:
- Messages();
- virtual ~Messages();
+extern "C"
+{
+ void register_environments(EnvironmentMaker * maker);
+}
- void message(const std::string &);
- };
+void register_environments(EnvironmentMaker * maker)
+{
+ maker->register_maker("paludis", &make_paludis_environment);
}
-#endif
+
+
diff --git a/paludis/environments/default/repository_config_entry.sr b/paludis/environments/paludis/repository_config_entry.sr
index c2c3a34..56a5223 100644
--- a/paludis/environments/default/repository_config_entry.sr
+++ b/paludis/environments/paludis/repository_config_entry.sr
@@ -9,10 +9,10 @@ make_class_RepositoryConfigEntry()
doxygen_comment << "END"
/**
- * Represents a DefaultConfig repository config file.
+ * Represents a PaludisConfig repository config file.
*
- * \see DefaultConfig
- * \ingroup grpdefaultconfig
+ * \see PaludisConfig
+ * \ingroup grppaludisconfig
* \nosubgrouping
*/
END
diff --git a/paludis/environments/default/use_config_entry.sr b/paludis/environments/paludis/use_config_entry.sr
index d2f3262..97dbe6b 100644
--- a/paludis/environments/default/use_config_entry.sr
+++ b/paludis/environments/paludis/use_config_entry.sr
@@ -9,10 +9,10 @@ make_class_UseConfigEntry()
doxygen_comment << "END"
/**
- * Represents a DefaultConfig package use configuration entry.
+ * Represents a PaludisConfig package use configuration entry.
*
- * \see DefaultConfig
- * \ingroup grpdefaultconfig
+ * \see PaludisConfig
+ * \ingroup grppaludisconfig
* \nosubgrouping
*/
END
@@ -27,10 +27,10 @@ make_class_SetUseConfigEntry()
doxygen_comment << "END"
/**
- * Represents a DefaultConfig set use configuration entry.
+ * Represents a PaludisConfig set use configuration entry.
*
- * \see DefaultConfig
- * \ingroup grpdefaultconfig
+ * \see PaludisConfig
+ * \ingroup grppaludisconfig
* \nosubgrouping
*/
END
@@ -44,10 +44,10 @@ make_class_SetUseConfigMinusStarEntry()
doxygen_comment << "END"
/**
- * Represents a DefaultConfig set -* use configuration entry.
+ * Represents a PaludisConfig set -* use configuration entry.
*
- * \see DefaultConfig
- * \ingroup grpdefaultconfig
+ * \see PaludisConfig
+ * \ingroup grppaludisconfig
* \nosubgrouping
*/
END
@@ -61,10 +61,10 @@ make_class_SetKeywordConfigEntry()
doxygen_comment << "END"
/**
- * Represents a DefaultConfig set keywords configuration entry.
+ * Represents a PaludisConfig set keywords configuration entry.
*
- * \see DefaultConfig
- * \ingroup grpdefaultconfig
+ * \see PaludisConfig
+ * \ingroup grppaludisconfig
* \nosubgrouping
*/
END
@@ -78,10 +78,10 @@ make_class_SetLicenseConfigEntry()
doxygen_comment << "END"
/**
- * Represents a DefaultConfig set licence configuration entry.
+ * Represents a PaludisConfig set licence configuration entry.
*
- * \see DefaultConfig
- * \ingroup grpdefaultconfig
+ * \see PaludisConfig
+ * \ingroup grppaludisconfig
* \nosubgrouping
*/
END
@@ -94,10 +94,10 @@ make_class_SetMaskConfigEntry()
doxygen_comment << "END"
/**
- * Represents a DefaultConfig set mask or unmask configuration entry.
+ * Represents a PaludisConfig set mask or unmask configuration entry.
*
- * \see DefaultConfig
- * \ingroup grpdefaultconfig
+ * \see PaludisConfig
+ * \ingroup grppaludisconfig
* \nosubgrouping
*/
END
diff --git a/paludis/environments/test/Makefile.am b/paludis/environments/test/Makefile.am
index 391b07f..b02f641 100644
--- a/paludis/environments/test/Makefile.am
+++ b/paludis/environments/test/Makefile.am
@@ -8,7 +8,8 @@ DEFS= \
-DLIBDIR=\"$(libdir)\"
libpaludistestenvironment_la_SOURCES = \
- test_environment.cc test_environment.hh
+ test_environment.cc test_environment.hh \
+ registration.cc
libpaludistestenvironment_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
diff --git a/src/clients/gtkpaludis/set_overview.hh b/paludis/environments/test/registration.cc
index a494111..6a6f867 100644
--- a/src/clients/gtkpaludis/set_overview.hh
+++ b/paludis/environments/test/registration.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -17,25 +17,17 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_SET_OVERVIEW_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_SET_OVERVIEW_HH 1
+#include <paludis/environments/environment_maker.hh>
+#include <paludis/environments/test/test_environment.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-#include <gtkmm/treeview.h>
+using namespace paludis;
-namespace gtkpaludis
+extern "C"
{
- class SetOverview :
- public Gtk::TreeView,
- private paludis::PrivateImplementationPattern<SetOverview>
- {
- public:
- SetOverview();
- virtual ~SetOverview();
+ void register_environments(EnvironmentMaker * maker);
+}
- void populate(const std::string &);
- };
+void register_environments(EnvironmentMaker *)
+{
}
-#endif
diff --git a/paludis/environments/test/test_environment.cc b/paludis/environments/test/test_environment.cc
index 495d335..42c9cb1 100644
--- a/paludis/environments/test/test_environment.cc
+++ b/paludis/environments/test/test_environment.cc
@@ -83,4 +83,15 @@ TestEnvironment::end_mirrors(const std::string &) const
return MirrorIterator(test_environment_mirrors.end());
}
+void
+TestEnvironment::force_use(std::tr1::shared_ptr<const PackageDepSpec>, const UseFlagName &,
+ const UseFlagState)
+{
+ throw InternalError(PALUDIS_HERE, "force_use not currently available for TestEnvironment");
+}
+
+void
+TestEnvironment::clear_forced_use()
+{
+}
diff --git a/paludis/environments/test/test_environment.hh b/paludis/environments/test/test_environment.hh
index 560fd3c..9f7aadd 100644
--- a/paludis/environments/test/test_environment.hh
+++ b/paludis/environments/test/test_environment.hh
@@ -40,6 +40,9 @@ namespace paludis
*/
class PALUDIS_VISIBLE TestEnvironment : public Environment
{
+ private:
+ std::string _paludis_command;
+
public:
/**
* Constructor.
@@ -48,6 +51,11 @@ namespace paludis
virtual bool query_use(const UseFlagName &, const PackageDatabaseEntry *) const;
+ virtual void force_use(std::tr1::shared_ptr<const PackageDepSpec>, const UseFlagName &,
+ const UseFlagState) PALUDIS_ATTRIBUTE((noreturn));
+
+ virtual void clear_forced_use();
+
virtual bool accept_keyword(const KeywordName &, const PackageDatabaseEntry * const,
const bool) const;
@@ -69,7 +77,12 @@ namespace paludis
virtual std::string paludis_command() const
{
- return "false";
+ return _paludis_command;
+ }
+
+ virtual void set_paludis_command(const std::string & c)
+ {
+ _paludis_command = c;
}
virtual int perform_hook(const Hook &) const PALUDIS_ATTRIBUTE((warn_unused_result))
diff --git a/paludis/qa/qa_environment.cc b/paludis/qa/qa_environment.cc
index fc24874..a5f3cd0 100644
--- a/paludis/qa/qa_environment.cc
+++ b/paludis/qa/qa_environment.cc
@@ -44,7 +44,9 @@ QAEnvironment::QAEnvironment(const FSEntry & base, const FSEntry & write_cache)
.write_cache(write_cache)
.accept_unstable(false)
.repository_type(ncer_portage)
- .master_repository_dir(FSEntry("/var/empty")))
+ .master_repository_dir(FSEntry("/var/empty"))),
+ _paludis_command("diefunc 'qa_environment.cc' 'QAEnvironment::paludis_command()' "
+ "'paludis_command called from within QAEnvironment'")
{
}
@@ -55,7 +57,9 @@ QAEnvironment::QAEnvironment(const FSEntry & base, const FSEntry & write_cache,
.write_cache(write_cache)
.accept_unstable(false)
.repository_type(ncer_portage)
- .master_repository_dir(master_repository_dir))
+ .master_repository_dir(master_repository_dir)),
+ _paludis_command("diefunc 'qa_environment.cc' 'QAEnvironment::paludis_command()' "
+ "'paludis_command called from within QAEnvironment'")
{
}
@@ -66,7 +70,24 @@ QAEnvironment::~QAEnvironment()
std::string
QAEnvironment::paludis_command() const
{
- return "diefunc 'qa_environment.cc' 'QAEnvironment::paludis_command()' "
- "'paludis_command called from within QAEnvironment'";
+ return _paludis_command;
+}
+
+void
+QAEnvironment::set_paludis_command(const std::string & s)
+{
+ _paludis_command = s;
+}
+
+void
+QAEnvironment::clear_forced_use()
+{
+}
+
+void
+QAEnvironment::force_use(std::tr1::shared_ptr<const PackageDepSpec>,
+ const UseFlagName &, const UseFlagState)
+{
+ throw InternalError(PALUDIS_HERE, "force_use not currently available for QAEnvironment");
}
diff --git a/paludis/qa/qa_environment.hh b/paludis/qa/qa_environment.hh
index bf63745..a75b31b 100644
--- a/paludis/qa/qa_environment.hh
+++ b/paludis/qa/qa_environment.hh
@@ -43,6 +43,9 @@ namespace paludis
class QAEnvironment :
public NoConfigEnvironment
{
+ private:
+ std::string _paludis_command;
+
public:
/**
* Constructor.
@@ -59,6 +62,12 @@ namespace paludis
~QAEnvironment();
virtual std::string paludis_command() const;
+ virtual void set_paludis_command(const std::string &);
+
+ virtual void force_use(std::tr1::shared_ptr<const PackageDepSpec>, const UseFlagName &,
+ const UseFlagState) PALUDIS_ATTRIBUTE((noreturn));
+
+ virtual void clear_forced_use();
};
}
}
diff --git a/paludis/qa/qa_environment_TEST.cc b/paludis/qa/qa_environment_TEST.cc
index 0e711fc..8fcc64f 100644
--- a/paludis/qa/qa_environment_TEST.cc
+++ b/paludis/qa/qa_environment_TEST.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -39,6 +39,8 @@ namespace test_cases
{
QAEnvironment env(FSEntry("qa_environment_TEST_dir/repo1"));
+ TestMessageSuffix suffix("paludis_command=" + env.paludis_command(), false);
+
CheckResult r1((*(*EbuildCheckMaker::get_instance()->find_maker(
CreateMetadataCheck::identifier()))())(EbuildCheckData(
QualifiedPackageName("cat-one/pkg-one"), VersionSpec("1"), &env)));
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index f054364..e0c7c76 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -83,10 +83,11 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/gentoo/ebuild/`" \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/gentoo/ebuild/`" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \
+ PALUDIS_ENVIRONMENT_SO_DIR="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/environments`" \
SYSCONFDIR="$(sysconfdir)" \
LD_LIBRARY_PATH=`echo "\`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/.libs\`: \
\`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/util/.libs\`: \
- \`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/environments/default/.libs\`: \
+ \`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/environments/.libs\`: \
\`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/environments/no_config/.libs\`: \
\`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/dep_list/.libs\`: \
\`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/.libs\`: \
@@ -117,7 +118,7 @@ libpaludisruby_la_LIBADD = \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/paludis/repositories/gentoo/libpaludisgentoorepository.la \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
- $(top_builddir)/paludis/environments/default/libpaludisdefaultenvironment.la \
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la \
$(top_builddir)/paludis/qa/libpaludisqa.la
TESTS = $(IF_RUBY_QA_TESTS) $(IF_RUBY_TESTS)
@@ -132,7 +133,7 @@ libpaludisruby_la_LIBADD = \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/paludis/repositories/gentoo/libpaludisgentoorepository.la \
$(top_builddir)/paludis/environments/no_config/libpaludisnoconfigenvironment.la \
- $(top_builddir)/paludis/environments/default/libpaludisdefaultenvironment.la
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la
TESTS = $(IF_RUBY_TESTS)
diff --git a/ruby/dep_list_TEST.rb b/ruby/dep_list_TEST.rb
index 5528c4b..4baba3b 100644
--- a/ruby/dep_list_TEST.rb
+++ b/ruby/dep_list_TEST.rb
@@ -110,7 +110,7 @@ module Paludis
end
def env
- DefaultEnvironment.instance
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
end
def dl
diff --git a/ruby/environment.cc b/ruby/environment.cc
index 71fe1ec..c0e928c 100644
--- a/ruby/environment.cc
+++ b/ruby/environment.cc
@@ -18,9 +18,8 @@
*/
#include <paludis_ruby.hh>
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/environments/default/default_config.hh>
#include <paludis/environments/no_config/no_config_environment.hh>
+#include <paludis/environments/environment_maker.hh>
#include <ruby.h>
using namespace paludis;
@@ -31,9 +30,8 @@ using namespace paludis::ruby;
namespace
{
static VALUE c_environment;
- static VALUE c_default_environment;
- static VALUE c_default_config;
static VALUE c_no_config_environment;
+ static VALUE c_environment_maker;
/*
* call-seq:
@@ -265,67 +263,6 @@ namespace
}
- /*
- * Gets the config suffix.
- */
- VALUE
- default_config_config_suffix(VALUE)
- {
- try
- {
- return rb_str_new2(DefaultConfig::config_suffix().c_str());
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * Document-method: root
- *
- * The ROOT.
- */
- /*
- * Document-method: bashrc_files
- *
- * Our bashrc files.
- */
- /*
- * Document-method: config_dir
- *
- * The config directory.
- */
- template <std::string (DefaultConfig::* m_) () const>
- struct ConfigStruct
- {
- static VALUE
- fetch(VALUE)
- {
- return rb_str_new2((((DefaultConfig::get_instance())->*m_)()).c_str());
- }
- };
-
- /*
- * call-seq:
- * config_suffix=
- *
- * Set config suffig.
- */
- VALUE
- default_config_config_suffix_set(VALUE klass, VALUE str)
- {
- try
- {
- DefaultConfig::set_config_suffix(stringify(StringValuePtr(str)));
- return klass;
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
VALUE
no_config_environment_init(int, VALUE*, VALUE self)
{
@@ -391,13 +328,18 @@ namespace
}
}
+ /*
+ * call-seq:
+ * portage_repository -> PortageRepository
+ *
+ * Return the PortageRepository in this environment
+ */
VALUE
- default_environment_new(VALUE self)
+ no_config_environment_portage_repository(VALUE self)
{
try
{
- EnvironmentData * ptr(new EnvironmentData(DefaultEnvironment::get_instance()));
- return Data_Wrap_Struct(self, 0, &Common<EnvironmentData>::free, ptr);
+ return repository_to_value(value_to_no_config_environment(self)->portage_repository());
}
catch (const std::exception & e)
{
@@ -405,18 +347,17 @@ namespace
}
}
- /*
- * call-seq:
- * portage_repository -> PortageRepository
- *
- * Return the PortageRepository in this environment
- */
VALUE
- no_config_environment_portage_repository(VALUE self)
+ environment_maker_make_from_spec(VALUE, VALUE spec)
{
try
{
- return repository_to_value(value_to_no_config_environment(self)->portage_repository());
+ std::tr1::shared_ptr<Environment> e(EnvironmentMaker::get_instance()->make_from_spec(
+ StringValuePtr(spec)));
+
+ EnvironmentData * ptr(new EnvironmentData(e.get(), 0, e));
+ VALUE tdata(Data_Wrap_Struct(c_environment, 0, &Common<EnvironmentData>::free, ptr));
+ return tdata;
}
catch (const std::exception & e)
{
@@ -427,6 +368,7 @@ namespace
void do_register_environment()
{
rb_require("singleton");
+
/*
* Document-class: Paludis::Environment
*
@@ -449,33 +391,6 @@ namespace
rb_define_method(c_environment, "default_destinations", RUBY_FUNC_CAST(&environment_default_destinations), 0);
/*
- * Document-class: Paludis::DefaultEnvironment
- *
- * The DefaultEnvironment is an Environment that correspons to the normal operating environment
- *
- */
- c_default_environment = rb_define_class_under(paludis_module(), "DefaultEnvironment", c_environment);
- rb_define_singleton_method(c_default_environment, "new", RUBY_FUNC_CAST(&default_environment_new), 0);
- rb_funcall(rb_const_get(rb_cObject, rb_intern("Singleton")), rb_intern("included"), 1, c_default_environment);
-
-
- /*
- * Document-class: Paludis::DefaultConfig
- *
- * DefaultConfig is used by DefaultEnvironment to access the user's configuration settings from on-disk configuration files.
- */
- c_default_config = rb_define_class_under(paludis_module(), "DefaultConfig", rb_cObject);
- rb_funcall(c_default_config, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_funcall(rb_const_get(rb_cObject, rb_intern("Singleton")), rb_intern("included"), 1, c_default_config);
- rb_define_singleton_method(c_default_config, "config_suffix",
- RUBY_FUNC_CAST(&default_config_config_suffix), 0);
- rb_define_singleton_method(c_default_config, "config_suffix=",
- RUBY_FUNC_CAST(&default_config_config_suffix_set), 1);
- rb_define_method(c_default_config, "config_dir", RUBY_FUNC_CAST((&ConfigStruct<&DefaultConfig::config_dir>::fetch)), 0);
- rb_define_method(c_default_config, "root", RUBY_FUNC_CAST((&ConfigStruct<&DefaultConfig::root>::fetch)), 0);
- rb_define_method(c_default_config, "bashrc_files", RUBY_FUNC_CAST((&ConfigStruct<&DefaultConfig::bashrc_files>::fetch)), 0);
-
- /*
* Document-class: Paludis::NoConfigEnvironment
*
* An environment that uses a single repository, with no user configuration.
@@ -484,6 +399,10 @@ namespace
rb_define_singleton_method(c_no_config_environment, "new", RUBY_FUNC_CAST(&no_config_environment_new), -1);
rb_define_method(c_no_config_environment, "initialize", RUBY_FUNC_CAST(&no_config_environment_init), -1);
rb_define_method(c_no_config_environment, "portage_repository", RUBY_FUNC_CAST(&no_config_environment_portage_repository), 0);
+
+ c_environment_maker = rb_define_class_under(paludis_module(), "EnvironmentMaker", rb_cObject);
+ rb_funcall(rb_const_get(rb_cObject, rb_intern("Singleton")), rb_intern("included"), 1, c_environment_maker);
+ rb_define_method(c_environment_maker, "make_from_spec", RUBY_FUNC_CAST(&environment_maker_make_from_spec), 1);
}
}
diff --git a/ruby/environment_TEST.rb b/ruby/environment_TEST.rb
index c70b0a2..d99f3d5 100644
--- a/ruby/environment_TEST.rb
+++ b/ruby/environment_TEST.rb
@@ -26,16 +26,10 @@ require 'Paludis'
Paludis::Log.instance.log_level = Paludis::LogLevel::Warning
module Paludis
- class TestCase_DefaultEnvironment < Test::Unit::TestCase
- def test_instance
- assert_equal DefaultEnvironment.instance.__id__, DefaultEnvironment.instance.__id__
- assert_kind_of Environment, DefaultEnvironment.instance
- assert_kind_of DefaultEnvironment, DefaultEnvironment.instance
- end
-
+ class TestCase_Environment < Test::Unit::TestCase
def test_no_create
assert_raise NoMethodError do
- x = DefaultEnvironment.new()
+ x = Environment.new()
end
end
end
@@ -78,25 +72,29 @@ module Paludis
end
end
- class TestCase_DefaultEnvironmentUse < Test::Unit::TestCase
+ class TestCase_EnvironmentUse < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def test_query_use
- assert DefaultEnvironment.instance.query_use("enabled")
- assert ! DefaultEnvironment.instance.query_use("not_enabled")
- assert ! DefaultEnvironment.instance.query_use("sometimes_enabled")
+ assert env.query_use("enabled")
+ assert ! env.query_use("not_enabled")
+ assert ! env.query_use("sometimes_enabled")
pde = PackageDatabaseEntry.new("foo/bar", VersionSpec.new("1.0"), "testrepo")
- assert DefaultEnvironment.instance.query_use("enabled", pde)
- assert ! DefaultEnvironment.instance.query_use("not_enabled", pde)
- assert DefaultEnvironment.instance.query_use("sometimes_enabled", pde)
+ assert env.query_use("enabled", pde)
+ assert ! env.query_use("not_enabled", pde)
+ assert env.query_use("sometimes_enabled", pde)
end
def test_query_use_bad
assert_raise ArgumentError do
- DefaultEnvironment.instance.query_use(1, 2, 3)
+ env.query_use(1, 2, 3)
end
assert_raise TypeError do
- DefaultEnvironment.instance.query_use(123)
+ env.query_use(123)
end
end
end
@@ -122,25 +120,29 @@ module Paludis
end
end
- class TestCase_DefaultEnvironmentAcceptKeyword < Test::Unit::TestCase
+ class TestCase_EnvironmentAcceptKeyword < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def test_accept_keyword
- assert DefaultEnvironment.instance.accept_keyword("test")
- assert ! DefaultEnvironment.instance.accept_keyword("bad")
- assert ! DefaultEnvironment.instance.accept_keyword("~test")
+ assert env.accept_keyword("test")
+ assert ! env.accept_keyword("bad")
+ assert ! env.accept_keyword("~test")
pde = PackageDatabaseEntry.new("foo/bar", "1.0", "testrepo")
- assert DefaultEnvironment.instance.accept_keyword("test", pde)
- assert ! DefaultEnvironment.instance.accept_keyword("bad", pde)
- assert DefaultEnvironment.instance.accept_keyword("~test", pde)
+ assert env.accept_keyword("test", pde)
+ assert ! env.accept_keyword("bad", pde)
+ assert env.accept_keyword("~test", pde)
end
def test_accept_keyword_bad
assert_raise ArgumentError do
- DefaultEnvironment.instance.accept_keyword(1, 2, 3)
+ env.accept_keyword(1, 2, 3)
end
assert_raise TypeError do
- DefaultEnvironment.instance.accept_keyword(123)
+ env.accept_keyword(123)
end
end
end
@@ -172,21 +174,25 @@ module Paludis
end
end
- class TestCase_DefaultEnvironmentAcceptLicense < Test::Unit::TestCase
+ class TestCase_EnvironmentAcceptLicense < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def test_accept_license
- assert DefaultEnvironment.instance.accept_license("test")
+ assert env.accept_license("test")
pde = PackageDatabaseEntry.new("foo/bar", VersionSpec.new("1.0"), "testrepo")
- assert DefaultEnvironment.instance.accept_license("test", pde)
+ assert env.accept_license("test", pde)
end
def test_accept_license_bad
assert_raise ArgumentError do
- DefaultEnvironment.instance.accept_license(1, 2, 3)
+ env.accept_license(1, 2, 3)
end
assert_raise TypeError do
- DefaultEnvironment.instance.accept_license(123)
+ env.accept_license(123)
end
end
end
@@ -251,9 +257,9 @@ module Paludis
end
end
- class TestCase_DefaultEnvironmentQueryUserMasks < Test::Unit::TestCase
+ class TestCase_EnvironmentQueryUserMasks < Test::Unit::TestCase
def env
- DefaultEnvironment.instance
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
end
def test_query_user_masks
@@ -293,9 +299,13 @@ module Paludis
end
end
- class TestCase_DefaultEnvironmentPackageDatabase < Test::Unit::TestCase
+ class TestCase_EnvironmentPackageDatabase < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def db
- DefaultEnvironment.instance.package_database
+ env.package_database
end
def test_package_database
@@ -319,14 +329,18 @@ module Paludis
end
end
- class TestCase_DefaultEnvironmentPackageSet < Test::Unit::TestCase
+ class TestCase_EnvironmentPackageSet < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def test_package_set
- assert_kind_of DepSpec, DefaultEnvironment.instance.package_set('everything')
+ assert_kind_of DepSpec, env.package_set('everything')
end
def test_package_set_error
assert_raise SetNameError do
- DefaultEnvironment.instance.package_set('broken*')
+ env.package_set('broken*')
end
end
end
@@ -337,7 +351,7 @@ module Paludis
end
def test_package_set
- assert_kind_of DepSpec, DefaultEnvironment.instance.package_set('everything')
+ assert_kind_of DepSpec, env.package_set('everything')
end
def test_package_set_error
@@ -357,48 +371,19 @@ module Paludis
end
end
- class TestCase_DefaultConfig < Test::Unit::TestCase
- def test_respond_to
- assert_respond_to DefaultConfig, :config_suffix
- assert_respond_to DefaultConfig, :config_suffix=
- assert_respond_to DefaultConfig.instance, :config_dir
- assert_respond_to DefaultConfig.instance, :root
- assert_respond_to DefaultConfig.instance, :bashrc_files
- end
-
- def test_root
- assert_kind_of String, DefaultConfig.instance.root
- assert_equal '', DefaultConfig.instance.root
- end
-
- def test_config_dir
- assert_kind_of String, DefaultConfig.instance.config_dir
- cd = DefaultConfig.instance.config_dir
- assert_equal '/environment_TEST_dir/home/.paludis',
- cd.gsub(Dir.getwd,'')
- end
-
- def test_bashrc_files
- assert_kind_of String, DefaultConfig.instance.bashrc_files
- cd = DefaultConfig.instance.bashrc_files
- assert_equal '/environment_TEST_dir/home/.paludis/bashrc',
- cd.gsub(Dir.getwd,'')
- end
- end
-
- class TestCase_DefaultEnvironmentRoot < Test::Unit::TestCase
+ class TestCase_EnvironmentRoot < Test::Unit::TestCase
def test_root
- assert_kind_of String, DefaultEnvironment.instance.root
+ assert_kind_of String, env.root
end
end
- class TestCase_DefaultEnvironmentDefaultDestinations < Test::Unit::TestCase
+ class TestCase_EnvironmentDefaultDestinations < Test::Unit::TestCase
def test_default_destinations
- assert_kind_of Array, DefaultEnvironment.instance.default_destinations
+ assert_kind_of Array, env.default_destinations
end
end
- class TestCase_DefaultEnvironmentRoot < Test::Unit::TestCase
+ class TestCase_EnvironmentRoot < Test::Unit::TestCase
def env
NoConfigEnvironment.new(Dir.getwd().to_s + "/environment_TEST_dir/testrepo")
end
@@ -408,7 +393,7 @@ module Paludis
end
end
- class TestCase_DefaultEnvironmentDefaultDestinations < Test::Unit::TestCase
+ class TestCase_EnvironmentDefaultDestinations < Test::Unit::TestCase
def env
NoConfigEnvironment.new(Dir.getwd().to_s + "/environment_TEST_dir/testrepo")
end
diff --git a/ruby/package_database_TEST.rb b/ruby/package_database_TEST.rb
index 6422d90..b9ded9e 100644
--- a/ruby/package_database_TEST.rb
+++ b/ruby/package_database_TEST.rb
@@ -35,14 +35,22 @@ module Paludis
end
class TestCase_PackageDatabaseFavouriteRepository < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def test_package_database_favourite_repository
- assert_equal "testrepo", DefaultEnvironment.instance.package_database.favourite_repository
+ assert_equal "testrepo", env.package_database.favourite_repository
end
end
class TestCase_PackageDatabaseFetchUniqueQualifiedPackageName < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def db
- return DefaultEnvironment.instance.package_database
+ return env.package_database
end
def test_package_database_fetch_unique_qualified_package_name
@@ -60,8 +68,12 @@ module Paludis
end
class TestCase_PackageDatabaseQuery < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def db
- return DefaultEnvironment.instance.package_database
+ return env.package_database
end
def test_arg_count
@@ -128,8 +140,12 @@ module Paludis
end
class TestCase_PackageDatabaseRepositories < Test::Unit::TestCase
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def db
- return DefaultEnvironment.instance.package_database
+ return env.package_database
end
def test_repositories
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index d4ff159..45128e4 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -52,12 +52,15 @@ namespace paludis
{
private:
Environment * _e;
+ const std::tr1::shared_ptr<Environment> _ee;
public:
Environment * const env_ptr;
- EnvironmentData(Environment * const ee, Environment * const free_e = 0) :
+ EnvironmentData(Environment * const ee, Environment * const free_e = 0,
+ const std::tr1::shared_ptr<Environment> & free_sp_e = std::tr1::shared_ptr<Environment>()) :
_e(free_e),
+ _ee(free_sp_e),
env_ptr(ee)
{
}
diff --git a/ruby/paludis_ruby_TEST.rb b/ruby/paludis_ruby_TEST.rb
index d03d879..a98f0b4 100644
--- a/ruby/paludis_ruby_TEST.rb
+++ b/ruby/paludis_ruby_TEST.rb
@@ -37,7 +37,7 @@ module Paludis
class TestCase_Match < Test::Unit::TestCase
def test_match
- env = DefaultEnvironment.instance
+ env = EnvironmentMaker.instance.make_from_spec("")
spec_good = PackageDepSpec.new('>=foo/bar-1')
spec_bad = PackageDepSpec.new('>=foo/bar-2')
pde = PackageDatabaseEntry.new('foo/bar','1','test')
@@ -48,7 +48,7 @@ module Paludis
end
def test_type_errors
- env = DefaultEnvironment.instance
+ env = EnvironmentMaker.instance.make_from_spec("")
spec = PackageDepSpec.new('>=foo/bar-1')
pde = PackageDatabaseEntry.new('foo/bar','1','test')
diff --git a/ruby/repository_TEST.rb b/ruby/repository_TEST.rb
index 4d914b8..a604bb9 100644
--- a/ruby/repository_TEST.rb
+++ b/ruby/repository_TEST.rb
@@ -85,8 +85,12 @@ module Paludis
db.fetch_repository "testrepo"
end
+ def env
+ @env or @env = EnvironmentMaker.instance.make_from_spec("")
+ end
+
def db
- DefaultEnvironment.instance.package_database
+ env.package_database
end
def no_config_testrepo
diff --git a/src/clients/contrarius/Makefile.am b/src/clients/contrarius/Makefile.am
index e63c045..a8c9dbd 100644
--- a/src/clients/contrarius/Makefile.am
+++ b/src/clients/contrarius/Makefile.am
@@ -26,7 +26,7 @@ contrarius_SOURCES = \
contrarius_LDADD = \
$(top_builddir)/paludis/libpaludis.la \
- $(top_builddir)/paludis/environments/default/libpaludisdefaultenvironment.la \
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la \
$(top_builddir)/paludis/tasks/libpaludistasks.a \
$(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
diff --git a/src/clients/contrarius/contrarius.cc b/src/clients/contrarius/contrarius.cc
index 568bbcc..ab8840c 100644
--- a/src/clients/contrarius/contrarius.cc
+++ b/src/clients/contrarius/contrarius.cc
@@ -19,6 +19,7 @@
#include <paludis/args/args.hh>
#include <paludis/paludis.hh>
+#include <paludis/environments/environment_maker.hh>
#include <paludis/util/util.hh>
#include <cstdlib>
@@ -70,15 +71,17 @@ int main(int argc, char *argv[])
else
stage = "cxx";
- ContrariusStageOptions contrarius_opts(HostTupleName(CommandLine::get_instance()->a_target.argument()),
- CommandLine::get_instance()->a_binutils_name.argument(),
- CommandLine::get_instance()->a_binutils_version.argument(),
- CommandLine::get_instance()->a_gcc_name.argument(),
- CommandLine::get_instance()->a_gcc_version.argument(),
- CommandLine::get_instance()->a_headers_name.argument(),
- CommandLine::get_instance()->a_headers_version.argument(),
- CommandLine::get_instance()->a_libc_name.argument(),
- CommandLine::get_instance()->a_libc_version.argument());
+ ContrariusStageOptions contrarius_opts(
+ EnvironmentMaker::get_instance()->make_from_spec(""),
+ HostTupleName(CommandLine::get_instance()->a_target.argument()),
+ CommandLine::get_instance()->a_binutils_name.argument(),
+ CommandLine::get_instance()->a_binutils_version.argument(),
+ CommandLine::get_instance()->a_gcc_name.argument(),
+ CommandLine::get_instance()->a_gcc_version.argument(),
+ CommandLine::get_instance()->a_headers_name.argument(),
+ CommandLine::get_instance()->a_headers_version.argument(),
+ CommandLine::get_instance()->a_libc_name.argument(),
+ CommandLine::get_instance()->a_libc_version.argument());
StageOptions stage_opts(CommandLine::get_instance()->a_pretend.specified(),
CommandLine::get_instance()->a_fetch.specified(),
diff --git a/src/clients/contrarius/contrarius_stage_options.sr b/src/clients/contrarius/contrarius_stage_options.sr
index ecc9f97..7e35d7e 100644
--- a/src/clients/contrarius/contrarius_stage_options.sr
+++ b/src/clients/contrarius/contrarius_stage_options.sr
@@ -3,6 +3,7 @@
make_class_ContrariusStageOptions()
{
+ key environment "std::tr1::shared_ptr<Environment>"
key target HostTupleName
key binutils "std::tr1::shared_ptr<const PackageDepSpec>"
@@ -11,7 +12,9 @@ make_class_ContrariusStageOptions()
key libc "std::tr1::shared_ptr<const PackageDepSpec>"
extra_constructors <<END
- ContrariusStageOptions(const HostTupleName & target,
+ ContrariusStageOptions(
+ std::tr1::shared_ptr<Environment>,
+ const HostTupleName & target,
const std::string & binutils_name,
const std::string & binutils_version,
const std::string & gcc_name,
diff --git a/src/clients/contrarius/install.cc b/src/clients/contrarius/install.cc
index 34ad5df..a9967d8 100644
--- a/src/clients/contrarius/install.cc
+++ b/src/clients/contrarius/install.cc
@@ -34,7 +34,7 @@
#include <paludis/util/fd_output_stream.hh>
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/environments/default/default_environment.hh>
+#include <paludis/environment.hh>
#include <paludis/dep_list/exceptions.hh>
#include <paludis/query.hh>
@@ -54,9 +54,8 @@ namespace
public ConsoleInstallTask
{
public:
- OurInstallTask(const DepListOptions & options) :
- ConsoleInstallTask(DefaultEnvironment::get_instance(), options,
- DefaultEnvironment::get_instance()->default_destinations())
+ OurInstallTask(std::tr1::shared_ptr<Environment> env, const DepListOptions & options) :
+ ConsoleInstallTask(env.get(), options, env->default_destinations())
{
}
@@ -97,7 +96,7 @@ namespace
}
};
- void show_resume_command(const InstallTask & task)
+ void show_resume_command(std::tr1::shared_ptr<Environment> env, const InstallTask & task)
{
if (CommandLine::get_instance()->a_fetch.specified() ||
CommandLine::get_instance()->a_pretend.specified())
@@ -105,7 +104,7 @@ namespace
if (task.current_dep_list_entry() != task.dep_list().end())
{
- std::string resume_command = DefaultEnvironment::get_instance()->paludis_command() + " "
+ std::string resume_command = env->paludis_command() + " "
"--dl-installed-deps-pre discard "
"--dl-installed-deps-runtime discard "
"--dl-installed-deps-post discard "
@@ -142,15 +141,18 @@ namespace
private:
static const InstallTask * _task;
+ static std::tr1::shared_ptr<Environment> _env;
+
static void _signal_handler(int sig) PALUDIS_ATTRIBUTE((noreturn));
sig_t _old;
public:
- InstallKilledCatcher(const InstallTask & task) :
+ InstallKilledCatcher(std::tr1::shared_ptr<Environment> env, const InstallTask & task) :
_old(signal(SIGINT, &InstallKilledCatcher::_signal_handler))
{
_task = &task;
+ _env = env;
}
~InstallKilledCatcher()
@@ -161,26 +163,47 @@ namespace
};
const InstallTask * InstallKilledCatcher::_task(0);
+ std::tr1::shared_ptr<Environment> InstallKilledCatcher::_env;
void
InstallKilledCatcher::_signal_handler(int sig)
{
- cout << endl;
- cerr << "Caught signal " << sig << endl;
- cerr << "Waiting for children..." << endl;
- while (-1 != wait(0))
- ;
- cerr << endl;
- if (_task)
- show_resume_command(*_task);
- cerr << endl;
- cerr << "Exiting with failure" << endl;
- exit(EXIT_FAILURE);
+ // ignore further signals to avoid a race if
+ // a sigal arrives while this handler hasn't finished
+ signal(sig, SIG_IGN);
+
+ static bool recursing(false);
+
+ if (recursing)
+ {
+ cout << endl;
+ cerr << "Caught signal " << sig << " inside signal" << endl;
+ cerr << "NOT waiting for children any more..." << endl;
+ cerr << endl;
+ cerr << "Exiting with failure" << endl;
+ exit(EXIT_FAILURE);
+ }
+ else
+ {
+ recursing = true;
+
+ cout << endl;
+ cerr << "Caught signal " << sig << endl;
+ cerr << "Waiting for children..." << endl;
+ while (-1 != wait(0))
+ ;
+ cerr << endl;
+ if (_task)
+ show_resume_command(_env, *_task);
+ cerr << endl;
+ cerr << "Exiting with failure" << endl;
+ exit(EXIT_FAILURE);
+ }
}
}
int
-do_install(std::tr1::shared_ptr<const PackageDepSpec> spec)
+do_install(std::tr1::shared_ptr<Environment> env, std::tr1::shared_ptr<const PackageDepSpec> spec)
{
int return_code(0);
@@ -199,7 +222,7 @@ do_install(std::tr1::shared_ptr<const PackageDepSpec> spec)
options.reinstall = dl_reinstall_never;
options.target_type = dl_target_set;
- OurInstallTask task(options);
+ OurInstallTask task(env, options);
task.set_fetch_only(CommandLine::get_instance()->a_fetch.specified());
task.set_pretend(CommandLine::get_instance()->a_pretend.specified());
@@ -271,7 +294,7 @@ do_install(std::tr1::shared_ptr<const PackageDepSpec> spec)
try
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> p(
- DefaultEnvironment::get_instance()->package_database()->query(
+ env->package_database()->query(
query::Matches(PackageDepSpec(e.query())) & query::RepositoryHasUninstallableInterface(),
qo_order_by_version));
@@ -294,7 +317,7 @@ do_install(std::tr1::shared_ptr<const PackageDepSpec> spec)
cerr << " * " << colour(cl_package_name, *pp) << ": Masked by ";
bool need_comma(false);
- MaskReasons m(DefaultEnvironment::get_instance()->mask_reasons(*pp));
+ MaskReasons m(env->mask_reasons(*pp));
for (unsigned mm = 0 ; mm < m.size() ; ++mm)
if (m[mm])
{
@@ -304,7 +327,7 @@ do_install(std::tr1::shared_ptr<const PackageDepSpec> spec)
if (mr_eapi == mm)
{
- std::string eapi_str(DefaultEnvironment::get_instance()->
+ std::string eapi_str(env->
package_database()->fetch_repository(
pp->repository)->version_metadata(
pp->name, pp->version)->eapi);
@@ -313,7 +336,7 @@ do_install(std::tr1::shared_ptr<const PackageDepSpec> spec)
}
else if (mr_license == mm)
{
- std::tr1::shared_ptr<const VersionMetadata> meta(DefaultEnvironment::get_instance()->
+ std::tr1::shared_ptr<const VersionMetadata> meta(env->
package_database()->fetch_repository(
pp->repository)->version_metadata(
pp->name, pp->version));
@@ -322,13 +345,13 @@ do_install(std::tr1::shared_ptr<const PackageDepSpec> spec)
{
cerr << " ";
- LicenceDisplayer ld(cerr, DefaultEnvironment::get_instance(), &*pp);
+ LicenceDisplayer ld(cerr, env.get(), &*pp);
meta->license_interface->license()->accept(&ld);
}
}
else if (mr_keyword == mm)
{
- std::tr1::shared_ptr<const VersionMetadata> meta(DefaultEnvironment::get_instance()->
+ std::tr1::shared_ptr<const VersionMetadata> meta(env->
package_database()->fetch_repository(
pp->repository)->version_metadata(
pp->name, pp->version));
diff --git a/src/clients/contrarius/install.hh b/src/clients/contrarius/install.hh
index 623037d..82c9add 100644
--- a/src/clients/contrarius/install.hh
+++ b/src/clients/contrarius/install.hh
@@ -21,7 +21,7 @@
#define PALUDIS_GUARD_SRC_DEPGRAPH_HH 1
#include <paludis/dep_spec.hh>
-
+#include <paludis/environment.hh>
#include "command_line.hh"
/** \file
@@ -29,6 +29,7 @@
*/
/// Handle --install.
-int do_install(std::tr1::shared_ptr<const paludis::PackageDepSpec> spec);
+int do_install(std::tr1::shared_ptr<paludis::Environment>,
+ std::tr1::shared_ptr<const paludis::PackageDepSpec> spec);
#endif
diff --git a/src/clients/contrarius/stage.cc b/src/clients/contrarius/stage.cc
index 2ed1df1..5a7bedb 100644
--- a/src/clients/contrarius/stage.cc
+++ b/src/clients/contrarius/stage.cc
@@ -17,8 +17,6 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/environments/default/default_config.hh>
#include <paludis/util/log.hh>
#include <paludis/query.hh>
#include <string>
@@ -42,7 +40,9 @@ namespace
#include <src/clients/contrarius/contrarius_stage_options-sr.cc>
-ContrariusStageOptions::ContrariusStageOptions(const HostTupleName & _target,
+ContrariusStageOptions::ContrariusStageOptions(
+ std::tr1::shared_ptr<Environment> env,
+ const HostTupleName & _target,
const std::string & binutils_name,
const std::string & binutils_version,
const std::string & gcc_name,
@@ -51,6 +51,7 @@ ContrariusStageOptions::ContrariusStageOptions(const HostTupleName & _target,
const std::string & headers_version,
const std::string & libc_name,
const std::string & libc_version) :
+ environment(env),
target(_target),
binutils(::make_spec(target, binutils_name, "binutils", binutils_version)),
gcc(::make_spec(target, gcc_name, "gcc", gcc_version)),
@@ -64,16 +65,16 @@ BinutilsStage::build(const StageOptions &) const
{
Context context("When building BinutilsStage:");
- DefaultConfig::get_instance()->clear_forced_use_config();
+ _options.environment->clear_forced_use();
- return 0 == do_install(_options.binutils);
+ return 0 == do_install(_options.environment, _options.binutils);
}
bool
BinutilsStage::is_rebuild() const
{
- return (! DefaultEnvironment::get_instance()->package_database()->query(
- query::Matches(*_options.binutils) & query::InstalledAtRoot(DefaultEnvironment::get_instance()->root()),
+ return (! _options.environment->package_database()->query(
+ query::Matches(*_options.binutils) & query::InstalledAtRoot(_options.environment->root()),
qo_whatever)->empty());
}
@@ -82,20 +83,20 @@ KernelHeadersStage::build(const StageOptions &) const
{
Context context("When building KernelHeadersStage:");
- DefaultConfig::get_instance()->clear_forced_use_config();
+ _options.environment->clear_forced_use();
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
+ _options.environment->force_use(
_options.headers, UseFlagName("crosscompile_opts_headers-only"),
- use_disabled));
+ use_disabled);
- return 0 == do_install(_options.headers);
+ return 0 == do_install(_options.environment, _options.headers);
}
bool
KernelHeadersStage::is_rebuild() const
{
- return (! DefaultEnvironment::get_instance()->package_database()->query(
- query::Matches(*_options.headers) & query::InstalledAtRoot(DefaultEnvironment::get_instance()->root()),
+ return (! _options.environment->package_database()->query(
+ query::Matches(*_options.headers) & query::InstalledAtRoot(_options.environment->root()),
qo_whatever)->empty());
}
@@ -104,35 +105,26 @@ MinimalStage::build(const StageOptions &) const
{
Context context("When executing MinimalStage:");
- DefaultConfig::get_instance()->clear_forced_use_config();
-
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("boundschecking"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("fortran"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("gtk"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("gcj"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("mudflap"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("objc"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("objc-gc"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("nocxx"), use_enabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("crosscompile_opts_bootstrap"), use_enabled));
-
- return 0 == do_install(_options.gcc);
+ _options.environment->clear_forced_use();
+
+ _options.environment->force_use(_options.gcc, UseFlagName("boundschecking"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("fortran"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("gtk"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("gcj"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("mudflap"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("objc"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("objc-gc"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("nocxx"), use_enabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("crosscompile_opts_bootstrap"), use_enabled);
+
+ return 0 == do_install(_options.environment, _options.gcc);
}
bool
MinimalStage::is_rebuild() const
{
- return (! DefaultEnvironment::get_instance()->package_database()->query(
- query::Matches(*_options.gcc) & query::InstalledAtRoot(DefaultEnvironment::get_instance()->root()),
+ return (! _options.environment->package_database()->query(
+ query::Matches(*_options.gcc) & query::InstalledAtRoot(_options.environment->root()),
qo_whatever)->empty());
}
@@ -141,23 +133,23 @@ LibCStage::build(const StageOptions &) const
{
Context context("When building LibCStage:");
- DefaultConfig::get_instance()->clear_forced_use_config();
+ _options.environment->clear_forced_use();
- return 0 == do_install(_options.libc);
+ return 0 == do_install(_options.environment, _options.libc);
}
bool
LibCStage::is_rebuild() const
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> c(
- DefaultEnvironment::get_instance()->package_database()->query(
- query::Matches(*_options.libc) & query::InstalledAtRoot(DefaultEnvironment::get_instance()->root()),
+ _options.environment->package_database()->query(
+ query::Matches(*_options.libc) & query::InstalledAtRoot(_options.environment->root()),
qo_whatever));
if (c->empty())
return false;
- return (! DefaultEnvironment::get_instance()->query_use(UseFlagName("crosscompile_opts_headers-only"), &(*c->last())));
+ return (! _options.environment->query_use(UseFlagName("crosscompile_opts_headers-only"), &(*c->last())));
}
int
@@ -165,33 +157,28 @@ FullStage::build(const StageOptions &) const
{
Context context("When building FullStage:");
- DefaultConfig::get_instance()->clear_forced_use_config();
-
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("boundschecking"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("gtk"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("gcj"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("mudflap"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("objc"), use_disabled));
- DefaultConfig::get_instance()->add_forced_use_config(UseConfigEntry(
- _options.gcc, UseFlagName("objc-gc"), use_disabled));
-
- return 0 == do_install(_options.gcc);
+ _options.environment->clear_forced_use();
+
+ _options.environment->force_use(_options.gcc, UseFlagName("boundschecking"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("gtk"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("gcj"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("mudflap"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("objc"), use_disabled);
+ _options.environment->force_use(_options.gcc, UseFlagName("objc-gc"), use_disabled);
+
+ return 0 == do_install(_options.environment, _options.gcc);
}
bool
FullStage::is_rebuild() const
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> c(
- DefaultEnvironment::get_instance()->package_database()->query(
- query::Matches(*_options.gcc) & query::InstalledAtRoot(DefaultEnvironment::get_instance()->root()), qo_whatever));
+ _options.environment->package_database()->query(
+ query::Matches(*_options.gcc) & query::InstalledAtRoot(_options.environment->root()), qo_whatever));
if (c->empty())
return false;
- return (! DefaultEnvironment::get_instance()->query_use(UseFlagName("nocxx"), &(*c->last())));
+ return (! _options.environment->query_use(UseFlagName("nocxx"), &(*c->last())));
}
+
diff --git a/src/clients/contrarius/stage.hh b/src/clients/contrarius/stage.hh
index ef8497d..4779bd1 100644
--- a/src/clients/contrarius/stage.hh
+++ b/src/clients/contrarius/stage.hh
@@ -29,6 +29,8 @@
namespace paludis
{
+ class Environment;
+
#include <src/clients/contrarius/contrarius_stage_options-sr.hh>
class ContrariusStage :
diff --git a/src/clients/contrarius/stage_builder.hh b/src/clients/contrarius/stage_builder.hh
index 7c73a75..ad25653 100644
--- a/src/clients/contrarius/stage_builder.hh
+++ b/src/clients/contrarius/stage_builder.hh
@@ -26,6 +26,8 @@
namespace paludis
{
+ class Environment;
+
class OurStageBuilderTask :
public StageBuilderTask
{
@@ -38,7 +40,8 @@ namespace paludis
virtual void on_build_all_pre();
virtual void on_build_pre(std::tr1::shared_ptr<const StageBase>);
virtual void on_build_post(std::tr1::shared_ptr<const StageBase>);
- virtual void on_build_fail(std::tr1::shared_ptr<const StageBase>, const StageBuildError &);
+ virtual void on_build_fail(std::tr1::shared_ptr<const StageBase>, const StageBuildError &)
+ PALUDIS_ATTRIBUTE((noreturn));
virtual void on_build_succeed(std::tr1::shared_ptr<const StageBase>);
virtual void on_build_skipped(std::tr1::shared_ptr<const StageBase>);
virtual void on_build_all_post();
diff --git a/src/clients/gtkpaludis/Makefile.am b/src/clients/gtkpaludis/Makefile.am
deleted file mode 100644
index aeaa4e8..0000000
--- a/src/clients/gtkpaludis/Makefile.am
+++ /dev/null
@@ -1,107 +0,0 @@
-AM_CXXFLAGS = -I$(top_srcdir) \
- @PALUDIS_CXXFLAGS@ \
- @PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST@ \
- @PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS@ \
- @PALUDIS_CXXFLAGS_NO_WSHADOW@
-
-DEFS = \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DLIBEXECDIR=\"$(libexecdir)\" \
- -DGLIBMM_EXCEPTIONS_ENABLED=1
-
-SUBDIRS = cellrendererbutton vtemm .
-
-INCLUDES = $(GTKDEPS_CFLAGS) $(GTKTESTDEPS_CFLAGS)
-
-TESTS_ENVIRONMENT = env \
- TEST_SCRIPT_DIR="$(srcdir)/" \
- PALUDIS_NO_GLOBAL_HOOKS="yes" \
- PALUDIS_NO_XTERM_TITLES="yes" \
- PALUDIS_EBUILD_DIR="`$(top_srcdir)/ebuild/utils/canonicalise $(top_srcdir)/ebuild/`" \
- 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`" \
- PALUDIS_HOME="$(srcdir)" \
- SYSCONFDIR="$(sysconfdir)" \
- GNOME_ACCESSIBILITY="1" \
- GTK_MODULES="gail:atk-bridge" \
- bash $(top_srcdir)/test/run_test.sh $(srcdir)/test_helper.bash
-
-if ENABLE_GTK
-
-bin_PROGRAMS = gtkpaludis
-
-common_sources = \
- categories_list.cc categories_list.hh \
- install.cc install.hh \
- main_window.cc main_window.hh \
- menu.cc menu.hh \
- messages.cc messages.hh \
- package_info.cc package_info.hh \
- package_overview.cc package_overview.hh \
- packages_list.cc packages_list.hh \
- packages_page.cc packages_page.hh \
- paludis_thread.cc paludis_thread.hh \
- queue_list.cc queue_list.hh \
- queue_options.cc queue_options.hh \
- queue_page.cc queue_page.hh \
- repositories_list.cc repositories_list.hh \
- repositories_page.cc repositories_page.hh \
- repository_overview.cc repository_overview.hh \
- set_overview.cc set_overview.hh \
- sets_list.cc sets_list.hh \
- sets_page.cc sets_page.hh \
- sync.cc sync.hh \
- tasks_page.cc tasks_page.hh
-
-gtkpaludis_SOURCES = \
- $(common_sources) \
- command_line.cc command_line.hh \
- gtkpaludis.cc
-
-gtkpaludis_LDADD = \
- $(top_builddir)/src/clients/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)/paludis/environments/default/libpaludisdefaultenvironment.la \
- $(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
- $(GTKDEPS_LIBS) \
- $(GTKTESTDEPS_LIBS) \
- $(DYNAMIC_LD_LIBS)
-
-BUILT_SOURCES = packages_list-sr.hh packages_list-sr.cc
-
-if ENABLE_GTK_TESTS
-
-check_PROGRAMS = prod-x-server
-check_SCRIPTS = \
- yay_spi_TEST.py \
- quit_TEST.py quit_TEST_setup.sh quit_TEST_cleanup.sh \
- config_suffix_TEST.py \
- sets_list_TEST.py sets_list_TEST_setup.sh sets_list_TEST_cleanup.sh
-
-prod_x_server_SOURCES = prod-x-server.cc
-prod_x_server_LDADD = -lX11
-
-TESTS = version_TEST help_TEST yay_spi_TEST.py quit_TEST.py config_suffix_TEST.py sets_list_TEST.py
-
-endif
-
-endif
-
-CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
-MAINTAINERCLEANFILES = Makefile.in
-DISTCLEANFILES = packages_list-sr.hh packages_list-sr.cc
-EXTRA_DIST = packages_list.sr version_TEST help_TEST $(check_SCRIPTS)
-
-packages_list-sr.hh : packages_list.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/packages_list.sr > $@
-
-packages_list-sr.cc : packages_list.sr $(top_srcdir)/misc/make_sr.bash
- $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/packages_list.sr > $@
-
-built-sources : $(BUILT_SOURCES)
- for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-
-
diff --git a/src/clients/gtkpaludis/categories_list.cc b/src/clients/gtkpaludis/categories_list.cc
deleted file mode 100644
index fa69564..0000000
--- a/src/clients/gtkpaludis/categories_list.cc
+++ /dev/null
@@ -1,163 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "categories_list.hh"
-#include "paludis_thread.hh"
-#include "main_window.hh"
-#include <paludis/environments/default/default_environment.hh>
-
-#include <gtkmm/treeview.h>
-#include <gtkmm/liststore.h>
-#include <glibmm/dispatcher.h>
-#include <set>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace
-{
- class Columns :
- public Gtk::TreeModel::ColumnRecord
- {
- public:
- Gtk::TreeModelColumn<Glib::ustring> col_category;
-
- Columns()
- {
- add(col_category);
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<CategoriesList>
- {
- Columns columns;
- Glib::RefPtr<Gtk::ListStore> model;
-
- sigc::signal<void> populated;
-
- Implementation() :
- model(Gtk::ListStore::create(columns))
- {
- }
-
- void add_categories(const std::set<CategoryNamePart> & c)
- {
- for (std::set<CategoryNamePart>::const_iterator n(c.begin()), n_end(c.end()) ; n != n_end ; ++n)
- {
- Gtk::TreeModel::Row row = *(model->append());
- row[columns.col_category] = stringify(*n);
- }
- }
- };
-}
-
-namespace
-{
- class Populate :
- public PaludisThread::Launchable
- {
- private:
- Implementation<CategoriesList> * const _imp;
-
- public:
- Populate(Implementation<CategoriesList> * const list) :
- _imp(list)
- {
- }
-
- virtual void operator() ();
- };
-
- void
- Populate::operator() ()
- {
- std::set<CategoryNamePart> names;
-
- StatusBarMessage m1(this, "Loading category names...");
-
- for (PackageDatabase::RepositoryIterator
- r(DefaultEnvironment::get_instance()->package_database()->begin_repositories()),
- r_end(DefaultEnvironment::get_instance()->package_database()->end_repositories()) ; r != r_end ; ++r)
- {
- StatusBarMessage m2(this, "Loading category names from '" + stringify((*r)->name()) + "'...");
-
- std::tr1::shared_ptr<const CategoryNamePartCollection> cats((*r)->category_names());
- std::copy(cats->begin(), cats->end(), std::inserter(names, names.end()));
- }
-
- dispatch(sigc::bind<1>(sigc::mem_fun(_imp, &Implementation<CategoriesList>::add_categories), names));
- dispatch(sigc::mem_fun(_imp->populated, &sigc::signal<void>::operator()));
- }
-}
-
-CategoriesList::CategoriesList() :
- PrivateImplementationPattern<CategoriesList>(new Implementation<CategoriesList>)
-{
- set_model(_imp->model);
- append_column("Category", _imp->columns.col_category);
-}
-
-CategoriesList::~CategoriesList()
-{
-}
-
-void
-CategoriesList::populate()
-{
- _imp->model->clear();
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Populate>(new Populate(_imp.operator-> ())));
-}
-
-void
-CategoriesList::select_category(const CategoryNamePart & cat)
-{
- const Gtk::TreeNodeChildren children(_imp->model->children());
- Gtk::TreeNodeChildren::iterator i(children.begin()), i_end(children.end());
- for ( ; i != i_end ; ++i)
- if (stringify(cat) == (*i)[_imp->columns.col_category])
- {
- get_selection()->select(i);
- get_selection()->signal_changed();
- return;
- }
-
- get_selection()->unselect_all();
- get_selection()->signal_changed();
-}
-
-CategoryNamePart
-CategoriesList::current_category()
-{
- Gtk::TreeModel::iterator i(get_selection()->get_selected());
- if (i)
- return CategoryNamePart(stringify((*i)[_imp->columns.col_category]));
- else
- return CategoryNamePart("no-category");
-}
-
-sigc::signal<void> &
-CategoriesList::populated()
-{
- return _imp->populated;
-}
-
diff --git a/src/clients/gtkpaludis/categories_list.hh b/src/clients/gtkpaludis/categories_list.hh
deleted file mode 100644
index 74c818e..0000000
--- a/src/clients/gtkpaludis/categories_list.hh
+++ /dev/null
@@ -1,45 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_CATEGORIES_LIST_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_CATEGORIES_LIST_HH 1
-
-#include <gtkmm/treeview.h>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-
-namespace gtkpaludis
-{
- class CategoriesList :
- public Gtk::TreeView,
- private paludis::PrivateImplementationPattern<CategoriesList>
- {
- public:
- CategoriesList();
- virtual ~CategoriesList();
-
- void populate();
- sigc::signal<void> & populated();
-
- void select_category(const paludis::CategoryNamePart &);
- paludis::CategoryNamePart current_category();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/cellrendererbutton/Makefile.am b/src/clients/gtkpaludis/cellrendererbutton/Makefile.am
deleted file mode 100644
index 3476902..0000000
--- a/src/clients/gtkpaludis/cellrendererbutton/Makefile.am
+++ /dev/null
@@ -1,32 +0,0 @@
-AM_CXXFLAGS = -I$(top_srcdir) \
- @PALUDIS_CXXFLAGS@ \
- @PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST@ \
- @PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS@ \
- @PALUDIS_CXXFLAGS_NO_WSHADOW@
-
-DEFS = \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DLIBEXECDIR=\"$(libexecdir)\" \
- -DGLIBMM_EXCEPTIONS_ENABLED=1
-
-SUBDIRS = .
-
-INCLUDES = $(GTKDEPS_CFLAGS)
-
-# if ENABLE_GTK
-#
-# noinst_LIBRARIES = libcellrendererbutton.a
-#
-# libcellrendererbutton_a_SOURCES = \
-# cellrendererbutton.cc cellrendererbutton.hh
-#
-# endif
-
-CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
-MAINTAINERCLEANFILES = Makefile.in
-
-built-sources : $(BUILT_SOURCES)
- for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-
-
-
diff --git a/src/clients/gtkpaludis/cellrendererbutton/cellrendererbutton.cc b/src/clients/gtkpaludis/cellrendererbutton/cellrendererbutton.cc
deleted file mode 100644
index 4104663..0000000
--- a/src/clients/gtkpaludis/cellrendererbutton/cellrendererbutton.cc
+++ /dev/null
@@ -1,189 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "cellrendererbutton.hh"
-#include <gtkmm/enums.h>
-#include <iomanip>
-#include <sstream>
-
-using namespace gtkpaludis;
-
-namespace
-{
- std::string
- gdk_color_to_colour_string(const Gdk::Color & c)
- {
- std::stringstream rs, gs, bs;
- rs << std::hex << std::setw(4) << std::setfill('0') << c.get_red();
- gs << std::hex << std::setw(4) << std::setfill('0') << c.get_green();
- bs << std::hex << std::setw(4) << std::setfill('0') << c.get_blue();
-
- return "#" + rs.str() + gs.str() + bs.str();
- }
-}
-
-CellRendererButton::CellRendererButton(Gtk::TreeView & owner) :
- Glib::ObjectBase(typeid(CellRendererButton)),
- Gtk::CellRendererText(),
- _owner(&owner),
- _column(0),
- _temporary_highlight_hack(false),
- _property_text_x_pad(*this, "text-x-pad", 4),
- _property_text_y_pad(*this, "text-y-pad", 4)
-{
- property_alignment() = Pango::ALIGN_CENTER;
- property_xalign() = 0.5;
-
- _owner->add_events(Gdk::POINTER_MOTION_MASK | Gdk::BUTTON_MOTION_MASK |
- Gdk::BUTTON_PRESS_MASK | Gdk::BUTTON_RELEASE_MASK | Gdk::ENTER_NOTIFY_MASK |
- Gdk::LEAVE_NOTIFY_MASK);
-
- _owner->signal_button_press_event().connect(sigc::mem_fun(
- this, &CellRendererButton::_button_pressed), false);
- _owner->signal_motion_notify_event().connect(sigc::mem_fun(
- this, &CellRendererButton::_motion_notify), false);
-}
-
-CellRendererButton::~CellRendererButton()
-{
-}
-
-void
-CellRendererButton::get_size_vfunc(Gtk::Widget & widget, const Gdk::Rectangle * cell_area,
- int * x_offset, int * y_offset, int * width, int * height) const
-{
- Gtk::CellRendererText::get_size_vfunc(widget, cell_area, x_offset, y_offset,
- width, height);
-
- const unsigned int x_pad = _property_text_x_pad.get_value();
- const unsigned int y_pad = _property_text_y_pad.get_value();
- const float x_align = property_xalign();
- const float y_align = property_yalign();
-
- const int calculated_width = 2 * x_pad + (width ? *width : 0);
- const int calculated_height = 2 * y_pad + (height ? *height : 0);
-
- if (width)
- *width = calculated_width;
- if (height)
- *height = calculated_height;
-
- if (cell_area)
- {
- if (x_offset)
- *x_offset = std::max(0, static_cast<int>(x_align * (cell_area->get_width() - calculated_width)));
- if (y_offset)
- *y_offset = std::max(0, static_cast<int>(y_align * (cell_area->get_height() - calculated_height)));
- }
-}
-
-void
-CellRendererButton::render_vfunc(const Glib::RefPtr<Gdk::Drawable> & window,
- Gtk::Widget & widget, const Gdk::Rectangle & r,
- const Gdk::Rectangle & cell_area, const Gdk::Rectangle & rr,
- Gtk::CellRendererState flags)
-{
- const unsigned int cell_x_pad = property_xpad();
- const unsigned int cell_y_pad = property_ypad();
-
- int x_offset = 0, y_offset = 0, width = 0, height = 0;
- get_size(widget, cell_area, x_offset, y_offset, width, height);
-
- width -= 2 * cell_x_pad;
- height -= 2 * cell_y_pad;
-
- if (width <= 0 || height <= 0)
- return;
-
-#if 0
- Gtk::StateType state = Gtk::STATE_INSENSITIVE;
- if (flags & Gtk::CELL_RENDERER_SELECTED)
- state = widget.has_focus() ? Gtk::STATE_SELECTED : Gtk::STATE_ACTIVE;
-#else
- Gtk::StateType state(_temporary_highlight_hack ? Gtk::STATE_SELECTED : Gtk::STATE_ACTIVE);
-#endif
-
- Glib::RefPtr<Gdk::Window> window_casted = Glib::RefPtr<Gdk::Window>::cast_dynamic<>(window);
- if (window_casted)
- {
- widget.get_style()->paint_box(window_casted, state, Gtk::SHADOW_OUT, cell_area,
- widget, "button", cell_area.get_x() + x_offset + cell_x_pad,
- cell_area.get_y() + y_offset + cell_y_pad, width - 1, height - 1);
-
- /* using property_attributes() sometimes breaks on redraws */
- widget.ensure_style();
- std::string colour_string(gdk_color_to_colour_string(widget.get_style()->get_fg(state)));
- property_markup() = "<markup><span foreground=\"" + colour_string +
- "\">" + property_text() + "</span></markup>";
- CellRendererText::render_vfunc(window, widget, r, cell_area, rr, flags);
- }
-}
-
-bool
-CellRendererButton::activate_vfunc(GdkEvent *, Gtk::Widget &,
- const Glib::ustring &, const Gdk::Rectangle &,
- const Gdk::Rectangle &, Gtk::CellRendererState)
-{
- return false;
-}
-
-bool
-CellRendererButton::_button_pressed(GdkEventButton * event)
-{
- if (! (event->type & GDK_BUTTON_PRESS && event->button == 1))
- return false;
-
- return true;
-}
-
-bool
-CellRendererButton::_motion_notify(GdkEventMotion * event)
-{
- Gtk::TreeModel::Path path, old_focused_path(_focused_path);
- Gtk::TreeViewColumn * column;
- int cell_x, cell_y;
- if (_owner->get_path_at_pos(static_cast<int>(event->x), static_cast<int>(event->y),
- path, column, cell_x, cell_y)
- && (_column && column == _column))
- _focused_path = path;
- else
- _focused_path = Gtk::TreePath();
-
- _temporary_highlight_hack = ! _focused_path.empty();
-
- /* path comparisons are a bit weird */
- if (old_focused_path.empty() && ! _focused_path.empty())
- _owner->queue_draw();
- else if (_focused_path.empty() && ! old_focused_path.empty())
- _owner->queue_draw();
- else if (_focused_path.empty() && old_focused_path.empty())
- {
- /* nothing */
- }
- else if (old_focused_path != _focused_path)
- _owner->queue_draw();
- return false;
-}
-
-void
-CellRendererButton::set_column(Gtk::TreeViewColumn * const column)
-{
- _column = column;
-}
-
diff --git a/src/clients/gtkpaludis/cellrendererbutton/cellrendererbutton.hh b/src/clients/gtkpaludis/cellrendererbutton/cellrendererbutton.hh
deleted file mode 100644
index 7aec3dd..0000000
--- a/src/clients/gtkpaludis/cellrendererbutton/cellrendererbutton.hh
+++ /dev/null
@@ -1,91 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_CELLRENDERERBUTTON_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_CELLRENDERERBUTTON_HH 1
-
-#include <gtkmm/cellrenderertext.h>
-#include <gtkmm/treeview.h>
-
-namespace gtkpaludis
-{
- /**
- * A cell renderer for a Gtk::TreeView that displays a button.
- *
- * Based upon gtkmm/examples/cellrenderercustom/cellrenderertoggle.cc
- */
- class CellRendererButton :
- public Gtk::CellRendererText
- {
- private:
- bool _button_pressed(GdkEventButton *);
- bool _motion_notify(GdkEventMotion *);
-
- Gtk::TreeView * const _owner;
- Gtk::TreeModel::Path _focused_path;
- Gtk::TreeViewColumn * _column;
-
- bool _temporary_highlight_hack;
-
- Glib::Property<unsigned int> _property_text_x_pad;
- Glib::Property<unsigned int> _property_text_y_pad;
-
- protected:
- virtual void get_size_vfunc(Gtk::Widget & widget, const Gdk::Rectangle * cell_area,
- int * x_offset, int * y_offset, int * width, int * height) const;
-
- virtual void render_vfunc(const Glib::RefPtr<Gdk::Drawable> & window,
- Gtk::Widget & widget, const Gdk::Rectangle & background_area,
- const Gdk::Rectangle & cell_area, const Gdk::Rectangle & expose_area,
- Gtk::CellRendererState flags);
-
- virtual bool activate_vfunc(GdkEvent * event, Gtk::Widget & widget,
- const Glib::ustring & path, const Gdk::Rectangle & background_area,
- const Gdk::Rectangle & cell_area, Gtk::CellRendererState flags);
-
- public:
- CellRendererButton(Gtk::TreeView & owner);
- virtual ~CellRendererButton();
- void set_column(Gtk::TreeViewColumn * const column);
-
- Glib::PropertyProxy<unsigned int> property_text_x_pad()
- {
- return _property_text_x_pad.get_proxy();
- }
-
- Glib::PropertyProxy_ReadOnly<unsigned int> property_text_x_pad() const
- {
- return Glib::PropertyProxy_ReadOnly<unsigned int>(this,
- "text-x-pad");
- }
-
- Glib::PropertyProxy<unsigned int> property_text_y_pad()
- {
- return _property_text_y_pad.get_proxy();
- }
-
- Glib::PropertyProxy_ReadOnly<unsigned int> property_text_y_pad() const
- {
- return Glib::PropertyProxy_ReadOnly<unsigned int>(this,
- "text-y-pad");
- }
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/command_line.cc b/src/clients/gtkpaludis/command_line.cc
deleted file mode 100644
index 3016e10..0000000
--- a/src/clients/gtkpaludis/command_line.cc
+++ /dev/null
@@ -1,71 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "command_line.hh"
-
-using namespace gtkpaludis;
-
-CommandLine::CommandLine() :
- ArgsHandler(),
-
- action_args(this, "Actions",
- "Selects which basic action to perform. Up to one action should "
- "be specified."),
- a_version(&action_args, "version", 'V', "Display program version"),
- a_help(&action_args, "help", 'h', "Display program help"),
-
- general_args(this, "General options",
- "Options which are relevant for most or all actions."),
- a_log_level(&general_args, "log-level", '\0', "Specify the log level",
- paludis::args::EnumArg::EnumArgOptions("debug", "Show debug output (noisy)")
- ("qa", "Show QA messages and warnings only")
- ("warning", "Show warnings only")
- ("silent", "Suppress all log messages"),
- "qa"),
- a_config_suffix(&general_args, "config-suffix", 'c', "Config directory suffix")
-{
- add_usage_line("[ general options ]");
- add_usage_line("--version");
- add_usage_line("--help");
- add_environment_variable("GTKPALUDIS_OPTIONS", "Default command-line options.");
-}
-
-std::string
-CommandLine::app_name() const
-{
- return "gtkpaludis";
-}
-
-std::string
-CommandLine::app_synopsis() const
-{
- return "A graphical interface for the other package mangler";
-}
-
-std::string
-CommandLine::app_description() const
-{
- return
- "A graphical interface for the paludis package manager.";
-}
-
-CommandLine::~CommandLine()
-{
-}
-
diff --git a/src/clients/gtkpaludis/command_line.hh b/src/clients/gtkpaludis/command_line.hh
deleted file mode 100644
index b09681a..0000000
--- a/src/clients/gtkpaludis/command_line.hh
+++ /dev/null
@@ -1,101 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_COMMAND_LINE_HH
-#define PALUDIS_GUARD_SRC_COMMAND_LINE_HH 1
-
-#include <paludis/args/args.hh>
-#include <paludis/util/instantiation_policy.hh>
-
-/** \file
- * Declarations for the CommandLine class.
- */
-
-/**
- * Our command line.
- */
-namespace gtkpaludis
-{
- class CommandLine :
- public paludis::args::ArgsHandler,
- public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>
- {
- friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonTag>;
-
- private:
- /// Constructor.
- CommandLine();
-
- /// Destructor.
- ~CommandLine();
-
- public:
- ///\name Program information
- ///\{
-
- virtual std::string app_name() const;
- virtual std::string app_synopsis() const;
- virtual std::string app_description() const;
-
- ///\}
-
- /// \name Action arguments
- ///\{
-
- /// Action arguments.
- paludis::args::ArgsGroup action_args;
-
- /// --version
- paludis::args::SwitchArg a_version;
-
- /// --help
- paludis::args::SwitchArg a_help;
-
- ///\}
-
- /// \name General arguments
- ///\{
-
- /// General arguments.
- paludis::args::ArgsGroup general_args;
-
- /// --log-level
- paludis::args::EnumArg a_log_level;
-
- /// --config-suffix
- paludis::args::StringArg a_config_suffix;
-
- ///\}
- };
-
- /**
- * Show the help message.
- */
- struct DoHelp
- {
- const std::string message;
-
- DoHelp(const std::string & m = "") :
- message(m)
- {
- }
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/config_suffix_TEST.py b/src/clients/gtkpaludis/config_suffix_TEST.py
deleted file mode 100755
index 4ef4fb6..0000000
--- a/src/clients/gtkpaludis/config_suffix_TEST.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-# vim: set ft=python sw=4 sts=4 et :
-
-import os
-import sys
-from dogtail.procedural import *
-import dogtail.utils
-
-os.environ["PALUDIS_HOME"] = os.getcwd() + "/config_suffix_TEST_dir/home"
-os.spawnv(os.P_NOWAIT, "./gtkpaludis", ["gtkpaludis", "-c", "doesnotexist"])
-for x in range(10):
- try:
- focus.application('lt-gtkpaludis')
- break
- except FocusError:
- dogtail.utils.doDelay()
-
-focus.application('lt-gtkpaludis')
-click('OK')
-
diff --git a/src/clients/gtkpaludis/gtkpaludis.cc b/src/clients/gtkpaludis/gtkpaludis.cc
deleted file mode 100644
index ed914ce..0000000
--- a/src/clients/gtkpaludis/gtkpaludis.cc
+++ /dev/null
@@ -1,317 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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/paludis.hh>
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/environments/default/default_config.hh>
-#include <paludis/util/log.hh>
-
-#include <libebt/libebt_version.hh>
-
-#include <libwrapiter/libwrapiter_version.hh>
-
-#include <gtkmm/main.h>
-#include <gtkmm/messagedialog.h>
-
-#include <iostream>
-
-#include "command_line.hh"
-#include "main_window.hh"
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-using std::cout;
-using std::cerr;
-using std::endl;
-
-namespace
-{
- struct DoVersion
- {
- };
-
- struct GtkInitFailed : Exception
- {
- GtkInitFailed() :
- Exception ("Couldn't initialize gtk")
- {
- }
- };
-
- class TryMain : public Gtk::Main
- {
- static bool _gtkmm_initialized;
-
- public:
- TryMain(int argc, char * argv[]) :
- Gtk::Main()
- {
- _gtkmm_initialized = gtk_init_check(&argc, &argv);
- }
-
- bool initialized() const
- {
- return _gtkmm_initialized;
- }
-
- static void run(Gtk::Window& window)
- {
- if (! _gtkmm_initialized)
- throw GtkInitFailed();
-
- Gtk::Main::run(window);
- }
-
- static void run()
- {
- if (! _gtkmm_initialized)
- throw GtkInitFailed();
-
- Gtk::Main::run();
- }
- };
-
-
- bool TryMain::_gtkmm_initialized;
-
- void display_version()
- {
- cout << "gtkpaludis " << PALUDIS_VERSION_MAJOR << "."
- << PALUDIS_VERSION_MINOR << "." << PALUDIS_VERSION_MICRO;
- if (! std::string(PALUDIS_SUBVERSION_REVISION).empty())
- cout << " svn " << PALUDIS_SUBVERSION_REVISION;
- cout << endl << endl;
- cout << "Built by " << PALUDIS_BUILD_USER << "@" << PALUDIS_BUILD_HOST
- << " on " << PALUDIS_BUILD_DATE << endl;
- cout << "CXX: " << PALUDIS_BUILD_CXX
-#if defined(__ICC)
- << " " << __ICC
-#elif defined(__VERSION__)
- << " " << __VERSION__
-#endif
- << endl;
- cout << "CXXFLAGS: " << PALUDIS_BUILD_CXXFLAGS << endl;
- cout << "LDFLAGS: " << PALUDIS_BUILD_LDFLAGS << endl;
- cout << "SYSCONFDIR: " << SYSCONFDIR << endl;
- cout << "LIBEXECDIR: " << LIBEXECDIR << endl;
- cout << "stdlib: "
-#if defined(__GLIBCXX__)
-# define XSTRINGIFY(x) #x
-# define STRINGIFY(x) XSTRINGIFY(x)
- << "GNU libstdc++ " << STRINGIFY(__GLIBCXX__)
-#endif
- << endl;
-
- cout << "libebt: " << LIBEBT_VERSION_MAJOR << "." << LIBEBT_VERSION_MINOR
- << "." << LIBEBT_VERSION_MICRO << endl;
- cout << "libwrapiter: " << LIBWRAPITER_VERSION_MAJOR << "." << LIBWRAPITER_VERSION_MINOR
- << "." << LIBWRAPITER_VERSION_MICRO << endl;
-#if HAVE_SANDBOX
- cout << "sandbox: enabled" << endl;
-#else
- cout << "sandbox: disabled" << endl;
-#endif
- }
-}
-
-int
-main(int argc, char * argv[])
-{
-
- Context context("In main program:");
-
- TryMain gui_kit(argc, argv);
-
- try
- {
- {
- Context context_local("When handling command line:");
- CommandLine::get_instance()->run(argc, argv, "gtkpaludis", "GTKPALUDIS_OPTIONS",
- "GTKPALUDIS_CMDLINE");
-
- if (CommandLine::get_instance()->a_help.specified())
- throw DoHelp();
-
- if (CommandLine::get_instance()->a_version.specified())
- throw DoVersion();
-
- if (! CommandLine::get_instance()->a_log_level.specified())
- Log::get_instance()->set_log_level(ll_qa);
- else if (CommandLine::get_instance()->a_log_level.argument() == "debug")
- Log::get_instance()->set_log_level(ll_debug);
- else if (CommandLine::get_instance()->a_log_level.argument() == "qa")
- Log::get_instance()->set_log_level(ll_qa);
- else if (CommandLine::get_instance()->a_log_level.argument() == "warning")
- Log::get_instance()->set_log_level(ll_warning);
- else if (CommandLine::get_instance()->a_log_level.argument() == "silent")
- Log::get_instance()->set_log_level(ll_silent);
- else
- throw DoHelp("bad value for --log-level");
- }
-
- {
- Context context_local("When loading configuration:");
-
- std::string paludis_command(argv[0]);
- std::string::size_type last_slash(paludis_command.rfind('/'));
- if (std::string::npos == last_slash)
- last_slash = 0;
- if (0 == paludis_command.compare(last_slash + 1, 13, "lt-gtkpaludis"))
- {
- /* i hate libtool */
- paludis_command.erase(last_slash);
- if (std::string::npos != ((last_slash = paludis_command.rfind('/'))))
- paludis_command.erase(last_slash);
- if (std::string::npos != ((last_slash = paludis_command.rfind('/'))))
- paludis_command.erase(last_slash);
- paludis_command.append("/paludis/paludis");
- }
- else if (0 == paludis_command.compare(last_slash + 1, 3, "gtk"))
- paludis_command.erase(last_slash + 1, 3);
- else if ("gtkpaludis" == paludis_command)
- paludis_command = "paludis";
-
- if (CommandLine::get_instance()->a_config_suffix.specified())
- {
- DefaultConfig::set_config_suffix(CommandLine::get_instance()->a_config_suffix.argument());
- paludis_command.append(" --config-suffix " +
- CommandLine::get_instance()->a_config_suffix.argument());
- }
-
- paludis_command.append(" --log-level " + CommandLine::get_instance()->a_log_level.argument());
- DefaultConfig::get_instance()->set_paludis_command(paludis_command);
- }
-
- {
- Context context_local("When displaying main window:");
-
- if (! gui_kit.initialized())
- throw GtkInitFailed();
-
- if (! Glib::thread_supported())
- Glib::thread_init();
-
-#ifdef GTKPALUDIS_SLAVE_MODE
- std::cerr << "Running in slave mode, for test cases" << std::endl;
-#endif
-
- Glib::signal_idle().connect(sigc::bind_return(sigc::mem_fun(*MainWindow::get_instance(),
- &MainWindow::populate), false));
- TryMain::run(*MainWindow::get_instance());
- }
- }
- catch (const DoVersion &)
- {
- display_version();
- cout << endl;
- cout << "Paludis comes with ABSOLUTELY NO WARRANTY. Paludis is free software, and you" << endl;
- cout << "are welcome to redistribute it under the terms of the GNU General Public" << endl;
- cout << "License, version 2." << endl;
-
- return EXIT_SUCCESS;
- }
- catch (const paludis::args::ArgsError & e)
- {
- cerr << "Usage error: " << e.message() << endl;
- cerr << "Try " << argv[0] << " --help" << endl;
- return EXIT_FAILURE;
- }
- catch (const DoHelp & h)
- {
- if (h.message.empty())
- {
- cout << "Usage: " << argv[0] << " [options]" << endl;
- cout << endl;
- cout << *CommandLine::get_instance();
- return EXIT_SUCCESS;
- }
- else
- {
- cerr << "Usage error: " << h.message << endl;
- cerr << "Try " << argv[0] << " --help" << endl;
- return EXIT_FAILURE;
- }
- }
- catch (GtkInitFailed & e)
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * " << e.backtrace("\n * ")
- << e.message() << " (" << e.what() << ")\n" << endl;
-
- cerr << "Try adjust DISPLAY environment variable or pass --display option\n" << endl;
-
- return EXIT_FAILURE;
- }
- catch (const Exception & e)
- {
- if (gui_kit.initialized())
- {
- Gtk::Main::init_gtkmm_internals();
- Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
- dialog.set_secondary_text(
- "- " + e.backtrace("\n- ") + e.message() + " (" + e.what() + ")");
- dialog.run();
- }
- else
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * " << e.backtrace("\n * ")
- << e.message() << " (" << e.what() << ")" << endl;
- }
- return EXIT_FAILURE;
- }
- catch (const std::exception & e)
- {
- if (gui_kit.initialized())
- {
- Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
- dialog.set_secondary_text("Unhandled exception (" + stringify(e.what()) + ")");
- dialog.run();
- }
- else
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * " << e.what() << endl;
- }
- return EXIT_FAILURE;
- }
- catch (...)
- {
- if (gui_kit.initialized())
- {
- Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
- dialog.set_secondary_text("Unhandled exception (unknown type)");
- dialog.run();
- }
- else
- {
- cout << endl;
- cerr << "Unhandled exception:" << endl
- << " * Unknown exception type. Ouch..." << endl;
- }
- return EXIT_FAILURE;
- }
-
- return EXIT_SUCCESS;
-}
-
diff --git a/src/clients/gtkpaludis/help_TEST b/src/clients/gtkpaludis/help_TEST
deleted file mode 100755
index e2e1fa0..0000000
--- a/src/clients/gtkpaludis/help_TEST
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-PALUDIS_SKIP_CONFIG=yes ./gtkpaludis --help
-
diff --git a/src/clients/gtkpaludis/install.cc b/src/clients/gtkpaludis/install.cc
deleted file mode 100644
index 4840b2f..0000000
--- a/src/clients/gtkpaludis/install.cc
+++ /dev/null
@@ -1,210 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "install.hh"
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/util/save.hh>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<OurInstallTask>
- {
- OurInstallTask::Callbacks * callbacks;
- };
-}
-
-OurInstallTask::OurInstallTask() :
- InstallTask(DefaultEnvironment::get_instance(), DepListOptions(), DefaultEnvironment::get_instance()->default_destinations()),
- PrivateImplementationPattern<OurInstallTask>(new Implementation<OurInstallTask>)
-{
-}
-
-OurInstallTask::~OurInstallTask()
-{
-}
-
-void
-OurInstallTask::on_build_deplist_pre()
-{
-}
-
-void
-OurInstallTask::on_build_deplist_post()
-{
-}
-
-void
-OurInstallTask::on_not_continuing_due_to_errors()
-{
-}
-
-void
-OurInstallTask::on_build_cleanlist_pre(const DepListEntry &)
-{
-}
-
-void
-OurInstallTask::on_build_cleanlist_post(const DepListEntry &)
-{
-}
-
-
-void
-OurInstallTask::on_display_merge_list_pre()
-{
-}
-
-void
-OurInstallTask::on_display_merge_list_post()
-{
-}
-
-void
-OurInstallTask::on_display_merge_list_entry(const DepListEntry & e)
-{
- if (! PrivateImplementationPattern<OurInstallTask>::_imp->callbacks)
- throw InternalError(PALUDIS_HERE, "_imp->callbacks is 0");
-
- PrivateImplementationPattern<OurInstallTask>::_imp->callbacks->display_entry(e);
-}
-
-void
-OurInstallTask::on_fetch_all_pre()
-{
-}
-
-void
-OurInstallTask::on_fetch_pre(const DepListEntry &)
-{
-}
-
-void
-OurInstallTask::on_fetch_post(const DepListEntry &)
-{
-}
-
-void
-OurInstallTask::on_fetch_all_post()
-{
-}
-
-
-void
-OurInstallTask::on_install_all_pre()
-{
-}
-
-void
-OurInstallTask::on_install_pre(const DepListEntry &)
-{
-}
-
-void
-OurInstallTask::on_install_post(const DepListEntry &)
-{
-}
-
-void
-OurInstallTask::on_install_all_post()
-{
-}
-
-void
-OurInstallTask::on_no_clean_needed(const DepListEntry &)
-{
-}
-
-void
-OurInstallTask::on_clean_all_pre(const DepListEntry &,
- const PackageDatabaseEntryCollection &)
-{
-}
-
-void
-OurInstallTask::on_clean_pre(const DepListEntry &,
- const PackageDatabaseEntry &)
-{
-}
-
-void
-OurInstallTask::on_clean_post(const DepListEntry &,
- const PackageDatabaseEntry &)
-{
-}
-
-void
-OurInstallTask::on_clean_all_post(const DepListEntry &,
- const PackageDatabaseEntryCollection &)
-{
-}
-
-void
-OurInstallTask::on_update_world_pre()
-{
-}
-
-void
-OurInstallTask::on_update_world(const PackageDepSpec &)
-{
-}
-
-void
-OurInstallTask::on_update_world(const SetName &)
-{
-}
-
-void
-OurInstallTask::on_update_world_skip(const PackageDepSpec &, const std::string &)
-{
-}
-
-void
-OurInstallTask::on_update_world_skip(const SetName &, const std::string &)
-{
-}
-
-void
-OurInstallTask::on_update_world_post()
-{
-}
-
-void
-OurInstallTask::on_preserve_world()
-{
-}
-
-OurInstallTask::Callbacks::Callbacks()
-{
-}
-
-OurInstallTask::Callbacks::~Callbacks()
-{
-}
-
-void
-OurInstallTask::execute(OurInstallTask::Callbacks * const c)
-{
- Save<OurInstallTask::Callbacks *> save_callback(&PrivateImplementationPattern<OurInstallTask>::_imp->callbacks, c);
- InstallTask::execute();
-}
-
diff --git a/src/clients/gtkpaludis/install.hh b/src/clients/gtkpaludis/install.hh
deleted file mode 100644
index 72aaea8..0000000
--- a/src/clients/gtkpaludis/install.hh
+++ /dev/null
@@ -1,97 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_INSTALL_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_INSTALL_HH 1
-
-#include <paludis/tasks/install_task.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace gtkpaludis
-{
- class OurInstallTask :
- protected paludis::InstallTask,
- private paludis::PrivateImplementationPattern<OurInstallTask>
- {
- protected:
- virtual void on_build_deplist_pre();
- virtual void on_build_deplist_post();
-
- virtual void on_build_cleanlist_pre(const paludis::DepListEntry &);
- virtual void on_build_cleanlist_post(const paludis::DepListEntry &);
-
- virtual void on_display_merge_list_pre();
- virtual void on_display_merge_list_post();
- virtual void on_display_merge_list_entry(const paludis::DepListEntry &);
- virtual void on_not_continuing_due_to_errors();
-
- virtual void on_fetch_all_pre();
- virtual void on_fetch_pre(const paludis::DepListEntry &);
- virtual void on_fetch_post(const paludis::DepListEntry &);
- virtual void on_fetch_all_post();
-
- virtual void on_install_all_pre();
- virtual void on_install_pre(const paludis::DepListEntry &);
- virtual void on_install_post(const paludis::DepListEntry &);
- virtual void on_install_all_post();
-
- virtual void on_no_clean_needed(const paludis::DepListEntry &);
- virtual void on_clean_all_pre(const paludis::DepListEntry &,
- const paludis::PackageDatabaseEntryCollection &);
- virtual void on_clean_pre(const paludis::DepListEntry &,
- const paludis::PackageDatabaseEntry &);
- virtual void on_clean_post(const paludis::DepListEntry &,
- const paludis::PackageDatabaseEntry &);
- virtual void on_clean_all_post(const paludis::DepListEntry &,
- const paludis::PackageDatabaseEntryCollection &);
-
- virtual void on_update_world_pre();
- virtual void on_update_world(const paludis::PackageDepSpec &);
- virtual void on_update_world_skip(const paludis::PackageDepSpec &, const std::string &);
- virtual void on_update_world(const paludis::SetName &);
- virtual void on_update_world_skip(const paludis::SetName &, const std::string &);
- virtual void on_update_world_post();
- virtual void on_preserve_world();
-
- public:
- OurInstallTask();
- virtual ~OurInstallTask();
-
- class Callbacks
- {
- protected:
- Callbacks();
-
- public:
- virtual ~Callbacks();
-
- virtual void display_entry(const paludis::DepListEntry & e) = 0;
- };
-
- void execute(Callbacks * const);
-
- using InstallTask::clear;
- using InstallTask::add_target;
- using InstallTask::begin_targets;
- using InstallTask::end_targets;
- using InstallTask::set_pretend;
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/main_window.cc b/src/clients/gtkpaludis/main_window.cc
deleted file mode 100644
index b8865a7..0000000
--- a/src/clients/gtkpaludis/main_window.cc
+++ /dev/null
@@ -1,244 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "main_window.hh"
-#include "sets_page.hh"
-#include "packages_page.hh"
-#include "repositories_page.hh"
-#include "messages.hh"
-#include "tasks_page.hh"
-#include "queue_page.hh"
-#include "menu.hh"
-
-#include <paludis/util/log.hh>
-
-#include <gtkmm/box.h>
-#include <gtkmm/notebook.h>
-#include <gtkmm/table.h>
-#include <gtkmm/messagedialog.h>
-#include <gtkmm/main.h>
-#include <gtkmm/statusbar.h>
-
-#include <list>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<MainWindow>
- {
- unsigned lock_count;
-
- Glib::Dispatcher dispatcher;
-
- Gtk::Table main_table;
-
- Menu menu;
- Gtk::Notebook main_notebook;
- TasksPage tasks_page;
- PackagesPage packages_page;
- SetsPage sets_page;
- RepositoriesPage repositories_page;
- QueuePage queue_page;
- Gtk::Table messages_page;
- Messages messages;
-
- Gtk::Statusbar status_bar;
-
- int messages_page_id;
- int queue_page_id;
- int sets_page_id;
- int packages_page_id;
-
- Implementation() :
- lock_count(0),
- main_table(1, 3, false),
- messages_page(1, 1, false)
- {
- }
- };
-}
-
-MainWindow::MainWindow() :
- PrivateImplementationPattern<MainWindow>(new Implementation<MainWindow>)
-{
- set_title("gtkpaludis");
- set_border_width(2);
- set_default_size(600, 400);
-
-// _imp->main_notebook.set_border_width(5);
- _imp->main_notebook.signal_switch_page().connect(sigc::mem_fun(this,
- &MainWindow::_main_notebook_page_switched));
-
- _imp->main_notebook.append_page(_imp->tasks_page, "Common Tasks");
- _imp->packages_page_id = _imp->main_notebook.append_page(_imp->packages_page, "Packages");
- _imp->sets_page_id = _imp->main_notebook.append_page(_imp->sets_page, "Sets");
- _imp->main_notebook.append_page(_imp->repositories_page, "Repositories");
- _imp->queue_page_id = _imp->main_notebook.append_page(_imp->queue_page, "Queue");
- _imp->messages_page_id = _imp->main_notebook.append_page(_imp->messages_page, "Messages");
-
- add(_imp->main_table);
-
- _imp->main_table.attach(*_imp->menu.get_menu_widget(), 0, 1, 0, 1, Gtk::FILL, Gtk::AttachOptions(0));
- _imp->menu.add_accel_group_to(this);
-
- _imp->main_table.attach(_imp->main_notebook, 0, 1, 1, 2);
- _imp->status_bar.set_has_resize_grip(true);
- _imp->main_table.attach(_imp->status_bar, 0, 1, 2, 3, Gtk::FILL, Gtk::AttachOptions(0));
-
- _imp->messages_page.attach(_imp->messages, 0, 1, 0, 1);
-
- show_all_children();
-}
-
-void
-MainWindow::_set_lock(bool value)
-{
- set_sensitive(! value);
-}
-
-MainWindow::~MainWindow()
-{
-}
-
-void
-MainWindow::populate()
-{
- lock_controls();
- _imp->packages_page.populate();
- _imp->repositories_page.populate();
- _imp->sets_page.populate();
- maybe_unlock_controls();
-}
-
-void
-MainWindow::lock_controls()
-{
- if (0 == _imp->lock_count++)
- _set_lock(true);
-}
-
-void
-MainWindow::maybe_unlock_controls()
-{
- if (0 == --_imp->lock_count)
- _set_lock(false);
-}
-
-void
-MainWindow::push_status(const std::string & s)
-{
- _imp->status_bar.push(s);
-}
-
-void
-MainWindow::pop_status()
-{
- _imp->status_bar.pop();
-}
-
-void
-MainWindow::show_messages_page()
-{
- _imp->main_notebook.set_current_page(_imp->messages_page_id);
-}
-
-void
-MainWindow::show_queue_page()
-{
- _imp->main_notebook.set_current_page(_imp->queue_page_id);
-}
-
-void
-MainWindow::show_sets_page()
-{
- _imp->main_notebook.set_current_page(_imp->sets_page_id);
-}
-
-void
-MainWindow::show_packages_page()
-{
- _imp->main_notebook.set_current_page(_imp->packages_page_id);
-}
-
-void
-MainWindow::show_exception(const std::string & what, const std::string & message, bool fatal)
-{
- Gtk::MessageDialog dialog(*this, fatal ? "Fatal Error" : "Error", false, Gtk::MESSAGE_ERROR);
- dialog.set_secondary_text(message + " (" + what + ")");
- dialog.run();
-
- if (fatal)
- Gtk::Main::quit();
-}
-
-void
-MainWindow::show_error_dialog(const std::string & title, const std::string & message)
-{
- Gtk::MessageDialog dialog(*this, title, false, Gtk::MESSAGE_ERROR);
- dialog.set_secondary_text(message);
- dialog.run();
-}
-
-void
-MainWindow::message(const std::string & s)
-{
- _imp->messages.message(s);
-}
-
-QueuePage *
-MainWindow::queue_page()
-{
- return &_imp->queue_page;
-}
-
-RepositoriesPage *
-MainWindow::repositories_page()
-{
- return &_imp->repositories_page;
-}
-
-SetsPage *
-MainWindow::sets_page()
-{
- return &_imp->sets_page;
-}
-
-PackagesPage *
-MainWindow::packages_page()
-{
- return &_imp->packages_page;
-}
-
-void
-MainWindow::message_window_changed()
-{
- if (_imp->main_notebook.get_current_page() != _imp->messages_page_id)
- _imp->main_notebook.set_tab_label_text(_imp->messages_page, "Messages *");
-}
-
-void
-MainWindow::_main_notebook_page_switched(GtkNotebookPage *, guint)
-{
- if (_imp->main_notebook.get_current_page() == _imp->messages_page_id)
- _imp->main_notebook.set_tab_label_text(_imp->messages_page, "Messages");
-}
-
diff --git a/src/clients/gtkpaludis/main_window.hh b/src/clients/gtkpaludis/main_window.hh
deleted file mode 100644
index 189d4e9..0000000
--- a/src/clients/gtkpaludis/main_window.hh
+++ /dev/null
@@ -1,76 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_MAIN_WINDOW_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_MAIN_WINDOW_HH 1
-
-#include <gtkmm/window.h>
-#include <gtkmm/notebook.h>
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace gtkpaludis
-{
- class QueuePage;
- class RepositoriesPage;
- class SetsPage;
- class PackagesPage;
-
- class MainWindow :
- public paludis::InstantiationPolicy<MainWindow, paludis::instantiation_method::SingletonTag>,
- private paludis::PrivateImplementationPattern<MainWindow>,
- public Gtk::Window
- {
- friend class paludis::InstantiationPolicy<MainWindow, paludis::instantiation_method::SingletonTag>;
-
- private:
- MainWindow();
- virtual ~MainWindow();
-
- void _set_lock(bool value);
- void _main_notebook_page_switched(GtkNotebookPage *, guint);
-
- public:
- virtual void populate();
-
- void lock_controls();
- void maybe_unlock_controls();
-
- void show_exception(const std::string & what, const std::string & message, bool fatal);
- void show_error_dialog(const std::string & title, const std::string & message);
-
- void message(const std::string &);
- void push_status(const std::string &);
- void pop_status();
-
- void show_messages_page();
- void show_queue_page();
- void show_sets_page();
- void show_packages_page();
-
- void message_window_changed();
-
- QueuePage * queue_page();
- RepositoriesPage * repositories_page();
- SetsPage * sets_page();
- PackagesPage * packages_page();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/menu.cc b/src/clients/gtkpaludis/menu.cc
deleted file mode 100644
index aedc5e7..0000000
--- a/src/clients/gtkpaludis/menu.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "menu.hh"
-#include <gtkmm/main.h>
-#include <gtkmm/actiongroup.h>
-#include <gtkmm/uimanager.h>
-#include <gtkmm/stock.h>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<Menu>
- {
- Glib::RefPtr<Gtk::ActionGroup> action_group;
- Glib::RefPtr<Gtk::UIManager> ui_manager;
-
- Implementation() :
- action_group(Gtk::ActionGroup::create()),
- ui_manager(Gtk::UIManager::create())
- {
- }
- };
-}
-
-Menu::Menu() :
- PrivateImplementationPattern<Menu>(new Implementation<Menu>)
-{
- _imp->ui_manager->insert_action_group(_imp->action_group);
- _imp->action_group->add(Gtk::Action::create("FileMenu", "File"));
- _imp->action_group->add(Gtk::Action::create("Quit", Gtk::Stock::QUIT),
- sigc::mem_fun(this, &Menu::action_quit));
- _imp->ui_manager->add_ui_from_string(
- "<ui>"
- " <menubar name='MenuBar'>"
- " <menu action='FileMenu'>"
- " <menuitem action='Quit' />"
- " </menu>"
- " </menubar>"
- "</ui>"
- );
-}
-
-Menu::~Menu()
-{
-}
-
-Gtk::Widget *
-Menu::get_menu_widget()
-{
- return _imp->ui_manager->get_widget("/MenuBar");
-}
-
-void
-Menu::action_quit()
-{
- Gtk::Main::quit();
-}
-
-void
-Menu::add_accel_group_to(Gtk::Window * w)
-{
- w->add_accel_group(_imp->ui_manager->get_accel_group());
-}
-
diff --git a/src/clients/gtkpaludis/menu.hh b/src/clients/gtkpaludis/menu.hh
deleted file mode 100644
index f0e4634..0000000
--- a/src/clients/gtkpaludis/menu.hh
+++ /dev/null
@@ -1,45 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_MENU_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_MENU_HH 1
-
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <gtkmm/widget.h>
-#include <gtkmm/window.h>
-
-namespace gtkpaludis
-{
- class Menu :
- private paludis::PrivateImplementationPattern<Menu>
- {
- private:
- void action_quit();
-
- public:
- Menu();
- ~Menu();
-
- Gtk::Widget * get_menu_widget();
- void add_accel_group_to(Gtk::Window *);
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/messages.cc b/src/clients/gtkpaludis/messages.cc
deleted file mode 100644
index d7512d7..0000000
--- a/src/clients/gtkpaludis/messages.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "messages.hh"
-#include "main_window.hh"
-
-#include <vtemm/terminal_widget.hh>
-#include <paludis/util/fd_output_stream.hh>
-#include <paludis/util/log.hh>
-#include <paludis/util/system.hh>
-#include <paludis/util/pstream.hh>
-#include <cstdlib>
-#include <fcntl.h>
-#include <unistd.h>
-
-// for restoring Log's output stream
-#include <iostream>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace
-{
- class Pty
- {
- private:
- int _master_fd, _slave_fd;
-
- public:
- Pty() :
- _master_fd(posix_openpt(O_RDWR))
- {
- if (_master_fd < 1)
- throw InternalError(PALUDIS_HERE, "posix_openpt failed");
- if (-1 == grantpt(_master_fd))
- throw InternalError(PALUDIS_HERE, "grantpt failed");
- if (-1 == unlockpt(_master_fd))
- throw InternalError(PALUDIS_HERE, "unlockpt failed");
-
- _slave_fd = open(ptsname(_master_fd), O_RDWR);
- if (-1 == _slave_fd)
- throw InternalError(PALUDIS_HERE, "open _slave_fd failed");
- }
-
- ~Pty()
- {
- close(_master_fd);
- close(_slave_fd);
- }
-
- int master_fd() const
- {
- return _master_fd;
- }
-
- int slave_fd() const
- {
- return _slave_fd;
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<Messages>
- {
- Pty term_pty;
- Vte::Terminal term;
- FDOutputStream messages_stream;
-
- Implementation() :
- messages_stream(term_pty.slave_fd())
- {
- }
- };
-}
-
-Messages::Messages() :
- PrivateImplementationPattern<Messages>(new Implementation<Messages>)
-{
- set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
- add(_imp->term);
-
- _imp->term.set_pty(dup(_imp->term_pty.master_fd()));
- _imp->term.set_scroll_on_output(true);
-
- set_run_command_stdout_fds(_imp->term_pty.slave_fd(), _imp->term_pty.master_fd());
- set_run_command_stderr_fds(_imp->term_pty.slave_fd(), _imp->term_pty.master_fd());
- PStream::set_stderr_fd(_imp->term_pty.slave_fd(), _imp->term_pty.master_fd());
-
- Log::get_instance()->set_log_stream(&_imp->messages_stream);
-
- Glib::signal_idle().connect(sigc::bind_return(sigc::mem_fun(this,
- &Messages::_install_signal_handlers), false));
-}
-
-Messages::~Messages()
-{
- Log::get_instance()->set_log_stream(&std::cerr);
-}
-
-void
-Messages::message(const std::string & s)
-{
- std::string msg("=== " + s + " ===\n");
- write(_imp->term_pty.slave_fd(), msg.c_str(), msg.length());
-}
-
-void
-Messages::_install_signal_handlers()
-{
- _imp->term.signal_cursor_moved().connect(sigc::mem_fun(MainWindow::get_instance(),
- &MainWindow::message_window_changed));
-}
-
diff --git a/src/clients/gtkpaludis/package_info.cc b/src/clients/gtkpaludis/package_info.cc
deleted file mode 100644
index cd5cc84..0000000
--- a/src/clients/gtkpaludis/package_info.cc
+++ /dev/null
@@ -1,100 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "package_info.hh"
-#include "package_overview.hh"
-#include "main_window.hh"
-#include "queue_page.hh"
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<PackageInfo>
- {
- Gtk::HBox overview_page;
- Gtk::ScrolledWindow overview_page_main;
- Gtk::VButtonBox overview_page_buttons;
-
- Gtk::Button queue_button;
- Gtk::Button uninstall_button;
-
- Gtk::ScrolledWindow metadata_page;
-
- PackageOverview overview;
-
- QualifiedPackageName current_package;
-
- Implementation() :
- queue_button("Queue"),
- uninstall_button("Uninstall"),
- current_package("no-category/no-package")
- {
- }
- };
-}
-
-PackageInfo::PackageInfo() :
- PrivateImplementationPattern<PackageInfo>(new Implementation<PackageInfo>)
-{
- append_page(_imp->overview_page, "Overview");
- append_page(_imp->metadata_page, "Metadata");
-
- _imp->overview_page.pack_start(_imp->overview_page_main);
- _imp->overview_page.pack_end(_imp->overview_page_buttons, Gtk::PACK_SHRINK);
-
- _imp->overview_page_main.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
- _imp->overview_page_main.add(_imp->overview);
-
- _imp->overview_page_buttons.set_border_width(5);
- _imp->overview_page_buttons.set_spacing(5);
- _imp->overview_page_buttons.set_layout(Gtk::BUTTONBOX_START);
- _imp->overview_page_buttons.add(_imp->queue_button);
- _imp->overview_page_buttons.add(_imp->uninstall_button);
-
- _imp->queue_button.signal_clicked().connect(sigc::mem_fun(this,
- &PackageInfo::_queue_button_clicked));
- _imp->queue_button.set_sensitive(false);
-}
-
-PackageInfo::~PackageInfo()
-{
-}
-
-void
-PackageInfo::populate(const QualifiedPackageName & n)
-{
- _imp->overview.populate(n);
- _imp->current_package = n;
- _imp->queue_button.set_sensitive(stringify(n) != "no-category/no-package");
-}
-
-void
-PackageInfo::_queue_button_clicked()
-{
- MainWindow::get_instance()->show_queue_page();
- MainWindow::get_instance()->queue_page()->add_target(stringify(_imp->current_package));
-}
-
diff --git a/src/clients/gtkpaludis/package_info.hh b/src/clients/gtkpaludis/package_info.hh
deleted file mode 100644
index 629e020..0000000
--- a/src/clients/gtkpaludis/package_info.hh
+++ /dev/null
@@ -1,44 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_PACKAGE_INFO_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_PACKAGE_INFO_HH 1
-
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-#include <gtkmm/notebook.h>
-
-namespace gtkpaludis
-{
- class PackageInfo :
- private paludis::PrivateImplementationPattern<PackageInfo>,
- public Gtk::Notebook
- {
- private:
- void _queue_button_clicked();
-
- public:
- PackageInfo();
- virtual ~PackageInfo();
-
- void populate(const paludis::QualifiedPackageName &);
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/package_overview.cc b/src/clients/gtkpaludis/package_overview.cc
deleted file mode 100644
index a162270..0000000
--- a/src/clients/gtkpaludis/package_overview.cc
+++ /dev/null
@@ -1,225 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "package_overview.hh"
-#include "paludis_thread.hh"
-#include "main_window.hh"
-
-#include <paludis/environments/default/default_environment.hh>
-#include <gtkmm/treeview.h>
-#include <gtkmm/treestore.h>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace
-{
- class Columns :
- public Gtk::TreeModel::ColumnRecord
- {
- public:
- Gtk::TreeModelColumn<Glib::ustring> col_left;
- Gtk::TreeModelColumn<Glib::ustring> col_right;
-
- Columns()
- {
- add(col_left);
- add(col_right);
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<PackageOverview>
- {
- PackageOverview * const overview;
- Columns columns;
- Glib::RefPtr<Gtk::TreeStore> model;
-
- Implementation(PackageOverview * const o) :
- overview(o),
- model(Gtk::TreeStore::create(columns))
- {
- }
-
- void set_model(const Glib::RefPtr<Gtk::TreeStore> & m)
- {
- model = m;
- overview->set_model(model);
- overview->expand_all();
- overview->columns_autosize();
- }
- };
-}
-
-PackageOverview::PackageOverview() :
- PrivateImplementationPattern<PackageOverview>(new Implementation<PackageOverview>(this))
-{
- set_headers_visible(false);
- set_model(_imp->model);
- append_column("Left", _imp->columns.col_left);
- append_column("Right", _imp->columns.col_right);
-}
-
-PackageOverview::~PackageOverview()
-{
-}
-
-namespace
-{
- std::string mask_reasons_to_letters(const MaskReasons & masks)
- {
- std::string reasons;
- for (MaskReason m(MaskReason(0)) ; m < last_mr ;
- m = MaskReason(static_cast<int>(m) + 1))
- {
- if (! masks.test(m))
- continue;
-
- switch (m)
- {
- case mr_keyword:
- reasons.append("K");
- break;
- case mr_user_mask:
- reasons.append("U");
- break;
- case mr_profile_mask:
- reasons.append("P");
- break;
- case mr_repository_mask:
- reasons.append("R");
- break;
- case mr_eapi:
- reasons.append("E");
- break;
- case mr_license:
- reasons.append("L");
- break;
- case mr_by_association:
- reasons.append("A");
- break;
- case last_mr:
- break;
- }
- }
-
- return reasons;
- }
-
- class Populate :
- public PaludisThread::Launchable
- {
- private:
- Implementation<PackageOverview> * const _imp;
- QualifiedPackageName _pkg;
-
- public:
- Populate(Implementation<PackageOverview> * const imp, const QualifiedPackageName & pkg) :
- _imp(imp),
- _pkg(pkg)
- {
- }
-
- virtual void operator() ();
- };
-
- void
- Populate::operator() ()
- {
- StatusBarMessage m1(this, "Querying package...");
-
- Glib::RefPtr<Gtk::TreeStore> model(Gtk::TreeStore::create(_imp->columns));
- std::map<RepositoryName, Gtk::TreeModel::iterator, RepositoryNameComparator> repository_rows;
-
- Gtk::TreeModel::Row top_row = *model->append();
- top_row[_imp->columns.col_left] = stringify(_pkg);
- top_row[_imp->columns.col_right] = "";
-
- Gtk::TreeModel::Row description_row = *model->append(top_row.children());
- description_row[_imp->columns.col_left] = "Description";
-
- Gtk::TreeModel::Row homepage_row = *model->append(top_row.children());
- homepage_row[_imp->columns.col_left] = "Homepage";
-
- Gtk::TreeModel::Row versions_row = *model->append(top_row.children());
- versions_row[_imp->columns.col_left] = "Versions";
- versions_row[_imp->columns.col_right] = "";
-
- std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(stringify(_pkg)));
- std::tr1::shared_ptr<const PackageDatabaseEntryCollection>
- entries(DefaultEnvironment::get_instance()->package_database()->query(
- *spec, is_any, qo_order_by_version)),
- preferred_entries(DefaultEnvironment::get_instance()->package_database()->query(
- *spec, is_installed_only, qo_order_by_version));
- if (preferred_entries->empty())
- preferred_entries = entries;
-
- {
- StatusBarMessage m2(this, "Querying package versions...");
-
- for (PackageDatabaseEntryCollection::Iterator i(entries->begin()), i_end(entries->end()) ;
- i != i_end ; ++i)
- {
- std::map<RepositoryName, Gtk::TreeModel::iterator, RepositoryNameComparator>::iterator
- r(repository_rows.find(i->repository));
- if (repository_rows.end() == r)
- {
- r = repository_rows.insert(std::make_pair(i->repository, model->append(versions_row.children()))).first;
- (*r->second)[_imp->columns.col_left] = stringify(i->repository);
- }
-
- Glib::ustring value((*r->second)[_imp->columns.col_right]);
- if (! value.empty())
- value.append(" ");
- value.append(stringify(i->version));
-
- std::string reasons(mask_reasons_to_letters(DefaultEnvironment::get_instance()->mask_reasons(*i)));
- if (! reasons.empty())
- value.append("(" + reasons + ")");
-
- (*r->second)[_imp->columns.col_right] = value;
- }
- }
-
- if (! (preferred_entries->empty()))
- {
- StatusBarMessage m2(this, "Querying package metadata...");
- std::tr1::shared_ptr<const VersionMetadata> metadata(DefaultEnvironment::get_instance()->package_database()->fetch_repository(
- preferred_entries->last()->repository)->version_metadata(
- preferred_entries->last()->name, preferred_entries->last()->version));
- homepage_row[_imp->columns.col_right] = metadata->homepage;
- description_row[_imp->columns.col_right] = metadata->description;
- }
-
- dispatch(sigc::bind<1>(sigc::mem_fun(_imp, &Implementation<PackageOverview>::set_model), model));
- }
-}
-
-void
-PackageOverview::populate(const QualifiedPackageName & name)
-{
- if (name == QualifiedPackageName("no-category/no-package"))
- _imp->set_model(Gtk::TreeStore::create(_imp->columns));
- else
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Populate>(new Populate(_imp.operator-> (), name)));
-}
-
diff --git a/src/clients/gtkpaludis/package_overview.hh b/src/clients/gtkpaludis/package_overview.hh
deleted file mode 100644
index 3f569e8..0000000
--- a/src/clients/gtkpaludis/package_overview.hh
+++ /dev/null
@@ -1,41 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_PACKAGE_OVERVIEW_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_PACKAGE_OVERVIEW_HH 1
-
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-#include <gtkmm/treeview.h>
-
-namespace gtkpaludis
-{
- class PackageOverview :
- public Gtk::TreeView,
- private paludis::PrivateImplementationPattern<PackageOverview>
- {
- public:
- PackageOverview();
- virtual ~PackageOverview();
-
- void populate(const paludis::QualifiedPackageName &);
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/packages_list.cc b/src/clients/gtkpaludis/packages_list.cc
deleted file mode 100644
index f985008..0000000
--- a/src/clients/gtkpaludis/packages_list.cc
+++ /dev/null
@@ -1,219 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "packages_list.hh"
-#include "paludis_thread.hh"
-#include "main_window.hh"
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/util/sr.hh>
-#include <paludis/util/compare.hh>
-
-#include <gtkmm/treeview.h>
-#include <gtkmm/liststore.h>
-#include <glibmm/dispatcher.h>
-#include <map>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace gtkpaludis
-{
-#include "packages_list-sr.hh"
-#include "packages_list-sr.cc"
-}
-
-namespace
-{
- class Columns :
- public Gtk::TreeModel::ColumnRecord
- {
- public:
- Gtk::TreeModelColumn<Glib::ustring> col_package_display;
- Gtk::TreeModelColumn<bool> col_is_installed;
- Gtk::TreeModelColumn<Glib::ustring> col_package_real;
- Gtk::TreeModelColumn<Glib::ustring> col_description;
-
- Columns()
- {
- add(col_package_display);
- add(col_is_installed);
- add(col_package_real);
- add(col_description);
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<PackagesList>
- {
- Columns columns;
- Glib::RefPtr<Gtk::ListStore> model;
- PackagesList * const list;
-
- sigc::signal<void> populated;
-
- Implementation(PackagesList * const l) :
- model(Gtk::ListStore::create(columns)),
- list(l)
- {
- }
-
- void add_packages(const std::map<QualifiedPackageName, PackagesListEntry> & s)
- {
- for (std::map<QualifiedPackageName, PackagesListEntry>::const_iterator n(s.begin()), n_end(s.end()) ;
- n != n_end ; ++n)
- {
- Gtk::TreeModel::Row row = *(model->append());
- row[columns.col_package_display] = stringify(n->first.package);
- row[columns.col_package_real] = stringify(n->first);
- row[columns.col_is_installed] = n->second.is_installed;
- row[columns.col_description] = n->second.description;
- }
-
- list->columns_autosize();
- }
- };
-}
-
-namespace
-{
-}
-
-PackagesList::PackagesList() :
- PrivateImplementationPattern<PackagesList>(new Implementation<PackagesList>(this))
-{
- set_model(_imp->model);
- append_column("Package", _imp->columns.col_package_display);
- append_column("I", _imp->columns.col_is_installed);
- append_column("Description", _imp->columns.col_description);
-}
-
-PackagesList::~PackagesList()
-{
-}
-
-namespace
-{
- class Populate :
- public PaludisThread::Launchable
- {
- private:
- Implementation<PackagesList> * const _list;
- CategoryNamePart _cat;
-
- public:
- Populate(Implementation<PackagesList> * const list, const CategoryNamePart & cat) :
- _list(list),
- _cat(cat)
- {
- }
-
- virtual void operator() ();
- };
-
- void
- Populate::operator() ()
- {
- std::map<QualifiedPackageName, PackagesListEntry> names;
-
- {
- StatusBarMessage m1(this, "Loading package names...");
-
- for (PackageDatabase::RepositoryIterator
- r(DefaultEnvironment::get_instance()->package_database()->begin_repositories()),
- r_end(DefaultEnvironment::get_instance()->package_database()->end_repositories()) ; r != r_end ; ++r)
- {
- StatusBarMessage m2(this, "Loading package names from '" + stringify((*r)->name()) + "'...");
-
- std::tr1::shared_ptr<const QualifiedPackageNameCollection> pkgs((*r)->package_names(_cat));
- for (QualifiedPackageNameCollection::Iterator p(pkgs->begin()), p_end(pkgs->end()) ;
- p != p_end ; ++p)
- names.insert(std::make_pair(*p, PackagesListEntry::create().description("").is_installed(false)));
- }
- }
-
- {
- StatusBarMessage m1(this, "Loading package descriptions...");
-
- for (std::map<QualifiedPackageName, PackagesListEntry>::iterator i(names.begin()), i_end(names.end()) ;
- i != i_end ; ++i)
- {
- bool is_installed(true);
-
- std::tr1::shared_ptr<const PackageDatabaseEntryCollection> results(DefaultEnvironment::get_instance()->package_database()->query(
- PackageDepSpec(i->first), is_installed_only, qo_order_by_version));
- if (results->empty())
- {
- is_installed = false;
- results = DefaultEnvironment::get_instance()->package_database()->query(
- PackageDepSpec(i->first), is_any, qo_order_by_version);
- }
- if (results->empty())
- continue;
-
- i->second.description = DefaultEnvironment::get_instance()->package_database()->fetch_repository(
- results->last()->repository)->version_metadata(results->last()->name,
- results->last()->version)->description;
- i->second.is_installed = is_installed;
- }
- }
-
- dispatch(sigc::bind<1>(sigc::mem_fun(_list, &Implementation<PackagesList>::add_packages), names));
- dispatch(sigc::mem_fun(_list->populated, &sigc::signal<void>::operator()));
- }
-}
-
-void
-PackagesList::clear_packages()
-{
- _imp->model->clear();
-}
-
-void
-PackagesList::populate(const CategoryNamePart & cat)
-{
- clear_packages();
- if (cat.data() != "no-category")
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Populate>(new Populate(_imp.operator-> (), cat)));
-}
-
-QualifiedPackageName
-PackagesList::current_package()
-{
- Gtk::TreeModel::iterator i(get_selection()->get_selected());
- if (i)
- return QualifiedPackageName(stringify((*i)[_imp->columns.col_package_real]));
- else
- return QualifiedPackageName("no-category/no-package");
-}
-
-sigc::signal<void> &
-PackagesList::populated()
-{
- return _imp->populated;
-}
-
-int
-PackagesList::number_of_packages()
-{
- return _imp->model->children().size();
-}
-
diff --git a/src/clients/gtkpaludis/packages_list.hh b/src/clients/gtkpaludis/packages_list.hh
deleted file mode 100644
index c794353..0000000
--- a/src/clients/gtkpaludis/packages_list.hh
+++ /dev/null
@@ -1,47 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_PACKAGES_LIST_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_PACKAGES_LIST_HH 1
-
-#include <gtkmm/treeview.h>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-
-namespace gtkpaludis
-{
- class PackagesList :
- public Gtk::TreeView,
- private paludis::PrivateImplementationPattern<PackagesList>
- {
- public:
- PackagesList();
- virtual ~PackagesList();
-
- void clear_packages();
- void populate(const paludis::CategoryNamePart &);
- sigc::signal<void> & populated();
-
- paludis::QualifiedPackageName current_package();
-
- int number_of_packages();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/packages_list.sr b/src/clients/gtkpaludis/packages_list.sr
deleted file mode 100644
index 4f6e4a6..0000000
--- a/src/clients/gtkpaludis/packages_list.sr
+++ /dev/null
@@ -1,6 +0,0 @@
-make_class_PackagesListEntry()
-{
- key description std::string
- key is_installed bool
- allow_named_args
-}
diff --git a/src/clients/gtkpaludis/packages_page.cc b/src/clients/gtkpaludis/packages_page.cc
deleted file mode 100644
index 48fd206..0000000
--- a/src/clients/gtkpaludis/packages_page.cc
+++ /dev/null
@@ -1,124 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "packages_page.hh"
-#include "categories_list.hh"
-#include "packages_list.hh"
-#include "package_info.hh"
-
-#include <gtkmm/button.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/separator.h>
-#include <gtkmm/stock.h>
-#include <gtkmm/box.h>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<PackagesPage>
- {
- Gtk::HBox packages_search;
- Gtk::Entry packages_search_entry;
- Gtk::Button packages_search_button;
- Gtk::HSeparator packages_search_button_sep;
-
- Gtk::ScrolledWindow categories_list_scroll;
- CategoriesList categories_list;
-
- Gtk::ScrolledWindow packages_list_scroll;
- PackagesList packages_list;
-
- PackageInfo package_info;
-
- Implementation() :
- packages_search_button(Gtk::Stock::FIND)
- {
- }
- };
-}
-
-PackagesPage::PackagesPage() :
- Gtk::Table(2, 3, false),
- PrivateImplementationPattern<PackagesPage>(new Implementation<PackagesPage>)
-{
- set_col_spacings(5);
- set_row_spacings(5);
- set_border_width(5);
-
- _imp->packages_search.pack_start(_imp->packages_search_entry, Gtk::PACK_EXPAND_WIDGET);
- _imp->packages_search.pack_start(_imp->packages_search_button_sep, Gtk::PACK_SHRINK, 5);
- _imp->packages_search.pack_end(_imp->packages_search_button, Gtk::PACK_SHRINK);
- _imp->packages_search_entry.set_width_chars(30);
- attach(_imp->packages_search, 0, 2, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions(0));
-
- _imp->categories_list_scroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
- _imp->categories_list_scroll.add(_imp->categories_list);
- attach(_imp->categories_list_scroll, 0, 1, 1, 2, Gtk::SHRINK, Gtk::FILL | Gtk::EXPAND);
-
- _imp->packages_list_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS);
- _imp->packages_list_scroll.add(_imp->packages_list);
- attach(_imp->packages_list_scroll, 1, 2, 1, 2);
-
- attach(_imp->package_info, 0, 2, 2, 3);
-
- _imp->categories_list.get_selection()->signal_changed().connect(sigc::mem_fun(this,
- &PackagesPage::_category_list_selection_changed));
- _imp->packages_list.get_selection()->signal_changed().connect(sigc::mem_fun(this,
- &PackagesPage::_package_list_selection_changed));
-}
-
-PackagesPage::~PackagesPage()
-{
-}
-
-void
-PackagesPage::populate()
-{
- _imp->categories_list.populate();
-}
-
-void
-PackagesPage::_category_list_selection_changed()
-{
- _imp->packages_list.populate(_imp->categories_list.current_category());
-}
-
-void
-PackagesPage::_package_list_selection_changed()
-{
- _imp->package_info.populate(_imp->packages_list.current_package());
-}
-
-PackagesList *
-PackagesPage::packages_list()
-{
- return &_imp->packages_list;
-}
-
-CategoriesList *
-PackagesPage::categories_list()
-{
- return &_imp->categories_list;
-}
-
diff --git a/src/clients/gtkpaludis/packages_page.hh b/src/clients/gtkpaludis/packages_page.hh
deleted file mode 100644
index 50cdbce..0000000
--- a/src/clients/gtkpaludis/packages_page.hh
+++ /dev/null
@@ -1,50 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_PACKAGES_PAGE_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_PACKAGES_PAGE_HH 1
-
-#include <gtkmm/table.h>
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace gtkpaludis
-{
- class PackagesList;
- class CategoriesList;
-
- class PackagesPage :
- public Gtk::Table,
- private paludis::PrivateImplementationPattern<PackagesPage>
- {
- private:
- void _package_list_selection_changed();
- void _category_list_selection_changed();
-
- public:
- PackagesPage();
- virtual ~PackagesPage();
-
- void populate();
-
- PackagesList * packages_list();
- CategoriesList * categories_list();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/paludis_thread.cc b/src/clients/gtkpaludis/paludis_thread.cc
deleted file mode 100644
index 925b237..0000000
--- a/src/clients/gtkpaludis/paludis_thread.cc
+++ /dev/null
@@ -1,162 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_thread.hh"
-#include "main_window.hh"
-#include <paludis/util/log.hh>
-#include <paludis/util/stringify.hh>
-#include <glibmm/thread.h>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<PaludisThread>
- {
- Glib::Dispatcher dispatcher;
- Glib::Mutex queue_mutex, single_mutex;
- std::deque<sigc::slot<void> > * queue;
-
- Implementation() :
- queue(new std::deque<sigc::slot<void> >)
- {
- }
-
- ~Implementation()
- {
- delete queue;
- }
- };
-}
-
-PaludisThread::PaludisThread() :
- PrivateImplementationPattern<PaludisThread>(new Implementation<PaludisThread>)
-{
- _imp->dispatcher.connect(sigc::mem_fun(this, &PaludisThread::_queue_run));
-}
-
-PaludisThread::~PaludisThread()
-{
-}
-
-PaludisThread::Launchable::Launchable()
-{
-}
-
-PaludisThread::Launchable::~Launchable()
-{
-}
-
-void
-PaludisThread::launch(std::tr1::shared_ptr<Launchable> l)
-{
- MainWindow::get_instance()->lock_controls();
- Glib::Thread::create(sigc::bind<1>(sigc::mem_fun(this, &PaludisThread::_thread_func), l), false);
-}
-
-void
-PaludisThread::Launchable::dispatch(const sigc::slot<void> & s)
-{
- PaludisThread::get_instance()->_queue_add(s);
-}
-
-void
-PaludisThread::_queue_add(const sigc::slot<void> & s)
-{
- {
- Glib::Mutex::Lock lock(_imp->queue_mutex);
- _imp->queue->push_back(s);
- }
- _imp->dispatcher();
-}
-
-void
-PaludisThread::_queue_run()
-{
- std::deque<sigc::slot<void> > * d(new std::deque<sigc::slot<void> >);
- {
- /* do as little as possible inside the mutex lock */
- Glib::Mutex::Lock lock(_imp->queue_mutex);
- std::swap(d, _imp->queue);
- }
-
- std::for_each(d->begin(), d->end(), std::mem_fun_ref(&sigc::slot<void>::operator()));
- delete d;
-}
-
-void
-PaludisThread::_thread_func(std::tr1::shared_ptr<PaludisThread::Launchable> l)
-{
- {
- Glib::Mutex::Lock lock(_imp->single_mutex);
- try
- {
- try
- {
- (*l)();
- }
- catch (const Exception &)
- {
- throw;
- }
- catch (const std::exception & e)
- {
- throw InternalError(PALUDIS_HERE, "Caught unexpected exception '" + stringify(e.what()) + "'");
- }
- }
- catch (const InternalError & e)
- {
- _queue_add(sigc::bind<std::string, std::string, bool>(
- sigc::mem_fun(MainWindow::get_instance(), &MainWindow::show_exception),
- stringify(e.what()), e.message(), true));
- }
- catch (const Exception & e)
- {
- _queue_add(sigc::bind<std::string, std::string, bool>(
- sigc::mem_fun(MainWindow::get_instance(), &MainWindow::show_exception),
- stringify(e.what()), e.message(), false));
- }
- }
- _queue_add(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::maybe_unlock_controls));
-}
-
-PaludisThread::Launchable::StatusBarMessage::StatusBarMessage(Launchable * const l, const std::string & s) :
- _l(l)
-{
- _l->dispatch(sigc::bind<1>(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::push_status), s));
-}
-
-PaludisThread::Launchable::StatusBarMessage::~StatusBarMessage()
-{
- _l->dispatch(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::pop_status));
-}
-
-bool
-PaludisThread::try_lock_unlock()
-{
- if (_imp->single_mutex.trylock())
- {
- _imp->single_mutex.unlock();
- return true;
- }
- return false;
-}
-
diff --git a/src/clients/gtkpaludis/paludis_thread.hh b/src/clients/gtkpaludis/paludis_thread.hh
deleted file mode 100644
index 14d0830..0000000
--- a/src/clients/gtkpaludis/paludis_thread.hh
+++ /dev/null
@@ -1,81 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_PALUDIS_THREAD_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_PALUDIS_THREAD_HH 1
-
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <glibmm/dispatcher.h>
-#include <sigc++/trackable.h>
-#include <sigc++/slot.h>
-#include <tr1/memory>
-
-namespace gtkpaludis
-{
- class PaludisThread :
- public paludis::InstantiationPolicy<PaludisThread, paludis::instantiation_method::SingletonTag>,
- private paludis::PrivateImplementationPattern<PaludisThread>,
- public sigc::trackable
- {
- friend class paludis::InstantiationPolicy<PaludisThread, paludis::instantiation_method::SingletonTag>;
-
- public:
- class Launchable :
- private paludis::InstantiationPolicy<Launchable, paludis::instantiation_method::NonCopyableTag>
- {
- friend class PaludisThread;
-
- protected:
- Launchable();
-
- public:
- void dispatch(const sigc::slot<void> &);
-
- virtual ~Launchable();
- virtual void operator() () = 0;
-
- class StatusBarMessage
- {
- private:
- Launchable * const _l;
-
- public:
- StatusBarMessage(Launchable * const, const std::string &);
- ~StatusBarMessage();
- };
- };
-
- friend class Launchable;
-
- private:
- PaludisThread();
- virtual ~PaludisThread();
-
- void _queue_add(const sigc::slot<void> &);
- void _queue_run();
- void _thread_func(std::tr1::shared_ptr<Launchable>);
-
- public:
- void launch(std::tr1::shared_ptr<Launchable>);
- bool try_lock_unlock();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/prod-x-server.cc b/src/clients/gtkpaludis/prod-x-server.cc
deleted file mode 100644
index ba704a7..0000000
--- a/src/clients/gtkpaludis/prod-x-server.cc
+++ /dev/null
@@ -1,25 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xos.h>
-#include <cstdlib>
-#include <iostream>
-
-int main(int, char *[])
-{
- Display * display(XOpenDisplay(0));
- if (display)
- {
- std::cerr << "X server is available" << std::endl;
- XCloseDisplay(display);
- return EXIT_SUCCESS;
- }
- else
- {
- std::cerr << "X server is not available" << std::endl;
- return EXIT_FAILURE;
- }
-}
-
-
diff --git a/src/clients/gtkpaludis/queue_list.cc b/src/clients/gtkpaludis/queue_list.cc
deleted file mode 100644
index 5412dca..0000000
--- a/src/clients/gtkpaludis/queue_list.cc
+++ /dev/null
@@ -1,398 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "queue_list.hh"
-#include "queue_page.hh"
-#include "main_window.hh"
-#include "install.hh"
-#include "paludis_thread.hh"
-
-#include <gtkmm/liststore.h>
-#include <gtkmm/stock.h>
-#include <gdkmm/pixbuf.h>
-
-#include <paludis/util/stringify.hh>
-#include <paludis/util/tokeniser.hh>
-#include <paludis/util/log.hh>
-#include <paludis/tasks/exceptions.hh>
-#include <paludis/environments/default/default_environment.hh>
-
-#include <list>
-#include <set>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace
-{
- class Columns :
- public Gtk::TreeModel::ColumnRecord
- {
- public:
- Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > col_icon;
- Gtk::TreeModelColumn<Glib::ustring> col_left;
- Gtk::TreeModelColumn<Glib::ustring> col_right;
-
- Columns()
- {
- add(col_icon);
- add(col_left);
- add(col_right);
- }
- };
-
- template <typename T_>
- std::string
- pango_colour(const std::string & c, const T_ & s)
- {
- return "<span foreground=\"" + c + "\">" + stringify(s) + "</span>";
- }
-
- std::string::size_type
- use_expand_delim_pos(const UseFlagName & u, const std::tr1::shared_ptr<const UseFlagNameCollection> c)
- {
- for (UseFlagNameCollection::Iterator i(c->begin()), i_end(c->end()) ; i != i_end ; ++i)
- if (0 == u.data().compare(0, i->data().length(), i->data(), 0, i->data().length()))
- return i->data().length();
- return std::string::npos;
- }
-
- void
- add_use_rows(Glib::RefPtr<Gtk::TreeStore> & model,
- Gtk::TreeModel::Row & row,
- Gtk::TreeModelColumn<Glib::ustring> & col_left,
- Gtk::TreeModelColumn<Glib::ustring> & col_right,
- const Environment * const env, const PackageDatabaseEntry & p,
- std::tr1::shared_ptr<const VersionMetadata> metadata, const PackageDatabaseEntry * const other_p)
- {
- static const std::string cl_flag_on("#00cc00");
- static const std::string cl_flag_off("#cc0000");
-
- if (metadata->ebuild_interface)
- {
- std::string use_expand_string;
- UseFlagName expand_name("OFTEN_NOT_BEEN_ON_BOATS"), expand_value("MONKEY");
-
- const RepositoryUseInterface * const use_interface(
- env->package_database()->
- fetch_repository(p.repository)->use_interface);
- std::set<UseFlagName> iuse;
- WhitespaceTokeniser::get_instance()->tokenise(
- metadata->ebuild_interface->iuse,
- create_inserter<UseFlagName>(std::inserter(iuse, iuse.end())));
-
- /* display normal use flags first */
- std::string use_string;
- for (std::set<UseFlagName>::const_iterator i(iuse.begin()), i_end(iuse.end()) ;
- i != i_end ; ++i)
- {
- if (std::string::npos != use_expand_delim_pos(*i, use_interface->use_expand_prefixes()))
- continue;
-
- if (! use_string.empty())
- use_string.append(" ");
-
- if (env->query_use(*i, &p))
- {
- if (use_interface && use_interface->query_use_force(*i, &p))
- use_string.append(pango_colour(cl_flag_on, "(" + stringify(*i) + ")"));
- else
- use_string.append(pango_colour(cl_flag_on, *i));
- }
- else
- {
- if (use_interface && use_interface->query_use_mask(*i, &p))
- use_string.append(pango_colour(cl_flag_off, "(-" + stringify(*i) + ")"));
- else
- use_string.append(pango_colour(cl_flag_off, "-" + stringify(*i)));
- }
-
- if (other_p)
- if (env->query_use(*i, &p) != env->query_use(*i, other_p))
- use_string.append("*");
- }
-
- if (! use_string.empty())
- {
- Gtk::TreeModel::Row use_row = *(model->append(row->children()));
- use_row[col_left] = "USE:";
- use_row[col_right] = use_string;
- }
-
- /* now display expand flags */
- UseFlagName old_expand_name("OFTEN_NOT_BEEN_ON_BOATS");
- for (std::set<UseFlagName>::const_iterator i(iuse.begin()), i_end(iuse.end()) ;
- i != i_end ; ++i)
- {
- std::string::size_type delim_pos;
- if (std::string::npos == ((delim_pos = use_expand_delim_pos(*i,
- use_interface->use_expand_prefixes()))))
- continue;
- if (use_interface->use_expand_hidden_prefixes()->count(UseFlagName(i->data().substr(
- 0, delim_pos))))
- continue;
-
- expand_name = UseFlagName(i->data().substr(0, delim_pos));
- expand_value = UseFlagName(i->data().substr(delim_pos + 1));
-
- if (expand_name != old_expand_name)
- {
- if (! use_expand_string.empty())
- {
- Gtk::TreeModel::Row use_row = *(model->append(row->children()));
- use_row[col_left] = stringify(old_expand_name) + ":";
- use_row[col_right] = use_expand_string;
- }
-
- old_expand_name = expand_name;
- use_expand_string = "";
- }
-
- if (! use_expand_string.empty())
- use_expand_string.append(" ");
-
- if (env->query_use(*i, &p))
- {
- if (use_interface && use_interface->query_use_force(*i, &p))
- use_expand_string.append(pango_colour(cl_flag_on, "(" + stringify(expand_value) + ")"));
- else
- use_expand_string.append(pango_colour(cl_flag_on, expand_value));
- }
- else
- {
- if (use_interface && use_interface->query_use_mask(*i, &p))
- use_expand_string.append(pango_colour(cl_flag_off, "(-" + stringify(expand_value) + ")"));
- else
- use_expand_string.append(pango_colour(cl_flag_off, "-" + stringify(expand_value)));
- }
-
- if (other_p)
- if (env->query_use(*i, &p) != env->query_use(*i, other_p))
- use_expand_string.append("*");
- }
-
- if (! use_expand_string.empty())
- {
- Gtk::TreeModel::Row use_row = *(model->append(row->children()));
- use_row[col_left] = stringify(expand_name) + ":";
- use_row[col_right] = use_expand_string;
- }
- }
-
- }
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<QueueList>
- {
- QueuePage * const page;
-
- Columns columns;
- Glib::RefPtr<Gtk::TreeStore> model;
- OurInstallTask install_task;
- bool installed_signal;
- Glib::RefPtr<Gdk::Pixbuf> target_icon;
-
- Implementation(QueuePage * const p) :
- page(p),
- model(Gtk::TreeStore::create(columns)),
- installed_signal(false),
- target_icon(page->render_icon(Gtk::Stock::MISSING_IMAGE, Gtk::ICON_SIZE_MENU))
- {
- }
- };
-}
-
-QueueList::QueueList(QueuePage * const page) :
- PrivateImplementationPattern<QueueList>(new Implementation<QueueList>(page))
-{
- set_model(_imp->model);
-}
-
-QueueList::~QueueList()
-{
-}
-
-void
-QueueList::clear()
-{
- _imp->install_task.clear();
- invalidate();
-}
-
-void
-QueueList::add_target(const std::string & s)
-{
- try
- {
- _imp->install_task.add_target(s);
- invalidate();
- }
- catch (const HadBothPackageAndSetTargets &)
- {
- MainWindow::get_instance()->show_error_dialog("Cannot add target '" + s + "'",
- "Cannot add target '" + s + "' because the queue already includes package targets. Package "
- "and set targets cannot both be specified in the same transaction.");
- }
- catch (const MultipleSetTargetsSpecified &)
- {
- MainWindow::get_instance()->show_error_dialog("Cannot add target '" + s + "'",
- "Cannot add target '" + s + "' because the queue already includes a set target. Multiple "
- "set targets cannot be specified in the same transaction.");
- }
-}
-
-void
-QueueList::invalidate()
-{
- _imp->page->set_queue_list_calculated(false);
- remove_all_columns();
- append_column("", _imp->columns.col_icon);
- append_column("Target", _imp->columns.col_left);
-
- Glib::RefPtr<Gtk::TreeStore> new_model(Gtk::TreeStore::create(_imp->columns));
-
- for (InstallTask::TargetsIterator i(_imp->install_task.begin_targets()),
- i_end(_imp->install_task.end_targets()) ; i != i_end ; ++i)
- {
- Gtk::TreeModel::Row row = *(new_model->append());
- row[_imp->columns.col_icon] = _imp->target_icon;
- row[_imp->columns.col_left] = stringify(*i);
- }
-
- _imp->model.swap(new_model);
- set_model(_imp->model);
-}
-
-namespace gtkpaludis
-{
- class QueueList::Populate :
- public PaludisThread::Launchable,
- public OurInstallTask::Callbacks
- {
- private:
- QueueList * const _q;
- Glib::RefPtr<Gtk::TreeStore> _model;
-
- public:
- Populate(QueueList * const q, Glib::RefPtr<Gtk::TreeStore> model) :
- _q(q),
- _model(model)
- {
- }
-
- virtual void operator() ();
- virtual void display_entry(const paludis::DepListEntry & e);
- };
-}
-
-void
-QueueList::Populate::operator() ()
-{
- StatusBarMessage m1(this, "Building dependency list...");
-
- _q->_imp->install_task.set_pretend(true);
- _q->_imp->install_task.execute(this);
-
- dispatch(sigc::bind<1>(sigc::mem_fun(_q, &QueueList::set_model_show_dep_columns), _model));
-}
-
-void
-QueueList::Populate::display_entry(const paludis::DepListEntry & e)
-{
- if (e.kind != dlk_package)
- return;
-
- Gtk::TreeModel::Row row = *(_model->append());
-
- row[_q->_imp->columns.col_icon] = _q->_imp->target_icon;
-
- std::string left;
- if (e.package.repository == DefaultEnvironment::get_instance()->package_database()->favourite_repository())
- left = stringify(e.package.name);
- else
- left = stringify(e.package.name) + "::" + stringify(e.package.repository);
-
- if (e.metadata->slot != SlotName("0"))
- left.append(" :" + pango_colour("#0000cc", stringify(e.metadata->slot)));
-
- row[_q->_imp->columns.col_left] = left;
-
- std::tr1::shared_ptr<PackageDatabaseEntryCollection> existing(DefaultEnvironment::get_instance()->package_database()->
- query(PackageDepSpec(e.package.name), is_installed_only, qo_order_by_version));
-
- std::string right = stringify(e.package.version);
-
- if (existing->empty())
- right.append(" [N]");
- else
- {
- existing = DefaultEnvironment::get_instance()->package_database()->query(PackageDepSpec(
- stringify(e.package.name) + ":" + stringify(e.metadata->slot)),
- is_installed_only, qo_order_by_version);
- if (existing->empty())
- right.append(" [S]");
- else if (existing->last()->version < e.package.version)
- right.append(" [U " + stringify(existing->last()->version) + "]");
- else if (existing->last()->version > e.package.version)
- right.append(" [D " + stringify(existing->last()->version) + "]");
- else
- right.append(" [R]");
- }
- row[_q->_imp->columns.col_right] = right;
-
- add_use_rows(_model, row, _q->_imp->columns.col_left, _q->_imp->columns.col_right,
- DefaultEnvironment::get_instance(), e.package, e.metadata,
- existing->empty() ? 0 : &*existing->last());
-}
-
-void
-QueueList::calculate()
-{
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Populate>(new Populate(this,
- Gtk::TreeStore::create(_imp->columns))));
-}
-
-void
-QueueList::set_model_show_dep_columns(Glib::RefPtr<Gtk::TreeStore> new_model)
-{
- remove_all_columns();
- append_column("", _imp->columns.col_icon);
- {
- Gtk::CellRendererText * const renderer(new Gtk::CellRendererText);
-
- Gtk::TreeViewColumn * column(new Gtk::TreeViewColumn("Package", *Gtk::manage(renderer)));
- column->add_attribute(renderer->property_markup(), _imp->columns.col_left);
- append_column(*column);
- set_expander_column(*column);
-
- column = new Gtk::TreeViewColumn("Details", *renderer);
- column->add_attribute(renderer->property_markup(), _imp->columns.col_right);
- append_column(*column);
- }
-
- _imp->model.swap(new_model);
- set_model(_imp->model);
- expand_all();
-
- _imp->page->set_queue_list_calculated(true);
-}
-
diff --git a/src/clients/gtkpaludis/queue_list.hh b/src/clients/gtkpaludis/queue_list.hh
deleted file mode 100644
index a6d068a..0000000
--- a/src/clients/gtkpaludis/queue_list.hh
+++ /dev/null
@@ -1,54 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_QUEUE_LIST_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_QUEUE_LIST_HH 1
-
-#include <gtkmm/treeview.h>
-#include <gtkmm/treestore.h>
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace gtkpaludis
-{
- class QueuePage;
-
- class QueueList :
- public Gtk::TreeView,
- private paludis::PrivateImplementationPattern<QueueList>
- {
- class Populate;
- friend class Populate;
-
- private:
- void _sensitive_changed();
-
- public:
- QueueList(QueuePage * const);
- virtual ~QueueList();
-
- void clear();
- void invalidate();
- void calculate();
- void add_target(const std::string &);
-
- void set_model_show_dep_columns(Glib::RefPtr<Gtk::TreeStore>);
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/queue_options.cc b/src/clients/gtkpaludis/queue_options.cc
deleted file mode 100644
index b48d3b7..0000000
--- a/src/clients/gtkpaludis/queue_options.cc
+++ /dev/null
@@ -1,198 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "queue_options.hh"
-#include <gtkmm/table.h>
-#include <gtkmm/checkbutton.h>
-#include <gtkmm/label.h>
-#include <gtkmm/comboboxtext.h>
-#include <gtkmm/frame.h>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<QueueOptions>
- {
- Gtk::Table basic_options_page;
- Gtk::CheckButton preserve_world_box;
- Gtk::CheckButton fetch_only_box;
- Gtk::Label reinstall_label;
- Gtk::ComboBoxText reinstall_box;
- Gtk::Label upgrade_label;
- Gtk::ComboBoxText upgrade_box;
- Gtk::Label circular_label;
- Gtk::ComboBoxText circular_box;
-
- Gtk::Table dependencies_page;
-
- Gtk::Frame installed_deps_frame;
- Gtk::Table installed_deps_table;
- Gtk::Label installed_deps_pre_label;
- Gtk::Label installed_deps_runtime_label;
- Gtk::Label installed_deps_post_label;
- Gtk::ComboBoxText installed_deps_pre_box;
- Gtk::ComboBoxText installed_deps_runtime_box;
- Gtk::ComboBoxText installed_deps_post_box;
-
- Gtk::Frame uninstalled_deps_frame;
- Gtk::Table uninstalled_deps_table;
- Gtk::Label uninstalled_deps_pre_label;
- Gtk::Label uninstalled_deps_runtime_label;
- Gtk::Label uninstalled_deps_post_label;
- Gtk::ComboBoxText uninstalled_deps_pre_box;
- Gtk::ComboBoxText uninstalled_deps_runtime_box;
- Gtk::ComboBoxText uninstalled_deps_post_box;
-
- Implementation() :
- basic_options_page(3, 3, false),
- preserve_world_box("Preserve world"),
- fetch_only_box("Fetch only"),
- reinstall_label("Reinstall:", Gtk::ALIGN_LEFT),
- upgrade_label("Upgrade:", Gtk::ALIGN_LEFT),
- circular_label("Circular dependencies:", Gtk::ALIGN_LEFT),
- dependencies_page(2, 1, false),
- installed_deps_frame("Installed packages"),
- installed_deps_table(2, 3, false),
- installed_deps_pre_label("Pre:", Gtk::ALIGN_LEFT),
- installed_deps_runtime_label("Runtime:", Gtk::ALIGN_LEFT),
- installed_deps_post_label("Post:", Gtk::ALIGN_LEFT),
- uninstalled_deps_frame("Uninstalled packages"),
- uninstalled_deps_table(2, 3, false),
- uninstalled_deps_pre_label("Pre:", Gtk::ALIGN_LEFT),
- uninstalled_deps_runtime_label("Runtime:", Gtk::ALIGN_LEFT),
- uninstalled_deps_post_label("Post:", Gtk::ALIGN_LEFT)
- {
- }
- };
-}
-
-namespace
-{
- void
- populate_deps_box(Gtk::ComboBoxText & box, const std::string & def)
- {
- box.append_text("Pre");
- box.append_text("Pre or post");
- box.append_text("Post");
- box.append_text("Try post");
- box.append_text("Discard");
- box.set_active_text(def);
- }
-}
-
-QueueOptions::QueueOptions() :
- PrivateImplementationPattern<QueueOptions>(new Implementation<QueueOptions>)
-{
- append_page(_imp->basic_options_page, "Basic Options");
-
- _imp->basic_options_page.set_col_spacings(5);
- _imp->basic_options_page.set_row_spacings(5);
- _imp->basic_options_page.set_border_width(5);
-
- _imp->basic_options_page.attach(_imp->preserve_world_box, 0, 1, 0, 1,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->basic_options_page.attach(_imp->fetch_only_box, 0, 1, 1, 2,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
-
- _imp->basic_options_page.attach(_imp->reinstall_label, 1, 2, 0, 1,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->basic_options_page.attach(_imp->upgrade_label, 1, 2, 1, 2,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->basic_options_page.attach(_imp->circular_label, 1, 2, 2, 3,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->basic_options_page.attach(_imp->reinstall_box, 2, 3, 0, 1,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->basic_options_page.attach(_imp->upgrade_box, 2, 3, 1, 2,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->basic_options_page.attach(_imp->circular_box, 2, 3, 2, 3,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
-
- _imp->reinstall_box.append_text("Never");
- _imp->reinstall_box.append_text("Always");
- _imp->reinstall_box.append_text("If USE changed");
- _imp->reinstall_box.set_active_text("Never");
-
- _imp->circular_box.append_text("Error");
- _imp->circular_box.append_text("Discard");
- _imp->circular_box.set_active_text("Error");
-
- _imp->upgrade_box.append_text("Always");
- _imp->upgrade_box.append_text("As needed");
- _imp->upgrade_box.set_active_text("Always");
-
- append_page(_imp->dependencies_page, "Dependencies");
- _imp->dependencies_page.attach(_imp->uninstalled_deps_frame, 0, 1, 0, 1);
- _imp->dependencies_page.attach(_imp->installed_deps_frame, 1, 2, 0, 1);
-
- _imp->uninstalled_deps_frame.add(_imp->uninstalled_deps_table);
- _imp->uninstalled_deps_frame.set_border_width(5);
- _imp->installed_deps_frame.add(_imp->installed_deps_table);
- _imp->installed_deps_frame.set_border_width(5);
-
- _imp->uninstalled_deps_table.set_row_spacings(5);
- _imp->uninstalled_deps_table.set_col_spacings(5);
- _imp->uninstalled_deps_table.set_border_width(5);
- _imp->installed_deps_table.set_row_spacings(5);
- _imp->installed_deps_table.set_col_spacings(5);
- _imp->installed_deps_table.set_border_width(5);
-
- _imp->uninstalled_deps_table.attach(_imp->uninstalled_deps_pre_label, 0, 1, 0, 1,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->uninstalled_deps_table.attach(_imp->uninstalled_deps_runtime_label, 0, 1, 1, 2,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->uninstalled_deps_table.attach(_imp->uninstalled_deps_post_label, 0, 1, 2, 3,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
-
- _imp->installed_deps_table.attach(_imp->installed_deps_pre_label, 0, 1, 0, 1,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->installed_deps_table.attach(_imp->installed_deps_runtime_label, 0, 1, 1, 2,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->installed_deps_table.attach(_imp->installed_deps_post_label, 0, 1, 2, 3,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
-
- _imp->uninstalled_deps_table.attach(_imp->uninstalled_deps_pre_box, 1, 2, 0, 1,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->uninstalled_deps_table.attach(_imp->uninstalled_deps_runtime_box, 1, 2, 1, 2,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->uninstalled_deps_table.attach(_imp->uninstalled_deps_post_box, 1, 2, 2, 3,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
-
- _imp->installed_deps_table.attach(_imp->installed_deps_pre_box, 1, 2, 0, 1,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->installed_deps_table.attach(_imp->installed_deps_runtime_box, 1, 2, 1, 2,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
- _imp->installed_deps_table.attach(_imp->installed_deps_post_box, 1, 2, 2, 3,
- Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(0));
-
- populate_deps_box(_imp->installed_deps_pre_box, "Discard");
- populate_deps_box(_imp->installed_deps_runtime_box, "Try post");
- populate_deps_box(_imp->installed_deps_post_box, "Try post");
-
- populate_deps_box(_imp->uninstalled_deps_pre_box, "Pre");
- populate_deps_box(_imp->uninstalled_deps_runtime_box, "Pre or post");
- populate_deps_box(_imp->uninstalled_deps_post_box, "Post");
-}
-
-QueueOptions::~QueueOptions()
-{
-}
-
diff --git a/src/clients/gtkpaludis/queue_page.cc b/src/clients/gtkpaludis/queue_page.cc
deleted file mode 100644
index 8f0c1c9..0000000
--- a/src/clients/gtkpaludis/queue_page.cc
+++ /dev/null
@@ -1,123 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "queue_page.hh"
-#include "queue_list.hh"
-#include "queue_options.hh"
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<QueuePage>
- {
- Gtk::ScrolledWindow queue_list_scroll;
- QueueList queue_list;
- QueueOptions queue_options;
-
- Gtk::VButtonBox queue_buttons;
- Gtk::Button recalculate_button;
- Gtk::Button install_button;
- Gtk::Button clear_button;
- Gtk::Button why_button;
-
- Implementation(QueuePage * const page) :
- queue_list(page),
- recalculate_button("Recalculate"),
- install_button("Install"),
- clear_button("Clear"),
- why_button("Why?")
- {
- }
- };
-}
-
-QueuePage::QueuePage() :
- Gtk::Table(2, 2, false),
- PrivateImplementationPattern<QueuePage>(new Implementation<QueuePage>(this))
-{
- _imp->queue_list_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
- _imp->queue_list_scroll.add(_imp->queue_list);
- attach(_imp->queue_list_scroll, 0, 2, 0, 1);
-
- attach(_imp->queue_options, 0, 1, 1, 2, Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions(0));
-
- _imp->queue_buttons.set_border_width(5);
- _imp->queue_buttons.set_spacing(5);
- _imp->queue_buttons.set_layout(Gtk::BUTTONBOX_START);
- _imp->queue_buttons.add(_imp->recalculate_button);
- _imp->queue_buttons.add(_imp->install_button);
- _imp->queue_buttons.add(_imp->clear_button);
- _imp->queue_buttons.add(_imp->why_button);
- attach(_imp->queue_buttons, 1, 2, 1, 2, Gtk::AttachOptions(0), Gtk::AttachOptions(0));
-
- _imp->queue_list.invalidate();
-
- _imp->recalculate_button.signal_clicked().connect(sigc::mem_fun(this,
- &QueuePage::_recalculate_button_clicked));
- _imp->clear_button.signal_clicked().connect(sigc::mem_fun(this,
- &QueuePage::_clear_button_clicked));
-}
-
-QueuePage::~QueuePage()
-{
-}
-
-void
-QueuePage::clear()
-{
- _imp->queue_list.clear();
-}
-
-void
-QueuePage::add_target(const std::string & s)
-{
- _imp->queue_list.add_target(s);
-}
-
-void
-QueuePage::set_queue_list_calculated(bool b)
-{
- _imp->install_button.set_sensitive(b);
- _imp->recalculate_button.set_sensitive(! b);
-}
-
-void
-QueuePage::_recalculate_button_clicked()
-{
- _imp->queue_list.calculate();
-}
-
-void
-QueuePage::recalculate()
-{
- _imp->queue_list.calculate();
-}
-
-void
-QueuePage::_clear_button_clicked()
-{
- clear();
-}
-
diff --git a/src/clients/gtkpaludis/queue_page.hh b/src/clients/gtkpaludis/queue_page.hh
deleted file mode 100644
index 6e0bda9..0000000
--- a/src/clients/gtkpaludis/queue_page.hh
+++ /dev/null
@@ -1,47 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_QUEUE_PAGE_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_QUEUE_PAGE_HH 1
-
-#include <gtkmm/table.h>
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace gtkpaludis
-{
- class QueuePage :
- public Gtk::Table,
- private paludis::PrivateImplementationPattern<QueuePage>
- {
- private:
- void _recalculate_button_clicked();
- void _clear_button_clicked();
-
- public:
- QueuePage();
- virtual ~QueuePage();
-
- void clear();
- void add_target(const std::string &);
- void recalculate();
- void set_queue_list_calculated(bool);
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/quit_TEST.py b/src/clients/gtkpaludis/quit_TEST.py
deleted file mode 100755
index 9b23acb..0000000
--- a/src/clients/gtkpaludis/quit_TEST.py
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env python
-
-import os
-from dogtail.procedural import *
-import dogtail.utils
-
-os.environ["PALUDIS_HOME"] = os.getcwd() + "/quit_TEST_dir/home"
-
-dogtail.utils.run('./gtkpaludis', appName = 'lt-gtkpaludis')
-focus.application('lt-gtkpaludis')
-click('Quit')
-
-
diff --git a/src/clients/gtkpaludis/quit_TEST_cleanup.sh b/src/clients/gtkpaludis/quit_TEST_cleanup.sh
deleted file mode 100755
index 253db39..0000000
--- a/src/clients/gtkpaludis/quit_TEST_cleanup.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-if [ -d quit_TEST_dir ] ; then
- rm -fr quit_TEST_dir
-else
- true
-fi
-
-
-
-
-
-
diff --git a/src/clients/gtkpaludis/quit_TEST_setup.sh b/src/clients/gtkpaludis/quit_TEST_setup.sh
deleted file mode 100755
index a75f6a0..0000000
--- a/src/clients/gtkpaludis/quit_TEST_setup.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-mkdir quit_TEST_dir || exit 1
-cd quit_TEST_dir || exit 1
-
-mkdir -p home/.paludis/repositories
-
-cat <<END > home/.paludis/repositories/testrepo.conf
-location = `pwd`/testrepo
-format = ebuild
-names_cache = /var/empty
-cache = /var/empty
-profiles = \${location}/profiles/testprofile
-END
-
-cat <<END > home/.paludis/keywords.conf
-* test
-~foo/bar-1 ~test
-END
-
-cat <<END > home/.paludis/use.conf
-* enabled
-~foo/bar-1 sometimes_enabled
-END
-
-cat <<END > home/.paludis/licenses.conf
-* *
-END
-
-mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
-cd testrepo || exit 1
-echo "testrepo" > profiles/repo_name || exit 1
-cat <<END > profiles/categories || exit 1
-foo
-END
-cat <<END > profiles/testprofile/make.defaults
-ARCH=test
-USERLAND=test
-KERNEL=test
-END
-cat <<END > profiles/profiles.desc
-test testprofile stable
-END
-
-cat <<"END" > foo/bar/bar-1.0.ebuild || exit 1
-DESCRIPTION="Test package"
-HOMEPAGE="http://paludis.pioto.org/"
-SRC_URI=""
-SLOT="0"
-IUSE=""
-LICENSE="GPL-2"
-KEYWORDS="test"
-END
-
-cat <<"END" > foo/bar/bar-2.0.ebuild || exit 1
-DESCRIPTION="Test package"
-HOMEPAGE="http://paludis.pioto.org/"
-SRC_URI=""
-SLOT="0"
-IUSE=""
-LICENSE="GPL-2"
-KEYWORDS="~test"
-END
-cd ..
-
-
-
-
diff --git a/src/clients/gtkpaludis/repositories_list.cc b/src/clients/gtkpaludis/repositories_list.cc
deleted file mode 100644
index 2abc1cb..0000000
--- a/src/clients/gtkpaludis/repositories_list.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "repositories_list.hh"
-#include "paludis_thread.hh"
-#include "main_window.hh"
-#include <paludis/environments/default/default_environment.hh>
-
-#include <gtkmm/treeview.h>
-#include <gtkmm/liststore.h>
-#include <glibmm/dispatcher.h>
-#include <set>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace
-{
- class Columns :
- public Gtk::TreeModel::ColumnRecord
- {
- public:
- Gtk::TreeModelColumn<Glib::ustring> col_repository;
-
- Columns()
- {
- add(col_repository);
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<RepositoriesList>
- {
- Columns columns;
- Glib::RefPtr<Gtk::ListStore> model;
-
- Implementation() :
- model(Gtk::ListStore::create(columns))
- {
- }
-
- void add_repositories(const std::set<RepositoryName, RepositoryNameComparator> & c)
- {
- for (std::set<RepositoryName>::const_iterator n(c.begin()), n_end(c.end()) ; n != n_end ; ++n)
- {
- Gtk::TreeModel::Row row = *(model->append());
- row[columns.col_repository] = stringify(*n);
- }
- }
- };
-}
-
-namespace
-{
- class Populate :
- public PaludisThread::Launchable
- {
- private:
- Implementation<RepositoriesList> * const _imp;
-
- public:
- Populate(Implementation<RepositoriesList> * const list) :
- _imp(list)
- {
- }
-
- virtual void operator() ();
- };
-
- void
- Populate::operator() ()
- {
- std::set<RepositoryName, RepositoryNameComparator> names;
-
- StatusBarMessage m1(this, "Loading repository names...");
-
- for (PackageDatabase::RepositoryIterator
- r(DefaultEnvironment::get_instance()->package_database()->begin_repositories()),
- r_end(DefaultEnvironment::get_instance()->package_database()->end_repositories()) ; r != r_end ; ++r)
- names.insert((*r)->name());
-
- dispatch(sigc::bind<1>(sigc::mem_fun(_imp, &Implementation<RepositoriesList>::add_repositories), names));
- }
-}
-
-RepositoriesList::RepositoriesList() :
- PrivateImplementationPattern<RepositoriesList>(new Implementation<RepositoriesList>)
-{
- set_model(_imp->model);
- append_column("Repository", _imp->columns.col_repository);
-}
-
-RepositoriesList::~RepositoriesList()
-{
-}
-
-void
-RepositoriesList::populate()
-{
- _imp->model->clear();
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Populate>(new Populate(_imp.operator-> ())));
-}
-
-RepositoryName
-RepositoriesList::current_repository()
-{
- Gtk::TreeModel::iterator i(get_selection()->get_selected());
- if (i)
- return RepositoryName(stringify((*i)[_imp->columns.col_repository]));
- else
- return RepositoryName("no-repository");
-}
-
diff --git a/src/clients/gtkpaludis/repositories_list.hh b/src/clients/gtkpaludis/repositories_list.hh
deleted file mode 100644
index 8ddc3c4..0000000
--- a/src/clients/gtkpaludis/repositories_list.hh
+++ /dev/null
@@ -1,43 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_REPOSITORIES_LIST_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_REPOSITORIES_LIST_HH 1
-
-#include <gtkmm/treeview.h>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-
-namespace gtkpaludis
-{
- class RepositoriesList :
- public Gtk::TreeView,
- private paludis::PrivateImplementationPattern<RepositoriesList>
- {
- public:
- RepositoriesList();
- virtual ~RepositoriesList();
-
- void populate();
- paludis::RepositoryName current_repository();
- };
-}
-
-
-#endif
diff --git a/src/clients/gtkpaludis/repositories_page.cc b/src/clients/gtkpaludis/repositories_page.cc
deleted file mode 100644
index 1977045..0000000
--- a/src/clients/gtkpaludis/repositories_page.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "repositories_page.hh"
-#include "repositories_list.hh"
-#include "repository_overview.hh"
-#include "paludis_thread.hh"
-#include "main_window.hh"
-#include "sync.hh"
-
-#include <paludis/environments/default/default_environment.hh>
-#include <gtkmm/button.h>
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/box.h>
-#include <gtkmm/buttonbox.h>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<RepositoriesPage>
- {
- Gtk::ScrolledWindow repositories_list_scroll;
- RepositoriesList repositories_list;
- Gtk::ScrolledWindow repository_info_scroll;
- RepositoryOverview repository_info;
-
- Gtk::HButtonBox buttons_box;
- Gtk::Button sync_button;
- Gtk::Button sync_all_button;
-
- Implementation() :
- sync_button("Sync"),
- sync_all_button("Sync all")
- {
- }
- };
-}
-
-RepositoriesPage::RepositoriesPage() :
- Gtk::Table(2, 2, false),
- PrivateImplementationPattern<RepositoriesPage>(new Implementation<RepositoriesPage>)
-{
- set_col_spacings(5);
- set_row_spacings(5);
- set_border_width(5);
-
- _imp->repositories_list_scroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
- _imp->repositories_list_scroll.add(_imp->repositories_list);
- attach(_imp->repositories_list_scroll, 0, 1, 0, 2, Gtk::SHRINK, Gtk::FILL | Gtk::EXPAND);
-
- _imp->repository_info_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
- _imp->repository_info_scroll.add(_imp->repository_info);
- attach(_imp->repository_info_scroll, 1, 2, 0, 1);
-
- _imp->buttons_box.set_border_width(5);
- _imp->buttons_box.set_spacing(5);
- _imp->buttons_box.set_layout(Gtk::BUTTONBOX_END);
- _imp->buttons_box.add(_imp->sync_button);
- _imp->buttons_box.add(_imp->sync_all_button);
- attach(_imp->buttons_box, 1, 2, 1, 2, Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions(0));
-
- _imp->sync_button.signal_clicked().connect(sigc::mem_fun(this,
- &RepositoriesPage::_sync_button_clicked));
- _imp->sync_button.set_sensitive(false);
- _imp->sync_all_button.signal_clicked().connect(sigc::mem_fun(this,
- &RepositoriesPage::_sync_all_button_clicked));
- _imp->repositories_list.get_selection()->signal_changed().connect(sigc::mem_fun(this,
- &RepositoriesPage::_repository_list_selection_changed));
-}
-
-RepositoriesPage::~RepositoriesPage()
-{
-}
-
-void
-RepositoriesPage::populate()
-{
- _imp->repositories_list.populate();
-}
-
-void
-RepositoriesPage::_repository_list_selection_changed()
-{
- _imp->repository_info.populate(_imp->repositories_list.current_repository());
- _imp->sync_button.set_sensitive(_imp->repositories_list.current_repository().data()
- != "no-repository");
-}
-
-namespace
-{
- class Sync :
- public PaludisThread::Launchable
- {
- private:
- bool _all;
- RepositoryName _name;
-
- public:
- Sync(const RepositoryName & name) :
- _all(false),
- _name(name)
- {
- }
-
- Sync() :
- _all(true),
- _name("dummy")
- {
- }
-
- virtual void operator() ();
- };
-
- void
- Sync::operator() ()
- {
- StatusBarMessage m1(this, _all ?
- "Syncing all repositories..." :
- "Syncing repository '" + stringify(_name) + "'...");
-
- OurSyncTask task(this);
- if (! _all)
- task.add_target(stringify(_name));
- task.execute();
- }
-}
-
-void
-RepositoriesPage::_sync_button_clicked()
-{
- RepositoryName current_repository(_imp->repositories_list.current_repository());
- if (current_repository.data() == "no-repository")
- return;
-
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Sync>(new Sync(current_repository)));
-}
-
-void
-RepositoriesPage::_sync_all_button_clicked()
-{
- sync_all();
-}
-
-void
-RepositoriesPage::sync_all()
-{
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Sync>(new Sync));
-}
-
diff --git a/src/clients/gtkpaludis/repositories_page.hh b/src/clients/gtkpaludis/repositories_page.hh
deleted file mode 100644
index 8c97429..0000000
--- a/src/clients/gtkpaludis/repositories_page.hh
+++ /dev/null
@@ -1,46 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_REPOSITORIES_PAGE_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_REPOSITORIES_PAGE_HH 1
-
-#include <gtkmm/table.h>
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace gtkpaludis
-{
- class RepositoriesPage :
- public Gtk::Table,
- private paludis::PrivateImplementationPattern<RepositoriesPage>
- {
- private:
- void _repository_list_selection_changed();
- void _sync_button_clicked();
- void _sync_all_button_clicked();
-
- public:
- RepositoriesPage();
- virtual ~RepositoriesPage();
-
- void populate();
- void sync_all();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/repository_overview.cc b/src/clients/gtkpaludis/repository_overview.cc
deleted file mode 100644
index e6a732d..0000000
--- a/src/clients/gtkpaludis/repository_overview.cc
+++ /dev/null
@@ -1,146 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "repository_overview.hh"
-#include "paludis_thread.hh"
-#include "main_window.hh"
-
-#include <paludis/environments/default/default_environment.hh>
-#include <gtkmm/treeview.h>
-#include <gtkmm/treestore.h>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace
-{
- class Columns :
- public Gtk::TreeModel::ColumnRecord
- {
- public:
- Gtk::TreeModelColumn<Glib::ustring> col_key;
- Gtk::TreeModelColumn<Glib::ustring> col_value;
-
- Columns()
- {
- add(col_key);
- add(col_value);
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<RepositoryOverview>
- {
- RepositoryOverview * const info;
- Columns columns;
- Glib::RefPtr<Gtk::TreeStore> model;
-
- Implementation(RepositoryOverview * const o) :
- info(o),
- model(Gtk::TreeStore::create(columns))
- {
- }
-
- void set_model(const Glib::RefPtr<Gtk::TreeStore> & m)
- {
- model = m;
- info->set_model(model);
- info->expand_all();
- info->columns_autosize();
- }
- };
-}
-
-RepositoryOverview::RepositoryOverview() :
- PrivateImplementationPattern<RepositoryOverview>(new Implementation<RepositoryOverview>(this))
-{
- set_headers_visible(false);
- set_model(_imp->model);
- append_column("Key", _imp->columns.col_key);
- append_column("Value", _imp->columns.col_value);
-}
-
-RepositoryOverview::~RepositoryOverview()
-{
-}
-
-namespace
-{
- class Populate :
- public PaludisThread::Launchable
- {
- private:
- Implementation<RepositoryOverview> * const _imp;
- RepositoryName _repo;
-
- public:
- Populate(Implementation<RepositoryOverview> * const imp, const RepositoryName & repo) :
- _imp(imp),
- _repo(repo)
- {
- }
-
- virtual void operator() ();
- };
-
- void
- Populate::operator() ()
- {
- Glib::RefPtr<Gtk::TreeStore> model(Gtk::TreeStore::create(_imp->columns));
-
- Gtk::TreeModel::Row top_row = *model->append();
- top_row[_imp->columns.col_key] = stringify(_repo);
- top_row[_imp->columns.col_value] = "";
-
- StatusBarMessage m1(this, "Querying repository information...");
-
- std::tr1::shared_ptr<const RepositoryInfo> info(DefaultEnvironment::get_instance()->package_database()->fetch_repository(
- _repo)->info(true));
- for (RepositoryInfo::SectionIterator s(info->begin_sections()), s_end(info->end_sections()) ;
- s != s_end ; ++s)
- {
- Gtk::TreeModel::Row section_row = *model->append(top_row.children());
- section_row[_imp->columns.col_key] = (*s)->heading();
- section_row[_imp->columns.col_value] = "";
-
- for (RepositoryInfoSection::KeyValueIterator k((*s)->begin_kvs()), k_end((*s)->end_kvs()) ; k != k_end ; ++k)
- {
- Gtk::TreeModel::Row kv_row = *model->append(section_row->children());
- kv_row[_imp->columns.col_key] = k->first;
- kv_row[_imp->columns.col_value] = k->second;
- }
- }
-
- dispatch(sigc::bind<1>(sigc::mem_fun(_imp, &Implementation<RepositoryOverview>::set_model), model));
- }
-}
-
-void
-RepositoryOverview::populate(const RepositoryName & name)
-{
- if (name.data() == "no-repository")
- _imp->set_model(Gtk::TreeStore::create(_imp->columns));
- else
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Populate>(new Populate(_imp.operator-> (), name)));
-}
-
-
diff --git a/src/clients/gtkpaludis/repository_overview.hh b/src/clients/gtkpaludis/repository_overview.hh
deleted file mode 100644
index fd60883..0000000
--- a/src/clients/gtkpaludis/repository_overview.hh
+++ /dev/null
@@ -1,41 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_REPOSITORY_INFO_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_REPOSITORY_INFO_HH 1
-
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-#include <gtkmm/treeview.h>
-
-namespace gtkpaludis
-{
- class RepositoryOverview :
- public Gtk::TreeView,
- private paludis::PrivateImplementationPattern<RepositoryOverview>
- {
- public:
- RepositoryOverview();
- virtual ~RepositoryOverview();
-
- void populate(const paludis::RepositoryName &);
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/set_overview.cc b/src/clients/gtkpaludis/set_overview.cc
deleted file mode 100644
index 73b3cd2..0000000
--- a/src/clients/gtkpaludis/set_overview.cc
+++ /dev/null
@@ -1,226 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "set_overview.hh"
-#include "paludis_thread.hh"
-#include "main_window.hh"
-
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/util/save.hh>
-#include <gtkmm/treeview.h>
-#include <gtkmm/treestore.h>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace
-{
- class Columns :
- public Gtk::TreeModel::ColumnRecord
- {
- public:
- Gtk::TreeModelColumn<Glib::ustring> col_spec;
- Gtk::TreeModelColumn<Glib::ustring> col_tag;
-
- Columns()
- {
- add(col_spec);
- add(col_tag);
- }
- };
-
- struct TagDecoder :
- public DepTagVisitorTypes::ConstVisitor
- {
- std::string text;
-
- void visit(const GLSADepTag * const tag)
- {
- text = tag->short_text() + ": " + tag->glsa_title();
- }
-
- void visit(const DependencyDepTag * const)
- {
- }
-
- void visit(const GeneralSetDepTag * const tag)
- {
- text = tag->short_text() + ": " + tag->source();
- }
- };
-
- class TreeFromDepSpec :
- private InstantiationPolicy<TreeFromDepSpec, instantiation_method::NonCopyableTag>,
- public DepSpecVisitorTypes::ConstVisitor
- {
- private:
- Glib::RefPtr<Gtk::TreeStore> _model;
- const Columns * const _columns;
- Gtk::TreeModel::Row * _row;
-
- public:
- TreeFromDepSpec(Glib::RefPtr<Gtk::TreeStore> model, const Columns * const columns,
- Gtk::TreeModel::Row * top_row) :
- _model(model),
- _columns(columns),
- _row(top_row)
- {
- }
-
- void visit(const AllDepSpec * spec)
- {
- if (spec->begin() != spec->end())
- {
- Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_spec] = "all of";
- Save<Gtk::TreeModel::Row *> save_row(&_row, &new_row);
- std::for_each(spec->begin(), spec->end(), accept_visitor(this));
- }
- }
-
- void visit(const AnyDepSpec * spec)
- {
- if (spec->begin() != spec->end())
- {
- Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_spec] = "any of";
- Save<Gtk::TreeModel::Row *> save_row(&_row, &new_row);
- std::for_each(spec->begin(), spec->end(), accept_visitor(this));
- }
- }
-
- void visit(const UseDepSpec * spec)
- {
- Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_spec] = "if " + stringify(spec->inverse() ? "!" : "") + stringify(spec->flag());
- Save<Gtk::TreeModel::Row *> save_row(&_row, &new_row);
- std::for_each(spec->begin(), spec->end(), accept_visitor(this));
- }
-
- void visit(const PlainTextDepSpec * spec)
- {
- Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_spec] = spec->text();
- }
-
- void visit(const PackageDepSpec * spec)
- {
- Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_spec] = stringify(*spec);
-
- if (spec->tag())
- {
- TagDecoder d;
- spec->tag()->accept(&d);
- new_row[_columns->col_tag] = d.text;
- }
- }
-
- void visit(const BlockDepSpec * spec)
- {
- Gtk::TreeModel::Row new_row(*_model->append(_row->children()));
- new_row[_columns->col_spec] = "!" + stringify(*spec->blocked_spec());
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<SetOverview>
- {
- SetOverview * const info;
- Columns columns;
- Glib::RefPtr<Gtk::TreeStore> model;
-
- Implementation(SetOverview * const o) :
- info(o),
- model(Gtk::TreeStore::create(columns))
- {
- }
-
- void set_model(const Glib::RefPtr<Gtk::TreeStore> & m)
- {
- model = m;
- info->set_model(model);
- info->expand_all();
- info->columns_autosize();
- }
- };
-}
-
-SetOverview::SetOverview() :
- PrivateImplementationPattern<SetOverview>(new Implementation<SetOverview>(this))
-{
- set_model(_imp->model);
- append_column("Atom", _imp->columns.col_spec);
- append_column("Tag", _imp->columns.col_tag);
-}
-
-SetOverview::~SetOverview()
-{
-}
-
-namespace
-{
- class Populate :
- public PaludisThread::Launchable
- {
- private:
- Implementation<SetOverview> * const _imp;
- SetName _set;
-
- public:
- Populate(Implementation<SetOverview> * const imp, const std::string & set) :
- _imp(imp),
- _set(set)
- {
- }
-
- virtual void operator() ();
- };
-
- void
- Populate::operator() ()
- {
- Glib::RefPtr<Gtk::TreeStore> model(Gtk::TreeStore::create(_imp->columns));
-
- StatusBarMessage m1(this, "Querying set information...");
-
- std::tr1::shared_ptr<const DepSpec> set_spec(DefaultEnvironment::get_instance()->package_set(_set));
- Gtk::TreeModel::Row top_row = *model->append();
- top_row[_imp->columns.col_spec] = stringify(_set);
- TreeFromDepSpec v(model, &_imp->columns, &top_row);
- set_spec->accept(&v);
-
- dispatch(sigc::bind<1>(sigc::mem_fun(_imp, &Implementation<SetOverview>::set_model), model));
- }
-}
-
-void
-SetOverview::populate(const std::string & name)
-{
- if (name.empty())
- _imp->set_model(Gtk::TreeStore::create(_imp->columns));
- else
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Populate>(new Populate(_imp.operator-> (), name)));
-}
-
-
-
diff --git a/src/clients/gtkpaludis/sets_list.cc b/src/clients/gtkpaludis/sets_list.cc
deleted file mode 100644
index f7b654b..0000000
--- a/src/clients/gtkpaludis/sets_list.cc
+++ /dev/null
@@ -1,171 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "sets_list.hh"
-#include "paludis_thread.hh"
-#include "main_window.hh"
-#include <paludis/environments/default/default_environment.hh>
-
-#include <gtkmm/treeview.h>
-#include <gtkmm/liststore.h>
-#include <glibmm/dispatcher.h>
-#include <set>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace
-{
- class Columns :
- public Gtk::TreeModel::ColumnRecord
- {
- public:
- Gtk::TreeModelColumn<Glib::ustring> col_set;
-
- Columns()
- {
- add(col_set);
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<SetsList>
- {
- Columns columns;
- Glib::RefPtr<Gtk::ListStore> model;
- sigc::signal<void> populated;
-
- Implementation() :
- model(Gtk::ListStore::create(columns))
- {
- }
-
- void add_sets(const std::set<SetName> & c)
- {
- for (std::set<SetName>::const_iterator n(c.begin()), n_end(c.end()) ; n != n_end ; ++n)
- {
- Gtk::TreeModel::Row row = *(model->append());
- row[columns.col_set] = stringify(*n);
- }
- }
- };
-}
-
-namespace
-{
- class Populate :
- public PaludisThread::Launchable
- {
- private:
- Implementation<SetsList> * const _imp;
-
- public:
- Populate(Implementation<SetsList> * const list) :
- _imp(list)
- {
- }
-
- virtual void operator() ();
- };
-
- void
- Populate::operator() ()
- {
- std::set<SetName> names;
-
- StatusBarMessage m1(this, "Loading set names...");
-
- for (PackageDatabase::RepositoryIterator r(DefaultEnvironment::get_instance()->package_database()->begin_repositories()),
- r_end(DefaultEnvironment::get_instance()->package_database()->end_repositories()) ; r != r_end ; ++r)
- {
- if (! (*r)->sets_interface)
- continue;
-
- std::tr1::shared_ptr<const SetsCollection> sets((*r)->sets_interface->sets_list());
- std::copy(sets->begin(), sets->end(), std::inserter(names, names.end()));
- }
-
- names.erase(SetName("insecurity"));
-
- std::tr1::shared_ptr<const SetsCollection> sets(DefaultEnvironment::get_instance()->sets_list());
- std::copy(sets->begin(), sets->end(), std::inserter(names, names.end()));
-
- dispatch(sigc::bind<1>(sigc::mem_fun(_imp, &Implementation<SetsList>::add_sets), names));
- dispatch(sigc::mem_fun(_imp->populated, &sigc::signal<void>::operator()));
- }
-}
-
-SetsList::SetsList() :
- PrivateImplementationPattern<SetsList>(new Implementation<SetsList>)
-{
-#ifdef GTKMM_ATKMM_ENABLED
- get_accessible()->set_name("SetsList");
-#endif
- set_model(_imp->model);
- append_column("Set", _imp->columns.col_set);
-}
-
-SetsList::~SetsList()
-{
-}
-
-void
-SetsList::populate()
-{
- _imp->model->clear();
- PaludisThread::get_instance()->launch(std::tr1::shared_ptr<Populate>(new Populate(_imp.operator-> ())));
-}
-
-std::string
-SetsList::current_set()
-{
- Gtk::TreeModel::iterator i(get_selection()->get_selected());
- if (i)
- return stringify((*i)[_imp->columns.col_set]);
- else
- return "";
-}
-
-int
-SetsList::number_of_sets()
-{
- return _imp->model->children().size();
-}
-
-bool
-SetsList::has_set_named(const SetName & s)
-{
- const Gtk::TreeNodeChildren children(_imp->model->children());
- for (Gtk::TreeNodeChildren::const_iterator i(children.begin()), i_end(children.end()) ;
- i != i_end ; ++i)
- if (stringify(s) == (*i)[_imp->columns.col_set])
- return true;
-
- return false;
-}
-
-sigc::signal<void> &
-SetsList::populated()
-{
- return _imp->populated;
-}
-
diff --git a/src/clients/gtkpaludis/sets_list.hh b/src/clients/gtkpaludis/sets_list.hh
deleted file mode 100644
index c2d9068..0000000
--- a/src/clients/gtkpaludis/sets_list.hh
+++ /dev/null
@@ -1,46 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_SETS_LIST_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_SETS_LIST_HH 1
-
-#include <gtkmm/treeview.h>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-
-namespace gtkpaludis
-{
- class SetsList :
- public Gtk::TreeView,
- private paludis::PrivateImplementationPattern<SetsList>
- {
- public:
- SetsList();
- virtual ~SetsList();
-
- void populate();
- sigc::signal<void> & populated();
-
- std::string current_set();
- bool has_set_named(const paludis::SetName &);
- int number_of_sets();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/sets_list_TEST.py b/src/clients/gtkpaludis/sets_list_TEST.py
deleted file mode 100755
index cdedb70..0000000
--- a/src/clients/gtkpaludis/sets_list_TEST.py
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/usr/bin/env python
-# vim: set ft=python sw=4 sts=4 et :
-
-import os, sys, dogtail.utils
-from dogtail import tree, predicate
-from dogtail.procedural import *
-
-os.environ["PALUDIS_HOME"] = os.getcwd() + "/sets_list_TEST_dir/home"
-
-dogtail.utils.run('./gtkpaludis', appName = 'lt-gtkpaludis')
-focus.application('lt-gtkpaludis')
-
-focus.widget(roleName = 'page tab', name = 'Sets')
-focus.widget.node.select()
-
-sets_list = tree.root.findChild(predicate.IsNamed("SetsList"))
-
-monkey_cell = sets_list.findChild(predicate.IsNamed("monkey"),
- requireResult = False, retry = False)
-if monkey_cell:
- raise "there should be no monkey"
-
-system_cell = sets_list.findChild(predicate.IsNamed("system"))
-system_cell.select()
-
-click('Quit')
-
diff --git a/src/clients/gtkpaludis/sets_list_TEST_cleanup.sh b/src/clients/gtkpaludis/sets_list_TEST_cleanup.sh
deleted file mode 100755
index 9f5ebc3..0000000
--- a/src/clients/gtkpaludis/sets_list_TEST_cleanup.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-if [ -d sets_list_TEST_dir ] ; then
- rm -fr sets_list_TEST_dir
-else
- true
-fi
-
-
-
-
-
diff --git a/src/clients/gtkpaludis/sets_list_TEST_setup.sh b/src/clients/gtkpaludis/sets_list_TEST_setup.sh
deleted file mode 100755
index 81091c2..0000000
--- a/src/clients/gtkpaludis/sets_list_TEST_setup.sh
+++ /dev/null
@@ -1,68 +0,0 @@
-#!/bin/bash
-# vim: set ft=sh sw=4 sts=4 et :
-
-mkdir sets_list_TEST_dir || exit 1
-cd sets_list_TEST_dir || exit 1
-
-mkdir -p home/.paludis/repositories
-
-cat <<END > home/.paludis/repositories/testrepo.conf
-location = `pwd`/testrepo
-format = ebuild
-names_cache = /var/empty
-cache = /var/empty
-profiles = \${location}/profiles/testprofile
-END
-
-cat <<END > home/.paludis/keywords.conf
-* test
-~foo/bar-1 ~test
-END
-
-cat <<END > home/.paludis/use.conf
-* enabled
-~foo/bar-1 sometimes_enabled
-END
-
-cat <<END > home/.paludis/licenses.conf
-* *
-END
-
-mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
-cd testrepo || exit 1
-echo "testrepo" > profiles/repo_name || exit 1
-cat <<END > profiles/categories || exit 1
-foo
-END
-cat <<END > profiles/testprofile/make.defaults
-ARCH=test
-USERLAND=test
-KERNEL=test
-END
-cat <<END > profiles/profiles.desc
-test testprofile stable
-END
-
-cat <<"END" > foo/bar/bar-1.0.ebuild || exit 1
-DESCRIPTION="Test package"
-HOMEPAGE="http://paludis.pioto.org/"
-SRC_URI=""
-SLOT="0"
-IUSE=""
-LICENSE="GPL-2"
-KEYWORDS="test"
-END
-
-cat <<"END" > foo/bar/bar-2.0.ebuild || exit 1
-DESCRIPTION="Test package"
-HOMEPAGE="http://paludis.pioto.org/"
-SRC_URI=""
-SLOT="0"
-IUSE=""
-LICENSE="GPL-2"
-KEYWORDS="~test"
-END
-cd ..
-
-
-
diff --git a/src/clients/gtkpaludis/sets_page.cc b/src/clients/gtkpaludis/sets_page.cc
deleted file mode 100644
index 7df9204..0000000
--- a/src/clients/gtkpaludis/sets_page.cc
+++ /dev/null
@@ -1,121 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "sets_page.hh"
-#include "sets_list.hh"
-#include "set_overview.hh"
-#include "main_window.hh"
-#include "queue_page.hh"
-
-#include <gtkmm/button.h>
-#include <gtkmm/entry.h>
-#include <gtkmm/label.h>
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/separator.h>
-#include <gtkmm/stock.h>
-#include <gtkmm/box.h>
-#include <gtkmm/buttonbox.h>
-
-using namespace gtkpaludis;
-using namespace paludis;
-
-namespace paludis
-{
- template<>
- struct Implementation<SetsPage>
- {
- Gtk::ScrolledWindow sets_list_scroll;
- SetsList sets_list;
-
- Gtk::ScrolledWindow sets_overview_scroll;
- SetOverview set_overview;
-
- Gtk::HButtonBox buttons_box;
- Gtk::Button queue_button;
-
- Implementation() :
- queue_button("Queue")
- {
- }
- };
-}
-
-SetsPage::SetsPage() :
- Gtk::Table(2, 2, false),
- PrivateImplementationPattern<SetsPage>(new Implementation<SetsPage>)
-{
- set_col_spacings(5);
- set_row_spacings(5);
- set_border_width(5);
-
- _imp->sets_list_scroll.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
- _imp->sets_list_scroll.add(_imp->sets_list);
- attach(_imp->sets_list_scroll, 0, 1, 0, 2, Gtk::SHRINK, Gtk::FILL | Gtk::EXPAND);
-
- _imp->sets_overview_scroll.set_policy(Gtk::POLICY_AUTOMATIC, Gtk::POLICY_AUTOMATIC);
- _imp->sets_overview_scroll.add(_imp->set_overview);
- attach(_imp->sets_overview_scroll, 1, 2, 0, 1);
-
- _imp->buttons_box.set_border_width(5);
- _imp->buttons_box.set_spacing(5);
- _imp->buttons_box.set_layout(Gtk::BUTTONBOX_END);
- _imp->buttons_box.add(_imp->queue_button);
- attach(_imp->buttons_box, 1, 2, 1, 2, Gtk::FILL | Gtk::EXPAND, Gtk::AttachOptions(0));
-
- _imp->queue_button.signal_clicked().connect(sigc::mem_fun(this,
- &SetsPage::_queue_button_clicked));
- _imp->queue_button.set_sensitive(false);
- _imp->sets_list.get_selection()->signal_changed().connect(sigc::mem_fun(this,
- &SetsPage::_sets_list_selection_changed));
-
-}
-
-SetsPage::~SetsPage()
-{
-}
-
-void
-SetsPage::populate()
-{
- _imp->sets_list.populate();
-}
-
-void
-SetsPage::_sets_list_selection_changed()
-{
- _imp->set_overview.populate(_imp->sets_list.current_set());
- _imp->queue_button.set_sensitive(! _imp->sets_list.current_set().empty());
-}
-
-void
-SetsPage::_queue_button_clicked()
-{
- if (! _imp->sets_list.current_set().empty())
- {
- MainWindow::get_instance()->show_queue_page();
- MainWindow::get_instance()->queue_page()->add_target(_imp->sets_list.current_set());
- }
-}
-
-SetsList *
-SetsPage::sets_list()
-{
- return &_imp->sets_list;
-}
-
diff --git a/src/clients/gtkpaludis/sets_page.hh b/src/clients/gtkpaludis/sets_page.hh
deleted file mode 100644
index deef856..0000000
--- a/src/clients/gtkpaludis/sets_page.hh
+++ /dev/null
@@ -1,48 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_SETS_PAGE_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_SETS_PAGE_HH 1
-
-#include <gtkmm/table.h>
-#include <paludis/util/private_implementation_pattern.hh>
-
-namespace gtkpaludis
-{
- class SetsList;
-
- class SetsPage :
- public Gtk::Table,
- private paludis::PrivateImplementationPattern<SetsPage>
- {
- private:
- void _sets_list_selection_changed();
- void _queue_button_clicked();
-
- public:
- SetsPage();
- virtual ~SetsPage();
-
- void populate();
-
- SetsList * sets_list();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/sync.cc b/src/clients/gtkpaludis/sync.cc
deleted file mode 100644
index 539c911..0000000
--- a/src/clients/gtkpaludis/sync.cc
+++ /dev/null
@@ -1,84 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "sync.hh"
-#include "main_window.hh"
-#include <paludis/environments/default/default_environment.hh>
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-OurSyncTask::OurSyncTask(PaludisThread::Launchable * const l) :
- SyncTask(DefaultEnvironment::get_instance()),
- _l(l)
-{
-}
-
-OurSyncTask::~OurSyncTask()
-{
-}
-
-void
-OurSyncTask::on_sync_all_pre()
-{
- _l->dispatch(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::show_messages_page));
- _l->dispatch(sigc::bind<1>(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::message),
- stringify("Starting sync")));
-}
-
-void
-OurSyncTask::on_sync_pre(const RepositoryName & r)
-{
- _l->dispatch(sigc::bind<1>(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::message),
- stringify("Syncing '" + stringify(r) + "'")));
-}
-
-void
-OurSyncTask::on_sync_post(const RepositoryName &)
-{
-}
-
-void
-OurSyncTask::on_sync_skip(const RepositoryName & r)
-{
- _l->dispatch(sigc::bind<1>(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::message),
- stringify("Sync of '" + stringify(r) + "' skipped")));
-}
-
-void
-OurSyncTask::on_sync_fail(const RepositoryName & r, const SyncFailedError &)
-{
- _l->dispatch(sigc::bind<1>(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::message),
- stringify("Sync of '" + stringify(r) + "' failed")));
-}
-
-void
-OurSyncTask::on_sync_succeed(const RepositoryName & r)
-{
- _l->dispatch(sigc::bind<1>(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::message),
- stringify("Sync of '" + stringify(r) + "' succeeded")));
-}
-
-void
-OurSyncTask::on_sync_all_post()
-{
- _l->dispatch(sigc::bind<1>(sigc::mem_fun(MainWindow::get_instance(), &MainWindow::message),
- stringify("Sync completed")));
-}
-
diff --git a/src/clients/gtkpaludis/sync.hh b/src/clients/gtkpaludis/sync.hh
deleted file mode 100644
index de98a3d..0000000
--- a/src/clients/gtkpaludis/sync.hh
+++ /dev/null
@@ -1,48 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_SYNC_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_SYNC_HH 1
-
-#include <paludis/tasks/sync_task.hh>
-#include <src/clients/gtkpaludis/paludis_thread.hh>
-
-namespace gtkpaludis
-{
- class OurSyncTask :
- public paludis::SyncTask
- {
- private:
- PaludisThread::Launchable * const _l;
-
- public:
- OurSyncTask(PaludisThread::Launchable * const l);
- virtual ~OurSyncTask();
-
- virtual void on_sync_all_pre();
- virtual void on_sync_pre(const paludis::RepositoryName &);
- virtual void on_sync_post(const paludis::RepositoryName &);
- virtual void on_sync_skip(const paludis::RepositoryName &);
- virtual void on_sync_fail(const paludis::RepositoryName &, const paludis::SyncFailedError &);
- virtual void on_sync_succeed(const paludis::RepositoryName &);
- virtual void on_sync_all_post();
- };
-}
-
-#endif
diff --git a/src/clients/gtkpaludis/tasks_page.cc b/src/clients/gtkpaludis/tasks_page.cc
deleted file mode 100644
index 72df744..0000000
--- a/src/clients/gtkpaludis/tasks_page.cc
+++ /dev/null
@@ -1,209 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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 "tasks_page.hh"
-#include "repositories_page.hh"
-#include "main_window.hh"
-#include "queue_page.hh"
-
-#include <gtkmm/box.h>
-#include <gtkmm/button.h>
-#include <gtkmm/buttonbox.h>
-#include <gtkmm/image.h>
-#include <gtkmm/button.h>
-#include <gtkmm/label.h>
-#include <gtkmm/textview.h>
-#include <gtkmm/table.h>
-#include <gtkmm/treeview.h>
-#include <gtkmm/liststore.h>
-#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/stock.h>
-#include <limits>
-
-#include "config.h"
-
-#ifdef USE_BROKEN_CELL_RENDERER_BUTTON
-# include <cellrendererbutton/cellrendererbutton.hh>
-#endif
-
-using namespace paludis;
-using namespace gtkpaludis;
-
-namespace
-{
- struct Columns :
- Gtk::TreeModel::ColumnRecord
- {
- Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf> > col_icon;
- Gtk::TreeModelColumn<Glib::ustring> col_text;
-#ifdef USE_BROKEN_CELL_RENDERER_BUTTON
- Gtk::TreeModelColumn<Glib::ustring> col_button;
-#endif
- Gtk::TreeModelColumn<sigc::slot<void> > col_action;
-
- Columns()
- {
- add(col_icon);
- add(col_text);
-#ifdef USE_BROKEN_CELL_RENDERER_BUTTON
- add(col_button);
-#endif
- add(col_action);
- }
- };
-
- struct TasksList :
- Gtk::TreeView
- {
- Columns columns;
- Glib::RefPtr<Gtk::ListStore> model;
-
- TasksList(TasksPage * const page) :
- model(Gtk::ListStore::create(columns))
- {
- set_model(model);
- set_headers_visible(false);
-#ifdef HAVE_TREE_VIEW_GRID_LINES
- set_grid_lines(Gtk::TREE_VIEW_GRID_LINES_VERTICAL);
-#endif
-
- {
- get_column(append_column("Icon", columns.col_icon) - 1)->get_first_cell_renderer()->
- set_fixed_size(40, 40);
- get_column(append_column("Text", columns.col_text) - 1)->set_expand(true);
-
-#ifdef USE_BROKEN_CELL_RENDERER_BUTTON
- CellRendererButton * const renderer = new CellRendererButton(*this);
- Gtk::TreeViewColumn * const column = new Gtk::TreeViewColumn("Button",
- *Gtk::manage(renderer));
- column->add_attribute(renderer->property_text(), columns.col_button);
- renderer->property_width_chars() = 10;
- renderer->set_column(column);
- append_column(*column);
-#endif
- }
-
- Gtk::TreeModel::Row row = *(model->append());
- row[columns.col_icon] = render_icon(Gtk::Stock::MISSING_IMAGE, Gtk::ICON_SIZE_LARGE_TOOLBAR);
- row[columns.col_text] = "Sync all repositories";
-#ifdef USE_BROKEN_CELL_RENDERER_BUTTON
- row[columns.col_button] = "Sync";
-#endif
- row[columns.col_action] = sigc::mem_fun(page, &TasksPage::sync_action);
-
- row = *(model->append());
- row[columns.col_icon] = render_icon(Gtk::Stock::MISSING_IMAGE, Gtk::ICON_SIZE_LARGE_TOOLBAR);
- row[columns.col_text] = "Show security updates";
-#ifdef USE_BROKEN_CELL_RENDERER_BUTTON
- row[columns.col_button] = "Preview";
-#endif
- row[columns.col_action] = sigc::mem_fun(page, &TasksPage::security_action);
-
- row = *(model->append());
- row[columns.col_icon] = render_icon(Gtk::Stock::MISSING_IMAGE, Gtk::ICON_SIZE_LARGE_TOOLBAR);
- row[columns.col_text] = "Show world updates";
-#ifdef USE_BROKEN_CELL_RENDERER_BUTTON
- row[columns.col_button] = "Preview";
-#endif
- row[columns.col_action] = sigc::mem_fun(page, &TasksPage::world_action);
- }
- };
-}
-
-namespace paludis
-{
- template<>
- struct Implementation<TasksPage>
- {
- Gtk::ScrolledWindow tasks_list_window;
- TasksList tasks_list;
- Gtk::HButtonBox buttons_box;
- Gtk::Button go_button;
-
- Implementation(TasksPage * const page) :
- tasks_list(page),
- go_button("Go")
- {
- }
- };
-}
-
-TasksPage::TasksPage() :
- PrivateImplementationPattern<TasksPage>(new Implementation<TasksPage>(this))
-{
- _imp->tasks_list_window.set_policy(Gtk::POLICY_NEVER, Gtk::POLICY_ALWAYS);
- _imp->tasks_list_window.add(_imp->tasks_list);
- pack_start(_imp->tasks_list_window, Gtk::PACK_EXPAND_WIDGET);
- pack_start(_imp->buttons_box, Gtk::PACK_SHRINK);
-
- _imp->buttons_box.set_border_width(5);
- _imp->buttons_box.set_spacing(5);
- _imp->buttons_box.set_layout(Gtk::BUTTONBOX_END);
- _imp->buttons_box.add(_imp->go_button);
-
- _imp->go_button.set_sensitive(false);
- _imp->go_button.signal_clicked().connect(sigc::mem_fun(this,
- &TasksPage::_go_button_clicked));
- _imp->tasks_list.get_selection()->signal_changed().connect(sigc::mem_fun(this,
- &TasksPage::_task_list_selection_changed));
-}
-
-TasksPage::~TasksPage()
-{
-}
-
-void
-TasksPage::_task_list_selection_changed()
-{
- _imp->go_button.set_sensitive(_imp->tasks_list.get_selection()->get_selected());
-}
-
-void
-TasksPage::sync_action()
-{
- MainWindow::get_instance()->repositories_page()->sync_all();
-}
-
-void
-TasksPage::security_action()
-{
- MainWindow::get_instance()->queue_page()->add_target("security");
- MainWindow::get_instance()->show_queue_page();
- MainWindow::get_instance()->queue_page()->recalculate();
-}
-
-void
-TasksPage::world_action()
-{
- MainWindow::get_instance()->queue_page()->add_target("world");
- MainWindow::get_instance()->show_queue_page();
- MainWindow::get_instance()->queue_page()->recalculate();
-}
-
-void
-TasksPage::_go_button_clicked()
-{
- Gtk::TreeModel::iterator i(_imp->tasks_list.get_selection()->get_selected());
- if (i)
- {
- sigc::slot<void> slot = (*i)[_imp->tasks_list.columns.col_action];
- slot();
- }
-}
-
diff --git a/src/clients/gtkpaludis/tasks_page.hh b/src/clients/gtkpaludis/tasks_page.hh
deleted file mode 100644
index 262b824..0000000
--- a/src/clients/gtkpaludis/tasks_page.hh
+++ /dev/null
@@ -1,48 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
- *
- * 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_SRC_GTKPALUDIS_TASKS_PAGE_HH
-#define PALUDIS_GUARD_SRC_GTKPALUDIS_TASKS_PAGE_HH 1
-
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-#include <gtkmm/box.h>
-
-namespace gtkpaludis
-{
- class TasksPage :
- public Gtk::VBox,
- private paludis::PrivateImplementationPattern<TasksPage>
- {
- private:
- void _task_list_selection_changed();
- void _go_button_clicked();
-
- public:
- TasksPage();
- virtual ~TasksPage();
-
- void sync_action();
- void security_action();
- void world_action();
- };
-}
-
-
-#endif
diff --git a/src/clients/gtkpaludis/test_helper.bash b/src/clients/gtkpaludis/test_helper.bash
deleted file mode 100755
index ed9e9a3..0000000
--- a/src/clients/gtkpaludis/test_helper.bash
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-export XAUTHORITY=
-unset LANG ${!LC*}
-
-XDISPLAY=0
-while [[ -f /tmp/.X${XDISPLAY}-lock ]] ; do
- XDISPLAY=$(( ${XDISPLAY} + 1 ))
-done
-export XDISPLAY=${XDISPLAY}
-echo "Using X display :${XDISPLAY}" 1>&2
-
-echo "Starting Xvfb..." 1>&2
-Xvfb :${XDISPLAY} -screen 0 1024x768x24 &>/dev/null &
-
-export DISPLAY=":${XDISPLAY}"
-tries=0
-while ! ./prod-x-server ; do
- sleep 1
- tries=$(( ${tries} + 1 ))
-
- if [[ ${tries} -gt 10 ]] ; then
- echo "Xvfb seems to be broken..." 1>&2
- kill $(</tmp/.X${XDISPLAY}-lock )
- exit 123
- fi
-done
-
-$@
-exit_code=$?
-
-echo "Killing Xvfb..." 1>&2
-kill $(</tmp/.X${XDISPLAY}-lock )
-
-exit $exit_code
-
diff --git a/src/clients/gtkpaludis/version_TEST b/src/clients/gtkpaludis/version_TEST
deleted file mode 100755
index a27cd03..0000000
--- a/src/clients/gtkpaludis/version_TEST
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/bash
-
-PALUDIS_SKIP_CONFIG=yes ./gtkpaludis --version
-
diff --git a/src/clients/gtkpaludis/vtemm/Makefile.am b/src/clients/gtkpaludis/vtemm/Makefile.am
deleted file mode 100644
index 2230723..0000000
--- a/src/clients/gtkpaludis/vtemm/Makefile.am
+++ /dev/null
@@ -1,77 +0,0 @@
-EXTRA_DIST = \
- terminal_widget.hg terminal_widget.ccg \
- reaper.hg reaper.ccg
-
-AM_CXXFLAGS = -I$(top_srcdir) \
- @PALUDIS_CXXFLAGS@ \
- @PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST@ \
- @PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS@ \
- @PALUDIS_CXXFLAGS_NO_WSHADOW@
-
-DEFS = \
- -DSYSCONFDIR=\"$(sysconfdir)\" \
- -DLIBEXECDIR=\"$(libexecdir)\" \
- -DGLIBMM_EXCEPTIONS_ENABLED=1
-
-vte_generated_sources = \
- terminal_widget.cc terminal_widget.hh private/terminal_widget_p.hh \
- reaper.cc reaper.hh private/reaper_p.hh
-
-SUBDIRS = defs converts .
-
-if ENABLE_GTK
-
-BUILT_SOURCES = terminal_widget.hh reaper.hh $(vte_generated_sources)
-
-# automake is rather weird on this one...
-automake-deps-hack.tmp :
- $(MAKE) -C defs
- touch $@
-
-terminal_widget.hh terminal_widget.cc : terminal_widget.hg terminal_widget.ccg automake-deps-hack.tmp
- mkdir -p private
- @GMMPROC@ --unwrapped -I converts --defs defs terminal_widget . .
- sed -e 's@/\* vim: set @/* vim: set ro @' < ./terminal_widget.h > ./terminal_widget.hh
- rm terminal_widget.h
- mv ./terminal_widget.cc ./terminal_widget.cc.tmp
- sed \
- -e 's@#include <vtemm/terminal_widget.h>@#include "terminal_widget.hh"@' \
- -e 's@#include <vtemm/private/terminal_widget_p.h>@#include "private/terminal_widget_p.hh"@' \
- -e 's@/\* vim: set @/* vim: set ro @' \
- < ./terminal_widget.cc.tmp > ./terminal_widget.cc
- rm ./terminal_widget.cc.tmp
- mv ./private/terminal_widget_p.h ./private/terminal_widget_p.hh
-
-reaper.hh reaper.cc : reaper.hg reaper.ccg automake-deps-hack.tmp
- mkdir -p private
- @GMMPROC@ --unwrapped -I converts --defs defs reaper . .
- sed -e 's@/\* vim: set @/* vim: set ro @' < ./reaper.h > ./reaper.hh
- rm reaper.h
- mv ./reaper.cc ./reaper.cc.tmp
- sed \
- -e 's@#include <vtemm/reaper.h>@#include "reaper.hh"@' \
- -e 's@#include <vtemm/private/reaper_p.h>@#include "private/reaper_p.hh"@' \
- -e 's@/\* vim: set @/* vim: set ro @' \
- < ./reaper.cc.tmp > ./reaper.cc
- rm ./reaper.cc.tmp
- mv ./private/reaper_p.h ./private/reaper_p.hh
-
-noinst_LIBRARIES = libvtemm.a
-
-nodist_libvtemm_a_SOURCES = \
- $(vte_generated_sources)
-
-INCLUDES = $(GTKDEPS_CFLAGS)
-
-clean-local :
- rm -fr private || true
-
-endif
-
-CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda $(vte_generated_sources) automake-deps-hack.tmp
-MAINTAINERCLEANFILES = Makefile.in
-
-built-sources : $(BUILT_SOURCES)
- for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-
-
diff --git a/src/clients/gtkpaludis/vtemm/converts/Makefile.am b/src/clients/gtkpaludis/vtemm/converts/Makefile.am
deleted file mode 100644
index ea65efb..0000000
--- a/src/clients/gtkpaludis/vtemm/converts/Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
-noinst_DATA = convert.m4 convert_base.m4
-CLEANFILES = *~
-MAINTAINERCLEANFILES = Makefile.in
-EXTRA_DIST = $(noinst_DATA)
-
-built-sources : $(BUILT_SOURCES)
- for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-
-
diff --git a/src/clients/gtkpaludis/vtemm/converts/convert.m4 b/src/clients/gtkpaludis/vtemm/converts/convert.m4
deleted file mode 100644
index 319807e..0000000
--- a/src/clients/gtkpaludis/vtemm/converts/convert.m4
+++ /dev/null
@@ -1,30 +0,0 @@
-dnl $Id: convert.m4,v 1.1.1.1 2003/01/21 13:41:24 murrayc Exp $
-
-# Other libraries, such as libgnomeuimm, can provide their own convert.m4 files,
-# Maybe choosing to include the same files as this one.
-
-include(convert_gtkmm.m4)
-
-_CONV_ENUM(Vte,TerminalEraseBinding)
-_CONV_ENUM(Vte,TerminalAntiAlias)
-
-_EQUAL(glong, long)
-_EQUAL(guint, unsigned)
-
-_CONVERSION(int&, int*, &($3))
-_CONVERSION(long&, glong*, &($3))
-_CONVERSION(return-char*, char*, ($3))
-
-# Gtk conversions
-_CONVERSION(const Gtk::MenuShell&, GtkMenuShell*, (const_cast<Gtk::MenuShell&>($3)).gobj())
-
-# Gdk conversions
-_CONVERSION(const Gdk::Color&, const GdkColor*, ($3).gobj())
-_CONVERSION(Gdk::Color&, GdkColor*, ($3).gobj())
-_CONVERSION(Gdk::Cursor&, GdkCursor*, ($3).gobj())
-
-# Pango conversions
-_CONVERSION(const Pango::FontDescription&, const PangoFontDescription*, ($3).gobj())
-_CONVERSION(const PangoFontDescription*, const Pango::FontDescription, Glib::wrap(const_cast<PangoFontDescription*>(($3)), true))
-
-
diff --git a/src/clients/gtkpaludis/vtemm/converts/convert_base.m4 b/src/clients/gtkpaludis/vtemm/converts/convert_base.m4
deleted file mode 100644
index feaf583..0000000
--- a/src/clients/gtkpaludis/vtemm/converts/convert_base.m4
+++ /dev/null
@@ -1,69 +0,0 @@
-dnl $Id: convert_base.m4,v 1.1.1.1 2003/01/21 13:41:24 murrayc Exp $
-
-#
-# Define a hashing for names
-#
-define(`__HASH',`__`'m4_translit(`$*',`ABCDEFGHIJKLMNOPQRSTUVWXYZ<>[]&*, ',`abcdefghijklmnopqrstuvwxyzVBNMRSC_')`'')
-define(`__EQUIV',`m4_ifdef(EV`'__HASH(`$1'),EV`'__HASH(`$1'),`$1')')
-
-define(`__HASH2',`dnl
-pushdef(`__E1',__EQUIV(`$1'))pushdef(`__E2',__EQUIV(`$2'))dnl
-m4_ifelse(__E1,__E2,`__EQ',__HASH(__E1)`'__HASH(__E2))`'dnl
-popdef(`__E1')popdef(`__E2')`'')
-
-define(`CF__EQ',`$3')
-
-#
-# _CONVERT(ctype, cpptype, name, wrap_line)
-# Print the conversion from ctype to cpptype
-define(`_CONVERT',`dnl
-pushdef(`__COV',`CF`'__HASH2(`$1',`$2')')dnl
-m4_ifdef(__COV,`m4_indir(__COV,`$1',`$2',`$3')',`
-m4_errprint(`No conversion from $1 to $2 defined (line: $4, parameter name: $3)
-')
-m4_m4exit(1)
-')`'dnl
-')
-
-
-#
-# Functions for populating the tables.
-#
-define(`_CONVERSION',`
-m4_ifelse(`$3',,,`define(CF`'__HASH2(`$1',`$2'),`$3')')
-')
-
-define(`_EQUAL',`define(EV`'__HASH(`$1'),`$2')')
-
-/*******************************************************************/
-
-
-define(`__ARG3__',`$`'3')
-define(`_CONV_ENUM',`dnl
-_CONVERSION(`$1$2', `$2', (($2)(__ARG3__)))
-_CONVERSION(`$1$2', `$1::$2', (($1::$2)(__ARG3__)))
-_CONVERSION(`$2', `$1$2', (($1$2)(__ARG3__)))
-_CONVERSION(`$1::$2', `$1$2', (($1$2)(__ARG3__)))
-')dnl
-
-# e.g. Glib::RefPtr<Gdk::Something> to GdkSomething*
-define(`__CONVERT_REFPTR_TO_P',`Glib::unwrap($`'3)')
-
-# e.g. Glib::RefPtr<const Gdk::Something> to GdkSomething*
-#define(`__CONVERT_CONST_REFPTR_TO_P',`const_cast<$`'2>($`'3->gobj())')
-define(`__CONVERT_CONST_REFPTR_TO_P',`const_cast<$`'2>(Glib::unwrap($`'3))')
-
-# The Sun Forte compiler doesn't seem to be able to handle these, so we are using the altlernative, __CONVERT_CONST_REFPTR_TO_P_SUN.
-# The Sun compiler gives this error, for instance:
-#  "widget.cc", line 4463: Error: Overloading ambiguity between "Glib::unwrap<Gdk::Window>(const Glib::RefPtr<const Gdk::Window>&)" and
-# "Glib::unwrap<const Gdk::Window>(const Glib::RefPtr<const Gdk::Window>&)".
-#
-define(`__CONVERT_CONST_REFPTR_TO_P_SUN',`const_cast<$`'2>(Glib::unwrap<$1>($`'3))')
-
-
-include(convert_gtk.m4)
-include(convert_pango.m4)
-include(convert_gdk.m4)
-include(convert_atk.m4)
-include(convert_glib.m4)
-
diff --git a/src/clients/gtkpaludis/vtemm/defs/Makefile.am b/src/clients/gtkpaludis/vtemm/defs/Makefile.am
deleted file mode 100644
index a741900..0000000
--- a/src/clients/gtkpaludis/vtemm/defs/Makefile.am
+++ /dev/null
@@ -1,55 +0,0 @@
-vte_defs_included = \
- vte_methods.defs \
- vte_vfuncs.defs \
- vte_enums.defs \
- vte_signals.defs
-
-vte_defs = \
- $(vte_defs_included) \
- vte.defs
-
-if ENABLE_GTK
-
-noinst_DATA = $(vte_defs)
-noinst_PROGRAMS = force_automake_to_include_cxxcompile
-
-endif
-
-INCLUDES = $(GTKDEPS_CFLAGS)
-
-force_automake_to_include_cxxcompile_SOURCES = force_automake_to_include_cxxcompile.cc
-
-force_automake_to_include_cxxcompile.cc :
- echo 'int main(int, char *[]) { }' > $@
-
-generate_defs_vte : generate_defs_vte.cc
- $(CXXCOMPILE) $(GTKDEPS_LIBS) -lglibmm_generate_extra_defs-2.4 -o $@ $<
-
-CLEANFILES = *~ force_automake_to_include_cxxcompile.cc generate_defs_vte
-MAINTAINERCLEANFILES = Makefile.in $(vte_defs)
-
-vte_methods.defs :
- if ! python `pkg-config --variable=datadir pygtk-2.0`/pygtk/2.0/codegen/h2def.py \
- `pkg-config --variable=includedir vte`/vte/*.h \
- > $@ ; then rm $@ ; false ; fi
-
-vte_enums.defs :
- if ! perl $(srcdir)/enum.pl `pkg-config --variable=includedir vte`/vte/*.h > $@ ; \
- then rm $@ ; false ; fi
-
-vte_signals.defs : generate_defs_vte
- ./generate_defs_vte | sed -e 's~const-gchar\*~gchar*~' > $@
-
-vte.defs :
- echo > $@
- for a in $(vte_defs_included) ; do echo "(include $${a})" >> $@ ; done
-
-vte_vfuncs.defs :
- touch $@
-
-EXTRA_DIST = enum.pl generate_defs_vte.cc
-
-built-sources : $(BUILT_SOURCES)
- for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
-
-
diff --git a/src/clients/gtkpaludis/vtemm/defs/enum.pl b/src/clients/gtkpaludis/vtemm/defs/enum.pl
deleted file mode 100644
index df41545..0000000
--- a/src/clients/gtkpaludis/vtemm/defs/enum.pl
+++ /dev/null
@@ -1,230 +0,0 @@
-#! /usr/bin/perl
-
-# The lisp definitions for flags does not include order.
-# thus we must extract it ourselves.
-# Usage: ./enum.pl /gnome/head/cvs/gconf/gconf/*.h > gconf_enums.defs
-
-
-my %token;
-$module="none";
-
-while ($ARGV[0] =~ /^--(\S+)/)
-{
- shift @ARGV;
- $module=shift @ARGV if ($1 eq "module");
- if ($1 eq "help")
- {
- print "enum.pl [--module modname] header_files ....\n";
- exit 0;
- }
-}
-
-foreach $file (@ARGV)
-{
- &parse($file);
-}
-
-exit;
-
-
-
-# parse enums from C
-sub parse
-{
- my ($file)=@_;
-
- $from=0;
- open(FILE,$file);
-
- $enum=0;
- $deprecated=0;
- $comment=0;
-
- while(<FILE>)
- {
- if($comment)
- {
- # end of multiline comment
- $comment = 0 if(/\*\//);
- next;
- }
-
- $deprecated = 1 if(s/^#ifndef [A-Z_]+_DISABLE_DEPRECATED//);
-
- ++$deprecated if($deprecated > 0 && /^#\s*if/);
- --$deprecated if($deprecated > 0 && /^#\s*endif/);
-
- next if($deprecated > 0);
-
- # filter single-line comments
- s/\/\*.*\*\///g;
-
- # begin of multiline comment
- if(/\/\*/)
- {
- $comment = 1;
- next;
- }
-
- s/','/\%\%COMMA\%\%/;
- s/'}'/\%\%RBRACE\%\%/;
- if (/^typedef enum/ )
- {
- print ";; From $file\n\n" if (!$from);
- $from=1;
- $enum=1;
- next;
- }
-
- if ($enum && /\}/)
- {
- $enum=0;
- &process($line,$_);
- $line="";
- }
- $line.=$_ if ($enum);
- }
-}
-
-
-# convert enums to lisp
-sub process
-{
- my ($line,$def)=@_;
-
- $def=~s/\s*\}\s*//g;
- $def=~s/\s*;\s*$//;
- my $c_name=$def;
-
- $line=~s/\s+/ /g;
- $line=~s/\/\*.*\*\///g;
- $line=~s/\s*{\s*//;
-
- my $entity = "enum";
- $c_name =~ /^([A-Z][a-z]*)/;
- $module = $1;
- $def =~ s/$module//;
-
- @c_name=();
- @name=();
- @number=();
-
- $val=0;
- foreach $i (split(/,/,$line))
- {
- $i=~s/^\s+//;
- $i=~s/\s+$//;
- if ($i =~ /^\S+$/)
- {
- push(@c_name,$i);
- push(@number,sprintf("%d",$val));
- $token{$i}=$val;
- }
- elsif ($i =~ /^(\S+)\s*=\s*(0x[0-9a-fA-F]+)$/ ||
- $i =~ /^(\S+)\s*=\s*(-?[0-9]+)$/ ||
- $i =~ /^(\S+)\s*=\s*(1\s*<<\s*[0-9]+)$/
- )
- {
- my ($tmp1, $tmp2) = ($1, $2);
- push(@c_name, $tmp1);
- eval("\$val = $tmp2;");
- $entity = "flags" if($tmp2 =~ /^1\s*<</ || $tmp2 =~ /^0x/);
- push(@number, $tmp2);
- $token{$tmp1} = $tmp2;
- }
- elsif ($i =~ /^(\S+)\s*=\s*([ _x0-9a-fA-Z|()~]+)$/)
- {
- my ($tmp1, $tmp2) = ($1, $2);
- push(@c_name, $tmp1);
- $tmp2 =~ s/([A-Z_]+)/($token{$1})/;
- eval("\$val = $tmp2;");
- $val = "#error" if(!$val);
- $val = sprintf("0x%X", $val) if($entity eq "flags");
- push(@number, $val);
- $token{$tmp1} = $val;
- }
- elsif ($i =~ /^(\S+)\s*=\s*'(.)'$/)
- {
- push(@c_name,$1);
- push(@number,"\'$2\'");
- $val=ord($2);
- $token{$1}=$val;
- }
- elsif ($i =~ /^(\S+)\s*=\s*(\%\%[A-Z]+\%\%)$/)
- {
- $tmp=$1;
- $_=$2;
- s/\%\%COMMA\%\%/,/;
- s/\%\%RBRACE\%\%/]/;
- push(@c_name,$tmp);
- push(@number,"\'$_\'");
- $val=ord($_);
- $token{$tmp}=$val;
- }
- else
- {
- #print STDERR "$i\n";
- }
- $val++;
- }
-
- # remove the prefix to form names
- &form_names(\@name,\@c_name);
-
- my $format = "%d";
- $format = "0x%X" if($entity eq "flags");
-
- # evaluate any unevaluated values
- my $j;
- for ($j=0;$j<$#number+1;$j++)
- {
- if ($number[$j]=~/\$/)
- {
- $number[$j]=sprintf($format, eval($number[$j]));
- }
- }
-
- #print ";; Enum $def\n\n";
- print "(define-$entity-extended $def\n";
- print " (in-module \"$module\")\n";
- print " (c-name \"$c_name\")\n";
-
- print " (values\n";
- for ($j=0;$j<$#c_name+1;$j++)
- {
- print " \'(\"$name[$j]\" \"$c_name[$j]\"";
- print " \"$number[$j]\"" if ($number[$j] ne "");
- print ")\n";
- }
- print " )\n";
- print ")\n\n";
-}
-
-
-sub form_names
-{
- my ($name,$c_name)=@_;
-
- my $len=length($$c_name[0]) - 1;
- my $j;
- for ($j=0;$j<$#c_name;$j++)
- {
- while (substr($$c_name[$j],$len-1,1) ne "_" ||
- substr($$c_name[$j],0,$len) ne substr($$c_name[$j+1],0,$len))
- {
- $len--;
- }
- #print substr($$c_name[$j],0,$len),"\n";
- }
-
- my $prefix=substr($$c_name[0],0,$len);
-
- for ($j=0;$j<$#c_name+1;$j++)
- {
- $_=$$c_name[$j];
- s/^$prefix//;
- tr/A-Z_/a-z-/;
- push(@$name,$_);
- }
-
-}
diff --git a/src/clients/gtkpaludis/vtemm/defs/generate_defs_vte.cc b/src/clients/gtkpaludis/vtemm/defs/generate_defs_vte.cc
deleted file mode 100644
index 20c9b5c..0000000
--- a/src/clients/gtkpaludis/vtemm/defs/generate_defs_vte.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-/* $Id: generate_defs_gtk.cc,v 1.22 2006/05/16 18:03:21 murrayc Exp $ */
-
-/* generate_defs_gtk.cc
- *
- * Copyright (C) 2001 The Free Software Foundation
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library 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
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include "glibmm_generate_extra_defs/generate_extra_defs.h"
-#include <gdk/gdk.h>
-#include <gtk/gtk.h>
-#include <vte/vte.h>
-#include <vte/reaper.h>
-
-int main (int argc, char *argv[])
-{
- gtk_init(&argc, &argv);
-
-std::cout << get_defs(VTE_TYPE_TERMINAL)
- << get_defs(VTE_TYPE_REAPER);
-
- return 0;
-}
diff --git a/src/clients/gtkpaludis/vtemm/reaper.ccg b/src/clients/gtkpaludis/vtemm/reaper.ccg
deleted file mode 100644
index e2f1164..0000000
--- a/src/clients/gtkpaludis/vtemm/reaper.ccg
+++ /dev/null
@@ -1,65 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
- *
- * 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 <vte/reaper.h>
-#include <paludis/util/exception.hh>
-
-namespace
-{
-
- void Reaper_proxy_signal_child_exited(GObject*, int pid, int status, gpointer data)
- {
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
- try
- {
- #endif //GLIBMM_EXCEPTIONS_ENABLED
- if (Vte::Reaper::get_instance() == data) //ignore signals connected using c api
- Vte::Reaper::get_instance()->signal_child_exited().emit(pid, status);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
- }
-} /* anonymous namspace */
-
-namespace Vte
-{
-
- Reaper::Reaper() :
- Glib::Object(reinterpret_cast<GObject*>(::vte_reaper_get()))
- {
- //TODO: looks like vte-0.13.3 has child-exited renamed abi/api breakage??
- //propably shoud be also unregistred if Reaper will stop be singleton
- g_signal_connect(G_OBJECT(gobj()), "child-exited", G_CALLBACK(Reaper_proxy_signal_child_exited) , this);
- }
-
- int Reaper::add_child(GPid pid)
- {
- return vte_reaper_add_child(pid);
- }
-
- sigc::signal<void, int, int>& Reaper::signal_child_exited()
- {
- return _signal_child_exited;
- }
-}
-
diff --git a/src/clients/gtkpaludis/vtemm/reaper.hg b/src/clients/gtkpaludis/vtemm/reaper.hg
deleted file mode 100644
index db7b146..0000000
--- a/src/clients/gtkpaludis/vtemm/reaper.hg
+++ /dev/null
@@ -1,50 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
- *
- * 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 <sys/types.h>
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <glibmm/object.h>
-#include <sigc++/sigc++.h>
-
-_DEFS(vtemm,vte)
-_PINCLUDE(glibmm/private/object_p.h)
-
-namespace Vte
-{
- class Reaper :
- public Glib::Object,
- public paludis::InstantiationPolicy<Reaper, paludis::instantiation_method::SingletonTag>
-
- {
- friend class paludis::InstantiationPolicy<Reaper, paludis::instantiation_method::SingletonTag>;
-
- sigc::signal<void, int, int> _signal_child_exited;
-
- _CLASS_GOBJECT(Reaper,VteReaper,VTE_REAPER,Glib::Object,GObject)
-
- Reaper();
-
- public:
-
- int add_child(GPid pid);
- sigc::signal<void, int, int>& signal_child_exited();
-
- };
-}
diff --git a/src/clients/gtkpaludis/vtemm/terminal_widget.ccg b/src/clients/gtkpaludis/vtemm/terminal_widget.ccg
deleted file mode 100644
index 74ff4a9..0000000
--- a/src/clients/gtkpaludis/vtemm/terminal_widget.ccg
+++ /dev/null
@@ -1,159 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
- *
- * 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 <vte/vte.h>
-
-namespace
-{
-
-gboolean proxy_slot_selected_callback(VteTerminal * /* term */ , glong column, glong row, gpointer data)
-{
- typedef Vte::Terminal::SlotIsSelected SlotType;
- SlotType& slot(*static_cast<SlotType*>(data));
-
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
- try
- {
- #endif //GLIBMM_EXCEPTIONS_ENABLED
- return slot(column, row);
- #ifdef GLIBMM_EXCEPTIONS_ENABLED
- }
- catch(...)
- {
- Glib::exception_handlers_invoke();
- }
- #endif //GLIBMM_EXCEPTIONS_ENABLED
-
- return 0;
-}
-
-} /* anonymous namespace */
-
-
-namespace Vte
-{
-
-CharAttributes::CharAttributes(VteCharAttributes* obj) :
- _gobject(new VteCharAttributes(*obj))
-{
-}
-
-CharAttributes::~CharAttributes()
-{
- delete _gobject;
-}
-
-CharAttributes::CharAttributes(const CharAttributes& rhs) :
- _gobject(new VteCharAttributes(*rhs._gobject))
-{
-}
-
-CharAttributes& CharAttributes::operator= (const CharAttributes& rhs)
-{
- if (this != &rhs)
- {
- delete _gobject;
- _gobject = new VteCharAttributes(*rhs._gobject);
- }
- return *this;
-}
-
-int CharAttributes::row() const
-{
- return _gobject->row;
-}
-
-int CharAttributes::column() const
-{
- return _gobject->column;
-}
-
-Gdk::Color CharAttributes::foreground() const
-{
- return Gdk::Color(&_gobject->fore, true);
-}
-
-Gdk::Color CharAttributes::background() const
-{
- return Gdk::Color(&_gobject->back, true);
-}
-
-bool CharAttributes::underline() const
-{
- return _gobject->underline;
-}
-
-bool CharAttributes::strikethrough() const
-{
- return _gobject->strikethrough;
-}
-
-char* Terminal::get_text(const Terminal::SlotIsSelected& slot, std::vector<CharAttributes>& attributes)
-{
- GArray* garray(g_array_new(false, true, sizeof(VteCharAttributes)));
- Terminal::SlotIsSelected slot_copy(slot);
-
- char * result(vte_terminal_get_text(gobj(), &proxy_slot_selected_callback, &slot_copy, garray));
-
- for (size_t i=0; i< garray->len; ++i)
- {
- attributes.push_back(new VteCharAttributes(g_array_index(garray, VteCharAttributes, i))); //TODO suboptimal deep copy
- }
-
- g_array_free(garray, false);
-
- return result;
-}
-
-char* Terminal::get_text_include_trailing_spaces(const Terminal::SlotIsSelected& slot, std::vector<CharAttributes>& attributes)
-{
- GArray* garray(g_array_new(false, true, sizeof(VteCharAttributes)));
- Terminal::SlotIsSelected slot_copy(slot);
-
- char * result(vte_terminal_get_text_include_trailing_spaces(gobj(),
- &proxy_slot_selected_callback, &slot_copy, garray));
-
- for (size_t i=0; i< garray->len; ++i)
- {
- attributes.push_back(new VteCharAttributes(g_array_index(garray, VteCharAttributes, i))); //TODO suboptimal deep copy
- }
-
- g_array_free(garray, true);
-
- return result;
-}
-
-char* Terminal::get_text_range(long start_row, long start_col, long end_row, long end_col, const SlotIsSelected& slot, std::vector<CharAttributes>& attributes)
-{
- GArray* garray(g_array_new(false, true, sizeof(VteCharAttributes)));
- Terminal::SlotIsSelected slot_copy(slot);
-
- char * result(vte_terminal_get_text_range(gobj(),start_row, start_col, end_row, end_col,
- &proxy_slot_selected_callback, &slot_copy, garray));
-
- for (size_t i=0; i< garray->len; ++i)
- {
- attributes.push_back(new VteCharAttributes(g_array_index(garray, VteCharAttributes, i))); //TODO suboptimal deep copy
- }
-
- g_array_free(garray, true);
-
- return result;
-}
-
-} /* namespace Vte */
diff --git a/src/clients/gtkpaludis/vtemm/terminal_widget.hg b/src/clients/gtkpaludis/vtemm/terminal_widget.hg
deleted file mode 100644
index 956a293..0000000
--- a/src/clients/gtkpaludis/vtemm/terminal_widget.hg
+++ /dev/null
@@ -1,181 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2006 Piotr Rak <piotr.rak@gmail.com>
- *
- * 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 <gtkmm/widget.h>
-#include <gtkmm/menushell.h>
-#include <gtkmm/adjustment.h>
-#include <gdkmm/cursor.h>
-#include <pangomm/fontdescription.h>
-
-#include <vector>
-
-_DEFS(vtemm,vte)
-_PINCLUDE(gtkmm/private/widget_p.h)
-
-/* we don't want whole vte.h in this file */
-typedef struct _VteCharAttributes VteCharAttributes;
-
-namespace Vte
-{
-
-
-class CharAttributes
-{
-private:
- VteCharAttributes * _gobject;
-
-public:
- CharAttributes(VteCharAttributes *obj);
- CharAttributes(const CharAttributes&);
-
- ~CharAttributes();
-
- CharAttributes& operator= (const CharAttributes&);
-
- int row() const;
- int column() const;
- Gdk::Color foreground() const;
- Gdk::Color background() const;
- bool underline() const;
- bool strikethrough() const;
-};
-
-_WRAP_ENUM(TerminalEraseBinding, VteTerminalEraseBinding)
-_WRAP_ENUM(TerminalAntiAlias, VteTerminalAntiAlias)
-
-class Terminal :
- public Gtk::Widget
-{
-
-_CLASS_GTKOBJECT(Terminal,VteTerminal,VTE_TERMINAL,Gtk::Widget,GtkWidget)
-public:
-
-typedef sigc::slot<bool, long, long> SlotIsSelected;
-
-_CTOR_DEFAULT
-
-_WRAP_METHOD(void im_append_menuitems(const Gtk::MenuShell& menushell), vte_terminal_im_append_menuitems)
-_WRAP_METHOD(pid_t fork_command(const char* command, char** argv, char** envv, const char* directory, bool lastlog, bool utmp, bool wtmp), vte_terminal_fork_command)
-_WRAP_METHOD(pid_t forkpty(char** env, const char* directory, bool lastlog, bool utmp, bool wtmp), vte_terminal_forkpty)
-_WRAP_METHOD(void set_pty(int pty_master), vte_terminal_set_pty)
-_WRAP_METHOD(void feed(const char* data, glong length), vte_terminal_feed)
-_WRAP_METHOD(void feed_child(const char* text, glong length), vte_terminal_feed_child)
-_WRAP_METHOD(void feed_child_binary(const char* data, glong length), vte_terminal_feed_child_binary)
-_WRAP_METHOD(void copy_clipboard(), vte_terminal_copy_clipboard)
-_WRAP_METHOD(void paste_clipboard(), vte_terminal_paste_clipboard)
-_WRAP_METHOD(void copy_primary(), vte_terminal_copy_primary)
-_WRAP_METHOD(void paste_primary(), vte_terminal_paste_primary)
-_WRAP_METHOD(void set_size(glong columns, glong rows), vte_terminal_set_size)
-_WRAP_METHOD(void set_audible_bell(bool is_audible), vte_terminal_set_audible_bell)
-_WRAP_METHOD(bool get_audible_bell(), vte_terminal_get_audible_bell)
-_WRAP_METHOD(void set_visible_bell(bool is_visible), vte_terminal_set_visible_bell)
-_WRAP_METHOD(bool get_visible_bell(), vte_terminal_get_visible_bell)
-_WRAP_METHOD(void set_allow_bold(bool allow_bold), vte_terminal_set_allow_bold)
-_WRAP_METHOD(bool get_allow_bold(), vte_terminal_get_allow_bold)
-_WRAP_METHOD(void set_scroll_on_output(bool scroll), vte_terminal_set_scroll_on_output)
-_WRAP_METHOD(void set_scroll_on_keystroke(bool scroll), vte_terminal_set_scroll_on_keystroke)
-_WRAP_METHOD(void set_color_bold(const Gdk::Color& bold), vte_terminal_set_color_bold )
-_WRAP_METHOD(void set_color_foreground(const Gdk::Color& foreground), vte_terminal_set_color_foreground)
-_WRAP_METHOD(void set_color_background(const Gdk::Color& background), vte_terminal_set_color_background)
-_WRAP_METHOD(void set_color_dim(const Gdk::Color& dim), vte_terminal_set_color_dim)
-_WRAP_METHOD(void set_color_cursor(const Gdk::Color& cursor), vte_terminal_set_color_cursor)
-_WRAP_METHOD(void set_color_highlight(const Gdk::Color& highlight), vte_terminal_set_color_highlight)
-_WRAP_METHOD(void set_colors(const Gdk::Color& foreground, const Gdk::Color& background, const Gdk::Color& palete_size, glong palette_size), vte_terminal_set_colors)
-_WRAP_METHOD(void set_default_colors(), vte_terminal_set_default_colors)
-_WRAP_METHOD(void set_background_image(Glib::RefPtr<Gdk::Pixbuf> pixbuf), vte_terminal_set_background_image)
-_WRAP_METHOD(void set_background_image_file(const char* path), vte_terminal_set_background_image_file)
-_WRAP_METHOD(void set_background_saturation(double saturation), vte_terminal_set_background_saturation)
-_WRAP_METHOD(void set_background_transparent(bool transparent), vte_terminal_set_background_transparent)
-_WRAP_METHOD(void set_background_tint_color(const Gdk::Color& color), vte_terminal_set_background_tint_color)
-_WRAP_METHOD(void set_scroll_background(bool scroll), vte_terminal_set_scroll_background)
-_WRAP_METHOD(void set_cursor_blinks(bool blink), vte_terminal_set_cursor_blinks)
-_WRAP_METHOD(void set_scrollback_lines(long lines), vte_terminal_set_scrollback_lines)
-_WRAP_METHOD(void set_font(const Pango::FontDescription& font_desc), vte_terminal_set_font)
-_WRAP_METHOD(void set_font_from_string(const char* name), vte_terminal_set_font_from_string)
-_WRAP_METHOD(void set_font_from_string_full(const char* name, TerminalAntiAlias antialas), vte_terminal_set_font_from_string_full)
-_WRAP_METHOD(void set_font_full(const Pango::FontDescription& font_desc, TerminalAntiAlias antialas), vte_terminal_set_font_full)
-_WRAP_METHOD(const Pango::FontDescription get_font(), vte_terminal_get_font)
-_WRAP_METHOD(bool get_using_xft(), vte_terminal_get_using_xft)
-_WRAP_METHOD(bool get_has_selection(), vte_terminal_get_has_selection)
-_WRAP_METHOD(void set_word_chars(const char* spec), vte_terminal_set_word_chars)
-_WRAP_METHOD(bool is_word_char(gunichar), vte_terminal_is_word_char)
-_WRAP_METHOD(void set_backspace_binding(TerminalEraseBinding binding), vte_terminal_set_backspace_binding)
-_WRAP_METHOD(void set_delete_binding(TerminalEraseBinding binding), vte_terminal_set_delete_binding)
-_WRAP_METHOD(void set_mouse_autohide(bool setting), vte_terminal_set_mouse_autohide)
-_WRAP_METHOD(bool get_mouse_autohide(), vte_terminal_get_mouse_autohide)
-_WRAP_METHOD(void reset(bool full, bool clear_history), vte_terminal_reset)
-//_WRAP_METHOD(char* get_text(bool (*is_selected) (glong column,glong row,gpointer data), gpointer data, GArray *attributes), vte_terminal_get_text) //Manualy wrapped below
-//_WRAP_METHOD(char* get_text_range(glong start_row, glong start_col, glong end_row, glong end_col, gboolean (*is_selected) (glong column,glong row,gpointer data), gpointer data, GArray *attributes), vte_terminal_get_text_range) //Manualy wrapped bellow
-_WRAP_METHOD(void get_cursor_position(long& column, long& row), vte_terminal_get_cursor_position)
-_WRAP_METHOD(void match_clear_all(), vte_terminal_match_clear_all)
-_WRAP_METHOD(int match_add(const char* match), vte_terminal_match_add)
-_WRAP_METHOD(void match_remove(int tag), vte_terminal_match_remove)
-_WRAP_METHOD(char* match_check(glong column, glong row, int& tag), vte_terminal_match_check)
-_WRAP_METHOD(void match_set_cursor(int tag, Gdk::Cursor& ), vte_terminal_match_set_cursor)
-_WRAP_METHOD(void match_set_cursor_type(int tag, Gdk::CursorType), vte_terminal_match_set_cursor_type)
-_WRAP_METHOD(void set_emulation(const char* emulation), vte_terminal_set_emulation)
-_WRAP_METHOD(const char* get_emulation(), vte_terminal_get_emulation)
-_WRAP_METHOD(const char* get_default_emulation(), vte_terminal_get_default_emulation)
-_WRAP_METHOD(void set_encoding(const char* codeset), vte_terminal_set_encoding)
-_WRAP_METHOD(const char* get_encoding(), vte_terminal_get_encoding)
-_WRAP_METHOD(const char* get_status_line(), vte_terminal_get_status_line)
-_WRAP_METHOD(void get_padding(int& xpad, int& ypad), vte_terminal_get_padding)
-_WRAP_METHOD(Gtk::Adjustment* get_adjustment(), vte_terminal_get_adjustment)
-_WRAP_METHOD(glong get_char_ascent(), vte_terminal_get_char_ascent)
-_WRAP_METHOD(glong get_char_descent(), vte_terminal_get_char_descent)
-_WRAP_METHOD(glong get_char_height(), vte_terminal_get_char_height)
-_WRAP_METHOD(glong get_char_width(), vte_terminal_get_char_width)
-_WRAP_METHOD(glong get_column_count(), vte_terminal_get_column_count)
-_WRAP_METHOD(const char* get_icon_title(), vte_terminal_get_icon_title)
-_WRAP_METHOD(glong get_row_count(), vte_terminal_get_row_count)
-_WRAP_METHOD(const char* get_window_title(), vte_terminal_get_window_title)
-
-_WRAP_SIGNAL(void char_size_changed(unsigned w, unsigned h), "char-size-changed")
-_WRAP_SIGNAL(void child_exited(), "child-exited")
-_WRAP_SIGNAL(void commit(gchar* text, unsigned length), "commit")
-_WRAP_SIGNAL(void contents_changed(), "contents-changed")
-_WRAP_SIGNAL(void cursor_moved(), "cursor-moved")
-_WRAP_SIGNAL(void decrease_font_size(), "decrease-font-size")
-_WRAP_SIGNAL(void deiconify_window(), "deiconify-window")
-_WRAP_SIGNAL(void emulation_changed(), "emulation-changed")
-_WRAP_SIGNAL(void encoding_changed(), "encoding-changed")
-_WRAP_SIGNAL(void eof(), "eof")
-_WRAP_SIGNAL(void icon_title_changed(), "icon-title-changed")
-_WRAP_SIGNAL(void iconify_window(), "iconify-window")
-_WRAP_SIGNAL(void increase_font_size(), "increase-font-size")
-_WRAP_SIGNAL(void lower_window(), "lower-window")
-_WRAP_SIGNAL(void maximize_window(), "maximize-window")
-_WRAP_SIGNAL(void move_window(unsigned x, unsigned y), "move-window")
-_WRAP_SIGNAL(void raise_window(), "raise-window")
-_WRAP_SIGNAL(void refresh_window(), "refresh-window")
-_WRAP_SIGNAL(void resize_window(unsigned w, unsigned h), "resize-window")
-_WRAP_SIGNAL(void restore_window(), "restore-window")
-_WRAP_SIGNAL(void selection_changed(), "selection-changed")
-_WRAP_SIGNAL(void status_line_changed(), "status-line-changed")
-_WRAP_SIGNAL(void text_deleted(), "text-deleted")
-_WRAP_SIGNAL(void text_inserted(), "text-inserted")
-_WRAP_SIGNAL(void text_modified(), "text-modified")
-_WRAP_SIGNAL(void text_scrolled(int arg), "text-scrolled")
-_WRAP_SIGNAL(void window_title_changed(), "window-title-changed")
- char* get_text(const SlotIsSelected& slot, std::vector<CharAttributes>& attributes);
- char* get_text_include_trailing_spaces(const SlotIsSelected& slot, std::vector<CharAttributes>& attributes);
- char* get_text_range(long start_row, long start_col, long end_row, long end_col, const SlotIsSelected& slot, std::vector<CharAttributes>& attributes);
-};
-
-} /* namespace Vte */
diff --git a/src/clients/gtkpaludis/yay_spi_TEST.py b/src/clients/gtkpaludis/yay_spi_TEST.py
deleted file mode 100755
index 84845e9..0000000
--- a/src/clients/gtkpaludis/yay_spi_TEST.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-
-import os
-from dogtail.procedural import *
-import dogtail.utils
-
-os.spawnv(os.P_NOWAIT, "./gtkpaludis", ["gtkpaludis", "-c", "doesnotexist"])
-for x in range(10):
- try:
- focus.application('lt-gtkpaludis')
- break
- except FocusError:
- dogtail.utils.doDelay()
-
-try:
- focus.application('lt-gtkpaludis')
- click('OK')
-except:
- True
-
diff --git a/src/clients/inquisitio/Makefile.am b/src/clients/inquisitio/Makefile.am
index de18d06..814fca0 100644
--- a/src/clients/inquisitio/Makefile.am
+++ b/src/clients/inquisitio/Makefile.am
@@ -47,7 +47,7 @@ inquisitio_LDADD = \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
- $(top_builddir)/paludis/environments/default/libpaludisdefaultenvironment.la \
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la \
$(top_builddir)/src/output/liboutput.a \
$(top_builddir)/src/common_args/libcommonargs.a \
$(DYNAMIC_LD_LIBS) \
diff --git a/src/clients/inquisitio/command_line.cc b/src/clients/inquisitio/command_line.cc
index fd90f2b..44440c4 100644
--- a/src/clients/inquisitio/command_line.cc
+++ b/src/clients/inquisitio/command_line.cc
@@ -37,7 +37,7 @@ CommandLine::CommandLine() :
a_log_level(&general_args, "log-level", '\0'),
a_no_colour(&general_args, "no-colour", '\0', "Do not use colour"),
a_no_color(&a_no_colour, "no-color"),
- a_config_suffix(&general_args, "config-suffix", 'c', "Config directory suffix"),
+ a_environment(&general_args, "environment", 'E', "Environment specification (class:suffix, both parts optional)"),
search_args(this, "Search options",
"Options that are relevant for the search action."),
@@ -58,7 +58,11 @@ CommandLine::CommandLine() :
a_category(&search_args, "category", '\0', "Matches with this category name only",
paludis::args::StringSetArg::StringSetArgOptions(), &paludis::CategoryNamePartValidator::validate),
a_package(&search_args, "package", '\0', "Matches with this package name only",
- paludis::args::StringSetArg::StringSetArgOptions(), &paludis::PackageNamePartValidator::validate)
+ paludis::args::StringSetArg::StringSetArgOptions(), &paludis::PackageNamePartValidator::validate),
+
+ deprecated_args(this, "Deprecated options", "Deprecated options."),
+ a_config_suffix(&deprecated_args, "config-suffix", 'c',
+ "Replaced by --environment")
{
add_usage_line("[ --search ] [search options] pattern ...");
add_usage_line("--help");
diff --git a/src/clients/inquisitio/command_line.hh b/src/clients/inquisitio/command_line.hh
index 5ab240a..2149c77 100644
--- a/src/clients/inquisitio/command_line.hh
+++ b/src/clients/inquisitio/command_line.hh
@@ -72,7 +72,7 @@ class CommandLine :
paludis::args::LogLevelArg a_log_level;
paludis::args::SwitchArg a_no_colour;
paludis::args::AliasArg a_no_color;
- paludis::args::StringArg a_config_suffix;
+ paludis::args::StringArg a_environment;
///}
@@ -89,6 +89,14 @@ class CommandLine :
paludis::args::StringSetArg a_package;
///\}
+
+ ///\name Deprecated arguments
+ ///\{
+
+ paludis::args::ArgsGroup deprecated_args;
+ paludis::args::StringArg a_config_suffix;
+
+ ///\}
};
diff --git a/src/clients/inquisitio/inquisitio.cc b/src/clients/inquisitio/inquisitio.cc
index ba1cfbd..2186152 100644
--- a/src/clients/inquisitio/inquisitio.cc
+++ b/src/clients/inquisitio/inquisitio.cc
@@ -26,8 +26,7 @@
#include <paludis/about.hh>
#include <paludis/util/join.hh>
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/environments/default/default_config.hh>
+#include <paludis/environments/environment_maker.hh>
#include <src/output/colour.hh>
#include <src/common_args/do_help.hh>
@@ -81,13 +80,22 @@ main(int argc, char *argv[])
CommandLine::get_instance()->a_version.specified()))
throw args::DoHelp("you should specify exactly one action");
- std::string paludis_command(argv[0]);
+ std::string paludis_command(argv[0]), env_spec;
if (CommandLine::get_instance()->a_config_suffix.specified())
{
- DefaultConfig::set_config_suffix(CommandLine::get_instance()->a_config_suffix.argument());
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "--config-suffix is deprecated, use --environment ':" +
+ CommandLine::get_instance()->a_config_suffix.argument() + "'");
+ env_spec = ":" + CommandLine::get_instance()->a_config_suffix.argument();
paludis_command.append(" --" + CommandLine::get_instance()->a_config_suffix.long_name() + " " +
CommandLine::get_instance()->a_config_suffix.argument());
}
+ else if (CommandLine::get_instance()->a_environment.specified())
+ {
+ paludis_command.append(" --" + CommandLine::get_instance()->a_environment.long_name() + " " +
+ CommandLine::get_instance()->a_config_suffix.argument());
+ env_spec = CommandLine::get_instance()->a_environment.argument();
+ }
paludis_command.append(" --" + CommandLine::get_instance()->a_log_level.long_name() + " " +
CommandLine::get_instance()->a_log_level.argument());
@@ -95,12 +103,13 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->a_no_color.specified())
paludis_command.append(" --" + CommandLine::get_instance()->a_no_color.long_name());
- DefaultConfig::get_instance()->set_paludis_command(paludis_command);
+ std::tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(env_spec));
+ env->set_paludis_command(paludis_command);
if (CommandLine::get_instance()->begin_parameters() == CommandLine::get_instance()->end_parameters())
throw args::DoHelp("search action takes at least one parameter");
- return do_search(*DefaultEnvironment::get_instance());
+ return do_search(*env);
}
catch (const DoVersion &)
{
diff --git a/src/clients/paludis/Makefile.am b/src/clients/paludis/Makefile.am
index 09ff90d..9d88478 100644
--- a/src/clients/paludis/Makefile.am
+++ b/src/clients/paludis/Makefile.am
@@ -53,7 +53,7 @@ paludis_LDADD = \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
- $(top_builddir)/paludis/environments/default/libpaludisdefaultenvironment.la \
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la \
$(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
$(top_builddir)/paludis/repositories/libpaludisrepositories.la \
$(top_builddir)/src/output/liboutput.a \
@@ -67,7 +67,7 @@ paludis_LDADD = \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
- $(top_builddir)/paludis/environments/default/libpaludisdefaultenvironment.la \
+ $(top_builddir)/paludis/environments/libpaludisenvironments.la \
$(top_builddir)/paludis/dep_list/libpaludisdeplist.la \
$(top_builddir)/src/output/liboutput.a \
$(top_builddir)/src/common_args/libcommonargs.a \
@@ -83,6 +83,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/gentoo/ebuild/`" \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/gentoo/ebuild/`" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \
+ PALUDIS_ENVIRONMENT_SO_DIR="`$(top_srcdir)/paludis/repositories/gentoo/ebuild/utils/canonicalise $(top_builddir)/paludis/environments`" \
SYSCONFDIR="$(sysconfdir)" \
bash $(top_srcdir)/test/run_test.sh bash
diff --git a/src/clients/paludis/applets.cc b/src/clients/paludis/applets.cc
index c5ddfa3..fbbb11f 100644
--- a/src/clients/paludis/applets.cc
+++ b/src/clients/paludis/applets.cc
@@ -28,7 +28,6 @@
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/system.hh>
#include <paludis/util/tokeniser.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <paludis/repositories/repository_maker.hh>
#include <string>
#include <set>
@@ -41,12 +40,11 @@
using namespace paludis;
-int do_has_version()
+int do_has_version(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
Context context("When performing has-version action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
std::string query(*CommandLine::get_instance()->begin_parameters());
std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(query));
@@ -59,12 +57,11 @@ int do_has_version()
return return_code;
}
-int do_best_version()
+int do_best_version(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
Context context("When performing best-version action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
std::string query(*CommandLine::get_instance()->begin_parameters());
std::tr1::shared_ptr<PackageDepSpec> spec(new PackageDepSpec(query));
@@ -104,12 +101,11 @@ int do_best_version()
return return_code;
}
-int do_environment_variable()
+int do_environment_variable(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
Context context("When performing environment-variable action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
std::string spec_str(*CommandLine::get_instance()->begin_parameters());
std::string var_str(* next(CommandLine::get_instance()->begin_parameters()));
@@ -141,12 +137,11 @@ int do_environment_variable()
return return_code;
}
-int do_configuration_variable()
+int do_configuration_variable(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
Context context("When performing configuration-variable action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
std::string repo_str(*CommandLine::get_instance()->begin_parameters());
std::string var_str(* next(CommandLine::get_instance()->begin_parameters()));
@@ -187,10 +182,9 @@ int do_list_repository_formats()
return return_code;
}
-int do_list_sync_protocols()
+int do_list_sync_protocols(std::tr1::shared_ptr<Environment> env)
{
std::map<std::string, std::string> syncers;
- Environment * const env(DefaultEnvironment::get_instance());
std::list<std::string> syncers_dirs;
WhitespaceTokeniser::get_instance()->tokenise(env->syncers_dirs(),
@@ -254,10 +248,9 @@ int do_list_dep_tag_categories()
return return_code;
}
-int do_regenerate_cache(bool installed)
+int do_regenerate_cache(std::tr1::shared_ptr<Environment> env, bool installed)
{
Context context("When performing cache regeneration action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
for (PackageDatabase::RepositoryIterator r(env->package_database()->begin_repositories()),
r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r)
diff --git a/src/clients/paludis/applets.hh b/src/clients/paludis/applets.hh
index 607b667..7c93813 100644
--- a/src/clients/paludis/applets.hh
+++ b/src/clients/paludis/applets.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -26,29 +26,34 @@
* Declaration for small do_* functions.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --has-version.
-int do_has_version();
+int do_has_version(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --best-version.
-int do_best_version();
+int do_best_version(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --environment-variable.
-int do_environment_variable();
+int do_environment_variable(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --configuration-variable.
-int do_configuration_variable();
+int do_configuration_variable(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --list-repository-formats
int do_list_repository_formats();
/// Handle --list-sync-protocols
-int do_list_sync_protocols();
+int do_list_sync_protocols(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --list-dep-tag-categories
int do_list_dep_tag_categories();
/// Handle cache regeneration
-int do_regenerate_cache(bool installed);
+int do_regenerate_cache(std::tr1::shared_ptr<paludis::Environment>, bool installed);
#endif
diff --git a/src/clients/paludis/command_line.cc b/src/clients/paludis/command_line.cc
index 6606010..4f76a51 100644
--- a/src/clients/paludis/command_line.cc
+++ b/src/clients/paludis/command_line.cc
@@ -67,7 +67,7 @@ CommandLine::CommandLine() :
a_log_level(&general_args, "log-level", '\0'),
a_no_colour(&general_args, "no-colour", '\0', "Do not use colour"),
a_no_color(&a_no_colour, "no-color"),
- a_config_suffix(&general_args, "config-suffix", 'c', "Config directory suffix"),
+ a_environment(&general_args, "environment", 'E', "Environment specification (class:suffix, both parts optional)"),
a_resume_command_template(&general_args, "resume-command-template", '\0', "Save the resume command to a file made using mkstemp(3)"),
query_args(this, "Query options",
@@ -228,7 +228,9 @@ CommandLine::CommandLine() :
a_show_install_reasons(&deprecated_args, "show-install-reasons",
'\0', "Replaced by --show-reasons"),
a_add_to_world_atom(&deprecated_args, "add-to-world-atom", '\0',
- "Repoaced by --add-to-world-spec")
+ "Replaced by --add-to-world-spec"),
+ a_config_suffix(&deprecated_args, "config-suffix", 'c',
+ "Replaced by --environment")
{
add_usage_line("--query [query options] target ...");
add_usage_line("--install [install options] target ...");
diff --git a/src/clients/paludis/command_line.hh b/src/clients/paludis/command_line.hh
index 21c6b81..53e82ec 100644
--- a/src/clients/paludis/command_line.hh
+++ b/src/clients/paludis/command_line.hh
@@ -160,8 +160,8 @@ class CommandLine :
/// --no-color
paludis::args::AliasArg a_no_color;
- /// --config-suffix
- paludis::args::StringArg a_config_suffix;
+ /// --environment
+ paludis::args::StringArg a_environment;
/// --resume-command-template
paludis::args::StringArg a_resume_command_template;
@@ -312,6 +312,8 @@ class CommandLine :
paludis::args::SwitchArg a_dl_ignore_installed;
paludis::args::StringArg a_show_install_reasons;
paludis::args::StringArg a_add_to_world_atom;
+ paludis::args::StringArg a_config_suffix;
+
///\}
};
diff --git a/src/clients/paludis/do_config.cc b/src/clients/paludis/do_config.cc
index efb3695..3234216 100644
--- a/src/clients/paludis/do_config.cc
+++ b/src/clients/paludis/do_config.cc
@@ -21,7 +21,6 @@
#include "command_line.hh"
#include <src/output/colour.hh>
#include <paludis/paludis.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <iostream>
using namespace paludis;
@@ -48,7 +47,7 @@ namespace
};
int
- do_one_config_entry(Environment * const env, const PackageDatabaseEntry & p)
+ do_one_config_entry(std::tr1::shared_ptr<Environment> env, const PackageDatabaseEntry & p)
{
int return_code(0);
@@ -68,7 +67,7 @@ namespace
}
int
- do_one_config(Environment * const env, const std::string & target)
+ do_one_config(std::tr1::shared_ptr<Environment> env, const std::string & target)
{
Context local_context("When handling query '" + target + "':");
@@ -93,12 +92,11 @@ namespace
}
int
-do_config()
+do_config(std::tr1::shared_ptr<Environment> env)
{
int ret_code(0);
Context context("When performing config action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
CommandLine::ParametersIterator q(CommandLine::get_instance()->begin_parameters()),
q_end(CommandLine::get_instance()->end_parameters());
diff --git a/src/clients/paludis/do_config.hh b/src/clients/paludis/do_config.hh
index c1f24ef..648c040 100644
--- a/src/clients/paludis/do_config.hh
+++ b/src/clients/paludis/do_config.hh
@@ -20,12 +20,19 @@
#ifndef PALUDIS_GUARD_SRC_CONFIG_HH
#define PALUDIS_GUARD_SRC_CONFIG_HH 1
+#include <tr1/memory>
+
/** \file
* Declaration for the do_config function.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --config.
-int do_config();
+int do_config(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/do_contents.cc b/src/clients/paludis/do_contents.cc
index c1fdfbb..250f005 100644
--- a/src/clients/paludis/do_contents.cc
+++ b/src/clients/paludis/do_contents.cc
@@ -21,7 +21,6 @@
#include <src/output/colour.hh>
#include "command_line.hh"
#include <paludis/paludis.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <iostream>
#include <algorithm>
@@ -69,7 +68,7 @@ namespace
void
do_one_contents_entry(
- const Environment * const env,
+ const std::tr1::shared_ptr<Environment> env,
const PackageDatabaseEntry & e)
{
cout << "* " << colour(cl_package_name, e) << endl;
@@ -92,7 +91,7 @@ do_one_contents_entry(
void
do_one_contents(
- const Environment * const env,
+ const std::tr1::shared_ptr<Environment> env,
const std::string & q)
{
Context local_context("When handling query '" + q + "':");
@@ -117,12 +116,11 @@ do_one_contents(
}
int
-do_contents()
+do_contents(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
Context context("When performing contents action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
CommandLine::ParametersIterator q(CommandLine::get_instance()->begin_parameters()),
q_end(CommandLine::get_instance()->end_parameters());
diff --git a/src/clients/paludis/do_contents.hh b/src/clients/paludis/do_contents.hh
index 5cf38e3..3a03a50 100644
--- a/src/clients/paludis/do_contents.hh
+++ b/src/clients/paludis/do_contents.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -24,7 +24,14 @@
* Declaration for the do_contents function.
*/
+#include <tr1/memory>
+
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --contents.
-int do_contents();
+int do_contents(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/exception_TEST b/src/clients/paludis/exception_TEST
index a3daaaf..7f5315b 100755
--- a/src/clients/paludis/exception_TEST
+++ b/src/clients/paludis/exception_TEST
@@ -2,5 +2,5 @@
PALUDIS_HOME=./ \
./paludis --config-suffix paludis-build-test -pi asdf 2>&1 \
- | grep 'Default configuration error' >/dev/null
+ | grep 'configuration error' >/dev/null
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index 9e774c4..3ba6f5b 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -43,8 +43,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/system.hh>
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/environments/default/default_config.hh>
#include <paludis/dep_list/exceptions.hh>
/** \file
@@ -59,9 +57,9 @@ using std::endl;
namespace
{
- std::string make_resume_command(const InstallTask & task, bool skip_first)
+ std::string make_resume_command(std::tr1::shared_ptr<Environment> env, const InstallTask & task, bool skip_first)
{
- std::string resume_command = DefaultEnvironment::get_instance()->paludis_command()
+ std::string resume_command = env->paludis_command()
+ " --" + CommandLine::get_instance()->dl_deps_default.long_name() + " discard --"
+ CommandLine::get_instance()->a_install.long_name();
@@ -97,7 +95,7 @@ namespace
return resume_command;
}
- void show_resume_command(const InstallTask & task)
+ void show_resume_command(std::tr1::shared_ptr<Environment> env, const InstallTask & task)
{
if (CommandLine::get_instance()->a_fetch.specified() ||
CommandLine::get_instance()->a_pretend.specified())
@@ -105,7 +103,7 @@ namespace
if (task.current_dep_list_entry() != task.dep_list().end())
{
- std::string resume_command(make_resume_command(task, false));
+ std::string resume_command(make_resume_command(env, task, false));
if (CommandLine::get_instance()->a_resume_command_template.specified())
{
@@ -150,10 +148,14 @@ namespace
class OurInstallTask :
public ConsoleInstallTask
{
+ private:
+ std::tr1::shared_ptr<Environment> _env;
+
public:
- OurInstallTask(const DepListOptions & options,
+ OurInstallTask(std::tr1::shared_ptr<Environment> env, const DepListOptions & options,
std::tr1::shared_ptr<const DestinationsCollection> destinations) :
- ConsoleInstallTask(DefaultEnvironment::get_instance(), options, destinations)
+ ConsoleInstallTask(env.get(), options, destinations),
+ _env(env)
{
}
@@ -201,7 +203,7 @@ namespace
virtual void on_installed_paludis()
{
- std::string r(DefaultConfig::get_instance()->root());
+ std::string r(stringify(_env->root()));
std::string exec_mode(getenv_with_default("PALUDIS_EXEC_PALUDIS", ""));
if ("always" != exec_mode)
@@ -212,7 +214,7 @@ namespace
return;
}
- std::string resume_command(make_resume_command(*this, true));
+ std::string resume_command(make_resume_command(_env, *this, true));
output_heading("Paludis has just upgraded Paludis");
output_starred_item("Using '" + resume_command + "' to start a new Paludis instance...");
@@ -227,15 +229,18 @@ namespace
private:
static const InstallTask * _task;
+ static std::tr1::shared_ptr<Environment> _env;
+
static void _signal_handler(int sig) PALUDIS_ATTRIBUTE((noreturn));
sig_t _old;
public:
- InstallKilledCatcher(const InstallTask & task) :
+ InstallKilledCatcher(std::tr1::shared_ptr<Environment> env, const InstallTask & task) :
_old(signal(SIGINT, &InstallKilledCatcher::_signal_handler))
{
_task = &task;
+ _env = env;
}
~InstallKilledCatcher()
@@ -246,6 +251,7 @@ namespace
};
const InstallTask * InstallKilledCatcher::_task(0);
+ std::tr1::shared_ptr<Environment> InstallKilledCatcher::_env;
void
InstallKilledCatcher::_signal_handler(int sig)
@@ -276,7 +282,7 @@ namespace
;
cerr << endl;
if (_task)
- show_resume_command(*_task);
+ show_resume_command(_env, *_task);
cerr << endl;
cerr << "Exiting with failure" << endl;
exit(EXIT_FAILURE);
@@ -302,7 +308,7 @@ namespace
}
int
-do_install()
+do_install(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
@@ -483,7 +489,7 @@ do_install()
i_end(CommandLine::get_instance()->a_destinations.end_args()) ;
i != i_end ; ++i)
{
- std::tr1::shared_ptr<Repository> repo(DefaultEnvironment::get_instance()->package_database()->fetch_repository(
+ std::tr1::shared_ptr<Repository> repo(env->package_database()->fetch_repository(
RepositoryName(*i)));
if (repo->destination_interface)
d->insert(repo);
@@ -494,9 +500,9 @@ do_install()
destinations = d;
}
else
- destinations = DefaultEnvironment::get_instance()->default_destinations();
+ destinations = env->default_destinations();
- OurInstallTask task(options, destinations);
+ OurInstallTask task(env, options, destinations);
task.set_no_config_protect(CommandLine::get_instance()->a_no_config_protection.specified());
task.set_fetch_only(CommandLine::get_instance()->a_fetch.specified());
task.set_pretend(CommandLine::get_instance()->a_pretend.specified());
@@ -509,7 +515,7 @@ do_install()
if (CommandLine::get_instance()->a_debug_build.specified())
task.set_debug_mode(CommandLine::get_instance()->a_debug_build.option());
- InstallKilledCatcher install_killed_catcher(task);
+ InstallKilledCatcher install_killed_catcher(env, task);
try
{
@@ -545,7 +551,7 @@ do_install()
cerr << " * " << e.backtrace("\n * ");
cerr << e.message() << endl;
cerr << endl;
- show_resume_command(task);
+ show_resume_command(env, task);
cerr << endl;
return_code |= 1;
@@ -557,7 +563,7 @@ do_install()
cerr << " * " << e.backtrace("\n * ");
cerr << e.message() << endl;
cerr << endl;
- show_resume_command(task);
+ show_resume_command(env, task);
cerr << endl;
return_code |= 1;
@@ -575,7 +581,7 @@ do_install()
try
{
std::tr1::shared_ptr<const PackageDatabaseEntryCollection> p(
- DefaultEnvironment::get_instance()->package_database()->query(
+ env->package_database()->query(
query::Matches(PackageDepSpec(e.query())) & query::RepositoryHasInstalledInterface(),
qo_order_by_version));
if (p->empty())
@@ -597,7 +603,7 @@ do_install()
cerr << " * " << colour(cl_package_name, *pp) << ": Masked by ";
bool need_comma(false);
- MaskReasons m(DefaultEnvironment::get_instance()->mask_reasons(*pp));
+ MaskReasons m(env->mask_reasons(*pp));
for (unsigned mm = 0 ; mm < m.size() ; ++mm)
if (m[mm])
{
@@ -607,8 +613,7 @@ do_install()
if (mr_eapi == mm)
{
- std::string eapi_str(DefaultEnvironment::get_instance()->
- package_database()->fetch_repository(
+ std::string eapi_str(env->package_database()->fetch_repository(
pp->repository)->version_metadata(
pp->name, pp->version)->eapi);
@@ -620,8 +625,8 @@ do_install()
}
else if (mr_license == mm)
{
- std::tr1::shared_ptr<const VersionMetadata> meta(DefaultEnvironment::get_instance()->
- package_database()->fetch_repository(
+ std::tr1::shared_ptr<const VersionMetadata> meta(
+ env->package_database()->fetch_repository(
pp->repository)->version_metadata(
pp->name, pp->version));
@@ -629,13 +634,13 @@ do_install()
{
cerr << " ";
- LicenceDisplayer ld(cerr, DefaultEnvironment::get_instance(), &*pp);
+ LicenceDisplayer ld(cerr, env.get(), &*pp);
meta->license_interface->license()->accept(&ld);
}
}
else if (mr_keyword == mm)
{
- std::tr1::shared_ptr<const VersionMetadata> meta(DefaultEnvironment::get_instance()->
+ std::tr1::shared_ptr<const VersionMetadata> meta(env->
package_database()->fetch_repository(
pp->repository)->version_metadata(
pp->name, pp->version));
diff --git a/src/clients/paludis/install.hh b/src/clients/paludis/install.hh
index 693931b..724e6db 100644
--- a/src/clients/paludis/install.hh
+++ b/src/clients/paludis/install.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -26,7 +26,12 @@
* Declaration for the do_install function.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --install.
-int do_install();
+int do_install(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/list.cc b/src/clients/paludis/list.cc
index f4a0161..cb41f61 100644
--- a/src/clients/paludis/list.cc
+++ b/src/clients/paludis/list.cc
@@ -25,19 +25,17 @@
#include <list>
#include <map>
#include <paludis/paludis.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <paludis/util/log.hh>
#include <paludis/util/visitor.hh>
using namespace paludis;
int
-do_list_repositories()
+do_list_repositories(std::tr1::shared_ptr<Environment> env)
{
int ret_code(1);
Context context("When performing list-repositories action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
for (IndirectIterator<PackageDatabase::RepositoryIterator, const Repository>
r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()) ;
@@ -77,12 +75,11 @@ do_list_repositories()
}
int
-do_list_categories()
+do_list_categories(std::tr1::shared_ptr<Environment> env)
{
int ret_code(1);
Context context("When performing list-categories action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
std::map<CategoryNamePart, std::list<RepositoryName> > cats;
@@ -131,12 +128,11 @@ do_list_categories()
}
int
-do_list_packages()
+do_list_packages(std::tr1::shared_ptr<Environment> env)
{
int ret_code(1);
Context context("When performing list-packages action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
std::map<QualifiedPackageName, std::list<RepositoryName> > pkgs;
@@ -197,12 +193,11 @@ do_list_packages()
}
int
-do_list_sets()
+do_list_sets(std::tr1::shared_ptr<Environment> env)
{
int ret_code(1);
Context context("While performing list-sets action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
std::map<SetName, std::list<std::string> > sets;
diff --git a/src/clients/paludis/list.hh b/src/clients/paludis/list.hh
index 204af50..4248a43 100644
--- a/src/clients/paludis/list.hh
+++ b/src/clients/paludis/list.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -24,16 +24,21 @@
* Declaration for the do_list_repositories and do_list_categories functions.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --list-repositories.
-int do_list_repositories();
+int do_list_repositories(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --list-categories.
-int do_list_categories();
+int do_list_categories(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --list-packages.
-int do_list_packages();
+int do_list_packages(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --list-sets.
-int do_list_sets();
+int do_list_sets(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/news.cc b/src/clients/paludis/news.cc
index e8651c6..da1cb3c 100644
--- a/src/clients/paludis/news.cc
+++ b/src/clients/paludis/news.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -23,24 +23,22 @@
#include <iomanip>
#include <iostream>
#include <paludis/paludis.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <string>
/** \file
* Handle the --update-news action for the main paludis program.
*/
-namespace p = paludis;
+using namespace paludis;
int
-do_update_news()
+do_update_news(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
- p::Context context("When performing update-news action from command line:");
- p::Environment * const env(p::DefaultEnvironment::get_instance());
+ Context context("When performing update-news action from command line:");
- for (p::PackageDatabase::RepositoryIterator r(env->package_database()->begin_repositories()),
+ for (PackageDatabase::RepositoryIterator r(env->package_database()->begin_repositories()),
r_end(env->package_database()->end_repositories()) ; r != r_end ; ++r)
if ((*r)->news_interface)
(*r)->news_interface->update_news();
diff --git a/src/clients/paludis/news.hh b/src/clients/paludis/news.hh
index 1e3e06d..4c2e88f 100644
--- a/src/clients/paludis/news.hh
+++ b/src/clients/paludis/news.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -26,8 +26,13 @@
* Declaration for the do_update_news function.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --update-news.
-int do_update_news();
+int do_update_news(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/owner.cc b/src/clients/paludis/owner.cc
index cbace86..cf99045 100644
--- a/src/clients/paludis/owner.cc
+++ b/src/clients/paludis/owner.cc
@@ -21,7 +21,6 @@
#include <src/output/colour.hh>
#include "command_line.hh"
#include <paludis/paludis.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <iostream>
using namespace paludis;
@@ -87,7 +86,7 @@ namespace
int
do_one_owner(
- const Environment * const env,
+ const std::tr1::shared_ptr<Environment> env,
const std::string & query)
{
bool found_owner=false;
@@ -133,11 +132,10 @@ do_one_owner(
int
-do_owner()
+do_owner(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
Context context("When performing owner action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
CommandLine::ParametersIterator q(CommandLine::get_instance()->begin_parameters()),
q_end(CommandLine::get_instance()->end_parameters());
diff --git a/src/clients/paludis/owner.hh b/src/clients/paludis/owner.hh
index ce9efba..cb190ee 100644
--- a/src/clients/paludis/owner.hh
+++ b/src/clients/paludis/owner.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -20,11 +20,18 @@
#ifndef PALUDIS_GUARD_SRC_OWNER_HH
#define PALUDIS_GUARD_SRC_OWNER_HH 1
+#include <tr1/memory>
+
/** \file
* Declaration for the do_owner function.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --owner.
-int do_owner();
+int do_owner(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/paludis.cc b/src/clients/paludis/paludis.cc
index 262d417..d16d36c 100644
--- a/src/clients/paludis/paludis.cc
+++ b/src/clients/paludis/paludis.cc
@@ -35,11 +35,10 @@
#include <src/output/colour.hh>
#include <paludis/paludis.hh>
+#include <paludis/environments/environment_maker.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/util/util.hh>
#include <paludis/util/log.hh>
-#include <paludis/environments/default/default_environment.hh>
-#include <paludis/environments/default/default_config.hh>
#include <libebt/libebt.hh>
#include <libwrapiter/libwrapiter.hh>
@@ -107,10 +106,8 @@ namespace
#endif
}
- void display_info()
+ void display_info(std::tr1::shared_ptr<Environment> env)
{
- Environment * const env(DefaultEnvironment::get_instance());
-
for (IndirectIterator<PackageDatabase::RepositoryIterator, const Repository>
r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()) ;
r != r_end ; ++r)
@@ -261,7 +258,7 @@ main(int argc, char *argv[])
throw args::DoHelp("you should specify exactly one action");
}
- /* these actions don't need DefaultConfig or paludis_command. */
+ /* these actions don't need Environment or paludis_command. */
if (CommandLine::get_instance()->a_list_repository_formats.specified())
{
@@ -279,51 +276,49 @@ main(int argc, char *argv[])
return do_list_dep_tag_categories();
}
- /* these actions do need DefaultConfig or paludis_command */
+ /* these actions do need Environment or paludis_command */
+
+ std::string paludis_command(argv[0]), env_spec;
- try
+ if (CommandLine::get_instance()->a_config_suffix.specified())
{
- std::string paludis_command(argv[0]);
- if (CommandLine::get_instance()->a_config_suffix.specified())
- {
- DefaultConfig::set_config_suffix(CommandLine::get_instance()->a_config_suffix.argument());
- paludis_command.append(" --" + CommandLine::get_instance()->a_config_suffix.long_name() + " " +
- CommandLine::get_instance()->a_config_suffix.argument());
- }
+ Log::get_instance()->message(ll_warning, lc_no_context,
+ "--config-suffix is deprecated, use --environment ':" +
+ CommandLine::get_instance()->a_config_suffix.argument() + "'");
- paludis_command.append(" --" + CommandLine::get_instance()->a_log_level.long_name() + " " +
- CommandLine::get_instance()->a_log_level.argument());
+ env_spec = ":" + CommandLine::get_instance()->a_config_suffix.argument();
+ paludis_command.append(" --" + CommandLine::get_instance()->a_config_suffix.long_name() + " " +
+ CommandLine::get_instance()->a_config_suffix.argument());
+ }
+ else if (CommandLine::get_instance()->a_environment.specified())
+ {
+ env_spec = CommandLine::get_instance()->a_environment.argument();
+ paludis_command.append(" --" + CommandLine::get_instance()->a_environment.long_name() + " " +
+ CommandLine::get_instance()->a_environment.argument());
+ }
- if (CommandLine::get_instance()->a_resume_command_template.specified())
- paludis_command.append(" --" + CommandLine::get_instance()->a_resume_command_template.long_name() + " "
- + CommandLine::get_instance()->a_resume_command_template.argument());
+ paludis_command.append(" --" + CommandLine::get_instance()->a_log_level.long_name() + " " +
+ CommandLine::get_instance()->a_log_level.argument());
- if (CommandLine::get_instance()->a_no_color.specified())
- paludis_command.append(" --" + CommandLine::get_instance()->a_no_color.long_name());
+ if (CommandLine::get_instance()->a_resume_command_template.specified())
+ paludis_command.append(" --" + CommandLine::get_instance()->a_resume_command_template.long_name() + " "
+ + CommandLine::get_instance()->a_resume_command_template.argument());
- if (CommandLine::get_instance()->a_no_config_protection.specified())
- paludis_command.append(" --" + CommandLine::get_instance()->a_no_config_protection.long_name());
+ if (CommandLine::get_instance()->a_no_color.specified())
+ paludis_command.append(" --" + CommandLine::get_instance()->a_no_color.long_name());
- if (CommandLine::get_instance()->a_preserve_world.specified())
- paludis_command.append(" --" + CommandLine::get_instance()->a_preserve_world.long_name());
+ if (CommandLine::get_instance()->a_no_config_protection.specified())
+ paludis_command.append(" --" + CommandLine::get_instance()->a_no_config_protection.long_name());
- if (CommandLine::get_instance()->a_debug_build.specified())
- paludis_command.append(" --" + CommandLine::get_instance()->a_debug_build.long_name() + " "
- + CommandLine::get_instance()->a_debug_build.argument());
+ if (CommandLine::get_instance()->a_preserve_world.specified())
+ paludis_command.append(" --" + CommandLine::get_instance()->a_preserve_world.long_name());
- DefaultConfig::get_instance()->set_paludis_command(paludis_command);
+ if (CommandLine::get_instance()->a_debug_build.specified())
+ paludis_command.append(" --" + CommandLine::get_instance()->a_debug_build.long_name() + " "
+ + CommandLine::get_instance()->a_debug_build.argument());
- }
- catch (const DefaultConfigError &)
- {
- if (CommandLine::get_instance()->a_info.specified())
- {
- display_version();
- cout << endl;
- cout << "Cannot complete --info output due to configuration exception" << endl;
- }
- throw;
- }
+ std::tr1::shared_ptr<Environment> env(EnvironmentMaker::get_instance()->make_from_spec(env_spec));
+ env->set_paludis_command(paludis_command);
if (CommandLine::get_instance()->a_resume_command_template.specified())
{
@@ -338,14 +333,14 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("list-sync-protocols action takes no parameters");
- return do_list_sync_protocols();
+ return do_list_sync_protocols(env);
}
if (CommandLine::get_instance()->a_info.specified())
{
display_version();
cout << endl;
- display_info();
+ display_info(env);
cout << endl;
return EXIT_SUCCESS;
}
@@ -355,7 +350,7 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->empty())
throw args::DoHelp("query action requires at least one parameter");
- return do_query();
+ return do_query(env);
}
if (CommandLine::get_instance()->a_install.specified())
@@ -363,7 +358,7 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->empty())
throw args::DoHelp("install action requires at least one parameter");
- return do_install();
+ return do_install(env);
}
if (CommandLine::get_instance()->a_uninstall.specified())
@@ -371,7 +366,7 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->empty())
throw args::DoHelp("uninstall action requires at least one parameter");
- return do_uninstall();
+ return do_uninstall(env);
}
if (CommandLine::get_instance()->a_config.specified())
@@ -379,7 +374,7 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->empty())
throw args::DoHelp("config action requires at least one parameter");
- return do_config();
+ return do_config(env);
}
if (CommandLine::get_instance()->a_uninstall_unused.specified())
@@ -387,19 +382,19 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("uninstall-unused action takes no parameters");
- return do_uninstall_unused();
+ return do_uninstall_unused(env);
}
if (CommandLine::get_instance()->a_sync.specified())
{
- return do_sync();
+ return do_sync(env);
}
if (CommandLine::get_instance()->a_report.specified())
{
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("report action takes no parameters");
- return do_report();
+ return do_report(env);
}
if (CommandLine::get_instance()->a_list_repositories.specified())
@@ -407,7 +402,7 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("list-repositories action takes no parameters");
- return do_list_repositories();
+ return do_list_repositories(env);
}
if (CommandLine::get_instance()->a_list_categories.specified())
@@ -415,7 +410,7 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("list-categories action takes no parameters");
- return do_list_categories();
+ return do_list_categories(env);
}
if (CommandLine::get_instance()->a_list_packages.specified())
@@ -423,7 +418,7 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("list-packages action takes no parameters");
- return do_list_packages();
+ return do_list_packages(env);
}
if (CommandLine::get_instance()->a_list_sets.specified())
@@ -431,7 +426,7 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("list-sets action takes no parameters");
- return do_list_sets();
+ return do_list_sets(env);
}
if (CommandLine::get_instance()->a_contents.specified())
@@ -439,7 +434,7 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->empty())
throw args::DoHelp("contents action requires at least one parameter");
- return do_contents();
+ return do_contents(env);
}
if (CommandLine::get_instance()->a_owner.specified())
@@ -447,7 +442,7 @@ main(int argc, char *argv[])
if (CommandLine::get_instance()->empty())
throw args::DoHelp("owner action requires at least one parameter");
- return do_owner();
+ return do_owner(env);
}
if (CommandLine::get_instance()->a_has_version.specified())
@@ -456,7 +451,7 @@ main(int argc, char *argv[])
CommandLine::get_instance()->end_parameters()))
throw args::DoHelp("has-version action takes exactly one parameter");
- return do_has_version();
+ return do_has_version(env);
}
if (CommandLine::get_instance()->a_best_version.specified())
@@ -465,7 +460,7 @@ main(int argc, char *argv[])
CommandLine::get_instance()->end_parameters()))
throw args::DoHelp("best-version action takes exactly one parameter");
- return do_best_version();
+ return do_best_version(env);
}
if (CommandLine::get_instance()->a_environment_variable.specified())
@@ -474,7 +469,7 @@ main(int argc, char *argv[])
CommandLine::get_instance()->end_parameters()))
throw args::DoHelp("environment-variable action takes exactly two parameters (depspec var)");
- return do_environment_variable();
+ return do_environment_variable(env);
}
if (CommandLine::get_instance()->a_configuration_variable.specified())
@@ -483,7 +478,7 @@ main(int argc, char *argv[])
CommandLine::get_instance()->end_parameters()))
throw args::DoHelp("configuration-variable action takes exactly two parameters (repository var)");
- return do_configuration_variable();
+ return do_configuration_variable(env);
}
if (CommandLine::get_instance()->a_update_news.specified())
@@ -491,7 +486,7 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("update-news action takes no parameters");
- return do_update_news();
+ return do_update_news(env);
}
if (CommandLine::get_instance()->a_regenerate_installed_cache.specified() ||
@@ -500,7 +495,7 @@ main(int argc, char *argv[])
if (! CommandLine::get_instance()->empty())
throw args::DoHelp("regenerate cache actions takes no parameters");
- return do_regenerate_cache(CommandLine::get_instance()->a_regenerate_installed_cache.specified());
+ return do_regenerate_cache(env, CommandLine::get_instance()->a_regenerate_installed_cache.specified());
}
throw InternalError(__PRETTY_FUNCTION__, "no action?");
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 7e8c7c3..513407a 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -27,7 +27,6 @@
#include <iostream>
#include <paludis/paludis.hh>
#include <paludis/util/collection_concrete.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <string>
/** \file
@@ -45,8 +44,8 @@ namespace
public ConsoleQueryTask
{
public:
- QueryTask(const Environment * const e) :
- ConsoleQueryTask(e)
+ QueryTask(const std::tr1::shared_ptr<Environment> e) :
+ ConsoleQueryTask(e.get())
{
}
@@ -63,7 +62,7 @@ namespace
}
void do_one_package_query(
- const Environment * const env,
+ const std::tr1::shared_ptr<Environment> env,
MaskReasons & mask_reasons_to_explain,
std::tr1::shared_ptr<PackageDepSpec> spec)
{
@@ -74,7 +73,7 @@ void do_one_package_query(
}
void do_one_set_query(
- const Environment * const,
+ const std::tr1::shared_ptr<Environment>,
const std::string & q,
MaskReasons &,
std::tr1::shared_ptr<DepSpec> set)
@@ -87,7 +86,7 @@ void do_one_set_query(
}
void do_one_query(
- const Environment * const env,
+ const std::tr1::shared_ptr<Environment> env,
const std::string & q,
MaskReasons & mask_reasons_to_explain)
{
@@ -119,12 +118,11 @@ void do_one_query(
do_one_set_query(env, q, mask_reasons_to_explain, set);
}
-int do_query()
+int do_query(std::tr1::shared_ptr<Environment> env)
{
int return_code(0);
Context context("When performing query action from command line:");
- Environment * const env(DefaultEnvironment::get_instance());
MaskReasons mask_reasons_to_explain;
diff --git a/src/clients/paludis/query.hh b/src/clients/paludis/query.hh
index 62e7e02..ee132a8 100644
--- a/src/clients/paludis/query.hh
+++ b/src/clients/paludis/query.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -26,7 +26,12 @@
* Declaration for the do_query function.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --query.
-int do_query();
+int do_query(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/report.cc b/src/clients/paludis/report.cc
index a9fe90e..2588e3d 100644
--- a/src/clients/paludis/report.cc
+++ b/src/clients/paludis/report.cc
@@ -20,7 +20,6 @@
#include "report.hh"
#include <src/output/colour.hh>
#include <paludis/tasks/report_task.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <iostream>
/** \file
@@ -41,8 +40,8 @@ namespace
int _n_errors;
public:
- OurReportTask() :
- ReportTask(DefaultEnvironment::get_instance()),
+ OurReportTask(std::tr1::shared_ptr<Environment> env) :
+ ReportTask(env.get()),
_n_packages(0),
_n_errors(0)
{
@@ -160,11 +159,11 @@ namespace
}
}
-int do_report()
+int do_report(std::tr1::shared_ptr<Environment> env)
{
Context context("When performing report action from command line:");
- OurReportTask task;
+ OurReportTask task(env);
task.execute();
return task.return_code();
diff --git a/src/clients/paludis/report.hh b/src/clients/paludis/report.hh
index 761a200..c3b94a5 100644
--- a/src/clients/paludis/report.hh
+++ b/src/clients/paludis/report.hh
@@ -26,8 +26,13 @@
* Declaration for the do_report function.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --report.
-int do_report();
+int do_report(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/sync.cc b/src/clients/paludis/sync.cc
index 055ab7c..a9ead07 100644
--- a/src/clients/paludis/sync.cc
+++ b/src/clients/paludis/sync.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -20,7 +20,6 @@
#include <src/output/colour.hh>
#include "sync.hh"
#include <paludis/tasks/sync_task.hh>
-#include <paludis/environments/default/default_environment.hh>
#include <paludis/syncer.hh>
#include <iomanip>
#include <iostream>
@@ -44,8 +43,8 @@ namespace
int _return_code;
public:
- OurSyncTask() :
- SyncTask(DefaultEnvironment::get_instance()),
+ OurSyncTask(std::tr1::shared_ptr<Environment> env) :
+ SyncTask(env.get()),
_return_code(0)
{
}
@@ -111,11 +110,11 @@ namespace
}
}
-int do_sync()
+int do_sync(std::tr1::shared_ptr<Environment> env)
{
Context context("When performing sync action from command line:");
- OurSyncTask task;
+ OurSyncTask task(env);
for (CommandLine::ParametersIterator q(CommandLine::get_instance()->begin_parameters()),
q_end(CommandLine::get_instance()->end_parameters()) ; q != q_end ; ++q)
diff --git a/src/clients/paludis/sync.hh b/src/clients/paludis/sync.hh
index 92c518c..6c2fe9e 100644
--- a/src/clients/paludis/sync.hh
+++ b/src/clients/paludis/sync.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -26,8 +26,13 @@
* Declaration for the do_sync function.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --sync.
-int do_sync();
+int do_sync(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/src/clients/paludis/uninstall.cc b/src/clients/paludis/uninstall.cc
index b4902bc..bd13744 100644
--- a/src/clients/paludis/uninstall.cc
+++ b/src/clients/paludis/uninstall.cc
@@ -20,7 +20,6 @@
#include <src/output/colour.hh>
#include "uninstall.hh"
-#include <paludis/environments/default/default_environment.hh>
#include <paludis/tasks/uninstall_task.hh>
#include <paludis/tasks/exceptions.hh>
#include <paludis/dep_list/uninstall_list.hh>
@@ -47,8 +46,8 @@ namespace
int _count, _current_count;
public:
- OurUninstallTask() :
- UninstallTask(DefaultEnvironment::get_instance()),
+ OurUninstallTask(std::tr1::shared_ptr<Environment> e) :
+ UninstallTask(e.get()),
_count(0),
_current_count(0)
{
@@ -175,7 +174,7 @@ namespace
}
};
- int real_uninstall(bool unused)
+ int real_uninstall(std::tr1::shared_ptr<Environment> env, bool unused)
{
int return_code(0);
@@ -183,7 +182,7 @@ namespace
"When performing uninstall-unused action from command line:" :
"When performing uninstall action from command line:");
- OurUninstallTask task;
+ OurUninstallTask task(env);
task.set_pretend(CommandLine::get_instance()->a_pretend.specified());
task.set_no_config_protect(CommandLine::get_instance()->a_no_config_protection.specified());
@@ -262,14 +261,14 @@ namespace
}
int
-do_uninstall()
+do_uninstall(std::tr1::shared_ptr<Environment> env)
{
- return real_uninstall(false);
+ return real_uninstall(env, false);
}
int
-do_uninstall_unused()
+do_uninstall_unused(std::tr1::shared_ptr<Environment> env)
{
- return real_uninstall(true);
+ return real_uninstall(env, true);
}
diff --git a/src/clients/paludis/uninstall.hh b/src/clients/paludis/uninstall.hh
index 55686db..124a535 100644
--- a/src/clients/paludis/uninstall.hh
+++ b/src/clients/paludis/uninstall.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006 Ciaran McCreesh <ciaranm@ciaranm.org>
+ * Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
*
* 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
@@ -26,11 +26,16 @@
* Declaration for the do_uninstall function.
*/
+namespace paludis
+{
+ class Environment;
+}
+
/// Handle --uninstall.
-int do_uninstall();
+int do_uninstall(std::tr1::shared_ptr<paludis::Environment>);
/// Handle --uninstall-unused.
-int do_uninstall_unused();
+int do_uninstall_unused(std::tr1::shared_ptr<paludis::Environment>);
#endif
diff --git a/tr1/Makefile.am b/tr1/Makefile.am
index f393a66..7068052 100644
--- a/tr1/Makefile.am
+++ b/tr1/Makefile.am
@@ -8,7 +8,7 @@ DEFS= \
-DDATADIR=\"$(datadir)\" \
-DLIBDIR=\"$(libdir)\"
-paludis_compat_tr1dir = $(libdir)/paludis/compat/tr1
+paludis_compat_tr1dir = $(includedir)/paludis/compat/tr1
paludis_compat_tr1_HEADERS = tr1_memory.hh