aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-18 19:48:40 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-18 19:48:40 +0000
commitb0984f6e15f2da0e52dd341d1bab63f94de927b8 (patch)
tree1c8815e09a64a0d0aeade3bbc30d5af6d8b5fc1d
parent6dfe78633a6155bb6231e996cfb2ac2bce3157bd (diff)
downloadpaludis-b0984f6e15f2da0e52dd341d1bab63f94de927b8.tar.gz
paludis-b0984f6e15f2da0e52dd341d1bab63f94de927b8.tar.xz
Make EAPIs, dep parsing ERepository specific. Fixes: ticket:316
-rw-r--r--configure.ac2
-rw-r--r--paludis/Makefile.am.m44
-rw-r--r--paludis/dep_list/Makefile.am4
-rw-r--r--paludis/dep_list/dep_list.cc2
-rw-r--r--paludis/dep_list/dep_list_TEST.cc10
-rw-r--r--paludis/dep_list/dep_list_TEST.hh1
-rw-r--r--paludis/dep_list/range_rewriter_TEST.cc1
-rw-r--r--paludis/dep_list/uninstall_list_TEST.cc1
-rw-r--r--paludis/dep_spec_pretty_printer.hh93
-rw-r--r--paludis/dep_tag.cc112
-rw-r--r--paludis/dep_tag.hh10
-rw-r--r--paludis/eapi.hh81
-rw-r--r--paludis/environment_implementation.cc8
-rw-r--r--paludis/environment_implementation.hh4
-rw-r--r--paludis/environments/no_config/Makefile.am2
-rw-r--r--paludis/environments/no_config/no_config_environment.cc8
-rw-r--r--paludis/environments/paludis/paludis_environment.cc2
-rw-r--r--paludis/environments/portage/portage_environment.cc2
-rw-r--r--paludis/files.m44
-rw-r--r--paludis/metadata_key.hh6
-rw-r--r--paludis/package_id.hh10
-rw-r--r--paludis/portage_dep_lexer.hh125
-rw-r--r--paludis/portage_dep_parser.hh120
-rw-r--r--paludis/repositories/e/Makefile.am77
-rw-r--r--paludis/repositories/e/dep_lexer.cc (renamed from paludis/portage_dep_lexer.cc)23
-rw-r--r--paludis/repositories/e/dep_lexer.hh128
-rw-r--r--paludis/repositories/e/dep_lexer_TEST.cc (renamed from paludis/portage_dep_lexer_TEST.cc)75
-rw-r--r--paludis/repositories/e/dep_parser-fwd.hh (renamed from paludis/portage_dep_parser-fwd.hh)12
-rw-r--r--paludis/repositories/e/dep_parser.cc (renamed from paludis/portage_dep_parser.cc)31
-rw-r--r--paludis/repositories/e/dep_parser.hh123
-rw-r--r--paludis/repositories/e/dep_parser.se (renamed from paludis/portage_dep_parser.se)5
-rw-r--r--paludis/repositories/e/dep_parser_TEST.cc (renamed from paludis/portage_dep_parser_TEST.cc)155
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.cc (renamed from paludis/dep_spec_pretty_printer.cc)5
-rw-r--r--paludis/repositories/e/dep_spec_pretty_printer.hh96
-rw-r--r--paludis/repositories/e/e_key.cc167
-rw-r--r--paludis/repositories/e/e_key.hh58
-rw-r--r--paludis/repositories/e/e_repository.cc40
-rw-r--r--paludis/repositories/e/e_repository.hh6
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc23
-rw-r--r--paludis/repositories/e/e_repository_entries.cc1
-rw-r--r--paludis/repositories/e/e_repository_entries.hh180
-rw-r--r--paludis/repositories/e/e_repository_id.cc33
-rw-r--r--paludis/repositories/e/e_repository_id.hh41
-rw-r--r--paludis/repositories/e/e_repository_profile.cc15
-rw-r--r--paludis/repositories/e/e_repository_sets.cc2
-rw-r--r--paludis/repositories/e/e_repository_sets_TEST.cc8
-rw-r--r--paludis/repositories/e/eapi-fwd.hh (renamed from paludis/eapi-fwd.hh)19
-rw-r--r--paludis/repositories/e/eapi.cc (renamed from paludis/eapi.cc)5
-rw-r--r--paludis/repositories/e/eapi.hh84
-rw-r--r--paludis/repositories/e/eapi.sr (renamed from paludis/eapi.sr)2
-rw-r--r--paludis/repositories/e/eapi_phase.cc4
-rw-r--r--paludis/repositories/e/eapis/0.conf (renamed from paludis/eapis/0.conf)0
-rw-r--r--paludis/repositories/e/eapis/Makefile.am (renamed from paludis/eapis/Makefile.am)0
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf (renamed from paludis/eapis/exheres-0.conf)0
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf (renamed from paludis/eapis/paludis-1.conf)0
-rw-r--r--paludis/repositories/e/ebin.cc6
-rw-r--r--paludis/repositories/e/ebin_entries.cc6
-rw-r--r--paludis/repositories/e/ebin_entries.hh85
-rw-r--r--paludis/repositories/e/ebuild.cc4
-rw-r--r--paludis/repositories/e/ebuild.hh1
-rw-r--r--paludis/repositories/e/ebuild.sr4
-rw-r--r--paludis/repositories/e/ebuild_entries.cc16
-rw-r--r--paludis/repositories/e/ebuild_entries.hh97
-rw-r--r--paludis/repositories/e/ebuild_flat_metadata_cache.cc6
-rw-r--r--paludis/repositories/e/ebuild_id.cc11
-rw-r--r--paludis/repositories/e/ebuild_id.hh7
-rw-r--r--paludis/repositories/e/exheres_layout.cc1
-rw-r--r--paludis/repositories/e/exheres_layout.hh125
-rw-r--r--paludis/repositories/e/layout.cc1
-rw-r--r--paludis/repositories/e/layout.hh204
-rw-r--r--paludis/repositories/e/traditional_layout.cc1
-rw-r--r--paludis/repositories/e/traditional_layout.hh127
-rw-r--r--paludis/repositories/e/vdb_id.cc6
-rw-r--r--paludis/repositories/e/vdb_id.hh3
-rw-r--r--paludis/repositories/e/vdb_repository.cc26
-rw-r--r--paludis/repositories/e/vdb_repository.hh9
-rw-r--r--paludis/repositories/fake/Makefile.am17
-rw-r--r--paludis/repositories/fake/fake_installed_repository.cc2
-rw-r--r--paludis/repositories/fake/fake_package_id.cc107
-rw-r--r--paludis/repositories/fake/fake_package_id.hh22
-rw-r--r--paludis/repositories/fake/fake_repository.cc1
-rw-r--r--paludis/repositories/fake/fake_repository_base.cc2
-rw-r--r--paludis/repositories/gems/gem_specification.cc15
-rw-r--r--paludis/repositories/gems/gem_specification.hh3
-rw-r--r--paludis/repositories/gems/gems_repository.cc1
-rw-r--r--paludis/repositories/gems/installed_gems_repository.cc1
-rw-r--r--paludis/repositories/virtuals/Makefile.am2
-rw-r--r--paludis/repositories/virtuals/package_id.cc27
-rw-r--r--paludis/repositories/virtuals/package_id.hh9
-rw-r--r--paludis/repository.hh8
-rw-r--r--paludis/set_file_TEST.cc77
-rw-r--r--paludis/tasks/install_task.cc9
-rw-r--r--python/Makefile.am6
-rwxr-xr-xpython/dep_list_TEST.py2
-rwxr-xr-xpython/dep_list_TEST_setup.sh5
-rwxr-xr-xpython/dep_spec_TEST.py62
-rwxr-xr-xpython/dep_tag_TEST.py2
-rw-r--r--python/eapi.cc104
-rwxr-xr-xpython/eapi_TEST.py55
-rw-r--r--python/package_id.cc4
-rwxr-xr-xpython/package_id_TEST.py4
-rw-r--r--python/paludis_python_so.cc4
-rw-r--r--python/portage_dep_parser.cc87
-rwxr-xr-xpython/portage_dep_parser_TEST.py69
-rw-r--r--ruby/Makefile.am6
-rw-r--r--ruby/eapi.cc198
-rw-r--r--ruby/eapi_TEST.rb110
-rw-r--r--ruby/package_id.cc17
-rw-r--r--ruby/package_id_TEST.rb12
-rw-r--r--ruby/paludis_ruby.cc12
-rw-r--r--ruby/paludis_ruby.hh2
-rw-r--r--ruby/portage_dep_parser.cc159
-rw-r--r--ruby/portage_dep_parser_TEST.rb92
-rw-r--r--src/clients/adjutrix/Makefile.am2
-rw-r--r--src/clients/contrarius/install.cc1
-rw-r--r--src/clients/contrarius/stage.cc1
-rw-r--r--src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc52
-rw-r--r--src/clients/paludis/Makefile.am2
-rw-r--r--src/clients/paludis/install.cc1
-rw-r--r--src/clients/paludis/query.cc25
-rw-r--r--src/output/console_install_task.cc1
-rw-r--r--src/output/console_query_task.cc175
-rw-r--r--src/output/console_query_task.hh10
123 files changed, 1895 insertions, 2466 deletions
diff --git a/configure.ac b/configure.ac
index cff41cb..674b939 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1204,7 +1204,6 @@ AC_OUTPUT(
paludis/dep_list/Makefile
paludis/digests/Makefile
paludis/distributions/Makefile
- paludis/eapis/Makefile
paludis/environments/Makefile
paludis/environments/adapted/Makefile
paludis/environments/no_config/Makefile
@@ -1217,6 +1216,7 @@ AC_OUTPUT(
paludis/repositories/cran/Makefile
paludis/repositories/cran/cran/Makefile
paludis/repositories/e/Makefile
+ paludis/repositories/e/eapis/Makefile
paludis/repositories/e/ebuild/0/Makefile
paludis/repositories/e/ebuild/Makefile
paludis/repositories/e/ebuild/digests/Makefile
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index a1e89f1..d16a27c 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -81,7 +81,7 @@ DEFS= \
EXTRA_DIST = about.hh.in Makefile.am.m4 paludis.hh.m4 files.m4 \
testscriptlist srlist srcleanlist selist secleanlist \
repository_blacklist.txt hooker.bash
-SUBDIRS = digests distributions eapis fetchers syncers util selinux . dep_list merger repositories environments args tasks
+SUBDIRS = digests distributions fetchers syncers util selinux . dep_list merger repositories environments args tasks
BUILT_SOURCES = srcleanlist secleanlist
libpaludis_la_SOURCES = filelist
@@ -148,7 +148,7 @@ built-sources : $(BUILT_SOURCES)
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_HOOKER_DIR="$(top_srcdir)/paludis/" \
PALUDIS_OUTPUTWRAPPER_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
diff --git a/paludis/dep_list/Makefile.am b/paludis/dep_list/Makefile.am
index f46c509..e164baa 100644
--- a/paludis/dep_list/Makefile.am
+++ b/paludis/dep_list/Makefile.am
@@ -70,7 +70,7 @@ TESTS = \
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/e/ebuild/`" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_SKIP_CONFIG="yes" \
TEST_SCRIPT_DIR="$(srcdir)/" \
@@ -87,6 +87,7 @@ dep_list_TEST_SOURCES = dep_list_TEST.cc
dep_list_TEST_LDADD = \
$(top_builddir)/paludis/environments/test/libpaludistestenvironment.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
+ $(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/virtuals/libpaludisvirtualsrepository.la \
$(top_builddir)/paludis/util/test_extras.o \
$(top_builddir)/test/libtest.a \
@@ -98,6 +99,7 @@ dep_list_TEST_blockers_SOURCES = dep_list_TEST_blockers.cc
dep_list_TEST_blockers_LDADD = \
$(top_builddir)/paludis/environments/test/libpaludistestenvironment.la \
$(top_builddir)/paludis/repositories/fake/libpaludisfakerepository.la \
+ $(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/repositories/virtuals/libpaludisvirtualsrepository.la \
$(top_builddir)/paludis/util/test_extras.o \
$(top_builddir)/test/libtest.a \
diff --git a/paludis/dep_list/dep_list.cc b/paludis/dep_list/dep_list.cc
index e6d950e..0605ad1 100644
--- a/paludis/dep_list/dep_list.cc
+++ b/paludis/dep_list/dep_list.cc
@@ -26,9 +26,7 @@
#include <paludis/dep_spec.hh>
#include <paludis/dep_spec_flattener.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/distribution.hh>
-#include <paludis/eapi.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/match_package.hh>
#include <paludis/metadata_key.hh>
diff --git a/paludis/dep_list/dep_list_TEST.cc b/paludis/dep_list/dep_list_TEST.cc
index d3803bb..4a73f9e 100644
--- a/paludis/dep_list/dep_list_TEST.cc
+++ b/paludis/dep_list/dep_list_TEST.cc
@@ -24,7 +24,7 @@
#include <paludis/mask.hh>
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/dep_list/override_functions.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -1738,7 +1738,7 @@ namespace test_cases
{
cat_three_has_tag_from_cat_one = true;
TEST_CHECK_STRINGIFY_EQUAL(*tag->dependency(), "cat/three");
- DepSpecPrettyPrinter pretty(0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, false);
tag->conditions()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "cat/three");
}
@@ -1748,14 +1748,14 @@ namespace test_cases
if ("<cat/three-1" == stringify(*tag->dependency()))
{
cat_three_has_first_tag_from_cat_two = true;
- DepSpecPrettyPrinter pretty(0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, false);
tag->conditions()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "enabled? ( || ( <cat/three-1 ) )");
}
else if ("cat/three:0" == stringify(*tag->dependency()))
{
cat_three_has_second_tag_from_cat_two = true;
- DepSpecPrettyPrinter pretty(0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, false);
tag->conditions()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "enabled? ( || ( cat/three:0 ) )");
}
@@ -1781,7 +1781,7 @@ namespace test_cases
tr1::static_pointer_cast<const DependencyDepTag>(tags->begin()->tag));
TEST_CHECK_EQUAL(deptag->short_text(), "cat/two-1:0::repo");
TEST_CHECK_STRINGIFY_EQUAL(*deptag->dependency(), "=cat/four-1");
- DepSpecPrettyPrinter pretty(0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, false);
deptag->conditions()->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "enabled? ( || ( =cat/four-1 ) )");
diff --git a/paludis/dep_list/dep_list_TEST.hh b/paludis/dep_list/dep_list_TEST.hh
index e2a05c6..465a5fb 100644
--- a/paludis/dep_list/dep_list_TEST.hh
+++ b/paludis/dep_list/dep_list_TEST.hh
@@ -22,7 +22,6 @@
#include <paludis/dep_list/dep_list.hh>
#include <paludis/dep_list/exceptions.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/repositories/fake/fake_repository.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
#include <paludis/repositories/virtuals/virtuals_repository.hh>
diff --git a/paludis/dep_list/range_rewriter_TEST.cc b/paludis/dep_list/range_rewriter_TEST.cc
index 0fa9582..957d269 100644
--- a/paludis/dep_list/range_rewriter_TEST.cc
+++ b/paludis/dep_list/range_rewriter_TEST.cc
@@ -19,7 +19,6 @@
#include <paludis/dep_list/range_rewriter.hh>
#include <paludis/dep_spec.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/util/visitor-impl.hh>
#include <test/test_runner.hh>
diff --git a/paludis/dep_list/uninstall_list_TEST.cc b/paludis/dep_list/uninstall_list_TEST.cc
index 2436240..2cd16c8 100644
--- a/paludis/dep_list/uninstall_list_TEST.cc
+++ b/paludis/dep_list/uninstall_list_TEST.cc
@@ -23,7 +23,6 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/repositories/virtuals/virtuals_repository.hh>
#include <paludis/environments/test/test_environment.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/package_database.hh>
#include <test/test_framework.hh>
diff --git a/paludis/dep_spec_pretty_printer.hh b/paludis/dep_spec_pretty_printer.hh
deleted file mode 100644
index 3024329..0000000
--- a/paludis/dep_spec_pretty_printer.hh
+++ /dev/null
@@ -1,93 +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_PALUDIS_DEP_ATOM_PRETTY_PRINTER_HH
-#define PALUDIS_GUARD_PALUDIS_DEP_ATOM_PRETTY_PRINTER_HH 1
-
-#include <iosfwd>
-#include <paludis/dep_spec.hh>
-
-/** \file
- * Declarations for the DepSpecPrettyPrinter class.
- *
- * \ingroup grpdepspecprettyprinter
- */
-
-namespace paludis
-{
- /**
- * Pretty print dependency specs.
- *
- * \ingroup grpdepspecprettyprinter
- */
- class PALUDIS_VISIBLE DepSpecPrettyPrinter :
- public ConstVisitor<GenericSpecTree>,
- private PrivateImplementationPattern<DepSpecPrettyPrinter>
- {
- friend std::ostream & operator<< (std::ostream &, const DepSpecPrettyPrinter &);
-
- private:
- std::string newline();
- std::string indent();
-
- public:
- ///\name Basic operations
- ///\{
-
- DepSpecPrettyPrinter(unsigned initial_indent, bool use_newlines = true);
-
- ~DepSpecPrettyPrinter();
-
- ///\}
-
- /// \name Visit functions
- ///{
-
- void visit_sequence(const AllDepSpec &,
- GenericSpecTree::ConstSequenceIterator,
- GenericSpecTree::ConstSequenceIterator);
-
- void visit_sequence(const AnyDepSpec &,
- GenericSpecTree::ConstSequenceIterator,
- GenericSpecTree::ConstSequenceIterator);
-
- void visit_sequence(const UseDepSpec &,
- GenericSpecTree::ConstSequenceIterator,
- GenericSpecTree::ConstSequenceIterator);
-
- void visit_leaf(const PackageDepSpec &);
-
- void visit_leaf(const PlainTextDepSpec &);
-
- void visit_leaf(const BlockDepSpec &);
-
- void visit_leaf(const URIDepSpec &);
-
- ///}
- };
-
- /**
- * Output a DepSpecPrettyPrinter to an ostream.
- *
- * \ingroup grpdepspecprettyprinter
- */
- std::ostream & operator<< (std::ostream & s, const DepSpecPrettyPrinter & p) PALUDIS_VISIBLE;
-}
-
-#endif
diff --git a/paludis/dep_tag.cc b/paludis/dep_tag.cc
index 65bf577..f00e638 100644
--- a/paludis/dep_tag.cc
+++ b/paludis/dep_tag.cc
@@ -19,7 +19,6 @@
#include "dep_tag.hh"
#include <paludis/dep_spec.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/util/virtual_constructor-impl.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -27,6 +26,7 @@
#include <paludis/util/set-impl.hh>
#include <paludis/util/mutex.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
+#include <sstream>
/** \file
* Implementation for DepTag, DepTagCategory etc.
@@ -181,22 +181,103 @@ DepTag::~DepTag()
{
}
-std::string
-DepTag::full_text() const
+namespace
{
- return short_text();
+ struct DepSpecStringifier :
+ ConstVisitor<DependencySpecTree>
+ {
+ std::ostringstream s;
+
+ void
+ visit_sequence(const AllDepSpec &,
+ DependencySpecTree::ConstSequenceIterator cur,
+ DependencySpecTree::ConstSequenceIterator end)
+ {
+ s << "( ";
+ std::for_each(cur, end, accept_visitor(*this));
+ s << ") ";
+ }
+
+ void
+ visit_sequence(const AnyDepSpec &,
+ DependencySpecTree::ConstSequenceIterator cur,
+ DependencySpecTree::ConstSequenceIterator end)
+ {
+ s << "|| ( ";
+ std::for_each(cur, end, accept_visitor(*this));
+ s << ") ";
+ }
+
+ void
+ visit_sequence(const UseDepSpec & a,
+ DependencySpecTree::ConstSequenceIterator cur,
+ DependencySpecTree::ConstSequenceIterator end)
+ {
+ s << (a.inverse() ? "!" : "") << a.flag() << "? ( ";
+ std::for_each(cur, end, accept_visitor(*this));
+ s << ") ";
+ }
+
+ void
+ visit_leaf(const PackageDepSpec & p)
+ {
+ s << p << " ";
+ }
+
+ void
+ visit_leaf(const BlockDepSpec & b)
+ {
+ s << "!" << *b.blocked_spec() << " ";
+ }
+
+ };
+
+ struct DepTagComparator :
+ ConstVisitor<DepTagVisitorTypes>
+ {
+ std::string value;
+
+ void visit(const GLSADepTag & t)
+ {
+ value = t.short_text();
+ }
+
+ void visit(const GeneralSetDepTag & t)
+ {
+ value = t.short_text();
+ }
+
+ void visit(const DependencyDepTag & t)
+ {
+ value = stringify(*t.package_id()) + "," + stringify(*t.dependency()) + ",";
+ DepSpecStringifier s;
+ t.conditions()->accept(s);
+ value.append(s.s.str());
+ }
+
+ void visit(const TargetDepTag & t)
+ {
+ value = t.short_text();
+ }
+ };
}
bool
DepTag::operator== (const DepTag & other) const
{
- return full_text() == other.full_text();
+ DepTagComparator c1, c2;
+ accept(c1);
+ other.accept(c2);
+ return c1.value == c2.value;
}
bool
DepTag::operator< (const DepTag & other) const
{
- return full_text() < other.full_text();
+ DepTagComparator c1, c2;
+ accept(c1);
+ other.accept(c2);
+ return c1.value < c2.value;
}
GLSADepTag::GLSADepTag(const std::string & id, const std::string & our_glsa_title) :
@@ -304,25 +385,6 @@ DependencyDepTag::~DependencyDepTag()
}
std::string
-DependencyDepTag::full_text() const
-{
- Lock l(_imp->mutex);
-
- if (_imp->str.empty())
- {
- _imp->str.append(stringify(*_imp->id));
- _imp->str.append(",");
- _imp->str.append(stringify(*_imp->spec));
- _imp->str.append(",");
- DepSpecPrettyPrinter pretty(0, false);
- _imp->cond->accept(pretty);
- _imp->str.append(stringify(pretty));
- }
-
- return _imp->str;
-}
-
-std::string
DependencyDepTag::short_text() const
{
return stringify(*_imp->id);
diff --git a/paludis/dep_tag.hh b/paludis/dep_tag.hh
index 38fbe60..65c25ef 100644
--- a/paludis/dep_tag.hh
+++ b/paludis/dep_tag.hh
@@ -179,12 +179,6 @@ namespace paludis
public virtual ConstAcceptInterface<DepTagVisitorTypes>
{
protected:
- /**
- * Return a string containing all our state, for
- * comparison with other tags.
- */
- virtual std::string full_text() const;
-
///\name Basic operations
///\{
@@ -293,10 +287,6 @@ namespace paludis
private:
void _make_str() const;
- protected:
- virtual std::string full_text() const;
-
-
public:
///\name Basic operations
///\{
diff --git a/paludis/eapi.hh b/paludis/eapi.hh
deleted file mode 100644
index ce2787f..0000000
--- a/paludis/eapi.hh
+++ /dev/null
@@ -1,81 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * 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
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_EAPI_HH
-#define PALUDIS_GUARD_PALUDIS_EAPI_HH 1
-
-#include <paludis/eapi-fwd.hh>
-#include <paludis/util/attributes.hh>
-#include <paludis/util/sr.hh>
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <paludis/name.hh>
-#include <paludis/dep_spec-fwd.hh>
-#include <paludis/portage_dep_parser-fwd.hh>
-
-namespace paludis
-{
-#include <paludis/eapi-sr.hh>
-
- /**
- * Thrown if an EAPI configuration is broken.
- *
- * \see EAPI
- * \ingroup grpeapi
- * \ingroup grpexceptions
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE EAPIConfigurationError :
- public ConfigurationError
- {
- public:
- EAPIConfigurationError(const std::string &) throw ();
- };
-
- /**
- * Holds information on recognised EAPIs.
- *
- * \see EAPI
- * \ingroup grpeapi
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE EAPIData :
- private PrivateImplementationPattern<EAPIData>,
- public InstantiationPolicy<EAPIData, instantiation_method::SingletonTag>
- {
- friend class InstantiationPolicy<EAPIData, instantiation_method::SingletonTag>;
-
- private:
- EAPIData();
- ~EAPIData();
-
- public:
- /**
- * Make an EAPI.
- */
- tr1::shared_ptr<const EAPI> eapi_from_string(const std::string &) const;
-
- /**
- * Make the unknown EAPI.
- */
- tr1::shared_ptr<const EAPI> unknown_eapi() const;
- };
-}
-
-#endif
diff --git a/paludis/environment_implementation.cc b/paludis/environment_implementation.cc
index d0dfc95..e84b11b 100644
--- a/paludis/environment_implementation.cc
+++ b/paludis/environment_implementation.cc
@@ -26,7 +26,6 @@
#include <paludis/util/save.hh>
#include <paludis/util/set.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <paludis/eapi.hh>
#include <paludis/hook.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
@@ -170,10 +169,3 @@ EnvironmentImplementation::set_names() const
return make_shared_ptr(new SetNameSet);
}
-bool
-EnvironmentImplementation::breaks_portage(const PackageID & e) const
-{
- return (e.version().has_try_part() || e.version().has_scm_part()
- || (! e.eapi()->supported) || (e.eapi()->supported->breaks_portage));
-}
-
diff --git a/paludis/environment_implementation.hh b/paludis/environment_implementation.hh
index 8d9e249..136911f 100644
--- a/paludis/environment_implementation.hh
+++ b/paludis/environment_implementation.hh
@@ -21,7 +21,6 @@
#define PALUDIS_GUARD_PALUDIS_ENVIRONMENT_IMPLEMENTATION_HH 1
#include <paludis/environment.hh>
-#include <paludis/eapi-fwd.hh>
#include <paludis/package_id-fwd.hh>
namespace paludis
@@ -40,9 +39,6 @@ namespace paludis
virtual tr1::shared_ptr<SetSpecTree::ConstItem> local_set(const SetName &) const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual bool breaks_portage(const PackageID &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
public:
///\name Basic operations
///\{
diff --git a/paludis/environments/no_config/Makefile.am b/paludis/environments/no_config/Makefile.am
index eb2fa8b..2dd1add 100644
--- a/paludis/environments/no_config/Makefile.am
+++ b/paludis/environments/no_config/Makefile.am
@@ -50,7 +50,7 @@ TESTS = no_config_environment_TEST
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/ebuild/" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_SKIP_CONFIG="yes" \
PALUDIS_REPOSITORY_SO_DIR="$(top_builddir)/paludis/repositories" \
diff --git a/paludis/environments/no_config/no_config_environment.cc b/paludis/environments/no_config/no_config_environment.cc
index ba5aafd..832e239 100644
--- a/paludis/environments/no_config/no_config_environment.cc
+++ b/paludis/environments/no_config/no_config_environment.cc
@@ -30,7 +30,6 @@
#include <paludis/config_file.hh>
#include <paludis/distribution.hh>
#include <paludis/package_database.hh>
-#include <paludis/eapi.hh>
#include <paludis/hook.hh>
#include <paludis/repositories/e/e_repository_params.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -289,17 +288,14 @@ NoConfigEnvironment::accept_keywords(tr1::shared_ptr<const KeywordNameSet> keywo
if (_imp->is_vdb)
return true;
- std::string accept_keywords_var(EAPIData::get_instance()->eapi_from_string(
- _imp->main_repo->e_interface->params().profile_eapi)->supported->ebuild_environment_variables->env_accept_keywords);
-
+ std::string accept_keywords_var(_imp->main_repo->e_interface->accept_keywords_variable());
std::string ak;
if (! accept_keywords_var.empty())
ak = _imp->main_repo->e_interface->profile_variable(accept_keywords_var);
if (ak.empty())
{
- std::string arch_var(EAPIData::get_instance()->eapi_from_string(
- _imp->main_repo->e_interface->params().profile_eapi)->supported->ebuild_environment_variables->env_arch);
+ std::string arch_var(_imp->main_repo->e_interface->arch_variable());
if (arch_var.empty())
throw ConfigurationError("Don't know how to work out whether keywords are acceptable");
diff --git a/paludis/environments/paludis/paludis_environment.cc b/paludis/environments/paludis/paludis_environment.cc
index 3363635..7167efe 100644
--- a/paludis/environments/paludis/paludis_environment.cc
+++ b/paludis/environments/paludis/paludis_environment.cc
@@ -481,7 +481,7 @@ namespace
const tr1::shared_ptr<const Mask>
PaludisEnvironment::mask_for_breakage(const PackageID & id) const
{
- if ((! _imp->config->accept_breaks_portage()) && breaks_portage(id))
+ if ((! _imp->config->accept_breaks_portage()) && id.breaks_portage())
return make_shared_ptr(new BreaksPortageMask);
return tr1::shared_ptr<const Mask>();
diff --git a/paludis/environments/portage/portage_environment.cc b/paludis/environments/portage/portage_environment.cc
index a943a43..00a24a9 100644
--- a/paludis/environments/portage/portage_environment.cc
+++ b/paludis/environments/portage/portage_environment.cc
@@ -707,7 +707,7 @@ namespace
const tr1::shared_ptr<const Mask>
PortageEnvironment::mask_for_breakage(const PackageID & id) const
{
- if (breaks_portage(id))
+ if (id.breaks_portage())
return make_shared_ptr(new BreaksPortageMask);
return tr1::shared_ptr<const Mask>();
diff --git a/paludis/files.m4 b/paludis/files.m4
index 4ef1b88..bf88fbd 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -14,10 +14,8 @@ add(`config_file', `hh', `cc', `se', `test', `testscript')
add(`contents', `hh', `cc', `fwd')
add(`dep_spec', `hh', `cc', `se', `test', `fwd')
add(`dep_spec_flattener', `hh', `cc')
-add(`dep_spec_pretty_printer', `hh', `cc', `test')
add(`dep_tag', `hh', `cc', `fwd', `sr')
add(`distribution', `hh', `cc', `fwd', `sr')
-add(`eapi', `hh', `cc', `fwd', `sr')
add(`environment', `hh', `fwd', `cc', `se')
add(`environment_implementation', `hh', `cc')
add(`hashed_containers', `hh', `cc', `test')
@@ -31,8 +29,6 @@ add(`name', `hh', `cc', `fwd', `test', `sr', `se')
add(`package_database', `hh', `cc', `test', `se')
add(`package_id', `hh', `cc', `fwd', `se')
add(`paludis', `hh')
-add(`portage_dep_lexer', `hh', `cc', `test')
-add(`portage_dep_parser', `hh', `cc', `fwd', `se', `test')
add(`qa', `hh', `cc', `fwd', `se')
add(`query', `hh', `cc')
add(`repository', `hh', `fwd', `cc', `sr')
diff --git a/paludis/metadata_key.hh b/paludis/metadata_key.hh
index be61510..7ae6489 100644
--- a/paludis/metadata_key.hh
+++ b/paludis/metadata_key.hh
@@ -143,6 +143,12 @@ namespace paludis
public:
virtual const tr1::shared_ptr<const typename C_::ConstItem> value() const
PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual std::string pretty_print_flat() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
};
}
diff --git a/paludis/package_id.hh b/paludis/package_id.hh
index a40ff2b..9ab46a2 100644
--- a/paludis/package_id.hh
+++ b/paludis/package_id.hh
@@ -30,7 +30,6 @@
#include <paludis/action-fwd.hh>
#include <paludis/dep_spec-fwd.hh>
-#include <paludis/eapi-fwd.hh>
#include <paludis/mask-fwd.hh>
#include <paludis/metadata_key-fwd.hh>
#include <paludis/name-fwd.hh>
@@ -63,7 +62,6 @@ namespace paludis
virtual const VersionSpec version() const = 0;
virtual const SlotName slot() const = 0;
virtual const tr1::shared_ptr<const Repository> repository() const = 0;
- virtual const tr1::shared_ptr<const EAPI> eapi() const = 0;
///\name Specific metadata keys
///\{
@@ -118,6 +116,14 @@ namespace paludis
MasksIterator end_masks() const PALUDIS_ATTRIBUTE((warn_unused_result));
bool masked() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ /**
+ * Do we break Portage?
+ *
+ * This method may be used by Environment implementations to apply a "we don't
+ * want packages that break Portage" mask.
+ */
+ virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
///\}
///\name Extra comparisons
diff --git a/paludis/portage_dep_lexer.hh b/paludis/portage_dep_lexer.hh
deleted file mode 100644
index bfc94a1..0000000
--- a/paludis/portage_dep_lexer.hh
+++ /dev/null
@@ -1,125 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 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_PALUDIS_E_DEP_LEXER_HH
-#define PALUDIS_GUARD_PALUDIS_E_DEP_LEXER_HH 1
-
-#include <paludis/util/exception.hh>
-#include <paludis/util/instantiation_policy.hh>
-#include <paludis/util/private_implementation_pattern.hh>
-#include <string>
-
-#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
-
-/** \file
- * Declarations for the PortageDepLexer class.
- *
- * \ingroup grpdeplexer
- */
-
-namespace paludis
-{
- /**
- * A DepStringError descendent is thrown if an invalid depend string is
- * encountered.
- *
- * \ingroup grpdeplexer
- * \ingroup grpexceptions
- */
- class PALUDIS_VISIBLE DepStringError : public Exception
- {
- protected:
- /**
- * Constructor.
- */
- DepStringError(const std::string & dep_string,
- const std::string & message) throw ();
- };
-
- /**
- * A DepStringLexError is thrown if a lex-level error is encountered when
- * parsing a dependency string.
- *
- * \ingroup grpdeplexer
- * \ingroup grpexceptions
- */
- class PALUDIS_VISIBLE DepStringLexError : public DepStringError
- {
- public:
- /**
- * Constructor.
- */
- DepStringLexError(const std::string & dep_string,
- const std::string & message) throw ();
- };
-
- /**
- * Lexemes used by PortageDepLexer.
- *
- * \see PortageDepLexer
- *
- * \ingroup grpdeplexer
- */
- enum PortageDepLexerLexeme
- {
- dpl_whitespace, ///< whitespace
- dpl_text, ///< a package or item name
- dpl_use_flag, ///< a use flag
- dpl_double_bar, ///< a double bar ('any' marker)
- dpl_open_paren, ///< open paren
- dpl_close_paren, ///< close paren
- dpl_arrow ///< arrow
- };
-
- /**
- * Converts a dependency string into a sequence of tokens, which are
- * then handled by DepParser.
- *
- * \see DepParser
- * \ingroup grpdeplexer
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE PortageDepLexer :
- private InstantiationPolicy<PortageDepLexer, instantiation_method::NonCopyableTag>,
- private PrivateImplementationPattern<PortageDepLexer>
- {
- public:
- ///\name Iterate over our items
- ///\{
-
- typedef libwrapiter::ForwardIterator<PortageDepLexer,
- const std::pair<PortageDepLexerLexeme, std::string> > Iterator;
-
- Iterator begin() const;
-
- Iterator end() const;
-
- ///\}
-
- ///\name Basic operations
- ///\{
-
- PortageDepLexer(const std::string &);
- ~PortageDepLexer();
-
- ///\}
- };
-}
-
-#endif
diff --git a/paludis/portage_dep_parser.hh b/paludis/portage_dep_parser.hh
deleted file mode 100644
index 4214d90..0000000
--- a/paludis/portage_dep_parser.hh
+++ /dev/null
@@ -1,120 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 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_PALUDIS_E_DEP_PARSER_HH
-#define PALUDIS_GUARD_PALUDIS_E_DEP_PARSER_HH 1
-
-#include <paludis/portage_dep_parser-fwd.hh>
-#include <paludis/dep_spec.hh>
-#include <paludis/portage_dep_lexer.hh>
-#include <paludis/eapi-fwd.hh>
-#include <paludis/util/exception.hh>
-#include <paludis/util/instantiation_policy.hh>
-#include <string>
-
-/** \file
- * Declarations for the PortageDepParser class.
- *
- * \ingroup grpdepparser
- */
-
-namespace paludis
-{
- /**
- * A DepStringParseError is thrown if an error is encountered when parsing
- * a dependency string.
- *
- * \ingroup grpexceptions
- * \ingroup grpdepparser
- */
- class PALUDIS_VISIBLE DepStringParseError : public DepStringError
- {
- public:
- /**
- * Constructor.
- */
- DepStringParseError(const std::string & dep_string,
- const std::string & message) throw ();
- };
-
- /**
- * A DepStringNestingError is thrown if a dependency string does not have
- * properly balanced parentheses.
- *
- * \ingroup grpexceptions
- * \ingroup grpdepparser
- */
- class PALUDIS_VISIBLE DepStringNestingError : public DepStringParseError
- {
- public:
- /**
- * Constructor.
- */
- DepStringNestingError(const std::string & dep_string) throw ();
- };
-
- /**
- * The PortageDepParser converts string representations of a dependency
- * specification into a DepSpec instance. The PortageDepLexer class is
- * used as the first stage.
- *
- * \ingroup grpdepparser
- */
- class PALUDIS_VISIBLE PortageDepParser :
- private InstantiationPolicy<PortageDepParser, instantiation_method::NonInstantiableTag>
- {
- private:
- template <typename H_, typename I_, bool any_, bool use_>
- static tr1::shared_ptr<typename H_::ConstItem> _parse(const std::string &,
- bool disallow_any_use, const I_ &);
-
- public:
- /**
- * Parse a dependency heirarchy.
- */
- static tr1::shared_ptr<DependencySpecTree::ConstItem> parse_depend(const std::string & s,
- const EAPI &);
-
- /**
- * Parse a provide heirarchy.
- */
- static tr1::shared_ptr<ProvideSpecTree::ConstItem> parse_provide(const std::string & s,
- const EAPI &);
-
- /**
- * Parse a restrict.
- */
- static tr1::shared_ptr<RestrictSpecTree::ConstItem> parse_restrict(const std::string & s,
- const EAPI &);
-
- /**
- * Parse a uri heirarchy.
- */
- static tr1::shared_ptr<URISpecTree::ConstItem> parse_uri(const std::string & s,
- const EAPI &);
-
- /**
- * Parse a license heirarchy.
- */
- static tr1::shared_ptr<LicenseSpecTree::ConstItem> parse_license(const std::string & s,
- const EAPI &);
- };
-}
-
-#endif
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 3063367..529e42b 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = ebuild qa .
+SUBDIRS = eapis ebuild qa .
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
DISTCLEANFILES = \
glsa-sr.hh glsa-sr.cc \
@@ -7,7 +7,9 @@ DISTCLEANFILES = \
ebuild-sr.hh ebuild-sr.cc \
ebin-sr.hh ebin-sr.cc ebin-se.hh ebin-se.cc \
vdb_merger-sr.hh vdb_merger-sr.cc \
- vdb_unmerger-sr.hh vdb_unmerger-sr.cc
+ vdb_unmerger-sr.hh vdb_unmerger-sr.cc \
+ eapi-sr.hh eapi-sr.cc \
+ dep_parser-se.hh dep_parser-se.cc
MAINTAINERCLEANFILES = Makefile.in
@@ -31,17 +33,24 @@ paludis_repositories_e_includedir = $(includedir)/paludis-$(PALUDIS_PC_SLOT)/pal
libpaludiserepository_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
paludis_repositories_e_include_HEADERS = \
+ dep_lexer.hh \
+ dep_parser.hh \
+ dep_parser-se.hh \
+ dep_spec_pretty_printer.hh \
e_key.hh \
e_mask.hh \
e_repository.hh \
e_repository_entries.hh \
e_repository_exceptions.hh \
+ e_repository_id.hh \
e_repository_news.hh \
e_repository_params-sr.hh \
e_repository_params.hh \
e_repository_profile.hh \
e_repository_profile_file.hh \
e_repository_sets.hh \
+ eapi.hh \
+ eapi-sr.hh \
eapi_phase.hh \
ebin-se.hh \
ebin-sr.hh \
@@ -70,16 +79,21 @@ paludis_repositories_e_include_HEADERS = \
vdb_unmerger.hh
libpaludiserepository_la_SOURCES = \
+ dep_lexer.cc \
+ dep_parser.cc \
+ dep_spec_pretty_printer.cc \
e_key.cc \
e_mask.cc \
e_repository.cc \
e_repository_entries.cc \
e_repository_exceptions.cc \
+ e_repository_id.cc \
e_repository_news.cc \
e_repository_params.cc \
e_repository_profile.cc \
e_repository_profile_file.cc \
e_repository_sets.cc \
+ eapi.cc \
eapi_phase.cc \
ebin.cc \
ebin_entries.cc \
@@ -157,7 +171,37 @@ e_repository_sets_TEST_LDADD = \
e_repository_sets_TEST_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir)
+dep_lexer_TEST_SOURCES = dep_lexer_TEST.cc
+
+dep_lexer_TEST_LDADD = \
+ libpaludiserepository.la \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/environments/test/libpaludistestenvironment.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
+dep_parser_TEST_SOURCES = dep_parser_TEST.cc
+
+dep_parser_TEST_LDADD = \
+ libpaludiserepository.la \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/environments/test/libpaludistestenvironment.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
EXTRA_DIST = \
+ dep_lexer_TEST.cc \
+ dep_parser.se \
+ dep_parser-se.hh \
+ dep_parser-se.cc \
+ dep_parser_TEST.cc \
+ eapi.sr \
+ eapi-sr.hh \
+ eapi-sr.cc \
ebuild.sr \
ebuild-sr.hh \
ebuild-sr.cc \
@@ -199,6 +243,8 @@ EXTRA_DIST = \
vdb_unmerger_TEST_cleanup.sh
BUILT_SOURCES = \
+ dep_parser-se.hh \
+ dep_parser-se.cc \
e_repository_params-sr.hh \
e_repository_params-sr.cc \
glsa-sr.hh \
@@ -214,7 +260,9 @@ BUILT_SOURCES = \
vdb_merger-sr.hh \
vdb_merger-sr.cc \
vdb_unmerger-sr.hh \
- vdb_unmerger-sr.cc
+ vdb_unmerger-sr.cc \
+ eapi-sr.hh \
+ eapi-sr.cc
check_SCRIPTS = \
e_repository_TEST_setup.sh e_repository_TEST_cleanup.sh \
@@ -226,7 +274,7 @@ TESTS_ENVIRONMENT = env \
TEST_OUTPUT_WRAPPER="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/outputwrapper`" \
PALUDIS_OUTPUTWRAPPER_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/util/`" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/e/ebuild/`" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_SKIP_CONFIG="yes" \
TEST_SCRIPT_DIR="$(srcdir)/" \
@@ -266,6 +314,12 @@ ebin-sr.hh : ebin.sr $(top_srcdir)/misc/make_sr.bash
ebin-sr.cc : ebin.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --source $(srcdir)/ebin.sr > $@
+eapi-sr.hh : eapi.sr $(top_srcdir)/misc/make_sr.bash
+ $(top_srcdir)/misc/make_sr.bash --header $(srcdir)/eapi.sr > $@
+
+eapi-sr.cc : eapi.sr $(top_srcdir)/misc/make_sr.bash
+ $(top_srcdir)/misc/make_sr.bash --source $(srcdir)/eapi.sr > $@
+
glsa-sr.hh : glsa.sr $(top_srcdir)/misc/make_sr.bash
$(top_srcdir)/misc/make_sr.bash --header $(srcdir)/glsa.sr > $@
@@ -284,6 +338,12 @@ ebin-se.hh : ebin.se $(top_srcdir)/misc/make_se.bash
ebin-se.cc : ebin.se $(top_srcdir)/misc/make_se.bash
if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/ebin.se > $@ ; then rm -f $@ ; exit 1 ; fi
+dep_parser-se.hh : dep_parser.se $(top_srcdir)/misc/make_se.bash
+ if ! $(top_srcdir)/misc/make_se.bash --header $(srcdir)/dep_parser.se > $@ ; then rm -f $@ ; exit 1 ; fi
+
+dep_parser-se.cc : dep_parser.se $(top_srcdir)/misc/make_se.bash
+ if ! $(top_srcdir)/misc/make_se.bash --source $(srcdir)/dep_parser.se > $@ ; then rm -f $@ ; exit 1 ; fi
+
libpaludiserepositoryxmlthings_la_SOURCES = xml_things.cc xml_things.hh
libpaludiserepositoryxmlthings_la_CXXFLAGS = $(AM_CXXFLAGS) @LIBXML2DEPS_CFLAGS@
@@ -311,7 +371,14 @@ xml_things_TEST_LDADD = \
endif
-TESTS = e_repository_TEST vdb_unmerger_TEST $(GLSA_TESTS) e_repository_sets_TEST
+TESTS = \
+ dep_lexer_TEST \
+ dep_parser_TEST \
+ e_repository_TEST \
+ vdb_unmerger_TEST \
+ $(GLSA_TESTS) \
+ e_repository_sets_TEST
+
check_PROGRAMS = $(TESTS)
built-sources : $(BUILT_SOURCES)
diff --git a/paludis/portage_dep_lexer.cc b/paludis/repositories/e/dep_lexer.cc
index 05bd84b..6542fde 100644
--- a/paludis/portage_dep_lexer.cc
+++ b/paludis/repositories/e/dep_lexer.cc
@@ -18,7 +18,7 @@
*/
#include <paludis/dep_spec.hh>
-#include <paludis/portage_dep_lexer.hh>
+#include <paludis/repositories/e/dep_lexer.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/tokeniser.hh>
@@ -33,18 +33,19 @@
*/
using namespace paludis;
+using namespace paludis::erepository;
namespace paludis
{
/**
- * Implementation data for PortageDepLexer.
+ * Implementation data for DepLexer.
*
* \ingroup grpdeplexer
*/
template<>
- struct Implementation<PortageDepLexer>
+ struct Implementation<DepLexer>
{
- std::list<std::pair<PortageDepLexerLexeme, std::string> > tokens;
+ std::list<std::pair<DepLexerLexeme, std::string> > tokens;
};
}
@@ -59,8 +60,8 @@ DepStringError::DepStringError(const std::string & d, const std::string & m) thr
{
}
-PortageDepLexer::PortageDepLexer(const std::string & s) :
- PrivateImplementationPattern<PortageDepLexer>(new Implementation<PortageDepLexer>)
+DepLexer::DepLexer(const std::string & s) :
+ PrivateImplementationPattern<DepLexer>(new Implementation<DepLexer>)
{
Context context("When lexing dependency string '" + s + "':");
@@ -97,18 +98,18 @@ PortageDepLexer::PortageDepLexer(const std::string & s) :
}
}
-PortageDepLexer::~PortageDepLexer()
+DepLexer::~DepLexer()
{
}
-PortageDepLexer::Iterator
-PortageDepLexer::begin() const
+DepLexer::Iterator
+DepLexer::begin() const
{
return Iterator(_imp->tokens.begin());
}
-PortageDepLexer::Iterator
-PortageDepLexer::end() const
+DepLexer::Iterator
+DepLexer::end() const
{
return Iterator(_imp->tokens.end());
}
diff --git a/paludis/repositories/e/dep_lexer.hh b/paludis/repositories/e/dep_lexer.hh
new file mode 100644
index 0000000..f39abca
--- /dev/null
+++ b/paludis/repositories/e/dep_lexer.hh
@@ -0,0 +1,128 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 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_PALUDIS_E_DEP_LEXER_HH
+#define PALUDIS_GUARD_PALUDIS_E_DEP_LEXER_HH 1
+
+#include <paludis/util/exception.hh>
+#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <string>
+
+#include <libwrapiter/libwrapiter_forward_iterator-fwd.hh>
+
+/** \file
+ * Declarations for the DepLexer class.
+ *
+ * \ingroup grpdeplexer
+ */
+
+namespace paludis
+{
+ namespace erepository
+ {
+ /**
+ * A DepStringError descendent is thrown if an invalid depend string is
+ * encountered.
+ *
+ * \ingroup grpdeplexer
+ * \ingroup grpexceptions
+ */
+ class PALUDIS_VISIBLE DepStringError : public Exception
+ {
+ protected:
+ /**
+ * Constructor.
+ */
+ DepStringError(const std::string & dep_string,
+ const std::string & message) throw ();
+ };
+
+ /**
+ * A DepStringLexError is thrown if a lex-level error is encountered when
+ * parsing a dependency string.
+ *
+ * \ingroup grpdeplexer
+ * \ingroup grpexceptions
+ */
+ class PALUDIS_VISIBLE DepStringLexError : public DepStringError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ DepStringLexError(const std::string & dep_string,
+ const std::string & message) throw ();
+ };
+
+ /**
+ * Lexemes used by DepLexer.
+ *
+ * \see DepLexer
+ *
+ * \ingroup grpdeplexer
+ */
+ enum DepLexerLexeme
+ {
+ dpl_whitespace, ///< whitespace
+ dpl_text, ///< a package or item name
+ dpl_use_flag, ///< a use flag
+ dpl_double_bar, ///< a double bar ('any' marker)
+ dpl_open_paren, ///< open paren
+ dpl_close_paren, ///< close paren
+ dpl_arrow ///< arrow
+ };
+
+ /**
+ * Converts a dependency string into a sequence of tokens, which are
+ * then handled by DepParser.
+ *
+ * \see DepParser
+ * \ingroup grpdeplexer
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE DepLexer :
+ private InstantiationPolicy<DepLexer, instantiation_method::NonCopyableTag>,
+ private PrivateImplementationPattern<DepLexer>
+ {
+ public:
+ ///\name Iterate over our items
+ ///\{
+
+ typedef libwrapiter::ForwardIterator<DepLexer,
+ const std::pair<DepLexerLexeme, std::string> > Iterator;
+
+ Iterator begin() const;
+
+ Iterator end() const;
+
+ ///\}
+
+ ///\name Basic operations
+ ///\{
+
+ DepLexer(const std::string &);
+ ~DepLexer();
+
+ ///\}
+ };
+ }
+}
+
+#endif
diff --git a/paludis/portage_dep_lexer_TEST.cc b/paludis/repositories/e/dep_lexer_TEST.cc
index b2fe769..5c618b7 100644
--- a/paludis/portage_dep_lexer_TEST.cc
+++ b/paludis/repositories/e/dep_lexer_TEST.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/portage_dep_lexer.hh>
+#include <paludis/repositories/e/dep_lexer.hh>
#include <sstream>
#include <test/test_framework.hh>
#include <test/test_runner.hh>
@@ -25,42 +25,43 @@
using namespace test;
using namespace paludis;
+using namespace paludis::erepository;
/** \file
- * Test cases for PortageDepLexer.
+ * Test cases for DepLexer.
*
*/
namespace test_cases
{
/**
- * \test Test PortageDepLexer with an empty input.
+ * \test Test DepLexer with an empty input.
*
*/
- struct PortageDepLexerEmptyTest : TestCase
+ struct DepLexerEmptyTest : TestCase
{
- PortageDepLexerEmptyTest() : TestCase("empty") { }
+ DepLexerEmptyTest() : TestCase("empty") { }
void run()
{
- PortageDepLexer l("");
- PortageDepLexer::Iterator i(l.begin());
+ DepLexer l("");
+ DepLexer::Iterator i(l.begin());
TEST_CHECK(i == l.end());
}
} test_dep_spec_parser_lexer_empty;
/**
- * \test Test PortageDepLexer with a blank input.
+ * \test Test DepLexer with a blank input.
*
*/
- struct PortageDepLexerBlankTest : TestCase
+ struct DepLexerBlankTest : TestCase
{
- PortageDepLexerBlankTest() : TestCase("blank") { }
+ DepLexerBlankTest() : TestCase("blank") { }
void run()
{
- PortageDepLexer l(" \n \t");
- PortageDepLexer::Iterator i(l.begin());
+ DepLexer l(" \n \t");
+ DepLexer::Iterator i(l.begin());
TEST_CHECK(i != l.end());
TEST_CHECK_EQUAL(i->first, dpl_whitespace);
TEST_CHECK_EQUAL(i->second, " \n \t");
@@ -69,17 +70,17 @@ namespace test_cases
} test_dep_spec_parser_lexer_blank;
/**
- * \test Test PortageDepLexer with a package.
+ * \test Test DepLexer with a package.
*
*/
- struct PortageDepLexerPackageTest : TestCase
+ struct DepLexerPackageTest : TestCase
{
- PortageDepLexerPackageTest() : TestCase("package") { }
+ DepLexerPackageTest() : TestCase("package") { }
void run()
{
- PortageDepLexer l("app-editors/vim");
- PortageDepLexer::Iterator i(l.begin());
+ DepLexer l("app-editors/vim");
+ DepLexer::Iterator i(l.begin());
TEST_CHECK(i != l.end());
TEST_CHECK_EQUAL(i->first, dpl_text);
TEST_CHECK_EQUAL(i->second, "app-editors/vim");
@@ -91,14 +92,14 @@ namespace test_cases
* \test Test DepParser with a sequence of packages.
*
*/
- struct PortageDepLexerPackagesTest : TestCase
+ struct DepLexerPackagesTest : TestCase
{
- PortageDepLexerPackagesTest() : TestCase("packages") { }
+ DepLexerPackagesTest() : TestCase("packages") { }
void run()
{
- PortageDepLexer l("app-editors/vim app-misc/hilite \nsys-apps/findutils");
- PortageDepLexer::Iterator i(l.begin());
+ DepLexer l("app-editors/vim app-misc/hilite \nsys-apps/findutils");
+ DepLexer::Iterator i(l.begin());
TEST_CHECK(i != l.end());
TEST_CHECK_EQUAL(i->first, dpl_text);
@@ -125,17 +126,17 @@ namespace test_cases
} test_dep_spec_parser_lexer_packages;
/**
- * \test Test PortageDepLexer with an any group.
+ * \test Test DepLexer with an any group.
*
*/
- struct PortageDepLexerAnyTest : TestCase
+ struct DepLexerAnyTest : TestCase
{
- PortageDepLexerAnyTest() : TestCase("any") { }
+ DepLexerAnyTest() : TestCase("any") { }
void run()
{
- PortageDepLexer l("|| ( one/one two/two )");
- PortageDepLexer::Iterator i(l.begin());
+ DepLexer l("|| ( one/one two/two )");
+ DepLexer::Iterator i(l.begin());
TEST_CHECK(i != l.end());
TEST_CHECK_EQUAL(i->first, dpl_double_bar);
@@ -178,17 +179,17 @@ namespace test_cases
} test_dep_spec_parser_lexer_any;
/**
- * \test Test PortageDepLexer with a use group.
+ * \test Test DepLexer with a use group.
*
*/
- struct PortageDepLexerUseTest : TestCase
+ struct DepLexerUseTest : TestCase
{
- PortageDepLexerUseTest() : TestCase("use") { }
+ DepLexerUseTest() : TestCase("use") { }
void run()
{
- PortageDepLexer l("foo? ( one/one )");
- PortageDepLexer::Iterator i(l.begin());
+ DepLexer l("foo? ( one/one )");
+ DepLexer::Iterator i(l.begin());
TEST_CHECK(i != l.end());
TEST_CHECK_EQUAL(i->first, dpl_use_flag);
@@ -223,18 +224,18 @@ namespace test_cases
} test_dep_spec_parser_lexer_use;
/**
- * \test Test PortageDepLexer with bad input.
+ * \test Test DepLexer with bad input.
*
*/
- struct PortageDepLexerBadTest : TestCase
+ struct DepLexerBadTest : TestCase
{
- PortageDepLexerBadTest() : TestCase("bad") { }
+ DepLexerBadTest() : TestCase("bad") { }
void run()
{
- TEST_CHECK_THROWS(PortageDepLexer("(moo)"), DepStringError);
- TEST_CHECK_THROWS(PortageDepLexer("|foo"), DepStringError);
- TEST_CHECK_THROWS(PortageDepLexer("( moo )bar"), DepStringError);
+ TEST_CHECK_THROWS(DepLexer("(moo)"), DepStringError);
+ TEST_CHECK_THROWS(DepLexer("|foo"), DepStringError);
+ TEST_CHECK_THROWS(DepLexer("( moo )bar"), DepStringError);
}
} test_dep_spec_parser_lexer_bad;
diff --git a/paludis/portage_dep_parser-fwd.hh b/paludis/repositories/e/dep_parser-fwd.hh
index e9c04b0..d6bdbbb 100644
--- a/paludis/portage_dep_parser-fwd.hh
+++ b/paludis/repositories/e/dep_parser-fwd.hh
@@ -25,11 +25,15 @@
namespace paludis
{
- class PortageDepParser;
- class DepStringNestingError;
- class DepStringParseError;
+ namespace erepository
+ {
+ class DepParser;
+ class DepStringNestingError;
+ class DepStringParseError;
-#include <paludis/portage_dep_parser-se.hh>
+#include <paludis/repositories/e/dep_parser-se.hh>
+
+ }
}
diff --git a/paludis/portage_dep_parser.cc b/paludis/repositories/e/dep_parser.cc
index b5a7b8f..feba76b 100644
--- a/paludis/portage_dep_parser.cc
+++ b/paludis/repositories/e/dep_parser.cc
@@ -18,9 +18,9 @@
*/
#include <paludis/dep_spec.hh>
-#include <paludis/eapi.hh>
-#include <paludis/portage_dep_lexer.hh>
-#include <paludis/portage_dep_parser.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_lexer.hh>
+#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/tr1_functional.hh>
@@ -36,8 +36,9 @@
*/
using namespace paludis;
+using namespace paludis::erepository;
-#include <paludis/portage_dep_parser-se.cc>
+#include <paludis/repositories/e/dep_parser-se.cc>
DepStringParseError::DepStringParseError(const std::string & d,
const std::string & m) throw () :
@@ -52,7 +53,7 @@ DepStringNestingError::DepStringNestingError(const std::string & dep_string) thr
namespace
{
- enum PortageDepParserState
+ enum DepParserState
{
dps_initial,
dps_had_double_bar,
@@ -251,7 +252,7 @@ namespace
template <typename H_, typename I_, bool any_, bool use_>
tr1::shared_ptr<typename H_::ConstItem>
-PortageDepParser::_parse(const std::string & s, bool disallow_any_use, const I_ & p)
+DepParser::_parse(const std::string & s, bool disallow_any_use, const I_ & p)
{
Context context("When parsing dependency string '" + s + "':");
@@ -262,9 +263,9 @@ PortageDepParser::_parse(const std::string & s, bool disallow_any_use, const I_
tr1::bind(&ConstTreeSequence<H_, AllDepSpec>::add, result, _1)), false));
std::string arrow_lhs;
- PortageDepParserState state(dps_initial);
- PortageDepLexer lexer(s);
- PortageDepLexer::Iterator i(lexer.begin()), i_end(lexer.end());
+ DepParserState state(dps_initial);
+ DepLexer lexer(s);
+ DepLexer::Iterator i(lexer.begin()), i_end(lexer.end());
for ( ; i != i_end ; ++i)
{
@@ -290,7 +291,7 @@ PortageDepParser::_parse(const std::string & s, bool disallow_any_use, const I_
if (i->second.empty())
throw DepStringParseError(i->second, "Empty text entry");
- PortageDepLexer::Iterator i_fwd(next(i));
+ DepLexer::Iterator i_fwd(next(i));
if (i_fwd != i_end && i_fwd->first == dpl_whitespace && ++i_fwd != i_end
&& i_fwd->first == dpl_arrow)
{
@@ -555,7 +556,7 @@ PortageDepParser::_parse(const std::string & s, bool disallow_any_use, const I_
}
tr1::shared_ptr<DependencySpecTree::ConstItem>
-PortageDepParser::parse_depend(const std::string & s, const EAPI & e)
+DepParser::parse_depend(const std::string & s, const EAPI & e)
{
Context c("When parsing dependency string '" + s + "' using EAPI '" + e.name + "':");
@@ -568,7 +569,7 @@ PortageDepParser::parse_depend(const std::string & s, const EAPI & e)
}
tr1::shared_ptr<ProvideSpecTree::ConstItem>
-PortageDepParser::parse_provide(const std::string & s, const EAPI & e)
+DepParser::parse_provide(const std::string & s, const EAPI & e)
{
Context c("When parsing provide string '" + s + "' using EAPI '" + e.name + "':");
@@ -580,7 +581,7 @@ PortageDepParser::parse_provide(const std::string & s, const EAPI & e)
}
tr1::shared_ptr<RestrictSpecTree::ConstItem>
-PortageDepParser::parse_restrict(const std::string & s, const EAPI & e)
+DepParser::parse_restrict(const std::string & s, const EAPI & e)
{
Context c("When parsing restrict string '" + s + "' using EAPI '" + e.name + "':");
@@ -592,7 +593,7 @@ PortageDepParser::parse_restrict(const std::string & s, const EAPI & e)
}
tr1::shared_ptr<URISpecTree::ConstItem>
-PortageDepParser::parse_uri(const std::string & s, const EAPI & e)
+DepParser::parse_uri(const std::string & s, const EAPI & e)
{
Context c("When parsing URI string '" + s + "' using EAPI '" + e.name + "':");
@@ -604,7 +605,7 @@ PortageDepParser::parse_uri(const std::string & s, const EAPI & e)
}
tr1::shared_ptr<LicenseSpecTree::ConstItem>
-PortageDepParser::parse_license(const std::string & s, const EAPI & e)
+DepParser::parse_license(const std::string & s, const EAPI & e)
{
Context c("When parsing license string '" + s + "' using EAPI '" + e.name + "':");
diff --git a/paludis/repositories/e/dep_parser.hh b/paludis/repositories/e/dep_parser.hh
new file mode 100644
index 0000000..2602ab0
--- /dev/null
+++ b/paludis/repositories/e/dep_parser.hh
@@ -0,0 +1,123 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2005, 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_PALUDIS_E_DEP_PARSER_HH
+#define PALUDIS_GUARD_PALUDIS_E_DEP_PARSER_HH 1
+
+#include <paludis/repositories/e/dep_parser-fwd.hh>
+#include <paludis/dep_spec.hh>
+#include <paludis/repositories/e/dep_lexer.hh>
+#include <paludis/repositories/e/eapi-fwd.hh>
+#include <paludis/util/exception.hh>
+#include <paludis/util/instantiation_policy.hh>
+#include <string>
+
+/** \file
+ * Declarations for the DepParser class.
+ *
+ * \ingroup grpdepparser
+ */
+
+namespace paludis
+{
+ namespace erepository
+ {
+ /**
+ * A DepStringParseError is thrown if an error is encountered when parsing
+ * a dependency string.
+ *
+ * \ingroup grpexceptions
+ * \ingroup grpdepparser
+ */
+ class PALUDIS_VISIBLE DepStringParseError : public DepStringError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ DepStringParseError(const std::string & dep_string,
+ const std::string & message) throw ();
+ };
+
+ /**
+ * A DepStringNestingError is thrown if a dependency string does not have
+ * properly balanced parentheses.
+ *
+ * \ingroup grpexceptions
+ * \ingroup grpdepparser
+ */
+ class PALUDIS_VISIBLE DepStringNestingError : public DepStringParseError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ DepStringNestingError(const std::string & dep_string) throw ();
+ };
+
+ /**
+ * The DepParser converts string representations of a dependency
+ * specification into a DepSpec instance. The DepLexer class is
+ * used as the first stage.
+ *
+ * \ingroup grpdepparser
+ */
+ class PALUDIS_VISIBLE DepParser :
+ private InstantiationPolicy<DepParser, instantiation_method::NonInstantiableTag>
+ {
+ private:
+ template <typename H_, typename I_, bool any_, bool use_>
+ static tr1::shared_ptr<typename H_::ConstItem> _parse(const std::string &,
+ bool disallow_any_use, const I_ &);
+
+ public:
+ /**
+ * Parse a dependency heirarchy.
+ */
+ static tr1::shared_ptr<DependencySpecTree::ConstItem> parse_depend(const std::string & s,
+ const EAPI &);
+
+ /**
+ * Parse a provide heirarchy.
+ */
+ static tr1::shared_ptr<ProvideSpecTree::ConstItem> parse_provide(const std::string & s,
+ const EAPI &);
+
+ /**
+ * Parse a restrict.
+ */
+ static tr1::shared_ptr<RestrictSpecTree::ConstItem> parse_restrict(const std::string & s,
+ const EAPI &);
+
+ /**
+ * Parse a uri heirarchy.
+ */
+ static tr1::shared_ptr<URISpecTree::ConstItem> parse_uri(const std::string & s,
+ const EAPI &);
+
+ /**
+ * Parse a license heirarchy.
+ */
+ static tr1::shared_ptr<LicenseSpecTree::ConstItem> parse_license(const std::string & s,
+ const EAPI &);
+ };
+ }
+}
+
+#endif
diff --git a/paludis/portage_dep_parser.se b/paludis/repositories/e/dep_parser.se
index 55a413b..df9c782 100644
--- a/paludis/portage_dep_parser.se
+++ b/paludis/repositories/e/dep_parser.se
@@ -5,6 +5,7 @@ make_enum_DependencySpecTreeParseMode()
{
prefix dst_pm
want_destringify
+ namespace paludis::erepository
key dst_pm_eapi_0 "EAPI 0"
key dst_pm_exheres_0 "EAPI exheres-0"
@@ -12,9 +13,9 @@ make_enum_DependencySpecTreeParseMode()
doxygen_comment << "END"
/**
- * How PortageDepParser should parse a DependencySpecTree string.
+ * How DepParser should parse a DependencySpecTree string.
*
- * \see PortageDepParser
+ * \see DepParser
* \ingroup grpdepspecs
*/
END
diff --git a/paludis/portage_dep_parser_TEST.cc b/paludis/repositories/e/dep_parser_TEST.cc
index 38bacbb..d1276fa 100644
--- a/paludis/portage_dep_parser_TEST.cc
+++ b/paludis/repositories/e/dep_parser_TEST.cc
@@ -17,7 +17,9 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/paludis.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/visitor-impl.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <sstream>
@@ -26,278 +28,279 @@
using namespace test;
using namespace paludis;
+using namespace paludis::erepository;
/** \file
- * Test cases for PortageDepParser.
+ * Test cases for DepParser.
*
*/
namespace test_cases
{
/**
- * \test Test PortageDepParser with an empty input.
+ * \test Test DepParser with an empty input.
*
*/
- struct PortageDepParserEmptyTest : TestCase
+ struct DepParserEmptyTest : TestCase
{
- PortageDepParserEmptyTest() : TestCase("empty") { }
+ DepParserEmptyTest() : TestCase("empty") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("",
+ DepParser::parse_depend("",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
}
} test_dep_spec_parser_empty;
/**
- * \test Test PortageDepParser with a blank input.
+ * \test Test DepParser with a blank input.
*
*/
- struct PortageDepParserBlankTest : TestCase
+ struct DepParserBlankTest : TestCase
{
- PortageDepParserBlankTest() : TestCase("blank") { }
+ DepParserBlankTest() : TestCase("blank") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend(" \n \t",
+ DepParser::parse_depend(" \n \t",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "");
}
} test_dep_spec_parser_blank;
/**
- * \test Test PortageDepParser with a package.
+ * \test Test DepParser with a package.
*
*/
- struct PortageDepParserPackageTest : TestCase
+ struct DepParserPackageTest : TestCase
{
- PortageDepParserPackageTest() : TestCase("package") { }
+ DepParserPackageTest() : TestCase("package") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("app-editors/vim",
+ DepParser::parse_depend("app-editors/vim",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim");
}
} test_dep_spec_parser_package;
/**
- * \test Test PortageDepParser with a decorated package.
+ * \test Test DepParser with a decorated package.
*
*/
- struct PortageDepParserDecoratedPackageTest : TestCase
+ struct DepParserDecoratedPackageTest : TestCase
{
- PortageDepParserDecoratedPackageTest() : TestCase("decorated package") { }
+ DepParserDecoratedPackageTest() : TestCase("decorated package") { }
void run()
{
DepSpecPrettyPrinter d1(0, false);
- PortageDepParser::parse_depend(">=app-editors/vim-6.4_alpha",
+ DepParser::parse_depend(">=app-editors/vim-6.4_alpha",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d1);
TEST_CHECK_EQUAL(stringify(d1), ">=app-editors/vim-6.4_alpha");
DepSpecPrettyPrinter d2(0, false);
- PortageDepParser::parse_depend("=app-editors/vim-6.4_alpha-r1",
+ DepParser::parse_depend("=app-editors/vim-6.4_alpha-r1",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d2);
TEST_CHECK_EQUAL(stringify(d2), "=app-editors/vim-6.4_alpha-r1");
DepSpecPrettyPrinter d3(0, false);
- PortageDepParser::parse_depend(">=app-editors/vim-6.4_alpha:one",
+ DepParser::parse_depend(">=app-editors/vim-6.4_alpha:one",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d3);
TEST_CHECK_EQUAL(stringify(d3), ">=app-editors/vim-6.4_alpha:one");
}
} test_dep_spec_parser_decorated_package;
/**
- * \test Test PortageDepParser with a sequence of packages.
+ * \test Test DepParser with a sequence of packages.
*
*/
- struct PortageDepParserPackagesTest : TestCase
+ struct DepParserPackagesTest : TestCase
{
- PortageDepParserPackagesTest() : TestCase("packages") { }
+ DepParserPackagesTest() : TestCase("packages") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("app-editors/vim app-misc/hilite \nsys-apps/findutils",
+ DepParser::parse_depend("app-editors/vim app-misc/hilite \nsys-apps/findutils",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "app-editors/vim app-misc/hilite sys-apps/findutils");
}
} test_dep_spec_parser_packages;
- struct PortageDepParserAnyTest : TestCase
+ struct DepParserAnyTest : TestCase
{
- PortageDepParserAnyTest() : TestCase("any") { }
+ DepParserAnyTest() : TestCase("any") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("|| ( one/one two/two )",
+ DepParser::parse_depend("|| ( one/one two/two )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one two/two )");
}
} test_dep_spec_parser_any;
- struct PortageDepParserAnyUseTest : TestCase
+ struct DepParserAnyUseTest : TestCase
{
- PortageDepParserAnyUseTest() : TestCase("any use") { }
+ DepParserAnyUseTest() : TestCase("any use") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("|| ( one/one foo? ( two/two ) )",
+ DepParser::parse_depend("|| ( one/one foo? ( two/two ) )",
*EAPIData::get_instance()->eapi_from_string("0"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "|| ( one/one foo? ( two/two ) )");
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("|| ( one/one foo? ( two/two ) )",
+ TEST_CHECK_THROWS(DepParser::parse_depend("|| ( one/one foo? ( two/two ) )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
DepSpecPrettyPrinter e(0, false);
- PortageDepParser::parse_depend("|| ( one/one ( foo? ( two/two ) ) )",
+ DepParser::parse_depend("|| ( one/one ( foo? ( two/two ) ) )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
TEST_CHECK_EQUAL(stringify(e), "|| ( one/one ( foo? ( two/two ) ) )");
}
} test_dep_spec_parser_any_use;
/**
- * \test Test PortageDepParser with an all group.
+ * \test Test DepParser with an all group.
*
*/
- struct PortageDepParserAllTest : TestCase
+ struct DepParserAllTest : TestCase
{
- PortageDepParserAllTest() : TestCase("all") { }
+ DepParserAllTest() : TestCase("all") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend(" ( one/one two/two ) ",
+ DepParser::parse_depend(" ( one/one two/two ) ",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "one/one two/two");
}
} test_dep_spec_parser_all;
/**
- * \test Test PortageDepParser with a use group.
+ * \test Test DepParser with a use group.
*
*/
- struct PortageDepParserUseTest : TestCase
+ struct DepParserUseTest : TestCase
{
- PortageDepParserUseTest() : TestCase("use") { }
+ DepParserUseTest() : TestCase("use") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("foo? ( one/one )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ DepParser::parse_depend("foo? ( one/one )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "foo? ( one/one )");
}
} test_dep_spec_parser_use;
/**
- * \test Test PortageDepParser with an inverse use group.
+ * \test Test DepParser with an inverse use group.
*
*/
- struct PortageDepParserInvUseTest : TestCase
+ struct DepParserInvUseTest : TestCase
{
- PortageDepParserInvUseTest() : TestCase("!use") { }
+ DepParserInvUseTest() : TestCase("!use") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- PortageDepParser::parse_depend("!foo? ( one/one )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ DepParser::parse_depend("!foo? ( one/one )", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "!foo? ( one/one )");
}
} test_dep_spec_parser_inv_use;
- struct PortageDepParserURITest : TestCase
+ struct DepParserURITest : TestCase
{
- PortageDepParserURITest() : TestCase("uri") { }
+ DepParserURITest() : TestCase("uri") { }
void run()
{
DepSpecPrettyPrinter d(0, true);
- PortageDepParser::parse_uri("a\n->\tb", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
+ DepParser::parse_uri("a\n->\tb", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d);
TEST_CHECK_EQUAL(stringify(d), "a -> b\n");
DepSpecPrettyPrinter e(0, true);
- PortageDepParser::parse_uri("a-> b", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
+ DepParser::parse_uri("a-> b", *EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(e);
TEST_CHECK_EQUAL(stringify(e), "a->\nb\n");
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> b",
+ TEST_CHECK_THROWS(DepParser::parse_uri("a -> b",
*EAPIData::get_instance()->eapi_from_string("0"))->accept(d), DepStringError);
}
} test_dep_spec_parser_uri;
/**
- * \test Test PortageDepParser nesting errors.
+ * \test Test DepParser nesting errors.
*
*/
- struct PortageDepParserBadNestingTest : TestCase
+ struct DepParserBadNestingTest : TestCase
{
- PortageDepParserBadNestingTest() : TestCase("bad nesting") { }
+ DepParserBadNestingTest() : TestCase("bad nesting") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("!foo? ( one/one",
+ TEST_CHECK_THROWS(DepParser::parse_depend("!foo? ( one/one",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("!foo? ( one/one ) )",
+ TEST_CHECK_THROWS(DepParser::parse_depend("!foo? ( one/one ) )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("( ( ( ) )",
+ TEST_CHECK_THROWS(DepParser::parse_depend("( ( ( ) )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("( ( ( ) ) ) )",
+ TEST_CHECK_THROWS(DepParser::parse_depend("( ( ( ) ) ) )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend(")",
+ TEST_CHECK_THROWS(DepParser::parse_depend(")",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
}
} test_dep_spec_parser_bad_nesting;
/**
- * \test Test PortageDepParser weird errors.
+ * \test Test DepParser weird errors.
*
*/
- struct PortageDepParserBadValuesTest : TestCase
+ struct DepParserBadValuesTest : TestCase
{
- PortageDepParserBadValuesTest() : TestCase("bad values") { }
+ DepParserBadValuesTest() : TestCase("bad values") { }
void run()
{
DepSpecPrettyPrinter d(0, false);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("||",
+ TEST_CHECK_THROWS(DepParser::parse_depend("||",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("|| ",
+ TEST_CHECK_THROWS(DepParser::parse_depend("|| ",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("foo?",
+ TEST_CHECK_THROWS(DepParser::parse_depend("foo?",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("!foo? ||",
+ TEST_CHECK_THROWS(DepParser::parse_depend("!foo? ||",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("(((",
+ TEST_CHECK_THROWS(DepParser::parse_depend("(((",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend(")",
+ TEST_CHECK_THROWS(DepParser::parse_depend(")",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_depend("(foo/bar)",
+ TEST_CHECK_THROWS(DepParser::parse_depend("(foo/bar)",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_license("a -> b",
+ TEST_CHECK_THROWS(DepParser::parse_license("a -> b",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("( -> )",
+ TEST_CHECK_THROWS(DepParser::parse_uri("( -> )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("( -> )",
+ TEST_CHECK_THROWS(DepParser::parse_uri("( -> )",
*EAPIData::get_instance()->eapi_from_string("0"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("foo? -> bar",
+ TEST_CHECK_THROWS(DepParser::parse_uri("foo? -> bar",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("a ->",
+ TEST_CHECK_THROWS(DepParser::parse_uri("a ->",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> ( )",
+ TEST_CHECK_THROWS(DepParser::parse_uri("a -> ( )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> )",
+ TEST_CHECK_THROWS(DepParser::parse_uri("a -> )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> || ( )",
+ TEST_CHECK_THROWS(DepParser::parse_uri("a -> || ( )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
- TEST_CHECK_THROWS(PortageDepParser::parse_uri("a -> foo? ( )",
+ TEST_CHECK_THROWS(DepParser::parse_uri("a -> foo? ( )",
*EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
}
} test_dep_spec_parser_bad_values;
diff --git a/paludis/dep_spec_pretty_printer.cc b/paludis/repositories/e/dep_spec_pretty_printer.cc
index 496c588..3150c38 100644
--- a/paludis/dep_spec_pretty_printer.cc
+++ b/paludis/repositories/e/dep_spec_pretty_printer.cc
@@ -20,7 +20,7 @@
#include <algorithm>
#include <sstream>
#include <paludis/dep_spec.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/util/save.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -33,6 +33,7 @@
*/
using namespace paludis;
+using namespace paludis::erepository;
namespace paludis
{
@@ -65,7 +66,7 @@ DepSpecPrettyPrinter::~DepSpecPrettyPrinter()
}
std::ostream &
-paludis::operator<< (std::ostream & s, const DepSpecPrettyPrinter & p)
+paludis::erepository::operator<< (std::ostream & s, const DepSpecPrettyPrinter & p)
{
s << p._imp->s.str();
return s;
diff --git a/paludis/repositories/e/dep_spec_pretty_printer.hh b/paludis/repositories/e/dep_spec_pretty_printer.hh
new file mode 100644
index 0000000..155b1da
--- /dev/null
+++ b/paludis/repositories/e/dep_spec_pretty_printer.hh
@@ -0,0 +1,96 @@
+/* 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_PALUDIS_DEP_ATOM_PRETTY_PRINTER_HH
+#define PALUDIS_GUARD_PALUDIS_DEP_ATOM_PRETTY_PRINTER_HH 1
+
+#include <iosfwd>
+#include <paludis/dep_spec.hh>
+
+/** \file
+ * Declarations for the DepSpecPrettyPrinter class.
+ *
+ * \ingroup grpdepspecprettyprinter
+ */
+
+namespace paludis
+{
+ namespace erepository
+ {
+ /**
+ * Pretty print dependency specs.
+ *
+ * \ingroup grpdepspecprettyprinter
+ */
+ class PALUDIS_VISIBLE DepSpecPrettyPrinter :
+ public ConstVisitor<GenericSpecTree>,
+ private PrivateImplementationPattern<DepSpecPrettyPrinter>
+ {
+ friend std::ostream & operator<< (std::ostream &, const DepSpecPrettyPrinter &);
+
+ private:
+ std::string newline();
+ std::string indent();
+
+ public:
+ ///\name Basic operations
+ ///\{
+
+ DepSpecPrettyPrinter(unsigned initial_indent, bool use_newlines = true);
+
+ ~DepSpecPrettyPrinter();
+
+ ///\}
+
+ /// \name Visit functions
+ ///{
+
+ void visit_sequence(const AllDepSpec &,
+ GenericSpecTree::ConstSequenceIterator,
+ GenericSpecTree::ConstSequenceIterator);
+
+ void visit_sequence(const AnyDepSpec &,
+ GenericSpecTree::ConstSequenceIterator,
+ GenericSpecTree::ConstSequenceIterator);
+
+ void visit_sequence(const UseDepSpec &,
+ GenericSpecTree::ConstSequenceIterator,
+ GenericSpecTree::ConstSequenceIterator);
+
+ void visit_leaf(const PackageDepSpec &);
+
+ void visit_leaf(const PlainTextDepSpec &);
+
+ void visit_leaf(const BlockDepSpec &);
+
+ void visit_leaf(const URIDepSpec &);
+
+ ///}
+ };
+
+ /**
+ * Output a DepSpecPrettyPrinter to an ostream.
+ *
+ * \ingroup grpdepspecprettyprinter
+ */
+ std::ostream & operator<< (std::ostream & s, const DepSpecPrettyPrinter & p) PALUDIS_VISIBLE;
+ }
+}
+
+#endif
diff --git a/paludis/repositories/e/e_key.cc b/paludis/repositories/e/e_key.cc
index 008365a..d1dfee6 100644
--- a/paludis/repositories/e/e_key.cc
+++ b/paludis/repositories/e/e_key.cc
@@ -19,6 +19,9 @@
#include <paludis/repositories/e/e_key.hh>
#include <paludis/repositories/e/ebuild_id.hh>
+#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/stringify.hh>
@@ -31,8 +34,6 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/idle_action_pool.hh>
-#include <paludis/portage_dep_parser.hh>
-#include <paludis/eapi.hh>
#include <paludis/contents.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -45,7 +46,7 @@
using namespace paludis;
using namespace paludis::erepository;
-EStringKey::EStringKey(const tr1::shared_ptr<const PackageID> &,
+EStringKey::EStringKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataStringKey(r, h, t),
_value(v)
@@ -67,13 +68,13 @@ namespace paludis
template <>
struct Implementation<EDependenciesKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<const DependencySpecTree::ConstItem> value;
mutable tr1::function<void () throw ()> value_used;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -81,7 +82,7 @@ namespace paludis
};
}
-EDependenciesKey::EDependenciesKey(const tr1::shared_ptr<const PackageID> & id,
+EDependenciesKey::EDependenciesKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSpecTreeKey<DependencySpecTree>(r, h, t),
PrivateImplementationPattern<EDependenciesKey>(new Implementation<EDependenciesKey>(id, v)),
@@ -110,10 +111,26 @@ EDependenciesKey::value() const
IdleActionPool::get_instance()->increase_unprepared_stat();
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = PortageDepParser::parse_depend(_imp->string_value, *_imp->id->eapi());
+ _imp->value = DepParser::parse_depend(_imp->string_value, *_imp->id->eapi());
return _imp->value;
}
+std::string
+EDependenciesKey::pretty_print() const
+{
+ DepSpecPrettyPrinter p(4, true);
+ value()->accept(p);
+ return stringify(p);
+}
+
+std::string
+EDependenciesKey::pretty_print_flat() const
+{
+ DepSpecPrettyPrinter p(0, false);
+ value()->accept(p);
+ return stringify(p);
+}
+
IdleActionResult
EDependenciesKey::idle_load() const
{
@@ -123,7 +140,7 @@ EDependenciesKey::idle_load() const
try
{
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "' as idle action:");
- _imp->value = PortageDepParser::parse_depend(_imp->string_value, *_imp->id->eapi());
+ _imp->value = DepParser::parse_depend(_imp->string_value, *_imp->id->eapi());
_imp->value_used = tr1::bind(tr1::mem_fn(&IdleActionPool::increase_used_stat), IdleActionPool::get_instance());
return iar_success;
}
@@ -142,13 +159,13 @@ namespace paludis
template <>
struct Implementation<ELicenseKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<const LicenseSpecTree::ConstItem> value;
mutable tr1::function<void () throw ()> value_used;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -156,7 +173,7 @@ namespace paludis
};
}
-ELicenseKey::ELicenseKey(const tr1::shared_ptr<const PackageID> & id,
+ELicenseKey::ELicenseKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSpecTreeKey<LicenseSpecTree>(r, h, t),
PrivateImplementationPattern<ELicenseKey>(new Implementation<ELicenseKey>(id, v)),
@@ -185,10 +202,26 @@ ELicenseKey::value() const
IdleActionPool::get_instance()->increase_unprepared_stat();
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = PortageDepParser::parse_license(_imp->string_value, *_imp->id->eapi());
+ _imp->value = DepParser::parse_license(_imp->string_value, *_imp->id->eapi());
return _imp->value;
}
+std::string
+ELicenseKey::pretty_print() const
+{
+ DepSpecPrettyPrinter p(4, true);
+ value()->accept(p);
+ return stringify(p);
+}
+
+std::string
+ELicenseKey::pretty_print_flat() const
+{
+ DepSpecPrettyPrinter p(0, false);
+ value()->accept(p);
+ return stringify(p);
+}
+
IdleActionResult
ELicenseKey::idle_load() const
{
@@ -198,7 +231,7 @@ ELicenseKey::idle_load() const
try
{
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "' as idle action:");
- _imp->value = PortageDepParser::parse_license(_imp->string_value, *_imp->id->eapi());
+ _imp->value = DepParser::parse_license(_imp->string_value, *_imp->id->eapi());
_imp->value_used = tr1::bind(tr1::mem_fn(&IdleActionPool::increase_used_stat), IdleActionPool::get_instance());
return iar_success;
}
@@ -217,12 +250,12 @@ namespace paludis
template <>
struct Implementation<EURIKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<const URISpecTree::ConstItem> value;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -230,7 +263,7 @@ namespace paludis
};
}
-EURIKey::EURIKey(const tr1::shared_ptr<const PackageID> & id,
+EURIKey::EURIKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSpecTreeKey<URISpecTree>(r, h, t),
PrivateImplementationPattern<EURIKey>(new Implementation<EURIKey>(id, v)),
@@ -251,21 +284,37 @@ EURIKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = PortageDepParser::parse_uri(_imp->string_value, *_imp->id->eapi());
+ _imp->value = DepParser::parse_uri(_imp->string_value, *_imp->id->eapi());
return _imp->value;
}
+std::string
+EURIKey::pretty_print() const
+{
+ DepSpecPrettyPrinter p(4, true);
+ value()->accept(p);
+ return stringify(p);
+}
+
+std::string
+EURIKey::pretty_print_flat() const
+{
+ DepSpecPrettyPrinter p(0, false);
+ value()->accept(p);
+ return stringify(p);
+}
+
namespace paludis
{
template <>
struct Implementation<ERestrictKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<const RestrictSpecTree::ConstItem> value;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -273,7 +322,7 @@ namespace paludis
};
}
-ERestrictKey::ERestrictKey(const tr1::shared_ptr<const PackageID> & id,
+ERestrictKey::ERestrictKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSpecTreeKey<RestrictSpecTree>(r, h, t),
PrivateImplementationPattern<ERestrictKey>(new Implementation<ERestrictKey>(id, v)),
@@ -294,21 +343,37 @@ ERestrictKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = PortageDepParser::parse_restrict(_imp->string_value, *_imp->id->eapi());
+ _imp->value = DepParser::parse_restrict(_imp->string_value, *_imp->id->eapi());
return _imp->value;
}
+std::string
+ERestrictKey::pretty_print() const
+{
+ DepSpecPrettyPrinter p(4, true);
+ value()->accept(p);
+ return stringify(p);
+}
+
+std::string
+ERestrictKey::pretty_print_flat() const
+{
+ DepSpecPrettyPrinter p(0, false);
+ value()->accept(p);
+ return stringify(p);
+}
+
namespace paludis
{
template <>
struct Implementation<EProvideKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<const ProvideSpecTree::ConstItem> value;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -316,7 +381,7 @@ namespace paludis
};
}
-EProvideKey::EProvideKey(const tr1::shared_ptr<const PackageID> & id,
+EProvideKey::EProvideKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSpecTreeKey<ProvideSpecTree>(r, h, t),
PrivateImplementationPattern<EProvideKey>(new Implementation<EProvideKey>(id, v)),
@@ -337,22 +402,38 @@ EProvideKey::value() const
return _imp->value;
Context context("When parsing metadata key '" + raw_name() + "' from '" + stringify(*_imp->id) + "':");
- _imp->value = PortageDepParser::parse_provide(_imp->string_value, *_imp->id->eapi());
+ _imp->value = DepParser::parse_provide(_imp->string_value, *_imp->id->eapi());
return _imp->value;
}
+std::string
+EProvideKey::pretty_print() const
+{
+ DepSpecPrettyPrinter p(4, true);
+ value()->accept(p);
+ return stringify(p);
+}
+
+std::string
+EProvideKey::pretty_print_flat() const
+{
+ DepSpecPrettyPrinter p(0, false);
+ value()->accept(p);
+ return stringify(p);
+}
+
namespace paludis
{
template <>
struct Implementation<EIUseKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<IUseFlagSet> value;
mutable tr1::function<void () throw ()> value_used;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -360,7 +441,7 @@ namespace paludis
};
}
-EIUseKey::EIUseKey(const tr1::shared_ptr<const PackageID> & id,
+EIUseKey::EIUseKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSetKey<IUseFlagSet>(r, h, t),
PrivateImplementationPattern<EIUseKey>(new Implementation<EIUseKey>(id, v)),
@@ -433,13 +514,13 @@ namespace paludis
template <>
struct Implementation<EKeywordsKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<KeywordNameSet> value;
mutable tr1::function<void () throw ()> value_used;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -447,7 +528,7 @@ namespace paludis
};
}
-EKeywordsKey::EKeywordsKey(const tr1::shared_ptr<const PackageID> & id,
+EKeywordsKey::EKeywordsKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSetKey<KeywordNameSet>(r, h, t),
PrivateImplementationPattern<EKeywordsKey>(new Implementation<EKeywordsKey>(id, v)),
@@ -511,12 +592,12 @@ namespace paludis
template <>
struct Implementation<EUseKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<UseFlagNameSet> value;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -524,7 +605,7 @@ namespace paludis
};
}
-EUseKey::EUseKey(const tr1::shared_ptr<const PackageID> & id,
+EUseKey::EUseKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSetKey<UseFlagNameSet>(r, h, t),
PrivateImplementationPattern<EUseKey>(new Implementation<EUseKey>(id, v)),
@@ -560,12 +641,12 @@ namespace paludis
template <>
struct Implementation<EInheritedKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const std::string string_value;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<InheritedSet> value;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const std::string & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const std::string & v) :
id(i),
string_value(v)
{
@@ -573,7 +654,7 @@ namespace paludis
};
}
-EInheritedKey::EInheritedKey(const tr1::shared_ptr<const PackageID> & id,
+EInheritedKey::EInheritedKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const std::string & v, const MetadataKeyType t) :
MetadataSetKey<InheritedSet>(r, h, t),
PrivateImplementationPattern<EInheritedKey>(new Implementation<EInheritedKey>(id, v)),
@@ -604,12 +685,12 @@ namespace paludis
template <>
struct Implementation<EContentsKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const FSEntry filename;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<Contents> value;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const FSEntry & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v) :
id(i),
filename(v)
{
@@ -617,7 +698,7 @@ namespace paludis
};
}
-EContentsKey::EContentsKey(const tr1::shared_ptr<const PackageID> & id,
+EContentsKey::EContentsKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
MetadataContentsKey(r, h, t),
PrivateImplementationPattern<EContentsKey>(new Implementation<EContentsKey>(id, v)),
@@ -702,12 +783,12 @@ namespace paludis
template <>
struct Implementation<ECTimeKey>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const ERepositoryID> id;
const FSEntry filename;
mutable Mutex value_mutex;
mutable tr1::shared_ptr<time_t> value;
- Implementation(const tr1::shared_ptr<const PackageID> & i, const FSEntry & v) :
+ Implementation(const tr1::shared_ptr<const ERepositoryID> & i, const FSEntry & v) :
id(i),
filename(v)
{
@@ -715,7 +796,7 @@ namespace paludis
};
}
-ECTimeKey::ECTimeKey(const tr1::shared_ptr<const PackageID> & id,
+ECTimeKey::ECTimeKey(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & r, const std::string & h, const FSEntry & v, const MetadataKeyType t) :
MetadataTimeKey(r, h, t),
PrivateImplementationPattern<ECTimeKey>(new Implementation<ECTimeKey>(id, v)),
diff --git a/paludis/repositories/e/e_key.hh b/paludis/repositories/e/e_key.hh
index 326fa6f..5f2cf26 100644
--- a/paludis/repositories/e/e_key.hh
+++ b/paludis/repositories/e/e_key.hh
@@ -26,10 +26,10 @@
namespace paludis
{
- class PackageID;
-
namespace erepository
{
+ class ERepositoryID;
+
class EStringKey :
public MetadataStringKey
{
@@ -37,7 +37,7 @@ namespace paludis
const std::string _value;
public:
- EStringKey(const tr1::shared_ptr<const PackageID> &,
+ EStringKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EStringKey();
@@ -53,13 +53,19 @@ namespace paludis
Implementation<EDependenciesKey> * const _imp;
public:
- EDependenciesKey(const tr1::shared_ptr<const PackageID> &,
+ EDependenciesKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EDependenciesKey();
virtual const tr1::shared_ptr<const DependencySpecTree::ConstItem> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print_flat() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
IdleActionResult idle_load() const;
};
@@ -71,12 +77,18 @@ namespace paludis
Implementation<EURIKey> * const _imp;
public:
- EURIKey(const tr1::shared_ptr<const PackageID> &,
+ EURIKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EURIKey();
virtual const tr1::shared_ptr<const URISpecTree::ConstItem> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print_flat() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
class ERestrictKey :
@@ -87,12 +99,18 @@ namespace paludis
Implementation<ERestrictKey> * const _imp;
public:
- ERestrictKey(const tr1::shared_ptr<const PackageID> &,
+ ERestrictKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~ERestrictKey();
virtual const tr1::shared_ptr<const RestrictSpecTree::ConstItem> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print_flat() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EProvideKey :
@@ -103,12 +121,18 @@ namespace paludis
Implementation<EProvideKey> * const _imp;
public:
- EProvideKey(const tr1::shared_ptr<const PackageID> &,
+ EProvideKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EProvideKey();
virtual const tr1::shared_ptr<const ProvideSpecTree::ConstItem> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print_flat() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
class ELicenseKey :
@@ -119,7 +143,7 @@ namespace paludis
Implementation<ELicenseKey> * const _imp;
public:
- ELicenseKey(const tr1::shared_ptr<const PackageID> &,
+ ELicenseKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~ELicenseKey();
@@ -127,6 +151,12 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
IdleActionResult idle_load() const;
+
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print_flat() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
class EIUseKey :
@@ -137,7 +167,7 @@ namespace paludis
Implementation<EIUseKey> * const _imp;
public:
- EIUseKey(const tr1::shared_ptr<const PackageID> &,
+ EIUseKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EIUseKey();
@@ -155,7 +185,7 @@ namespace paludis
Implementation<EKeywordsKey> * const _imp;
public:
- EKeywordsKey(const tr1::shared_ptr<const PackageID> &,
+ EKeywordsKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EKeywordsKey();
@@ -173,7 +203,7 @@ namespace paludis
Implementation<EUseKey> * const _imp;
public:
- EUseKey(const tr1::shared_ptr<const PackageID> &,
+ EUseKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EUseKey();
@@ -189,7 +219,7 @@ namespace paludis
Implementation<EInheritedKey> * const _imp;
public:
- EInheritedKey(const tr1::shared_ptr<const PackageID> &,
+ EInheritedKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const std::string &, const MetadataKeyType);
~EInheritedKey();
@@ -205,7 +235,7 @@ namespace paludis
Implementation<EContentsKey> * const _imp;
public:
- EContentsKey(const tr1::shared_ptr<const PackageID> &,
+ EContentsKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
~EContentsKey();
@@ -221,7 +251,7 @@ namespace paludis
Implementation<ECTimeKey> * const _imp;
public:
- ECTimeKey(const tr1::shared_ptr<const PackageID> &,
+ ECTimeKey(const tr1::shared_ptr<const ERepositoryID> &,
const std::string &, const std::string &, const FSEntry &, const MetadataKeyType);
~ECTimeKey();
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index 0f1aece..b7474c1 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -26,6 +26,7 @@
#include <paludis/repositories/e/e_repository_sets.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/repositories/e/e_repository_entries.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <paludis/repositories/e/use_desc.hh>
#include <paludis/repositories/e/layout.hh>
@@ -44,7 +45,6 @@
#include <paludis/query.hh>
#include <paludis/repository_name_cache.hh>
#include <paludis/syncer.hh>
-#include <paludis/eapi.hh>
#include <paludis/action.hh>
#include <paludis/util/fs_entry.hh>
@@ -130,8 +130,8 @@ namespace paludis
mutable tr1::shared_ptr<ERepositoryNews> news_ptr;
mutable tr1::shared_ptr<ERepositorySets> sets_ptr;
- mutable tr1::shared_ptr<ERepositoryEntries> entries_ptr;
- mutable tr1::shared_ptr<Layout> layout;
+ mutable tr1::shared_ptr<erepository::ERepositoryEntries> entries_ptr;
+ mutable tr1::shared_ptr<erepository::Layout> layout;
Implementation(ERepository * const, const ERepositoryParams &);
~Implementation();
@@ -149,9 +149,9 @@ namespace paludis
has_mirrors(false),
has_profiles_desc(false),
sets_ptr(new ERepositorySets(params.environment, r, p)),
- entries_ptr(ERepositoryEntriesMaker::get_instance()->find_maker(
+ entries_ptr(erepository::ERepositoryEntriesMaker::get_instance()->find_maker(
params.entry_format)(params.environment, r, p)),
- layout(LayoutMaker::get_instance()->find_maker(
+ layout(erepository::LayoutMaker::get_instance()->find_maker(
params.layout)(r, params.location, entries_ptr, params.master_repository ?
make_shared_ptr(new FSEntry(params.master_repository->params().location)) :
tr1::shared_ptr<FSEntry>()))
@@ -172,7 +172,8 @@ namespace paludis
profile_ptr.reset(new ERepositoryProfile(
params.environment, repo, repo->name(), *params.profiles,
- EAPIData::get_instance()->eapi_from_string(params.eapi_when_unknown)->supported->ebuild_environment_variables->env_arch));
+ erepository::EAPIData::get_instance()->eapi_from_string(
+ params.eapi_when_unknown)->supported->ebuild_environment_variables->env_arch));
}
void
@@ -212,7 +213,7 @@ namespace paludis
.status(tokens.at(2))
.profile(tr1::shared_ptr<ERepositoryProfile>(new ERepositoryProfile(
params.environment, repo, repo->name(), profiles,
- EAPIData::get_instance()->eapi_from_string(
+ erepository::EAPIData::get_instance()->eapi_from_string(
params.eapi_when_unknown)->supported->ebuild_environment_variables->env_arch))));
}
}
@@ -603,7 +604,7 @@ ERepository::update_news() const
_imp->news_ptr->update_news();
}
-const tr1::shared_ptr<const Layout>
+const tr1::shared_ptr<const erepository::Layout>
ERepository::layout() const
{
return _imp->layout;
@@ -616,7 +617,7 @@ ERepository::profile() const
return _imp->profile_ptr;
}
-const tr1::shared_ptr<const ERepositoryEntries>
+const tr1::shared_ptr<const erepository::ERepositoryEntries>
ERepository::entries() const
{
return _imp->entries_ptr;
@@ -632,7 +633,8 @@ ERepository::get_environment_variable(
_imp->need_profiles();
- return _imp->entries_ptr->get_environment_variable(for_package, var, _imp->profile_ptr);
+ return _imp->entries_ptr->get_environment_variable(tr1::static_pointer_cast<const erepository::ERepositoryID>(for_package),
+ var, _imp->profile_ptr);
}
tr1::shared_ptr<const RepositoryInfo>
@@ -760,7 +762,7 @@ ERepository::do_use_expand_flags() const
{
_imp->need_profiles();
- std::string expand_sep(stringify(EAPIData::get_instance()->eapi_from_string(_imp->params.profile_eapi
+ std::string expand_sep(stringify(erepository::EAPIData::get_instance()->eapi_from_string(_imp->params.profile_eapi
)->supported->ebuild_options->use_expand_separator));
tr1::shared_ptr<UseFlagNameSet> result(new UseFlagNameSet);
for (ERepositoryProfile::UseExpandIterator i(_imp->profile_ptr->begin_use_expand()),
@@ -901,7 +903,7 @@ ERepository::do_describe_use_flag(const UseFlagName & f,
if (_imp->use_desc.empty())
{
- std::string expand_sep(stringify(EAPIData::get_instance()->eapi_from_string(
+ std::string expand_sep(stringify(erepository::EAPIData::get_instance()->eapi_from_string(
_imp->params.profile_eapi)->supported->ebuild_options->use_expand_separator));
tr1::shared_ptr<const FSEntrySequence> use_desc_dirs(_imp->layout->use_desc_dirs());
for (FSEntrySequence::Iterator p(use_desc_dirs->begin()), p_end(use_desc_dirs->end()) ;
@@ -1034,3 +1036,17 @@ ERepository::do_some_ids_might_support_action(const SupportsActionTestBase & a)
return q.result;
}
+std::string
+ERepository::accept_keywords_variable() const
+{
+ return erepository::EAPIData::get_instance()->eapi_from_string(
+ params().profile_eapi)->supported->ebuild_environment_variables->env_accept_keywords;
+}
+
+std::string
+ERepository::arch_variable() const
+{
+ return erepository::EAPIData::get_instance()->eapi_from_string(
+ params().profile_eapi)->supported->ebuild_environment_variables->env_arch;
+}
+
diff --git a/paludis/repositories/e/e_repository.hh b/paludis/repositories/e/e_repository.hh
index 393ad78..8ea0c92 100644
--- a/paludis/repositories/e/e_repository.hh
+++ b/paludis/repositories/e/e_repository.hh
@@ -194,6 +194,8 @@ namespace paludis
///\{
std::string profile_variable(const std::string &) const;
+ virtual std::string accept_keywords_variable() const;
+ virtual std::string arch_variable() const;
const ERepositoryParams & params() const;
@@ -219,8 +221,8 @@ namespace paludis
*/
void update_news() const;
- const tr1::shared_ptr<const Layout> layout() const;
- const tr1::shared_ptr<const ERepositoryEntries> entries() const;
+ const tr1::shared_ptr<const erepository::Layout> layout() const;
+ const tr1::shared_ptr<const erepository::ERepositoryEntries> entries() const;
const tr1::shared_ptr<const ERepositoryProfile> profile() const;
bool repository_masked(const PackageID &) const;
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 42f3e29..d4804f6 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -18,18 +18,19 @@
*/
#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
#include <paludis/repositories/e/make_ebuild_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/system.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/map.hh>
#include <paludis/util/set.hh>
-#include <paludis/eapi.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/query.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <test/test_framework.hh>
@@ -512,15 +513,14 @@ namespace test_cases
tr1::shared_ptr<const PackageID> id1(*env.package_database()->query(query::Matches(
PackageDepSpec("=cat-one/pkg-one-1", pds_pm_unspecific)), qo_require_exactly_one)->begin());
- TEST_CHECK_EQUAL(id1->eapi()->name, "0");
- TEST_CHECK(id1->eapi()->supported);
+ TEST_CHECK(id1->end_metadata() != id1->find_metadata("EAPI"));
TEST_CHECK(id1->short_description_key());
TEST_CHECK_EQUAL(id1->short_description_key()->value(), "The Description");
- DepSpecPrettyPrinter pd(0, false);
+ erepository::DepSpecPrettyPrinter pd(0, false);
TEST_CHECK(id1->build_dependencies_key());
id1->build_dependencies_key()->value()->accept(pd);
TEST_CHECK_STRINGIFY_EQUAL(pd, "foo/bar");
- DepSpecPrettyPrinter pr(0, false);
+ erepository::DepSpecPrettyPrinter pr(0, false);
TEST_CHECK(id1->run_dependencies_key());
id1->run_dependencies_key()->value()->accept(pr);
TEST_CHECK_STRINGIFY_EQUAL(pr, "foo/bar");
@@ -528,15 +528,14 @@ namespace test_cases
tr1::shared_ptr<const PackageID> id2(*env.package_database()->query(query::Matches(
PackageDepSpec("=cat-one/pkg-one-2", pds_pm_unspecific)), qo_require_exactly_one)->begin());
- TEST_CHECK_EQUAL(id2->eapi()->name, "0");
- TEST_CHECK(id2->eapi()->supported);
+ TEST_CHECK(id2->end_metadata() != id2->find_metadata("EAPI"));
TEST_CHECK(id2->short_description_key());
TEST_CHECK_EQUAL(id2->short_description_key()->value(), "dquote \" squote ' backslash \\ dollar $");
- DepSpecPrettyPrinter pd2(0, false);
+ erepository::DepSpecPrettyPrinter pd2(0, false);
TEST_CHECK(id2->build_dependencies_key());
id2->build_dependencies_key()->value()->accept(pd2);
TEST_CHECK_STRINGIFY_EQUAL(pd2, "foo/bar bar/baz");
- DepSpecPrettyPrinter pr2(0, false);
+ erepository::DepSpecPrettyPrinter pr2(0, false);
TEST_CHECK(id2->run_dependencies_key());
id2->run_dependencies_key()->value()->accept(pr2);
TEST_CHECK_STRINGIFY_EQUAL(pr2, "foo/bar");
@@ -577,8 +576,8 @@ namespace test_cases
tr1::shared_ptr<const PackageID> id1(*env.package_database()->query(query::Matches(
PackageDepSpec("=cat-one/pkg-two-1", pds_pm_unspecific)), qo_require_exactly_one)->begin());
- TEST_CHECK_EQUAL(id1->eapi()->name, "UNKNOWN");
- TEST_CHECK(! id1->eapi()->supported);
+ TEST_CHECK(id1->end_metadata() != id1->find_metadata("EAPI"));
+ TEST_CHECK_EQUAL(tr1::static_pointer_cast<const erepository::ERepositoryID>(id1)->eapi()->name, "UNKNOWN");
TEST_CHECK(! id1->short_description_key());
}
}
diff --git a/paludis/repositories/e/e_repository_entries.cc b/paludis/repositories/e/e_repository_entries.cc
index 8a6fb1d..811b923 100644
--- a/paludis/repositories/e/e_repository_entries.cc
+++ b/paludis/repositories/e/e_repository_entries.cc
@@ -24,6 +24,7 @@
#include <paludis/util/instantiation_policy-impl.hh>
using namespace paludis;
+using namespace paludis::erepository;
template class VirtualConstructor<std::string,
tr1::shared_ptr<ERepositoryEntries> (*) (const Environment * const, ERepository * const,
diff --git a/paludis/repositories/e/e_repository_entries.hh b/paludis/repositories/e/e_repository_entries.hh
index 26b5155..8cc82af 100644
--- a/paludis/repositories/e/e_repository_entries.hh
+++ b/paludis/repositories/e/e_repository_entries.hh
@@ -25,10 +25,13 @@
#include <paludis/repository-fwd.hh>
#include <paludis/version_spec-fwd.hh>
#include <paludis/package_id-fwd.hh>
+#include <paludis/environment-fwd.hh>
#include <paludis/util/instantiation_policy.hh>
#include <paludis/util/virtual_constructor.hh>
+#include <paludis/util/tr1_memory.hh>
#include <paludis/repositories/e/e_repository_profile.hh>
#include <paludis/repositories/e/e_repository_params.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
#include <string>
/** \file
@@ -40,95 +43,96 @@
namespace paludis
{
class ERepository;
- class Environment;
-
- /**
- * Handle entries (for example, ebuilds) in a ERepository.
- *
- * \ingroup grperepository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE ERepositoryEntries
- {
- public:
- ///\name Basic operations
- ///\{
-
- virtual ~ERepositoryEntries() = 0;
-
- ///\}
-
- virtual bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- virtual VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * Create a PackageID.
- */
- virtual const tr1::shared_ptr<const PackageID> make_id(const QualifiedPackageName &, const VersionSpec &,
- const FSEntry &, const std::string &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
-
- /**
- * Fetch an environment variable.
- */
- virtual std::string get_environment_variable(const tr1::shared_ptr<const PackageID> &, const std::string & var,
- tr1::shared_ptr<const ERepositoryProfile>) const = 0;
-
- /**
- * Handle an install.
- */
- virtual void install(const tr1::shared_ptr<const PackageID> &, const InstallActionOptions &,
- tr1::shared_ptr<const ERepositoryProfile>) const = 0;
-
- /**
- * Handle a pretend.
- */
- virtual bool pretend(const tr1::shared_ptr<const PackageID> &,
- tr1::shared_ptr<const ERepositoryProfile>) const = 0;
-
- /**
- * Handle a merge.
- */
- virtual void merge(const MergeOptions &) = 0;
- };
-
- /**
- * Thrown if a repository of the specified type does not exist.
- *
- * \ingroup grpexceptions
- * \ingroup grprepository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE NoSuchERepositoryEntriesType : public ConfigurationError
- {
- public:
- /**
- * Constructor.
- */
- NoSuchERepositoryEntriesType(const std::string & format) throw ();
- };
-
- /**
- * Virtual constructor for ERepositoryEntries.
- *
- * \ingroup grprepository
- */
- class PALUDIS_VISIBLE ERepositoryEntriesMaker :
- public VirtualConstructor<std::string,
- tr1::shared_ptr<ERepositoryEntries> (*) (const Environment * const, ERepository * const,
- const ERepositoryParams &),
- virtual_constructor_not_found::ThrowException<NoSuchERepositoryEntriesType> >,
- public InstantiationPolicy<ERepositoryEntriesMaker, instantiation_method::SingletonTag>
- {
- friend class InstantiationPolicy<ERepositoryEntriesMaker, instantiation_method::SingletonTag>;
-
- private:
- ERepositoryEntriesMaker();
- };
+ namespace erepository
+ {
+ /**
+ * Handle entries (for example, ebuilds) in a ERepository.
+ *
+ * \ingroup grperepository
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE ERepositoryEntries
+ {
+ public:
+ ///\name Basic operations
+ ///\{
+
+ virtual ~ERepositoryEntries() = 0;
+
+ ///\}
+
+ virtual bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ /**
+ * Create an ERepositoryID.
+ */
+ virtual const tr1::shared_ptr<const ERepositoryID> make_id(const QualifiedPackageName &, const VersionSpec &,
+ const FSEntry &, const std::string &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ /**
+ * Fetch an environment variable.
+ */
+ virtual std::string get_environment_variable(const tr1::shared_ptr<const ERepositoryID> &, const std::string & var,
+ tr1::shared_ptr<const ERepositoryProfile>) const = 0;
+
+ /**
+ * Handle an install.
+ */
+ virtual void install(const tr1::shared_ptr<const ERepositoryID> &, const InstallActionOptions &,
+ tr1::shared_ptr<const ERepositoryProfile>) const = 0;
+
+ /**
+ * Handle a pretend.
+ */
+ virtual bool pretend(const tr1::shared_ptr<const ERepositoryID> &,
+ tr1::shared_ptr<const ERepositoryProfile>) const = 0;
+
+ /**
+ * Handle a merge.
+ */
+ virtual void merge(const MergeOptions &) = 0;
+ };
+
+ /**
+ * Thrown if a repository of the specified type does not exist.
+ *
+ * \ingroup grpexceptions
+ * \ingroup grprepository
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE NoSuchERepositoryEntriesType : public ConfigurationError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ NoSuchERepositoryEntriesType(const std::string & format) throw ();
+ };
+
+ /**
+ * Virtual constructor for ERepositoryEntries.
+ *
+ * \ingroup grprepository
+ */
+ class PALUDIS_VISIBLE ERepositoryEntriesMaker :
+ public VirtualConstructor<std::string,
+ tr1::shared_ptr<ERepositoryEntries> (*) (const Environment * const, ERepository * const,
+ const ERepositoryParams &),
+ virtual_constructor_not_found::ThrowException<NoSuchERepositoryEntriesType> >,
+ public InstantiationPolicy<ERepositoryEntriesMaker, instantiation_method::SingletonTag>
+ {
+ friend class InstantiationPolicy<ERepositoryEntriesMaker, instantiation_method::SingletonTag>;
+
+ private:
+ ERepositoryEntriesMaker();
+ };
+ }
}
#endif
diff --git a/paludis/repositories/e/e_repository_id.cc b/paludis/repositories/e/e_repository_id.cc
new file mode 100644
index 0000000..5de3260
--- /dev/null
+++ b/paludis/repositories/e/e_repository_id.cc
@@ -0,0 +1,33 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * 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
+ * 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/version_spec.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
+
+using namespace paludis;
+using namespace paludis::erepository;
+
+bool
+ERepositoryID::breaks_portage() const
+{
+ return (version().has_try_part() || version().has_scm_part()
+ || (! eapi()->supported) || (eapi()->supported->breaks_portage));
+}
+
diff --git a/paludis/repositories/e/e_repository_id.hh b/paludis/repositories/e/e_repository_id.hh
new file mode 100644
index 0000000..1a50915
--- /dev/null
+++ b/paludis/repositories/e/e_repository_id.hh
@@ -0,0 +1,41 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_REPOSITORY_ID_HH
+#define PALUDIS_GUARD_PALUDIS_REPOSITORIES_E_E_REPOSITORY_ID_HH 1
+
+#include <paludis/package_id.hh>
+#include <paludis/repositories/e/eapi-fwd.hh>
+
+namespace paludis
+{
+ namespace erepository
+ {
+ class ERepositoryID :
+ public PackageID
+ {
+ public:
+ virtual const tr1::shared_ptr<const EAPI> eapi() const PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+
+ virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+ }
+}
+
+#endif
diff --git a/paludis/repositories/e/e_repository_profile.cc b/paludis/repositories/e/e_repository_profile.cc
index c971809..2f64f06 100644
--- a/paludis/repositories/e/e_repository_profile.cc
+++ b/paludis/repositories/e/e_repository_profile.cc
@@ -21,6 +21,8 @@
#include <paludis/repositories/e/e_repository_profile_file.hh>
#include <paludis/repositories/e/e_repository_exceptions.hh>
#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+
#include <paludis/util/log.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
@@ -33,7 +35,6 @@
#include <paludis/util/options.hh>
#include <paludis/config_file.hh>
#include <paludis/dep_tag.hh>
-#include <paludis/eapi.hh>
#include <paludis/environment.hh>
#include <paludis/match_package.hh>
#include <paludis/hashed_containers.hh>
@@ -323,7 +324,7 @@ Implementation<ERepositoryProfile>::load_profile_make_defaults(const FSEntry & d
stringify(k->first) + "' is now '" + stringify(environment_variables[k->first]) + "'");
}
- std::string use_expand_var(EAPIData::get_instance()->eapi_from_string(
+ std::string use_expand_var(erepository::EAPIData::get_instance()->eapi_from_string(
repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand);
try
{
@@ -342,7 +343,7 @@ Implementation<ERepositoryProfile>::load_profile_make_defaults(const FSEntry & d
void
Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
{
- std::string use_var(EAPIData::get_instance()->eapi_from_string(
+ std::string use_var(erepository::EAPIData::get_instance()->eapi_from_string(
repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use);
try
{
@@ -357,7 +358,7 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
+ e.message() + " (" + e.what() + ")");
}
- std::string use_expand_var(EAPIData::get_instance()->eapi_from_string(
+ std::string use_expand_var(erepository::EAPIData::get_instance()->eapi_from_string(
repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand);
try
{
@@ -372,7 +373,7 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
+ e.message() + " (" + e.what() + ")");
}
- std::string use_expand_hidden_var(EAPIData::get_instance()->eapi_from_string(
+ std::string use_expand_hidden_var(erepository::EAPIData::get_instance()->eapi_from_string(
repository->params().profile_eapi)->supported->ebuild_environment_variables->env_use_expand_hidden);
try
{
@@ -391,7 +392,7 @@ Implementation<ERepositoryProfile>::load_special_make_defaults_vars()
bool
Implementation<ERepositoryProfile>::is_incremental(const std::string & s) const
{
- tr1::shared_ptr<const EAPI> e(EAPIData::get_instance()->eapi_from_string(repository->params().profile_eapi));
+ tr1::shared_ptr<const erepository::EAPI> e(erepository::EAPIData::get_instance()->eapi_from_string(repository->params().profile_eapi));
try
{
@@ -581,7 +582,7 @@ Implementation<ERepositoryProfile>::add_use_expand_to_use()
stacked_values_list.push_back(StackedValues("use_expand special values"));
- std::string expand_sep(stringify(EAPIData::get_instance()->eapi_from_string(
+ std::string expand_sep(stringify(erepository::EAPIData::get_instance()->eapi_from_string(
repository->params().profile_eapi)->supported->ebuild_options->use_expand_separator));
for (UseFlagSet::const_iterator x(use_expand.begin()), x_end(use_expand.end()) ;
diff --git a/paludis/repositories/e/e_repository_sets.cc b/paludis/repositories/e/e_repository_sets.cc
index c77697c..9fa4d79 100644
--- a/paludis/repositories/e/e_repository_sets.cc
+++ b/paludis/repositories/e/e_repository_sets.cc
@@ -21,6 +21,7 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/e_repository_sets.hh>
#include <paludis/repositories/e/glsa.hh>
+#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/environment.hh>
#include <paludis/config_file.hh>
@@ -29,7 +30,6 @@
#include <paludis/dep_tag.hh>
#include <paludis/version_operator.hh>
#include <paludis/version_requirements.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/util/dir_iterator.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/is_file_with_extension.hh>
diff --git a/paludis/repositories/e/e_repository_sets_TEST.cc b/paludis/repositories/e/e_repository_sets_TEST.cc
index 9355de5..4932a69 100644
--- a/paludis/repositories/e/e_repository_sets_TEST.cc
+++ b/paludis/repositories/e/e_repository_sets_TEST.cc
@@ -19,8 +19,8 @@
#include <paludis/repositories/e/e_repository.hh>
#include <paludis/repositories/e/make_ebuild_repository.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/repositories/fake/fake_installed_repository.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/system.hh>
@@ -96,7 +96,7 @@ namespace test_cases
env.package_database()->add_repository(0, installed);
tr1::shared_ptr<SetSpecTree::ConstItem> set1(repo->sets_interface->package_set(SetName("set1")));
- DepSpecPrettyPrinter pretty(0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, false);
set1->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "cat-one/foo >=cat-two/bar-2");
}
@@ -130,7 +130,7 @@ namespace test_cases
env.package_database()->add_repository(1, repo);
tr1::shared_ptr<SetSpecTree::ConstItem> insecurity(repo->sets_interface->package_set(SetName("insecurity")));
- DepSpecPrettyPrinter pretty(0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, false);
insecurity->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "=cat-one/foo-1::test-repo-1 =cat-two/bar-1.5::test-repo-1 "
"=cat-two/bar-1.5.1::test-repo-1 =cat-three/baz-1.0::test-repo-1 "
@@ -171,7 +171,7 @@ namespace test_cases
env.package_database()->add_repository(0, installed);
tr1::shared_ptr<const SetSpecTree::ConstItem> security(repo->sets_interface->package_set(SetName("security")));
- DepSpecPrettyPrinter pretty(0, false);
+ erepository::DepSpecPrettyPrinter pretty(0, false);
security->accept(pretty);
TEST_CHECK_STRINGIFY_EQUAL(pretty, "=cat-two/bar-2.0::test-repo-1 =cat-three/baz-1.3::test-repo-1");
}
diff --git a/paludis/eapi-fwd.hh b/paludis/repositories/e/eapi-fwd.hh
index 882817c..fe54207 100644
--- a/paludis/eapi-fwd.hh
+++ b/paludis/repositories/e/eapi-fwd.hh
@@ -22,14 +22,17 @@
namespace paludis
{
- class EAPI;
- class SupportedEAPI;
- class EAPIData;
- class EAPIConfigurationError;
- class EAPIEbuildPhases;
- class EAPIEbuildMetadataVariables;
- class EAPIEbuildEnvironmentVariables;
- class EAPIEbuildOptions;
+ namespace erepository
+ {
+ class EAPI;
+ class SupportedEAPI;
+ class EAPIData;
+ class EAPIConfigurationError;
+ class EAPIEbuildPhases;
+ class EAPIEbuildMetadataVariables;
+ class EAPIEbuildEnvironmentVariables;
+ class EAPIEbuildOptions;
+ }
}
#endif
diff --git a/paludis/eapi.cc b/paludis/repositories/e/eapi.cc
index 395b9ff..dd211c3 100644
--- a/paludis/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -17,7 +17,7 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include <paludis/eapi.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <paludis/name.hh>
#include <paludis/dep_spec.hh>
#include <paludis/hashed_containers.hh>
@@ -34,8 +34,9 @@
#include <paludis/config_file.hh>
using namespace paludis;
+using namespace paludis::erepository;
-#include <paludis/eapi-sr.cc>
+#include <paludis/repositories/e/eapi-sr.cc>
template class InstantiationPolicy<EAPIData, instantiation_method::SingletonTag>;
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
new file mode 100644
index 0000000..3661029
--- /dev/null
+++ b/paludis/repositories/e/eapi.hh
@@ -0,0 +1,84 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * 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
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_PALUDIS_EAPI_HH
+#define PALUDIS_GUARD_PALUDIS_EAPI_HH 1
+
+#include <paludis/repositories/e/eapi-fwd.hh>
+#include <paludis/repositories/e/dep_parser-fwd.hh>
+#include <paludis/util/attributes.hh>
+#include <paludis/util/sr.hh>
+#include <paludis/util/instantiation_policy.hh>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/name.hh>
+#include <paludis/dep_spec-fwd.hh>
+
+namespace paludis
+{
+ namespace erepository
+ {
+#include <paludis/repositories/e/eapi-sr.hh>
+
+ /**
+ * Thrown if an EAPI configuration is broken.
+ *
+ * \see EAPI
+ * \ingroup grpeapi
+ * \ingroup grpexceptions
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE EAPIConfigurationError :
+ public ConfigurationError
+ {
+ public:
+ EAPIConfigurationError(const std::string &) throw ();
+ };
+
+ /**
+ * Holds information on recognised EAPIs.
+ *
+ * \see EAPI
+ * \ingroup grpeapi
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE EAPIData :
+ private PrivateImplementationPattern<EAPIData>,
+ public InstantiationPolicy<EAPIData, instantiation_method::SingletonTag>
+ {
+ friend class InstantiationPolicy<EAPIData, instantiation_method::SingletonTag>;
+
+ private:
+ EAPIData();
+ ~EAPIData();
+
+ public:
+ /**
+ * Make an EAPI.
+ */
+ tr1::shared_ptr<const EAPI> eapi_from_string(const std::string &) const;
+
+ /**
+ * Make the unknown EAPI.
+ */
+ tr1::shared_ptr<const EAPI> unknown_eapi() const;
+ };
+ }
+}
+
+#endif
diff --git a/paludis/eapi.sr b/paludis/repositories/e/eapi.sr
index 71347c9..6b3a545 100644
--- a/paludis/eapi.sr
+++ b/paludis/repositories/e/eapi.sr
@@ -150,7 +150,7 @@ make_class_SupportedEAPI()
key package_dep_spec_parse_mode PackageDepSpecParseMode
key strict_package_dep_spec_parse_mode PackageDepSpecParseMode
- key dependency_spec_tree_parse_mode DependencySpecTreeParseMode
+ key dependency_spec_tree_parse_mode "erepository::DependencySpecTreeParseMode"
key iuse_flag_parse_mode IUseFlagParseMode
key strict_iuse_flag_parse_mode IUseFlagParseMode
key uri_supports_arrow bool
diff --git a/paludis/repositories/e/eapi_phase.cc b/paludis/repositories/e/eapi_phase.cc
index 70dafc2..ab299ae 100644
--- a/paludis/repositories/e/eapi_phase.cc
+++ b/paludis/repositories/e/eapi_phase.cc
@@ -17,12 +17,12 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "eapi_phase.hh"
+#include <paludis/repositories/e/eapi_phase.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <paludis/util/tokeniser.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/iterator.hh>
#include <paludis/util/make_shared_ptr.hh>
-#include <paludis/eapi.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
diff --git a/paludis/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index b41c2d4..b41c2d4 100644
--- a/paludis/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
diff --git a/paludis/eapis/Makefile.am b/paludis/repositories/e/eapis/Makefile.am
index 2f5513d..2f5513d 100644
--- a/paludis/eapis/Makefile.am
+++ b/paludis/repositories/e/eapis/Makefile.am
diff --git a/paludis/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index f6b59d5..f6b59d5 100644
--- a/paludis/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
diff --git a/paludis/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 3e23ce6..3e23ce6 100644
--- a/paludis/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
diff --git a/paludis/repositories/e/ebin.cc b/paludis/repositories/e/ebin.cc
index d5b8efc..4928dd0 100644
--- a/paludis/repositories/e/ebin.cc
+++ b/paludis/repositories/e/ebin.cc
@@ -17,14 +17,14 @@
* Place, Suite 330, Boston, MA 02111-1307 USA
*/
-#include "ebin.hh"
-#include <paludis/portage_dep_parser.hh>
+#include <paludis/repositories/e/ebin.hh>
+#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <paludis/environment.hh>
#include <paludis/util/system.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/eapi.hh>
#include <paludis/about.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
diff --git a/paludis/repositories/e/ebin_entries.cc b/paludis/repositories/e/ebin_entries.cc
index 0f25496..8454619 100644
--- a/paludis/repositories/e/ebin_entries.cc
+++ b/paludis/repositories/e/ebin_entries.cc
@@ -20,13 +20,14 @@
#include "ebin_entries.hh"
#include <paludis/repositories/e/ebin.hh>
#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/config_file.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/eapi.hh>
#include <paludis/util/strip.hh>
#include <paludis/util/log.hh>
#include <paludis/util/system.hh>
@@ -34,7 +35,6 @@
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/util/is_file_with_extension.hh>
#include <paludis/util/visitor-impl.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <set>
diff --git a/paludis/repositories/e/ebin_entries.hh b/paludis/repositories/e/ebin_entries.hh
index 930f8fb..6e897e8 100644
--- a/paludis/repositories/e/ebin_entries.hh
+++ b/paludis/repositories/e/ebin_entries.hh
@@ -29,48 +29,51 @@ namespace paludis
class FSEntry;
class ERepository;
- /**
- * ERepositoryEntries handler for ebins.
- *
- * \ingroup grperepository
- */
- class PALUDIS_VISIBLE EbinEntries :
- public ERepositoryEntries,
- private PrivateImplementationPattern<EbinEntries>
+ namespace erepository
{
- public:
- /**
- * Create an EbinEntries instance.
- */
- static tr1::shared_ptr<ERepositoryEntries> make_ebin_entries(const Environment * const,
- ERepository * const, const ERepositoryParams &);
-
- ///\name Basic operations
- ///\{
-
- EbinEntries(const Environment * const,
- ERepository * const e_repository,
- const ERepositoryParams &);
-
- virtual ~EbinEntries();
-
- ///\}
-
- virtual bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const tr1::shared_ptr<const PackageID> make_id(const QualifiedPackageName &, const VersionSpec &,
- const FSEntry &, const std::string &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string get_environment_variable(const tr1::shared_ptr<const PackageID> &, const std::string & var,
- tr1::shared_ptr<const ERepositoryProfile>) const;
-
- virtual void merge(const MergeOptions &);
- };
+ /**
+ * ERepositoryEntries handler for ebins.
+ *
+ * \ingroup grperepository
+ */
+ class PALUDIS_VISIBLE EbinEntries :
+ public ERepositoryEntries,
+ private PrivateImplementationPattern<EbinEntries>
+ {
+ public:
+ /**
+ * Create an EbinEntries instance.
+ */
+ static tr1::shared_ptr<ERepositoryEntries> make_ebin_entries(const Environment * const,
+ ERepository * const, const ERepositoryParams &);
+
+ ///\name Basic operations
+ ///\{
+
+ EbinEntries(const Environment * const,
+ ERepository * const e_repository,
+ const ERepositoryParams &);
+
+ virtual ~EbinEntries();
+
+ ///\}
+
+ virtual bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const tr1::shared_ptr<const ERepositoryID> make_id(const QualifiedPackageName &, const VersionSpec &,
+ const FSEntry &, const std::string &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string get_environment_variable(const tr1::shared_ptr<const ERepositoryID> &, const std::string & var,
+ tr1::shared_ptr<const ERepositoryProfile>) const;
+
+ virtual void merge(const MergeOptions &);
+ };
+ }
}
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index bc72d57..af71660 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -20,6 +20,8 @@
#include <paludis/repositories/e/ebuild.hh>
#include <paludis/repositories/e/ebuild_id.hh>
#include <paludis/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_parser.hh>
#include <paludis/util/system.hh>
#include <paludis/util/strip.hh>
@@ -32,10 +34,8 @@
#include <paludis/about.hh>
#include <paludis/environment.hh>
#include <paludis/config_file.hh>
-#include <paludis/eapi.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/portage_dep_parser.hh>
#include <sys/resource.h>
#include <sys/time.h>
diff --git a/paludis/repositories/e/ebuild.hh b/paludis/repositories/e/ebuild.hh
index 60e0b5a..82f768b 100644
--- a/paludis/repositories/e/ebuild.hh
+++ b/paludis/repositories/e/ebuild.hh
@@ -42,6 +42,7 @@ namespace paludis
namespace erepository
{
class EbuildID;
+ class ERepositoryID;
#include <paludis/repositories/e/ebuild-sr.hh>
diff --git a/paludis/repositories/e/ebuild.sr b/paludis/repositories/e/ebuild.sr
index 613e536..20fd4c3 100644
--- a/paludis/repositories/e/ebuild.sr
+++ b/paludis/repositories/e/ebuild.sr
@@ -4,7 +4,7 @@
make_class_EbuildCommandParams()
{
key environment "const Environment *"
- key package_id "tr1::shared_ptr<const PackageID>"
+ key package_id "tr1::shared_ptr<const erepository::ERepositoryID>"
key ebuild_dir FSEntry
key ebuild_file FSEntry
key files_dir FSEntry
@@ -147,7 +147,7 @@ END
make_class_WriteVDBEntryParams()
{
key environment "const Environment *"
- key package_id "tr1::shared_ptr<const PackageID>"
+ key package_id "tr1::shared_ptr<const erepository::ERepositoryID>"
key output_directory "FSEntry"
key environment_file "FSEntry"
diff --git a/paludis/repositories/e/ebuild_entries.cc b/paludis/repositories/e/ebuild_entries.cc
index d92c8eb..714eb06 100644
--- a/paludis/repositories/e/ebuild_entries.cc
+++ b/paludis/repositories/e/ebuild_entries.cc
@@ -23,14 +23,14 @@
#include <paludis/repositories/e/ebuild.hh>
#include <paludis/repositories/e/eapi_phase.hh>
#include <paludis/repositories/e/ebuild_id.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_parser.hh>
-#include <paludis/eapi.hh>
#include <paludis/action.hh>
#include <paludis/dep_spec_flattener.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
@@ -99,7 +99,7 @@ EbuildEntries::~EbuildEntries()
{
}
-const tr1::shared_ptr<const PackageID>
+const tr1::shared_ptr<const ERepositoryID>
EbuildEntries::make_id(const QualifiedPackageName & q, const VersionSpec & v, const FSEntry & f,
const std::string & guessed_eapi) const
{
@@ -158,7 +158,7 @@ namespace
}
std::string make_use(const Environment * const env,
- const PackageID & id,
+ const ERepositoryID & id,
tr1::shared_ptr<const ERepositoryProfile> profile)
{
std::string use;
@@ -178,7 +178,7 @@ namespace
tr1::shared_ptr<Map<std::string, std::string> >
make_expand(const Environment * const env,
- const PackageID & e,
+ const ERepositoryID & e,
tr1::shared_ptr<const ERepositoryProfile> profile,
std::string & use,
const std::string & expand_sep)
@@ -234,7 +234,7 @@ namespace
}
void
-EbuildEntries::install(const tr1::shared_ptr<const PackageID> & id,
+EbuildEntries::install(const tr1::shared_ptr<const ERepositoryID> & id,
const InstallActionOptions & o, tr1::shared_ptr<const ERepositoryProfile> p) const
{
using namespace tr1::placeholders;
@@ -562,7 +562,7 @@ EbuildEntries::install(const tr1::shared_ptr<const PackageID> & id,
}
std::string
-EbuildEntries::get_environment_variable(const tr1::shared_ptr<const PackageID> & id,
+EbuildEntries::get_environment_variable(const tr1::shared_ptr<const ERepositoryID> & id,
const std::string & var, tr1::shared_ptr<const ERepositoryProfile>) const
{
EAPIPhases phases(id->eapi()->supported->ebuild_phases->ebuild_variable);
@@ -638,7 +638,7 @@ EbuildEntries::extract_package_file_version(const QualifiedPackageName & n, cons
}
bool
-EbuildEntries::pretend(const tr1::shared_ptr<const PackageID> & id,
+EbuildEntries::pretend(const tr1::shared_ptr<const ERepositoryID> & id,
tr1::shared_ptr<const ERepositoryProfile> p) const
{
using namespace tr1::placeholders;
diff --git a/paludis/repositories/e/ebuild_entries.hh b/paludis/repositories/e/ebuild_entries.hh
index 11a302f..c25f5d1 100644
--- a/paludis/repositories/e/ebuild_entries.hh
+++ b/paludis/repositories/e/ebuild_entries.hh
@@ -35,54 +35,57 @@ namespace paludis
class FSEntry;
class ERepository;
- /**
- * ERepositoryEntries handler for ebuilds.
- *
- * \ingroup grperepository
- */
- class PALUDIS_VISIBLE EbuildEntries :
- public ERepositoryEntries,
- private PrivateImplementationPattern<EbuildEntries>
+ namespace erepository
{
- public:
- /**
- * Create an EbuildEntries instance.
- */
- static tr1::shared_ptr<ERepositoryEntries> make_ebuild_entries(const Environment * const,
- ERepository * const, const ERepositoryParams &);
-
- ///\name Basic operations
- ///\{
-
- EbuildEntries(const Environment * const,
- ERepository * const e_repository,
- const ERepositoryParams &);
-
- virtual ~EbuildEntries();
-
- ///\}
-
- virtual void merge(const MergeOptions &) PALUDIS_ATTRIBUTE((noreturn));
-
- virtual bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual const tr1::shared_ptr<const PackageID> make_id(const QualifiedPackageName &, const VersionSpec &,
- const FSEntry &, const std::string &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
-
- virtual std::string get_environment_variable(const tr1::shared_ptr<const PackageID> &, const std::string & var,
- tr1::shared_ptr<const ERepositoryProfile>) const;
-
- virtual void install(const tr1::shared_ptr<const PackageID> &, const InstallActionOptions &,
- tr1::shared_ptr<const ERepositoryProfile>) const;
-
- virtual bool pretend(const tr1::shared_ptr<const PackageID> &,
- tr1::shared_ptr<const ERepositoryProfile>) const;
- };
+ /**
+ * ERepositoryEntries handler for ebuilds.
+ *
+ * \ingroup grperepository
+ */
+ class PALUDIS_VISIBLE EbuildEntries :
+ public ERepositoryEntries,
+ private PrivateImplementationPattern<EbuildEntries>
+ {
+ public:
+ /**
+ * Create an EbuildEntries instance.
+ */
+ static tr1::shared_ptr<ERepositoryEntries> make_ebuild_entries(const Environment * const,
+ ERepository * const, const ERepositoryParams &);
+
+ ///\name Basic operations
+ ///\{
+
+ EbuildEntries(const Environment * const,
+ ERepository * const e_repository,
+ const ERepositoryParams &);
+
+ virtual ~EbuildEntries();
+
+ ///\}
+
+ virtual void merge(const MergeOptions &) PALUDIS_ATTRIBUTE((noreturn));
+
+ virtual bool is_package_file(const QualifiedPackageName &, const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual VersionSpec extract_package_file_version(const QualifiedPackageName &, const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual const tr1::shared_ptr<const ERepositoryID> make_id(const QualifiedPackageName &, const VersionSpec &,
+ const FSEntry &, const std::string &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string get_environment_variable(const tr1::shared_ptr<const ERepositoryID> &, const std::string & var,
+ tr1::shared_ptr<const ERepositoryProfile>) const;
+
+ virtual void install(const tr1::shared_ptr<const ERepositoryID> &, const InstallActionOptions &,
+ tr1::shared_ptr<const ERepositoryProfile>) const;
+
+ virtual bool pretend(const tr1::shared_ptr<const ERepositoryID> &,
+ tr1::shared_ptr<const ERepositoryProfile>) const;
+ };
+ }
}
#endif
diff --git a/paludis/repositories/e/ebuild_flat_metadata_cache.cc b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
index 6ff332b..cc4e573 100644
--- a/paludis/repositories/e/ebuild_flat_metadata_cache.cc
+++ b/paludis/repositories/e/ebuild_flat_metadata_cache.cc
@@ -23,8 +23,8 @@
#include <paludis/util/join.hh>
#include <paludis/util/visitor-impl.hh>
#include <paludis/util/set.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
-#include <paludis/eapi.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <fstream>
#include <set>
#include <list>
@@ -85,8 +85,6 @@ EbuildFlatMetadataCache::load(const tr1::shared_ptr<const EbuildID> & id)
Log::get_instance()->message(ll_warning, lc_no_context) << "Stale cache file at '"
<< _filename << "'";
return ok;
-
- return true;
}
else
{
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 73189d9..1c62c96 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -25,12 +25,12 @@
#include <paludis/repositories/e/eapi_phase.hh>
#include <paludis/repositories/e/e_key.hh>
#include <paludis/repositories/e/e_mask.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
#include <paludis/distribution.hh>
-#include <paludis/eapi.hh>
#include <paludis/environment.hh>
#include <paludis/action.hh>
@@ -242,6 +242,8 @@ EbuildID::need_keys_added() const
}
}
+ add_metadata_key(make_shared_ptr(new EStringKey(shared_from_this(), "EAPI", "EAPI", _imp->eapi->name, mkt_internal)));
+
if (_imp->eapi->supported)
{
if (_imp->build_dependencies)
@@ -769,13 +771,16 @@ namespace
void visit(const InstallAction & a)
{
- tr1::static_pointer_cast<const ERepository>(id->repository())->entries()->install(id, a.options,
+ tr1::static_pointer_cast<const ERepository>(id->repository())->entries()->install(
+ tr1::static_pointer_cast<const ERepositoryID>(id),
+ a.options,
tr1::static_pointer_cast<const ERepository>(id->repository())->profile());
}
void visit(const PretendAction &)
{
- tr1::static_pointer_cast<const ERepository>(id->repository())->entries()->pretend(id,
+ tr1::static_pointer_cast<const ERepository>(id->repository())->entries()->pretend(
+ tr1::static_pointer_cast<const ERepositoryID>(id),
tr1::static_pointer_cast<const ERepository>(id->repository())->profile());
}
diff --git a/paludis/repositories/e/ebuild_id.hh b/paludis/repositories/e/ebuild_id.hh
index f54a8f2..e249e06 100644
--- a/paludis/repositories/e/ebuild_id.hh
+++ b/paludis/repositories/e/ebuild_id.hh
@@ -24,6 +24,8 @@
#include <paludis/metadata_key.hh>
#include <paludis/util/fs_entry-fwd.hh>
#include <paludis/util/idle_action_pool-fwd.hh>
+#include <paludis/repositories/e/eapi-fwd.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
namespace paludis
{
@@ -33,7 +35,7 @@ namespace paludis
namespace erepository
{
class EbuildID :
- public PackageID,
+ public ERepositoryID,
public tr1::enable_shared_from_this<EbuildID>,
private PrivateImplementationPattern<EbuildID>
{
@@ -61,7 +63,6 @@ namespace paludis
virtual const VersionSpec version() const;
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const EAPI> eapi() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const;
@@ -111,6 +112,8 @@ namespace paludis
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
+
+ virtual const tr1::shared_ptr<const EAPI> eapi() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/e/exheres_layout.cc b/paludis/repositories/e/exheres_layout.cc
index 648f260..ca15bac 100644
--- a/paludis/repositories/e/exheres_layout.cc
+++ b/paludis/repositories/e/exheres_layout.cc
@@ -46,6 +46,7 @@
#include <list>
using namespace paludis;
+using namespace paludis::erepository;
typedef MakeHashedMap<CategoryNamePart, bool>::Type CategoryMap;
typedef MakeHashedMap<QualifiedPackageName, bool>::Type PackagesMap;
diff --git a/paludis/repositories/e/exheres_layout.hh b/paludis/repositories/e/exheres_layout.hh
index b7f159f..3c3b9fd 100644
--- a/paludis/repositories/e/exheres_layout.hh
+++ b/paludis/repositories/e/exheres_layout.hh
@@ -25,90 +25,93 @@
namespace paludis
{
- class ERepositoryEntries;
-
- /**
- * The Exheres tree layout for a ERepository.
- *
- * \ingroup grperepository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE ExheresLayout :
- public Layout,
- private PrivateImplementationPattern<ExheresLayout>
+ namespace erepository
{
- private:
- void need_category_names() const;
- void need_category_names_collection() const;
- void need_package_ids(const QualifiedPackageName &) const;
+ class ERepositoryEntries;
- public:
- ///\name Basic operations
- ///\{
+ /**
+ * The Exheres tree layout for a ERepository.
+ *
+ * \ingroup grperepository
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE ExheresLayout :
+ public Layout,
+ private PrivateImplementationPattern<ExheresLayout>
+ {
+ private:
+ void need_category_names() const;
+ void need_category_names_collection() const;
+ void need_package_ids(const QualifiedPackageName &) const;
- ExheresLayout(const ERepository * const, const FSEntry &,
- tr1::shared_ptr<const ERepositoryEntries>,
- tr1::shared_ptr<const FSEntry>);
+ public:
+ ///\name Basic operations
+ ///\{
- virtual ~ExheresLayout();
+ ExheresLayout(const ERepository * const, const FSEntry &,
+ tr1::shared_ptr<const ERepositoryEntries>,
+ tr1::shared_ptr<const FSEntry>);
- ///\}
+ virtual ~ExheresLayout();
- virtual bool has_category_named(const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ ///\}
- virtual bool has_package_named(const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual bool has_category_named(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual bool has_package_named(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const PackageIDSequence> package_ids(
- const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
+ const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry info_packages_file(const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const PackageIDSequence> package_ids(
+ const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry info_variables_file(const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry info_packages_file(const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry package_directory(const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry info_variables_file(const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry category_directory(const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry package_directory(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry package_file(const PackageID &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry category_directory(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry package_file(const PackageID &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool eapi_ebuild_suffix() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry profiles_base_dir() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual bool eapi_ebuild_suffix() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const;
- };
+ virtual FSEntry profiles_base_dir() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const;
+ };
+ }
}
#endif
diff --git a/paludis/repositories/e/layout.cc b/paludis/repositories/e/layout.cc
index cec1ab1..b19f442 100644
--- a/paludis/repositories/e/layout.cc
+++ b/paludis/repositories/e/layout.cc
@@ -26,6 +26,7 @@
#include <paludis/util/instantiation_policy-impl.hh>
using namespace paludis;
+using namespace paludis::erepository;
template class VirtualConstructor<std::string,
tr1::shared_ptr<Layout> (*) (const ERepository * const, const FSEntry &,
diff --git a/paludis/repositories/e/layout.hh b/paludis/repositories/e/layout.hh
index c223de9..30e6f00 100644
--- a/paludis/repositories/e/layout.hh
+++ b/paludis/repositories/e/layout.hh
@@ -32,140 +32,144 @@
namespace paludis
{
- class ERepositoryEntries;
class ERepository;
- /**
- * Manages the layout of a ERepository.
- *
- * \ingroup grperepository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE Layout
+ namespace erepository
{
- private:
- tr1::shared_ptr<const FSEntry> _master_repository_location;
+ class ERepositoryEntries;
- protected:
- ///\name Basic operations
- ///\{
+ /**
+ * Manages the layout of a ERepository.
+ *
+ * \ingroup grperepository
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE Layout
+ {
+ private:
+ tr1::shared_ptr<const FSEntry> _master_repository_location;
- Layout(tr1::shared_ptr<const FSEntry> master_repository_location);
+ protected:
+ ///\name Basic operations
+ ///\{
- ///\}
+ Layout(tr1::shared_ptr<const FSEntry> master_repository_location);
- public:
- ///\name Basic operations
- ///\{
+ ///\}
- virtual ~Layout() = 0;
+ public:
+ ///\name Basic operations
+ ///\{
- ///\}
+ virtual ~Layout() = 0;
- ///\name Configuration information
- ///\{
+ ///\}
- tr1::shared_ptr<const FSEntry> master_repository_location() const;
+ ///\name Configuration information
+ ///\{
- ///\}
+ tr1::shared_ptr<const FSEntry> master_repository_location() const;
- ///\name Layout operations
- ///\{
+ ///\}
- virtual bool has_category_named(const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ ///\name Layout operations
+ ///\{
- virtual bool has_package_named(const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual bool has_category_named(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual bool has_package_named(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const PackageIDSequence> package_ids(
- const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
+ const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry info_packages_file(const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<const PackageIDSequence> package_ids(
+ const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry info_variables_file(const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry info_packages_file(const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry package_directory(const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry info_variables_file(const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry category_directory(const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry package_directory(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry package_file(const PackageID &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry category_directory(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry package_file(const PackageID &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual bool eapi_ebuild_suffix() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual FSEntry profiles_base_dir() const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual bool eapi_ebuild_suffix() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
+ virtual FSEntry profiles_base_dir() const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- ///\}
- };
+ virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result)) = 0;
- /**
- * Thrown if a layout of the specified type does not exist.
- *
- * \ingroup grpexceptions
- * \ingroup grperepository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE NoSuchLayoutType :
- public ConfigurationError
- {
- public:
- /**
- * Constructor.
- */
- NoSuchLayoutType(const std::string & format) throw ();
- };
-
- /**
- * Virtual constructor for Layout.
- *
- * \ingroup grperepository
- */
- class PALUDIS_VISIBLE LayoutMaker :
- public VirtualConstructor<std::string,
- tr1::shared_ptr<Layout> (*) (const ERepository * const, const FSEntry &,
- tr1::shared_ptr<const ERepositoryEntries>,
- tr1::shared_ptr<const FSEntry>),
- virtual_constructor_not_found::ThrowException<NoSuchLayoutType> >,
- public InstantiationPolicy<LayoutMaker, instantiation_method::SingletonTag>
- {
- friend class InstantiationPolicy<LayoutMaker, instantiation_method::SingletonTag>;
+ ///\}
+ };
+
+ /**
+ * Thrown if a layout of the specified type does not exist.
+ *
+ * \ingroup grpexceptions
+ * \ingroup grperepository
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE NoSuchLayoutType :
+ public ConfigurationError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ NoSuchLayoutType(const std::string & format) throw ();
+ };
- private:
- LayoutMaker();
- };
+ /**
+ * Virtual constructor for Layout.
+ *
+ * \ingroup grperepository
+ */
+ class PALUDIS_VISIBLE LayoutMaker :
+ public VirtualConstructor<std::string,
+ tr1::shared_ptr<Layout> (*) (const ERepository * const, const FSEntry &,
+ tr1::shared_ptr<const ERepositoryEntries>,
+ tr1::shared_ptr<const FSEntry>),
+ virtual_constructor_not_found::ThrowException<NoSuchLayoutType> >,
+ public InstantiationPolicy<LayoutMaker, instantiation_method::SingletonTag>
+ {
+ friend class InstantiationPolicy<LayoutMaker, instantiation_method::SingletonTag>;
+
+ private:
+ LayoutMaker();
+ };
+ }
}
#endif
diff --git a/paludis/repositories/e/traditional_layout.cc b/paludis/repositories/e/traditional_layout.cc
index 292d719..2b5a0b2 100644
--- a/paludis/repositories/e/traditional_layout.cc
+++ b/paludis/repositories/e/traditional_layout.cc
@@ -46,6 +46,7 @@
#include <libwrapiter/libwrapiter_output_iterator.hh>
using namespace paludis;
+using namespace paludis::erepository;
typedef MakeHashedMap<CategoryNamePart, bool>::Type CategoryMap;
typedef MakeHashedMap<QualifiedPackageName, bool>::Type PackagesMap;
diff --git a/paludis/repositories/e/traditional_layout.hh b/paludis/repositories/e/traditional_layout.hh
index 9b97305..6f208df 100644
--- a/paludis/repositories/e/traditional_layout.hh
+++ b/paludis/repositories/e/traditional_layout.hh
@@ -26,91 +26,94 @@
namespace paludis
{
- class ERepositoryEntries;
-
- /**
- * The traditional tree layout (as used by Gentoo) for a ERepository.
- *
- * \ingroup grperepository
- * \nosubgrouping
- */
- class PALUDIS_VISIBLE TraditionalLayout :
- public Layout,
- private PrivateImplementationPattern<TraditionalLayout>
+ namespace erepository
{
- private:
- void need_category_names() const;
- void need_category_names_collection() const;
- void need_package_ids(const QualifiedPackageName &) const;
+ class ERepositoryEntries;
- public:
- ///\name Basic operations
- ///\{
+ /**
+ * The traditional tree layout (as used by Gentoo) for a ERepository.
+ *
+ * \ingroup grperepository
+ * \nosubgrouping
+ */
+ class PALUDIS_VISIBLE TraditionalLayout :
+ public Layout,
+ private PrivateImplementationPattern<TraditionalLayout>
+ {
+ private:
+ void need_category_names() const;
+ void need_category_names_collection() const;
+ void need_package_ids(const QualifiedPackageName &) const;
- TraditionalLayout(const ERepository * const, const FSEntry &,
- tr1::shared_ptr<const ERepositoryEntries>,
- tr1::shared_ptr<const FSEntry>);
+ public:
+ ///\name Basic operations
+ ///\{
- virtual ~TraditionalLayout();
+ TraditionalLayout(const ERepository * const, const FSEntry &,
+ tr1::shared_ptr<const ERepositoryEntries>,
+ tr1::shared_ptr<const FSEntry>);
- ///\}
+ virtual ~TraditionalLayout();
- virtual bool has_category_named(const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ ///\}
- virtual bool has_package_named(const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual bool has_category_named(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual bool has_package_named(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
- const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const CategoryNamePartSet> category_names() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const PackageIDSequence> package_ids(
- const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const QualifiedPackageNameSet> package_names(
+ const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry info_packages_file(const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const PackageIDSequence> package_ids(
+ const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry info_variables_file(const FSEntry &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry info_packages_file(const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry package_directory(const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry info_variables_file(const FSEntry &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry category_directory(const CategoryNamePart &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry package_directory(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry package_file(const PackageID &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry category_directory(const CategoryNamePart &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual FSEntry package_file(const PackageID &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> arch_list_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> repository_mask_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> profiles_desc_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> mirror_files() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual bool eapi_ebuild_suffix() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual tr1::shared_ptr<const FSEntrySequence> use_desc_dirs() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual FSEntry profiles_base_dir() const
- PALUDIS_ATTRIBUTE((warn_unused_result));
+ virtual bool eapi_ebuild_suffix() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
- virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const
- PALUDIS_ATTRIBUTE((warn_unused_result));
- };
+ virtual FSEntry profiles_base_dir() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual tr1::shared_ptr<const FSEntrySequence> exlibsdirs(const QualifiedPackageName &) const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+ };
+ }
}
#endif
diff --git a/paludis/repositories/e/vdb_id.cc b/paludis/repositories/e/vdb_id.cc
index 52d57fb..d71de9d 100644
--- a/paludis/repositories/e/vdb_id.cc
+++ b/paludis/repositories/e/vdb_id.cc
@@ -20,12 +20,12 @@
#include <paludis/repositories/e/vdb_id.hh>
#include <paludis/repositories/e/e_key.hh>
#include <paludis/repositories/e/vdb_repository.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <paludis/name.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
#include <paludis/distribution.hh>
-#include <paludis/eapi.hh>
#include <paludis/environment.hh>
#include <paludis/action.hh>
#include <paludis/util/fs_entry.hh>
@@ -628,9 +628,9 @@ namespace
struct PerformAction :
ConstVisitor<ActionVisitorTypes>
{
- const tr1::shared_ptr<const PackageID> id;
+ const tr1::shared_ptr<const erepository::ERepositoryID> id;
- PerformAction(const tr1::shared_ptr<const PackageID> i) :
+ PerformAction(const tr1::shared_ptr<const erepository::ERepositoryID> i) :
id(i)
{
}
diff --git a/paludis/repositories/e/vdb_id.hh b/paludis/repositories/e/vdb_id.hh
index 52a6a63..192929a 100644
--- a/paludis/repositories/e/vdb_id.hh
+++ b/paludis/repositories/e/vdb_id.hh
@@ -24,13 +24,14 @@
#include <paludis/metadata_key.hh>
#include <paludis/environment-fwd.hh>
#include <paludis/util/fs_entry-fwd.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
namespace paludis
{
namespace erepository
{
class VDBID :
- public PackageID,
+ public ERepositoryID,
public tr1::enable_shared_from_this<VDBID>,
private PrivateImplementationPattern<VDBID>
{
diff --git a/paludis/repositories/e/vdb_repository.cc b/paludis/repositories/e/vdb_repository.cc
index 243d96f..2fcd705 100644
--- a/paludis/repositories/e/vdb_repository.cc
+++ b/paludis/repositories/e/vdb_repository.cc
@@ -22,14 +22,15 @@
#include <paludis/repositories/e/vdb_unmerger.hh>
#include <paludis/repositories/e/vdb_id.hh>
#include <paludis/repositories/e/eapi_phase.hh>
+#include <paludis/repositories/e/eapi.hh>
+#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/dep_spec_pretty_printer.hh>
#include <paludis/action.hh>
#include <paludis/config_file.hh>
#include <paludis/dep_spec.hh>
#include <paludis/dep_spec_flattener.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/dep_tag.hh>
-#include <paludis/eapi.hh>
#include <paludis/environment.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/hook.hh>
@@ -37,7 +38,6 @@
#include <paludis/metadata_key.hh>
#include <paludis/package_database.hh>
#include <paludis/package_id.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/repositories/e/ebuild.hh>
#include <paludis/repository_info.hh>
#include <paludis/repository_name_cache.hh>
@@ -343,7 +343,7 @@ VDBRepositoryKeyReadError::VDBRepositoryKeyReadError(
}
void
-VDBRepository::perform_uninstall(const tr1::shared_ptr<const PackageID> & id,
+VDBRepository::perform_uninstall(const tr1::shared_ptr<const ERepositoryID> & id,
const UninstallActionOptions & o, bool reinstalling) const
{
Context context("When uninstalling '" + stringify(*id) + (reinstalling ? "' for a reinstall:" : "':"));
@@ -429,7 +429,7 @@ VDBRepository::perform_uninstall(const tr1::shared_ptr<const PackageID> & id,
}
void
-VDBRepository::perform_config(const tr1::shared_ptr<const PackageID> & id) const
+VDBRepository::perform_config(const tr1::shared_ptr<const ERepositoryID> & id) const
{
Context context("When configuring '" + stringify(*id) + "':");
@@ -765,7 +765,7 @@ VDBRepository::load_provided_using_cache() const
}
DepSpecFlattener f(_imp->params.environment, id);
- tr1::shared_ptr<ProvideSpecTree::ConstItem> pp(PortageDepParser::parse_provide(
+ tr1::shared_ptr<ProvideSpecTree::ConstItem> pp(DepParser::parse_provide(
join(next(next(tokens.begin())), tokens.end(), " "), *EAPIData::get_instance()->eapi_from_string("paludis-1")));
pp->accept(f);
@@ -978,7 +978,7 @@ VDBRepository::merge(const MergeOptions & m)
WriteVDBEntryCommand write_vdb_entry_command(
WriteVDBEntryParams::create()
.environment(_imp->params.environment)
- .package_id(m.package_id)
+ .package_id(tr1::static_pointer_cast<const ERepositoryID>(m.package_id))
.output_directory(tmp_vdb_dir)
.environment_file(m.environment_file));
@@ -1033,7 +1033,7 @@ VDBRepository::merge(const MergeOptions & m)
if (is_replace)
{
UninstallActionOptions uninstall_options(false);
- perform_uninstall(m.package_id, uninstall_options, true);
+ perform_uninstall(tr1::static_pointer_cast<const ERepositoryID>(m.package_id), uninstall_options, true);
}
VDBPostMergeCommand post_merge_command(
@@ -1117,7 +1117,7 @@ VDBRepository::need_package_ids(const CategoryNamePart & c) const
_imp->categories[c] = q;
}
-const tr1::shared_ptr<const PackageID>
+const tr1::shared_ptr<const ERepositoryID>
VDBRepository::make_id(const QualifiedPackageName & q, const VersionSpec & v, const FSEntry & f) const
{
Lock l(_imp->big_nasty_mutex);
@@ -1128,13 +1128,13 @@ VDBRepository::make_id(const QualifiedPackageName & q, const VersionSpec & v, co
return result;
}
-const tr1::shared_ptr<const PackageID>
+const tr1::shared_ptr<const ERepositoryID>
VDBRepository::package_id_if_exists(const QualifiedPackageName & q, const VersionSpec & v) const
{
Lock l(_imp->big_nasty_mutex);
if (! has_package_named(q))
- return tr1::shared_ptr<const PackageID>();
+ return tr1::shared_ptr<const ERepositoryID>();
need_package_ids(q.category);
@@ -1143,8 +1143,8 @@ VDBRepository::package_id_if_exists(const QualifiedPackageName & q, const Versio
PackageIDSequence::Iterator i(std::find_if(_imp->ids[q]->begin(), _imp->ids[q]->end(),
tr1::bind(std::equal_to<VersionSpec>(), v, tr1::bind(tr1::mem_fn(&PackageID::version), _1))));
if (_imp->ids[q]->end() == i)
- return tr1::shared_ptr<const PackageID>();
- return *i;
+ return tr1::shared_ptr<const ERepositoryID>();
+ return tr1::static_pointer_cast<const ERepositoryID>(*i);
}
namespace
diff --git a/paludis/repositories/e/vdb_repository.hh b/paludis/repositories/e/vdb_repository.hh
index 74ca391..ca5661e 100644
--- a/paludis/repositories/e/vdb_repository.hh
+++ b/paludis/repositories/e/vdb_repository.hh
@@ -27,6 +27,7 @@
#include <paludis/util/fs_entry.hh>
#include <paludis/util/tr1_memory.hh>
#include <paludis/util/map.hh>
+#include <paludis/repositories/e/e_repository_id.hh>
/** \file
* Declarations for VDBRepository.
@@ -72,11 +73,11 @@ namespace paludis
void add_string_to_world(const std::string & n) const;
void remove_string_from_world(const std::string &) const;
- const tr1::shared_ptr<const PackageID> package_id_if_exists(const QualifiedPackageName &,
+ const tr1::shared_ptr<const erepository::ERepositoryID> package_id_if_exists(const QualifiedPackageName &,
const VersionSpec &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
- const tr1::shared_ptr<const PackageID> make_id(const QualifiedPackageName &, const VersionSpec &,
+ const tr1::shared_ptr<const erepository::ERepositoryID> make_id(const QualifiedPackageName &, const VersionSpec &,
const FSEntry &) const
PALUDIS_ATTRIBUTE((warn_unused_result));
@@ -226,10 +227,10 @@ namespace paludis
///\name For use by VDBID
///\{
- void perform_uninstall(const tr1::shared_ptr<const PackageID> & id,
+ void perform_uninstall(const tr1::shared_ptr<const erepository::ERepositoryID> & id,
const UninstallActionOptions & o, bool reinstalling) const;
- void perform_config(const tr1::shared_ptr<const PackageID> & id) const;
+ void perform_config(const tr1::shared_ptr<const erepository::ERepositoryID> & id) const;
///\}
diff --git a/paludis/repositories/fake/Makefile.am b/paludis/repositories/fake/Makefile.am
index 5ae61cb..b6ba9ba 100644
--- a/paludis/repositories/fake/Makefile.am
+++ b/paludis/repositories/fake/Makefile.am
@@ -11,7 +11,7 @@ paludis_repositories_libdir = $(libdir)/paludis/repositories
TESTS_ENVIRONMENT = env \
PALUDIS_GEMS_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/gems/`" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_SKIP_CONFIG="yes" \
TEST_SCRIPT_DIR="$(srcdir)/" \
@@ -30,6 +30,7 @@ EXTRA_DIST = \
fake_repository_TEST_LDADD = \
libpaludisfakerepository.la \
+ $(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/environments/test/libpaludistestenvironment.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/util/test_extras.o \
@@ -38,6 +39,7 @@ fake_repository_TEST_LDADD = \
fake_installed_repository_TEST_LDADD = \
libpaludisfakerepository.la \
+ $(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/environments/test/libpaludistestenvironment.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/util/test_extras.o \
@@ -50,30 +52,19 @@ fake_repository_TEST_SOURCES = \
fake_installed_repository_TEST_SOURCES = \
fake_installed_repository_TEST.cc
-if MONOLITHIC
-
-noinst_LTLIBRARIES = libpaludisfakerepository.la
-
-else
-
paludis_repositories_lib_LTLIBRARIES = libpaludisfakerepository.la
-endif
-
libpaludisfakerepository_la_SOURCES = \
fake_repository_base.cc fake_repository_base.hh \
fake_repository.cc fake_repository.hh \
fake_installed_repository.cc fake_installed_repository.hh \
fake_package_id.cc fake_package_id.hh
-if ! MONOLITHIC
-
libpaludisfakerepository_la_LIBADD = \
+ $(top_builddir)/paludis/repositories/e/libpaludiserepository.la \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/util/libpaludisutil.la
-endif
-
libpaludisfakerepository_la_LDFLAGS = -version-info @VERSION_LIB_CURRENT@:@VERSION_LIB_REVISION@:0
paludis_repositories_fake_includedir = $(includedir)/paludis-$(PALUDIS_PC_SLOT)/paludis/repositories/fake/
diff --git a/paludis/repositories/fake/fake_installed_repository.cc b/paludis/repositories/fake/fake_installed_repository.cc
index 52df82e..e900512 100644
--- a/paludis/repositories/fake/fake_installed_repository.cc
+++ b/paludis/repositories/fake/fake_installed_repository.cc
@@ -24,11 +24,11 @@
#include <paludis/util/set.hh>
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/visitor-impl.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/environment.hh>
#include <paludis/dep_spec_flattener.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/action.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
diff --git a/paludis/repositories/fake/fake_package_id.cc b/paludis/repositories/fake/fake_package_id.cc
index becdccb..b890037 100644
--- a/paludis/repositories/fake/fake_package_id.cc
+++ b/paludis/repositories/fake/fake_package_id.cc
@@ -19,12 +19,13 @@
#include <paludis/repositories/fake/fake_package_id.hh>
#include <paludis/repositories/fake/fake_repository_base.hh>
-#include <paludis/eapi.hh>
+#include <paludis/repositories/e/dep_parser.hh>
+#include <paludis/repositories/e/eapi.hh>
#include <paludis/name.hh>
#include <paludis/action.hh>
#include <paludis/environment.hh>
#include <paludis/version_spec.hh>
-#include <paludis/portage_dep_parser.hh>
+#include <paludis/dep_spec.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/util/stringify.hh>
#include <paludis/util/mutex.hh>
@@ -40,6 +41,7 @@
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <list>
+#include <sstream>
using namespace paludis;
@@ -113,6 +115,7 @@ namespace paludis
struct Implementation<FakeMetadataSpecTreeKey<C_> >
{
tr1::shared_ptr<const typename C_::ConstItem> value;
+ std::string string_value;
const tr1::function<const tr1::shared_ptr<const typename C_::ConstItem> (const std::string &)> func;
Implementation(const tr1::function<const tr1::shared_ptr<const typename C_::ConstItem> (const std::string &)> & f) :
@@ -141,6 +144,7 @@ template <typename C_>
void
FakeMetadataSpecTreeKey<C_>::set_from_string(const std::string & s)
{
+ _imp->string_value = s;
_imp->value = _imp->func(s);
}
@@ -151,6 +155,20 @@ FakeMetadataSpecTreeKey<C_>::value() const
return _imp->value;
}
+template <typename C_>
+std::string
+FakeMetadataSpecTreeKey<C_>::pretty_print() const
+{
+ return _imp->string_value;
+}
+
+template <typename C_>
+std::string
+FakeMetadataSpecTreeKey<C_>::pretty_print_flat() const
+{
+ return _imp->string_value;
+}
+
namespace paludis
{
template <>
@@ -226,53 +244,6 @@ FakeUnacceptedMask::unaccepted_key() const
namespace paludis
{
- template <>
- struct Implementation<FakeUnsupportedMask>
- {
- const char key;
- const std::string description;
- const std::string eapi_name;
-
- Implementation(const char k, const std::string & d, const std::string & n) :
- key(k),
- description(d),
- eapi_name(n)
- {
- }
- };
-}
-
-FakeUnsupportedMask::FakeUnsupportedMask(const char c, const std::string & s, const std::string & n) :
- PrivateImplementationPattern<FakeUnsupportedMask>(new Implementation<FakeUnsupportedMask>(c, s, n))
-{
-}
-
-FakeUnsupportedMask::~FakeUnsupportedMask()
-{
-}
-
-const char
-FakeUnsupportedMask::key() const
-{
- return _imp->key;
-}
-
-const std::string
-FakeUnsupportedMask::description() const
-{
- return _imp->description;
-}
-
-const std::string
-FakeUnsupportedMask::explanation() const
-{
- if (_imp->eapi_name == "UNKNOWN")
- return "Unsupported EAPI 'UNKNOWN' (likely a broken package or configuration error)";
- return "Unsupported EAPI '" + _imp->eapi_name + "'";
-}
-
-namespace paludis
-{
using namespace tr1::placeholders;
template <>
@@ -285,7 +256,6 @@ namespace paludis
const QualifiedPackageName name;
const VersionSpec version;
SlotName slot;
- tr1::shared_ptr<const EAPI> eapi;
tr1::shared_ptr<FakeMetadataPackageIDKey> package_id;
tr1::shared_ptr<FakeMetadataPackageIDKey> virtual_for;
@@ -311,21 +281,26 @@ namespace paludis
name(q),
version(v),
slot("0"),
- eapi(EAPIData::get_instance()->eapi_from_string("0")),
keywords(new FakeMetadataKeywordSetKey("KEYWORDS", "Keywords", "test", mkt_normal)),
iuse(new FakeMetadataIUseSetKey("IUSE", "Used USE flags", "", iuse_pm_permissive, mkt_normal)),
license(new FakeMetadataSpecTreeKey<LicenseSpecTree>("LICENSE", "Licenses",
- "", tr1::bind(&PortageDepParser::parse_license, _1, tr1::cref(*eapi)), mkt_normal)),
+ "", tr1::bind(&erepository::DepParser::parse_license, _1,
+ *erepository::EAPIData::get_instance()->eapi_from_string("0")), mkt_normal)),
provide(new FakeMetadataSpecTreeKey<ProvideSpecTree>("PROVIDE", "Provided packages",
- "", tr1::bind(&PortageDepParser::parse_provide, _1, tr1::cref(*eapi)), mkt_normal)),
+ "", tr1::bind(&erepository::DepParser::parse_provide, _1,
+ *erepository::EAPIData::get_instance()->eapi_from_string("0")), mkt_normal)),
build_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("DEPEND", "Build dependencies",
- "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)), mkt_dependencies)),
+ "", tr1::bind(&erepository::DepParser::parse_depend, _1,
+ *erepository::EAPIData::get_instance()->eapi_from_string("0")), mkt_dependencies)),
run_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("RDEPEND", "Run dependencies",
- "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)), mkt_dependencies)),
+ "", tr1::bind(&erepository::DepParser::parse_depend, _1,
+ *erepository::EAPIData::get_instance()->eapi_from_string("0")), mkt_dependencies)),
post_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("PDEPEND", "Post dependencies",
- "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)), mkt_dependencies)),
+ "", tr1::bind(&erepository::DepParser::parse_depend, _1,
+ *erepository::EAPIData::get_instance()->eapi_from_string("0")), mkt_dependencies)),
suggested_dependencies(new FakeMetadataSpecTreeKey<DependencySpecTree>("SDEPEND", "Suggested dependencies",
- "", tr1::bind(&PortageDepParser::parse_depend, _1, tr1::cref(*eapi)), mkt_dependencies)),
+ "", tr1::bind(&erepository::DepParser::parse_depend, _1,
+ *erepository::EAPIData::get_instance()->eapi_from_string("0")), mkt_dependencies)),
has_masks(false)
{
}
@@ -396,12 +371,6 @@ FakePackageID::repository() const
return _imp->repository;
}
-const tr1::shared_ptr<const EAPI>
-FakePackageID::eapi() const
-{
- return _imp->eapi;
-}
-
const tr1::shared_ptr<const MetadataPackageIDKey>
FakePackageID::virtual_for_key() const
{
@@ -671,12 +640,6 @@ FakePackageID::need_masks_added() const
Context context("When generating masks for ID '" + canonical_form(idcf_full) + "':");
- if (! eapi()->supported)
- {
- add_mask(make_shared_ptr(new FakeUnsupportedMask('E', "eapi", eapi()->name)));
- return;
- }
-
if (keywords_key())
if (! _imp->env->accept_keywords(keywords_key()->value(), *this))
add_mask(make_shared_ptr(new FakeUnacceptedMask('K', "keywords", keywords_key())));
@@ -757,6 +720,12 @@ FakePackageID::perform_action(Action & a) const
a.accept(b);
}
+bool
+FakePackageID::breaks_portage() const
+{
+ return (version().has_try_part() || version().has_scm_part());
+}
+
template class FakeMetadataSpecTreeKey<LicenseSpecTree>;
template class FakeMetadataSpecTreeKey<ProvideSpecTree>;
template class FakeMetadataSpecTreeKey<DependencySpecTree>;
diff --git a/paludis/repositories/fake/fake_package_id.hh b/paludis/repositories/fake/fake_package_id.hh
index 60ae6e4..3114b38 100644
--- a/paludis/repositories/fake/fake_package_id.hh
+++ b/paludis/repositories/fake/fake_package_id.hh
@@ -81,6 +81,12 @@ namespace paludis
PALUDIS_ATTRIBUTE((warn_unused_result));
void set_from_string(const std::string &);
+
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print_flat() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
class PALUDIS_VISIBLE FakeMetadataPackageIDKey :
@@ -112,19 +118,6 @@ namespace paludis
const tr1::shared_ptr<const MetadataKey> unaccepted_key() const;
};
- class PALUDIS_VISIBLE FakeUnsupportedMask :
- public UnsupportedMask,
- private PrivateImplementationPattern<FakeUnsupportedMask>
- {
- public:
- FakeUnsupportedMask(const char, const std::string &, const std::string &);
- ~FakeUnsupportedMask();
-
- const char key() const;
- const std::string description() const;
- const std::string explanation() const;
- };
-
class PALUDIS_VISIBLE FakePackageID :
public PackageID,
private PrivateImplementationPattern<FakePackageID>
@@ -148,7 +141,6 @@ namespace paludis
virtual const VersionSpec version() const;
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const EAPI> eapi() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const;
@@ -189,6 +181,8 @@ namespace paludis
virtual bool supports_action(const SupportsActionTestBase &) const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual void perform_action(Action &) const;
+ virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
+
};
}
diff --git a/paludis/repositories/fake/fake_repository.cc b/paludis/repositories/fake/fake_repository.cc
index 89f60eb..48a90c9 100644
--- a/paludis/repositories/fake/fake_repository.cc
+++ b/paludis/repositories/fake/fake_repository.cc
@@ -24,7 +24,6 @@
#include <paludis/util/make_shared_ptr.hh>
#include <paludis/util/sequence.hh>
#include <paludis/util/visitor-impl.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/distribution.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
diff --git a/paludis/repositories/fake/fake_repository_base.cc b/paludis/repositories/fake/fake_repository_base.cc
index a611b84..967fcb1 100644
--- a/paludis/repositories/fake/fake_repository_base.cc
+++ b/paludis/repositories/fake/fake_repository_base.cc
@@ -26,8 +26,6 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/set.hh>
#include <paludis/util/sequence.hh>
-#include <paludis/portage_dep_parser.hh>
-#include <paludis/eapi.hh>
#include <paludis/repository_info.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
diff --git a/paludis/repositories/gems/gem_specification.cc b/paludis/repositories/gems/gem_specification.cc
index abbc8e4..6f2cd22 100644
--- a/paludis/repositories/gems/gem_specification.cc
+++ b/paludis/repositories/gems/gem_specification.cc
@@ -25,7 +25,6 @@
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/stringify.hh>
#include <paludis/name.hh>
-#include <paludis/eapi.hh>
#include <paludis/version_spec.hh>
#include <paludis/repository.hh>
#include <paludis/metadata_key.hh>
@@ -91,14 +90,12 @@ namespace paludis
const Environment * const environment;
const tr1::shared_ptr<const Repository> repository;
- const tr1::shared_ptr<const EAPI> eapi;
mutable bool has_masks;
Implementation(const Environment * const e, const tr1::shared_ptr<const Repository> & r) :
environment(e),
repository(r),
- eapi(EAPIData::get_instance()->eapi_from_string("gems-1")),
has_masks(false)
{
}
@@ -363,12 +360,6 @@ GemSpecification::repository() const
return _imp->repository;
}
-const tr1::shared_ptr<const EAPI>
-GemSpecification::eapi() const
-{
- return _imp->eapi;
-}
-
const tr1::shared_ptr<const MetadataPackageIDKey>
GemSpecification::virtual_for_key() const
{
@@ -636,3 +627,9 @@ GemSpecification::need_masks_added() const
add_mask(breaks_mask);
}
+bool
+GemSpecification::breaks_portage() const
+{
+ return true;
+}
+
diff --git a/paludis/repositories/gems/gem_specification.hh b/paludis/repositories/gems/gem_specification.hh
index 1983e8a..3870c76 100644
--- a/paludis/repositories/gems/gem_specification.hh
+++ b/paludis/repositories/gems/gem_specification.hh
@@ -89,7 +89,6 @@ namespace paludis
virtual const VersionSpec version() const;
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const EAPI> eapi() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const;
@@ -119,6 +118,8 @@ namespace paludis
virtual bool arbitrary_less_than_comparison(const PackageID &) const;
virtual std::size_t extra_hash_value() const;
+
+ virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repositories/gems/gems_repository.cc b/paludis/repositories/gems/gems_repository.cc
index cfb8dd2..2379561 100644
--- a/paludis/repositories/gems/gems_repository.cc
+++ b/paludis/repositories/gems/gems_repository.cc
@@ -31,7 +31,6 @@
#include <paludis/util/sequence.hh>
#include <paludis/util/mutex.hh>
#include <paludis/util/visitor-impl.hh>
-#include <paludis/eapi.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/action.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
diff --git a/paludis/repositories/gems/installed_gems_repository.cc b/paludis/repositories/gems/installed_gems_repository.cc
index 77776c3..06da0f7 100644
--- a/paludis/repositories/gems/installed_gems_repository.cc
+++ b/paludis/repositories/gems/installed_gems_repository.cc
@@ -38,7 +38,6 @@
#include <paludis/util/log.hh>
#include <paludis/util/strip.hh>
#include <paludis/hashed_containers.hh>
-#include <paludis/eapi.hh>
#include <paludis/action.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
diff --git a/paludis/repositories/virtuals/Makefile.am b/paludis/repositories/virtuals/Makefile.am
index f9f085a..11975db 100644
--- a/paludis/repositories/virtuals/Makefile.am
+++ b/paludis/repositories/virtuals/Makefile.am
@@ -55,7 +55,7 @@ EXTRA_DIST = $(virtuals_repository_TEST_SOURCES) $(installed_virtuals_repository
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/e/ebuild/`" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_SKIP_CONFIG="yes" \
TEST_SCRIPT_DIR="$(srcdir)/" \
diff --git a/paludis/repositories/virtuals/package_id.cc b/paludis/repositories/virtuals/package_id.cc
index e65b3f6..85491cc 100644
--- a/paludis/repositories/virtuals/package_id.cc
+++ b/paludis/repositories/virtuals/package_id.cc
@@ -53,7 +53,7 @@ namespace paludis
template <>
struct Implementation<VirtualsDepKey>
{
- const tr1::shared_ptr<const DependencySpecTree::ConstItem> value;
+ const tr1::shared_ptr<const TreeLeaf<DependencySpecTree, PackageDepSpec> > value;
Implementation(const tr1::shared_ptr<const PackageID> & v, bool exact) :
value(exact ?
@@ -111,6 +111,18 @@ VirtualsDepKey::value() const
return _imp->value;
}
+std::string
+VirtualsDepKey::pretty_print() const
+{
+ return stringify(*_imp->value->item());
+}
+
+std::string
+VirtualsDepKey::pretty_print_flat() const
+{
+ return stringify(*_imp->value->item());
+}
+
namespace paludis
{
template <>
@@ -207,12 +219,6 @@ VirtualsPackageID::repository() const
return _imp->repository;
}
-const tr1::shared_ptr<const EAPI>
-VirtualsPackageID::eapi() const
-{
- return _imp->virtual_for->value()->eapi();
-}
-
const tr1::shared_ptr<const MetadataPackageIDKey>
VirtualsPackageID::virtual_for_key() const
{
@@ -465,3 +471,10 @@ VirtualsPackageID::need_masks_added() const
_imp->has_masks = true;
}
+bool
+VirtualsPackageID::breaks_portage() const
+{
+ return (version().has_try_part() || version().has_scm_part());
+}
+
+
diff --git a/paludis/repositories/virtuals/package_id.hh b/paludis/repositories/virtuals/package_id.hh
index 80e7f17..304ee17 100644
--- a/paludis/repositories/virtuals/package_id.hh
+++ b/paludis/repositories/virtuals/package_id.hh
@@ -57,6 +57,12 @@ namespace paludis
virtual const tr1::shared_ptr<const DependencySpecTree::ConstItem> value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual std::string pretty_print_flat() const
+ PALUDIS_ATTRIBUTE((warn_unused_result));
};
class VirtualsPackageID :
@@ -85,7 +91,6 @@ namespace paludis
virtual const VersionSpec version() const;
virtual const SlotName slot() const;
virtual const tr1::shared_ptr<const Repository> repository() const;
- virtual const tr1::shared_ptr<const EAPI> eapi() const;
virtual const tr1::shared_ptr<const MetadataPackageIDKey> virtual_for_key() const;
virtual const tr1::shared_ptr<const MetadataSetKey<KeywordNameSet> > keywords_key() const;
@@ -117,6 +122,8 @@ namespace paludis
virtual std::size_t extra_hash_value() const
PALUDIS_ATTRIBUTE((warn_unused_result));
+
+ virtual bool breaks_portage() const PALUDIS_ATTRIBUTE((warn_unused_result));
};
}
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 6d37273..a2a3edc 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -712,7 +712,6 @@ namespace paludis
};
class ERepositoryParams;
- class Layout;
/**
* Interface for handling ERepository specific functionality.
@@ -729,6 +728,8 @@ namespace paludis
///\{
virtual std::string profile_variable(const std::string &) const = 0;
+ virtual std::string accept_keywords_variable() const = 0;
+ virtual std::string arch_variable() const = 0;
virtual const ERepositoryParams & params() const = 0;
@@ -750,11 +751,6 @@ namespace paludis
///\}
- /**
- * Gives our current Layout
- */
- virtual const tr1::shared_ptr<const Layout> layout() const = 0;
-
virtual ~RepositoryEInterface();
};
diff --git a/paludis/set_file_TEST.cc b/paludis/set_file_TEST.cc
index ab4f649..90eae91 100644
--- a/paludis/set_file_TEST.cc
+++ b/paludis/set_file_TEST.cc
@@ -20,7 +20,6 @@
#include "set_file.hh"
#include <test/test_runner.hh>
#include <test/test_framework.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/util/fs_entry.hh>
#include <paludis/util/visitor-impl.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
@@ -29,6 +28,58 @@
using namespace test;
using namespace paludis;
+namespace
+{
+ struct DepSpecStringifier :
+ ConstVisitor<DependencySpecTree>
+ {
+ std::ostringstream s;
+
+ void
+ visit_sequence(const AllDepSpec &,
+ DependencySpecTree::ConstSequenceIterator cur,
+ DependencySpecTree::ConstSequenceIterator end)
+ {
+ s << "( ";
+ std::for_each(cur, end, accept_visitor(*this));
+ s << ") ";
+ }
+
+ void
+ visit_sequence(const AnyDepSpec &,
+ DependencySpecTree::ConstSequenceIterator cur,
+ DependencySpecTree::ConstSequenceIterator end)
+ {
+ s << "|| ( ";
+ std::for_each(cur, end, accept_visitor(*this));
+ s << ") ";
+ }
+
+ void
+ visit_sequence(const UseDepSpec & a,
+ DependencySpecTree::ConstSequenceIterator cur,
+ DependencySpecTree::ConstSequenceIterator end)
+ {
+ s << (a.inverse() ? "!" : "") << a.flag() << "? ( ";
+ std::for_each(cur, end, accept_visitor(*this));
+ s << ") ";
+ }
+
+ void
+ visit_leaf(const PackageDepSpec & p)
+ {
+ s << p << " ";
+ }
+
+ void
+ visit_leaf(const BlockDepSpec & b)
+ {
+ s << "!" << *b.blocked_spec() << " ";
+ }
+
+ };
+}
+
namespace test_cases
{
struct SimpleTest : TestCase
@@ -45,17 +96,17 @@ namespace test_cases
.environment(0));
{
- DepSpecPrettyPrinter p(0, false);
+ DepSpecStringifier p;
f.contents()->accept(p);
- TEST_CHECK_STRINGIFY_EQUAL(p, "foo/bar >=bar/baz-1.23");
+ TEST_CHECK_STRINGIFY_EQUAL(p.s.str(), "( foo/bar >=bar/baz-1.23 ) ");
}
f.add("foo/bar");
f.add("moo/oink");
{
- DepSpecPrettyPrinter p(0, false);
+ DepSpecStringifier p;
f.contents()->accept(p);
- TEST_CHECK_STRINGIFY_EQUAL(p, "foo/bar >=bar/baz-1.23 moo/oink");
+ TEST_CHECK_STRINGIFY_EQUAL(p.s.str(), "( foo/bar >=bar/baz-1.23 moo/oink ) ");
}
f.rewrite();
@@ -71,9 +122,9 @@ namespace test_cases
f.remove("bar/cow");
{
- DepSpecPrettyPrinter p(0, false);
+ DepSpecStringifier p;
f.contents()->accept(p);
- TEST_CHECK_STRINGIFY_EQUAL(p, "foo/bar moo/oink");
+ TEST_CHECK_STRINGIFY_EQUAL(p.s.str(), "( foo/bar moo/oink ) ");
}
f.rewrite();
@@ -106,17 +157,17 @@ namespace test_cases
.environment(0));
{
- DepSpecPrettyPrinter p(0, false);
+ DepSpecStringifier p;
f.contents()->accept(p);
- TEST_CHECK_STRINGIFY_EQUAL(p, ">=bar/baz-1.23");
+ TEST_CHECK_STRINGIFY_EQUAL(p.s.str(), "( >=bar/baz-1.23 ) ");
}
f.add("foo/bar");
f.add("moo/oink");
{
- DepSpecPrettyPrinter p(0, false);
+ DepSpecStringifier p;
f.contents()->accept(p);
- TEST_CHECK_STRINGIFY_EQUAL(p, ">=bar/baz-1.23 moo/oink");
+ TEST_CHECK_STRINGIFY_EQUAL(p.s.str(), "( >=bar/baz-1.23 moo/oink ) ");
}
f.rewrite();
@@ -132,9 +183,9 @@ namespace test_cases
f.remove("bar/cow");
{
- DepSpecPrettyPrinter p(0, false);
+ DepSpecStringifier p;
f.contents()->accept(p);
- TEST_CHECK_STRINGIFY_EQUAL(p, "moo/oink");
+ TEST_CHECK_STRINGIFY_EQUAL(p.s.str(), "( moo/oink ) ");
}
f.rewrite();
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index 5276fb3..fca4336 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -19,8 +19,6 @@
#include "install_task.hh"
#include <paludis/dep_spec.hh>
-#include <paludis/portage_dep_parser.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/action.hh>
#include <paludis/util/exception.hh>
#include <paludis/util/iterator.hh>
@@ -115,10 +113,6 @@ InstallTask::add_target(const std::string & target)
{
if ((target != "insecurity") && ((s = ((_imp->env->set(SetName(target)))))))
{
- DepSpecPrettyPrinter p(0, false);
- s->accept(p);
- Log::get_instance()->message(ll_debug, lc_context) << "target '" << target << "' is set '" << p << "'";
-
if (_imp->had_set_targets)
throw MultipleSetTargetsSpecified();
@@ -177,9 +171,6 @@ InstallTask::execute()
/* build up our dep list */
on_build_deplist_pre();
- DepSpecPrettyPrinter p(0, false);
- _imp->targets->accept(p);
- Log::get_instance()->message(ll_debug, lc_context) << "_imp->targets is '" << p << "'";
_imp->dep_list.add(*_imp->targets, _imp->destinations);
on_build_deplist_post();
diff --git a/python/Makefile.am b/python/Makefile.am
index 0b5b6d4..45a230b 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -26,8 +26,6 @@ IF_PYTHON_TESTS = \
version_requirements_TEST.py \
contents_TEST.py \
dep_spec_TEST.py \
- eapi_TEST.py \
- portage_dep_parser_TEST.py \
dep_tag_TEST.py \
log_TEST.py \
name_TEST.py \
@@ -46,7 +44,6 @@ IF_PYTHON_SOURCES = \
dep_list.cc \
dep_spec.hh dep_spec.cc \
dep_tag.cc \
- eapi.cc \
environment.cc \
exception.hh exception.cc \
fs_entry.cc \
@@ -55,7 +52,6 @@ IF_PYTHON_SOURCES = \
log.cc \
package_database.cc \
package_id.cc \
- portage_dep_parser.cc \
query.cc \
repository.cc \
version_operator.cc \
@@ -82,7 +78,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_NO_XTERM_TITLES="yes" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \
PALUDIS_ENVIRONMENT_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/environments`" \
diff --git a/python/dep_list_TEST.py b/python/dep_list_TEST.py
index 1100d26..2f2fcd6 100755
--- a/python/dep_list_TEST.py
+++ b/python/dep_list_TEST.py
@@ -123,7 +123,7 @@ class TestCase_02_DepList(unittest.TestCase):
dl = DepList(env, DepListOptions())
dd = env.default_destinations
pds = PackageDepSpec("foo/bar", PackageDepSpecParseMode.PERMISSIVE)
- cds = PortageDepParser.parse_depend("foo/bar", EAPIData.instance.eapi_from_string("0"))
+ cds = env.set("bar")
def test_01_create(self):
pass
diff --git a/python/dep_list_TEST_setup.sh b/python/dep_list_TEST_setup.sh
index d04d8fb..79e0238 100755
--- a/python/dep_list_TEST_setup.sh
+++ b/python/dep_list_TEST_setup.sh
@@ -39,7 +39,7 @@ cat <<END > home/.paludis/licenses.conf
*/* *
END
-mkdir -p testrepo/{eclass,distfiles,profiles/testprofile,foo/bar/files} || exit 1
+mkdir -p testrepo/{eclass,sets,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
@@ -53,6 +53,9 @@ END
cat <<END > profiles/profiles.desc
test testprofile stable
END
+cat <<END > sets/bar.conf
+* foo/bar
+END
cat <<"END" > foo/bar/bar-1.0.ebuild || exit 1
DESCRIPTION="Test package"
diff --git a/python/dep_spec_TEST.py b/python/dep_spec_TEST.py
index 35051f6..232159f 100755
--- a/python/dep_spec_TEST.py
+++ b/python/dep_spec_TEST.py
@@ -69,45 +69,43 @@ class TestCase_1_DepSpecs(unittest.TestCase):
self.assertEquals(self.pds.version_requirements_mode, VersionRequirementsMode.AND)
def test_09_use_requirements(self):
- eapi = EAPIData.instance.eapi_from_string("paludis-1")
- spec = PortageDepParser.parse_depend("foo/monkey[foo]", eapi)
- ur = iter(iter(spec).next().use_requirements).next()
+ spec = PackageDepSpec("foo/monkey[foo]", PackageDepSpecParseMode.PERMISSIVE)
+ ur = iter(spec.use_requirements).next()
self.assertEquals(str(ur[0]), "foo")
self.assertEquals(ur[1], UseFlagState.ENABLED)
def test_10_without_use_requirements(self):
- eapi = EAPIData.instance.eapi_from_string("paludis-1")
- spec = PortageDepParser.parse_depend("foo/monkey[foo]", eapi)
- pds = iter(spec).next().without_use_requirements()
+ spec = PackageDepSpec("foo/monkey[foo]", PackageDepSpecParseMode.PERMISSIVE)
+ pds = spec.without_use_requirements()
self.assertEquals(pds.use_requirements, None)
self.assertEquals(str(pds), "foo/monkey")
- def test_11_composites(self):
- eapi = EAPIData.instance.eapi_from_string("0")
- spec = PortageDepParser.parse_depend("|| ( foo/bar foo/baz ) foo/monkey", eapi)
-
- self.assert_(isinstance(spec, CompositeDepSpec))
- self.assert_(isinstance(spec, AllDepSpec))
-
- self.assertEqual(len(list(spec)), 2)
-
- for i, subspec1 in enumerate(spec):
- if i == 0:
- self.assert_(isinstance(subspec1, AnyDepSpec))
- for j, subspec2 in enumerate(subspec1):
- if j == 0:
- self.assert_(isinstance(subspec2, PackageDepSpec))
- self.assertEquals(str(subspec2), "foo/bar")
- elif j == 1:
- self.assert_(isinstance(subspec2, PackageDepSpec))
- self.assertEquals(str(subspec2), "foo/baz")
- else:
- self.assertEquals("Too many items", "OK")
- elif i == 1:
- self.assert_(isinstance(subspec1, PackageDepSpec))
- self.assertEquals(str(subspec1), "foo/monkey")
- else:
- self.assertEquals("Too many items", "OK")
+### def test_11_composites(self):
+### eapi = EAPIData.instance.eapi_from_string("0")
+### spec = PortageDepParser.parse_depend("|| ( foo/bar foo/baz ) foo/monkey", eapi)
+###
+### self.assert_(isinstance(spec, CompositeDepSpec))
+### self.assert_(isinstance(spec, AllDepSpec))
+###
+### self.assertEqual(len(list(spec)), 2)
+###
+### for i, subspec1 in enumerate(spec):
+### if i == 0:
+### self.assert_(isinstance(subspec1, AnyDepSpec))
+### for j, subspec2 in enumerate(subspec1):
+### if j == 0:
+### self.assert_(isinstance(subspec2, PackageDepSpec))
+### self.assertEquals(str(subspec2), "foo/bar")
+### elif j == 1:
+### self.assert_(isinstance(subspec2, PackageDepSpec))
+### self.assertEquals(str(subspec2), "foo/baz")
+### else:
+### self.assertEquals("Too many items", "OK")
+### elif i == 1:
+### self.assert_(isinstance(subspec1, PackageDepSpec))
+### self.assertEquals(str(subspec1), "foo/monkey")
+### else:
+### self.assertEquals("Too many items", "OK")
if __name__ == "__main__":
unittest.main()
diff --git a/python/dep_tag_TEST.py b/python/dep_tag_TEST.py
index 4be5e7b..14624cc 100755
--- a/python/dep_tag_TEST.py
+++ b/python/dep_tag_TEST.py
@@ -58,7 +58,7 @@ class TestCase_04_DependencyDepTag(unittest.TestCase):
repo = FakeRepository(env, "repo")
pid = repo.add_version("cat/foo", "1.0")
pds = PackageDepSpec("=cat/boo-1", PackageDepSpecParseMode.PERMISSIVE)
- cds = PortageDepParser.parse_depend("", EAPIData.instance.eapi_from_string("0"))
+ cds = env.set("everything")
dt = DependencyDepTag(pid, pds, cds);
def test_01_instance(self):
diff --git a/python/eapi.cc b/python/eapi.cc
deleted file mode 100644
index 23a714a..0000000
--- a/python/eapi.cc
+++ /dev/null
@@ -1,104 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 Piotr Jaroszyński <peper@gentoo.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_python.hh>
-
-#include <paludis/eapi.hh>
-
-using namespace paludis;
-using namespace paludis::python;
-namespace bp = boost::python;
-
-void PALUDIS_VISIBLE expose_eapi()
-{
- /**
- * SupportedEAPI
- */
- register_shared_ptrs_to_python<SupportedEAPI>();
- bp::class_<SupportedEAPI, boost::noncopyable>
- (
- "SupportedEAPI",
- "Information about a supported EAPI.",
- bp::no_init
- )
- .def_readonly("package_dep_spec_parse_mode", &SupportedEAPI::package_dep_spec_parse_mode,
- "[ro] PackageDepSpecParseMode"
- )
-
- .def_readonly("strict_package_dep_spec_parse_mode", &SupportedEAPI::strict_package_dep_spec_parse_mode,
- "[ro] PackageDepSpecParseMode"
- )
-
- .def_readonly("iuse_flag_parse_mode", &SupportedEAPI::iuse_flag_parse_mode,
- "[ro] IUseFlagParseMode"
- )
-
- .def_readonly("strict_iuse_flag_parse_mode", &SupportedEAPI::strict_iuse_flag_parse_mode,
- "[ro] IUseFlagParseMode"
- )
-
- .def_readonly("breaks_portage", &SupportedEAPI::breaks_portage,
- "[ro] bool"
- )
- ;
-
- /**
- * EAPI
- */
- register_shared_ptrs_to_python<EAPI>();
- bp::class_<EAPI, boost::noncopyable>
- ("EAPI",
- "Information about an EAPI.",
- bp::no_init
- )
- .def_readonly("name", &EAPI::name,
- "[ro] str"
- )
-
- .add_property("supported", bp::make_getter(&EAPI::supported,
- bp::return_value_policy<bp::return_by_value>()),
- "[ro] SupportedEAPI"
- )
- ;
-
- /**
- * EAPIData
- */
- bp::class_<EAPIData, boost::noncopyable>
- (
- "EAPIData",
- "Holds information on recognised EAPIs.",
- bp::no_init
- )
- .add_static_property("instance", bp::make_function(&EAPIData::get_instance,
- bp::return_value_policy<bp::reference_existing_object>()),
- "Singleton instance."
- )
-
- .def("eapi_from_string", &EAPIData::eapi_from_string,
- "eapi_from_string(str) -> EAPI\n"
- "Make an EAPI."
- )
-
- .def("unknown_eapi", &EAPIData::unknown_eapi,
- "unknown_eapi() -> EAPI\n"
- "Make the unknown EAPI."
- )
- ;
-}
diff --git a/python/eapi_TEST.py b/python/eapi_TEST.py
deleted file mode 100755
index c390e1b..0000000
--- a/python/eapi_TEST.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env python
-# vim: set fileencoding=utf-8 sw=4 sts=4 et :
-
-#
-# Copyright (c) 2007 Piotr Jaroszyński <peper@gentoo.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
-#
-
-from paludis import *
-import unittest
-
-class TestCase_EAPI(unittest.TestCase):
- def test_01_instance(self):
- self.assert_(isinstance(EAPIData.instance, EAPIData))
-
- def test_02_create_error(self):
- self.assertRaises(Exception, SupportedEAPI)
- self.assertRaises(Exception, EAPI)
-
- def test_03_unknown_eapi(self):
- eapi = EAPIData.instance.unknown_eapi()
-
- self.assertEquals(eapi.name, "UNKNOWN")
- self.assertEquals(eapi.supported, None)
-
- def test_04_eapi(self):
- eapi = EAPIData.instance.eapi_from_string("foo")
-
- self.assertEquals(eapi.name, "foo")
- self.assertEquals(eapi.supported, None)
-
- def test_05_supported_eapi(self):
- eapi = EAPIData.instance.eapi_from_string("paludis-1")
-
- self.assertEquals(eapi.name, "paludis-1")
- self.assert_(isinstance(eapi.supported.package_dep_spec_parse_mode, PackageDepSpecParseMode))
- self.assert_(isinstance(eapi.supported.strict_package_dep_spec_parse_mode, PackageDepSpecParseMode))
- self.assert_(isinstance(eapi.supported.iuse_flag_parse_mode, IUseFlagParseMode))
- self.assert_(isinstance(eapi.supported.strict_iuse_flag_parse_mode, IUseFlagParseMode))
- self.assert_(isinstance(eapi.supported.breaks_portage, bool))
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/python/package_id.cc b/python/package_id.cc
index 1222b2c..d8cd924 100644
--- a/python/package_id.cc
+++ b/python/package_id.cc
@@ -81,10 +81,6 @@ void PALUDIS_VISIBLE expose_package_id()
"[ro] Repository\n"
)
- .add_property("eapi", &PackageID::eapi,
- "[ro] EAPI\n"
- )
-
.def("__iter__", bp::range(&PackageID::begin_metadata, &PackageID::end_metadata))
.def("find_metadata", &PackageIDWrapper::find_metadata,
diff --git a/python/package_id_TEST.py b/python/package_id_TEST.py
index 4032200..2df9cc1 100755
--- a/python/package_id_TEST.py
+++ b/python/package_id_TEST.py
@@ -55,10 +55,6 @@ class TestCase_01_PackageID(unittest.TestCase):
self.assertEquals(str(pid.repository.name), "testrepo")
self.assertEquals(str(ipid.repository.name), "installed")
- def test_06_eapi(self):
- self.assertEquals(pid.eapi.name, "0")
- self.assertEquals(ipid.eapi.name, "0")
-
def test_07_canonical_form(self):
self.assertEquals(pid.canonical_form(PackageIDCanonicalForm.FULL), "foo/bar-1.0::testrepo")
self.assertEquals(pid.canonical_form(PackageIDCanonicalForm.VERSION), "1.0")
diff --git a/python/paludis_python_so.cc b/python/paludis_python_so.cc
index f29ddfc..ddb903c 100644
--- a/python/paludis_python_so.cc
+++ b/python/paludis_python_so.cc
@@ -25,7 +25,6 @@ void expose_contents();
void expose_dep_list();
void expose_dep_spec();
void expose_dep_tag();
-void expose_eapi();
void expose_environment();
void expose_exception();
void expose_fs_entry();
@@ -34,7 +33,6 @@ void expose_metadata_key();
void expose_name();
void expose_package_database();
void expose_package_id();
-void expose_portage_dep_parser();
void expose_query();
void expose_repository();
void expose_version_operator();
@@ -52,12 +50,10 @@ BOOST_PYTHON_MODULE(paludis)
expose_version_operator();
expose_version_requirements();
expose_fs_entry();
- expose_eapi();
expose_contents();
expose_dep_spec();
expose_dep_tag();
expose_dep_list();
- expose_portage_dep_parser();
expose_name();
expose_log();
expose_query();
diff --git a/python/portage_dep_parser.cc b/python/portage_dep_parser.cc
deleted file mode 100644
index 5ab274c..0000000
--- a/python/portage_dep_parser.cc
+++ /dev/null
@@ -1,87 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 Piotr Jaroszyński <peper@gentoo.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_python.hh>
-
-#include <paludis/portage_dep_parser.hh>
-#include <paludis/eapi.hh>
-
-using namespace paludis;
-using namespace paludis::python;
-namespace bp = boost::python;
-
-void PALUDIS_VISIBLE expose_portage_dep_parser()
-{
- /**
- * Exceptions
- */
- ExceptionRegister::get_instance()->add_exception<DepStringError>
- ("DepStringError", "BaseException",
- "A DepStringError descendent is thrown if an invalid depend string is encountered.");
- ExceptionRegister::get_instance()->add_exception<DepStringLexError>
- ("DepStringLexError", "DepStringError",
- "A DepStringLexError is thrown if a lex-level error is encountered when parsing a dependency string.");
- ExceptionRegister::get_instance()->add_exception<DepStringParseError>
- ("DepStringParseError", "DepStringError",
- "Thrown if an error is encountered when parsing a dependency string.");
- ExceptionRegister::get_instance()->add_exception<DepStringNestingError>
- ("DepStringNestingError", "DepStringParseError",
- "Thrown if a dependency string does not have properly balanced parentheses.");
-
- /**
- * PortageDepParser
- */
- bp::class_<PortageDepParser, boost::noncopyable>
- (
- "PortageDepParser",
- "The PortageDepParser converts string representations "
- "of a dependency specification into a DepSpec instance.",
- bp::no_init
- )
- .def("parse_depend", &PortageDepParser::parse_depend,
- "parse_depend(string, EAPI) -> CompositeDepSpec\n"
- "Parse a dependency heirarchy."
- )
- .staticmethod("parse_depend")
-
- .def("parse_provide", &PortageDepParser::parse_provide,
- "parse_provide(string, EAPI) -> CompositeDepSpec\n"
- "Parse a provide heirarchy."
- )
- .staticmethod("parse_provide")
-
- .def("parse_restrict", &PortageDepParser::parse_restrict,
- "parse_restrict(string, EAPI) -> CompositeDepSpec\n"
- "Parse a restrict."
- )
- .staticmethod("parse_restrict")
-
- .def("parse_uri", &PortageDepParser::parse_uri,
- "parse_uri(string, EAPI) -> CompositeDepSpec\n"
- "Parse a uri heirarchy."
- )
- .staticmethod("parse_uri")
-
- .def("parse_license", &PortageDepParser::parse_license,
- "parse_license(string, EAPI) -> CompositeDepSpec\n"
- "Parse a license heirarchy."
- )
- .staticmethod("parse_license")
- ;
-}
diff --git a/python/portage_dep_parser_TEST.py b/python/portage_dep_parser_TEST.py
deleted file mode 100755
index ac51fe3..0000000
--- a/python/portage_dep_parser_TEST.py
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/usr/bin/env python
-# vim: set fileencoding=utf-8 sw=4 sts=4 et :
-
-#
-# Copyright (c) 2007 Piotr Jaroszyński <peper@gentoo.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
-#
-
-from paludis import *
-import unittest
-
-class TestCase_01_PortageDepParser(unittest.TestCase):
- def setUp(self):
- global eapi
- eapi = EAPIData.instance.eapi_from_string("0")
-
- def test_01_init_error(self):
- self.assertRaises(Exception, PortageDepParser)
-
- def test_02_parse_depend(self):
- spec = PortageDepParser.parse_depend("foo/boo", eapi)
- self.assert_(isinstance(spec, AllDepSpec))
- self.assert_(isinstance(iter(spec).next(), PackageDepSpec))
- self.assertEquals(len(list(spec)), 1)
-
- def test_03_parse_provide(self):
- spec = PortageDepParser.parse_provide("foo/boo", eapi)
- self.assert_(isinstance(spec, AllDepSpec))
- self.assert_(isinstance(iter(spec).next(), PackageDepSpec))
- self.assertEquals(len(list(spec)), 1)
-
- def test_04_parse_restrict(self):
- spec = PortageDepParser.parse_restrict("foo/boo", eapi)
- self.assert_(isinstance(spec, AllDepSpec))
- self.assert_(isinstance(iter(spec).next(), PlainTextDepSpec))
- self.assertEquals(len(list(spec)), 1)
-
- def test_05_parse_uri(self):
- spec = PortageDepParser.parse_uri("http://foo/boo", eapi)
- self.assert_(isinstance(spec, AllDepSpec))
- self.assert_(isinstance(iter(spec).next(), URIDepSpec))
- self.assertEquals(len(list(spec)), 1)
-
-
- def test_06_parse_license(self):
- spec = PortageDepParser.parse_license("FOO_LICENSE", eapi)
- self.assert_(isinstance(spec, AllDepSpec))
- self.assert_(isinstance(iter(spec).next(), PlainTextDepSpec))
- self.assertEquals(len(list(spec)), 1)
-
- def test_07_exceptions(self):
- self.assertRaises(DepStringLexError, PortageDepParser.parse_depend, "(foo/boo )", eapi)
- self.assertRaises(DepStringNestingError, PortageDepParser.parse_license, "|| ( foo/boo ", eapi)
- self.assertRaises(DepStringParseError, PortageDepParser.parse_provide, "|| ( foo/boo )", eapi)
-
-if __name__ == "__main__":
- unittest.main()
diff --git a/ruby/Makefile.am b/ruby/Makefile.am
index e243ad6..8b4a647 100644
--- a/ruby/Makefile.am
+++ b/ruby/Makefile.am
@@ -19,12 +19,10 @@ MAINTAINERCLEANFILES = Makefile.in
IF_RUBY_TESTS = \
query_TEST.rb \
find_unused_packages_task_TEST.rb \
- eapi_TEST.rb \
package_database_TEST.rb \
log_TEST.rb \
version_spec_TEST.rb \
dep_spec_TEST.rb \
- portage_dep_parser_TEST.rb \
qualified_package_name_TEST.rb \
contents_TEST.rb \
dep_list_TEST.rb \
@@ -46,14 +44,12 @@ IF_RUBY_SOURCES = \
package_database.cc \
repository.cc \
package_id.cc \
- portage_dep_parser.cc \
qualified_package_name.cc \
contents.cc \
dep_list.cc \
dep_tag.cc \
query.cc \
find_unused_packages_task.cc \
- eapi.cc \
name.cc
IF_RUBY_QA_SOURCES = \
@@ -77,7 +73,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_NO_XTERM_TITLES="yes" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \
PALUDIS_ENVIRONMENT_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/environments`" \
diff --git a/ruby/eapi.cc b/ruby/eapi.cc
deleted file mode 100644
index ce0973e..0000000
--- a/ruby/eapi.cc
+++ /dev/null
@@ -1,198 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2007 Richard Brown <rbrown@gentoo.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_ruby.hh>
-#include <paludis/eapi.hh>
-#include <ruby.h>
-
-using namespace paludis;
-using namespace paludis::ruby;
-
-#define RUBY_FUNC_CAST(x) reinterpret_cast<VALUE (*)(...)>(x)
-
-namespace
-{
- static VALUE c_eapi;
- static VALUE c_supported_eapi;
- static VALUE c_eapi_data;
-
- VALUE
- supported_eapi_to_value(tr1::shared_ptr<const SupportedEAPI> m)
- {
- tr1::shared_ptr<const SupportedEAPI> * m_ptr = new tr1::shared_ptr<const SupportedEAPI>(m);
- return Data_Wrap_Struct(c_supported_eapi, 0, &Common<tr1::shared_ptr<const SupportedEAPI> >::free, m_ptr);
- }
-
- VALUE
- eapi_name(VALUE self)
- {
- tr1::shared_ptr<const EAPI> * p;
- Data_Get_Struct(self, tr1::shared_ptr<const EAPI>, p);
- return rb_str_new2(((*p)->name).c_str());
- }
-
- VALUE
- eapi_supported(VALUE self)
- {
- tr1::shared_ptr<const EAPI> * p;
- Data_Get_Struct(self, tr1::shared_ptr<const EAPI>, p);
- if ((*p)->supported)
- return supported_eapi_to_value(((*p)->supported));
- return Qnil;
- }
- /*
- * Document-method: package_dep_spec_parse_mode
- *
- * call-seq:
- * package_dep_spec_parse_mode -> PackageDepSpecParseMode
- *
- * Our PackageDepSpecParseMode.
- */
- /*
- * Document-method: strict_package_dep_spec_parse_mode
- *
- * call-seq:
- * strict_package_dep_spec_parse_mode -> PackageDepSpecParseMode
- *
- * Our strict PackageDepSpecParseMode.
- */
- /*
- * Document-method: iuse_flag_parse_mode
- *
- * call-seq:
- * iuse_flag_parse_mode -> IUseFlagParseMode
- *
- * Our IUseFlagParseMode.
- */
- /*
- * Document-method: strict_iuse_flag_parse_mode
- *
- * call-seq:
- * strict_iuse_flag_parse_mode -> IUseFlagParseMode
- *
- * Our strict IUseFlagParseMode.
- */
- template <typename T_, T_ SupportedEAPI::* m_>
- struct ParseModeMember
- {
- static VALUE
- fetch(VALUE self)
- {
- tr1::shared_ptr<SupportedEAPI> * p;
- Data_Get_Struct(self, tr1::shared_ptr<SupportedEAPI>, p);
- return INT2FIX((**p).*m_);
- }
- };
-
- /*
- * Document-method: breaks_portage?
- *
- * call_seq:
- * breaks_portage? -> true or false
- *
- * Does this EAPI break portage?
- */
- /*
- * Document-method: has_pretend_phase?
- *
- * call_seq:
- * has_pretend_phase? -> true or false
- *
- * Does this EAPI have a pretend phase?
- */
- template <bool SupportedEAPI::* m_>
- struct BoolMember
- {
- static VALUE
- fetch(VALUE self)
- {
- tr1::shared_ptr<SupportedEAPI> * p;
- Data_Get_Struct(self, tr1::shared_ptr<SupportedEAPI>, p);
- return ((**p).*m_) ? Qtrue : Qfalse;
- }
- };
-
- /*
- * call-seq:
- * EAPIData.eapi_from_string(eapi_string) -> EAPI
- *
- * Make an EAPI.
- */
- VALUE
- eapi_data_eapi_from_string(VALUE, VALUE eapi)
- {
- return eapi_to_value(EAPIData::get_instance()->eapi_from_string(stringify(StringValuePtr(eapi))));
- }
-
- /*
- * call-seq:
- * EAPIData.unknown_eapi -> EAPI
- *
- * Make the unknown EAPI.
- */
- VALUE
- eapi_data_unknown_eapi()
- {
- return eapi_to_value(EAPIData::get_instance()->unknown_eapi());
- }
-
- void do_register_eapi()
- {
- /*
- * Document-class: Paludis::EAPI
- *
- * Information about an EAPI.
- */
- c_eapi = rb_define_class_under(paludis_module(), "EAPI", rb_cObject);
- rb_funcall(c_eapi, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_eapi, "name", RUBY_FUNC_CAST(&eapi_name), 0);
- rb_define_method(c_eapi, "supported", RUBY_FUNC_CAST(&eapi_supported), 0);
-
- c_supported_eapi = rb_define_class_under(paludis_module(), "SupportedEAPI", rb_cObject);
- rb_funcall(c_supported_eapi, rb_intern("private_class_method"), 1, rb_str_new2("new"));
- rb_define_method(c_supported_eapi, "package_dep_spec_parse_mode",
- RUBY_FUNC_CAST((&ParseModeMember<PackageDepSpecParseMode, &SupportedEAPI::package_dep_spec_parse_mode>::fetch)), 0);
- rb_define_method(c_supported_eapi, "strict_package_dep_spec_parse_mode",
- RUBY_FUNC_CAST((&ParseModeMember<PackageDepSpecParseMode, &SupportedEAPI::strict_package_dep_spec_parse_mode>::fetch)), 0);
- rb_define_method(c_supported_eapi, "iuse_flag_parse_mode",
- RUBY_FUNC_CAST((&ParseModeMember<IUseFlagParseMode, &SupportedEAPI::iuse_flag_parse_mode>::fetch)), 0);
- rb_define_method(c_supported_eapi, "strict_iuse_flag_parse_mode",
- RUBY_FUNC_CAST((&ParseModeMember<IUseFlagParseMode, &SupportedEAPI::strict_iuse_flag_parse_mode>::fetch)), 0);
- rb_define_method(c_supported_eapi, "breaks_portage?",
- RUBY_FUNC_CAST((&BoolMember<&SupportedEAPI::breaks_portage>::fetch)), 0);
-
- rb_require("singleton");
-
- c_eapi_data = rb_define_class_under(paludis_module(), "EAPIData", rb_cObject);
- rb_funcall(rb_const_get(rb_cObject, rb_intern("Singleton")), rb_intern("included"), 1, c_eapi_data);
- rb_define_method(c_eapi_data, "eapi_from_string", RUBY_FUNC_CAST(&eapi_data_eapi_from_string), 1);
- rb_define_method(c_eapi_data, "unknown_eapi", RUBY_FUNC_CAST(&eapi_data_unknown_eapi), 0);
- }
-}
-
-VALUE
-paludis::ruby::eapi_to_value(const tr1::shared_ptr<const EAPI> & v)
-{
- tr1::shared_ptr<const EAPI> * m_ptr = new tr1::shared_ptr<const EAPI>(v);
- return Data_Wrap_Struct(c_eapi, 0, &Common<tr1::shared_ptr<const EAPI> >::free, m_ptr);
-}
-
-RegisterRubyClass::Register paludis_ruby_register_eapi PALUDIS_ATTRIBUTE((used))
- (&do_register_eapi);
-
diff --git a/ruby/eapi_TEST.rb b/ruby/eapi_TEST.rb
deleted file mode 100644
index dfe6997..0000000
--- a/ruby/eapi_TEST.rb
+++ /dev/null
@@ -1,110 +0,0 @@
-#!/usr/bin/env ruby
-# vim: set sw=4 sts=4 et tw=80 :
-
-#
-# Copyright (c) 2007 Richard Brown <rbrown@gentoo.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
-#
-
-ENV["PALUDIS_HOME"] = Dir.getwd().to_s + "/default_environment_TEST_dir/home";
-
-require 'test/unit'
-require 'Paludis'
-
-module Paludis
- class TestCase_EAPIData < Test::Unit::TestCase
- def test_instance
- assert_equal Log.instance.__id__, Log.instance.__id__
- end
-
- def test_no_create
- assert_raise NoMethodError do
- x = EAPIData.new()
- end
- end
-
- def test_unknown_eapi
- assert_respond_to EAPIData.instance, :unknown_eapi
- assert_kind_of EAPI, EAPIData.instance.unknown_eapi
- end
-
- def test_eapi_from_string
- assert_respond_to EAPIData.instance, :eapi_from_string
- assert_kind_of EAPI, EAPIData.instance.eapi_from_string('0')
- end
- end
-
- class TestCase_EAPI < Test::Unit::TestCase
- def eapi0
- @eapi0 ||= EAPIData.instance.eapi_from_string('0')
- end
-
- def eapi_zarniwoop
- @eapi_zarniwoop ||= EAPIData.instance.eapi_from_string('zarniwoop')
- end
-
- def test_no_create
- assert_raise NoMethodError do
- x = EAPI.new()
- end
- end
-
- def test_name
- assert_equal '0', eapi0.name
- assert_equal 'zarniwoop', eapi_zarniwoop.name
- end
-
- def test_supported
- assert_kind_of SupportedEAPI, eapi0.supported
- assert_kind_of NilClass, eapi_zarniwoop.supported
- end
- end
-
- class TestCase_SupportedEAPI < Test::Unit::TestCase
- include PackageDepSpecParseMode
- include IUseFlagParseMode
-
- def supported
- @supported ||= EAPIData.instance.eapi_from_string('0').supported
- end
-
- def test_no_create
- assert_raise NoMethodError do
- x = SupportedEAPI.new()
- end
- end
-
- def test_package_dep_spec_parse_mode
- assert_equal Eapi0, supported.package_dep_spec_parse_mode
- end
-
- def test_strict_package_dep_spec_parse_mode
- assert_equal Eapi0Strict, supported.strict_package_dep_spec_parse_mode
- end
-
- def test_iuse_flag_parse_mode
- assert_equal Eapi0, supported.iuse_flag_parse_mode
- end
-
- def test_strict_iuse_flag_parse_mode
- assert_equal Eapi0Strict, supported.strict_iuse_flag_parse_mode
- end
-
- def test_breaks_portage?
- assert !supported.breaks_portage?
- end
- end
-end
-
diff --git a/ruby/package_id.cc b/ruby/package_id.cc
index 716ac4b..0e7e755 100644
--- a/ruby/package_id.cc
+++ b/ruby/package_id.cc
@@ -204,22 +204,6 @@ namespace
};
/*
- * Document-method: eapi
- *
- * call-seq:
- * eapi -> EAPI
- *
- * Our EAPI.
- */
- VALUE
- package_id_eapi(VALUE self)
- {
- tr1::shared_ptr<const PackageID> * self_ptr;
- Data_Get_Struct(self, tr1::shared_ptr<const PackageID>, self_ptr);
- return eapi_to_value((*self_ptr)->eapi());
- }
-
- /*
* call-seq:
* version -> VersionSpec
*
@@ -432,7 +416,6 @@ namespace
rb_define_method(c_package_id, "version", RUBY_FUNC_CAST(&package_id_version), 0);
rb_define_method(c_package_id, "slot", RUBY_FUNC_CAST((&BaseValue<SlotName,PackageID,&PackageID::slot>::fetch)), 0);
rb_define_method(c_package_id, "repository", RUBY_FUNC_CAST(&package_id_repository), 0);
- rb_define_method(c_package_id, "eapi", RUBY_FUNC_CAST(&package_id_eapi), 0);
rb_define_method(c_package_id, "==", RUBY_FUNC_CAST(&package_id_equal), 1);
rb_define_method(c_package_id, "keywords_key", RUBY_FUNC_CAST((&KeyValue<MetadataSetKey<KeywordNameSet>,&PackageID::keywords_key>::fetch)), 0);
rb_define_method(c_package_id, "use_key", RUBY_FUNC_CAST((&KeyValue<MetadataSetKey<UseFlagNameSet>,&PackageID::use_key>::fetch)), 0);
diff --git a/ruby/package_id_TEST.rb b/ruby/package_id_TEST.rb
index 0fab703..6f76a09 100644
--- a/ruby/package_id_TEST.rb
+++ b/ruby/package_id_TEST.rb
@@ -104,7 +104,7 @@ module Paludis
end
def test_members
- [:name, :version, :slot, :repository, :eapi, :==, :keywords_key,
+ [:name, :version, :slot, :repository, :==, :keywords_key,
:use_key, :iuse_key, :inherited_key, :short_description_key,
:long_description_key, :contents_key, :installed_time_key,
:source_origin_key, :binary_origin_key].each do |method|
@@ -141,11 +141,6 @@ module Paludis
assert_equal 'testrepo', pid_testrepo.repository.name
end
- def test_eapi
- assert_kind_of EAPI, pid_testrepo.eapi
- assert_equal '0', pid_testrepo.eapi.name
- end
-
def test_slot
assert_kind_of String, pid_testrepo.slot
assert_equal '0', pid_testrepo.slot
@@ -224,11 +219,6 @@ module Paludis
assert_equal 'installed', pid_installed.repository.name
end
- def test_eapi
- assert_kind_of EAPI, pid_installed.eapi
- assert_equal '0', pid_installed.eapi.name
- end
-
def test_slot
assert_kind_of String, pid_installed.slot
assert_equal 'test_slot', pid_installed.slot
diff --git a/ruby/paludis_ruby.cc b/ruby/paludis_ruby.cc
index d341e90..b71b380 100644
--- a/ruby/paludis_ruby.cc
+++ b/ruby/paludis_ruby.cc
@@ -58,9 +58,6 @@ namespace
static VALUE c_ambiguous_package_name_error;
static VALUE c_no_such_package_error;
static VALUE c_no_such_repository_error;
- static VALUE c_dep_string_error;
- static VALUE c_dep_string_parse_error;
- static VALUE c_dep_string_nesting_error;
static VALUE c_configuration_error;
static VALUE c_config_file_error;
static VALUE c_dep_list_error;
@@ -149,12 +146,6 @@ void paludis::ruby::exception_to_ruby_exception(const std::exception & ee)
rb_raise(c_package_database_lookup_error, dynamic_cast<const paludis::PackageDatabaseLookupError *>(&ee)->message().c_str());
else if (0 != dynamic_cast<const paludis::PackageDatabaseError *>(&ee))
rb_raise(c_package_database_error, dynamic_cast<const paludis::PackageDatabaseError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::DepStringNestingError *>(&ee))
- rb_raise(c_dep_string_nesting_error, dynamic_cast<const paludis::DepStringNestingError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::DepStringParseError *>(&ee))
- rb_raise(c_dep_string_parse_error, dynamic_cast<const paludis::DepStringParseError *>(&ee)->message().c_str());
- else if (0 != dynamic_cast<const paludis::DepStringError *>(&ee))
- rb_raise(c_dep_string_error, dynamic_cast<const paludis::DepStringError *>(&ee)->message().c_str());
else if (0 != dynamic_cast<const paludis::AllMaskedError *>(&ee))
{
VALUE ex_args[2];
@@ -274,9 +265,6 @@ void PALUDIS_VISIBLE paludis::ruby::init()
c_ambiguous_package_name_error = rb_define_class_under(c_paludis_module, "AmbiguousPackageNameError", c_package_database_lookup_error);
c_no_such_package_error = rb_define_class_under(c_paludis_module, "NoSuchPackageError", c_package_database_lookup_error);
c_no_such_repository_error = rb_define_class_under(c_paludis_module, "NoSuchRepositoryError", c_package_database_lookup_error);
- c_dep_string_error = rb_define_class_under(c_paludis_module, "DepStringError", rb_eRuntimeError);
- c_dep_string_parse_error = rb_define_class_under(c_paludis_module, "DepStringParseError", c_dep_string_error);
- c_dep_string_nesting_error = rb_define_class_under(c_paludis_module, "DepStringNestingError", c_dep_string_parse_error);
c_configuration_error = rb_define_class_under(c_paludis_module, "ConfigurationError", rb_eRuntimeError);
c_config_file_error = rb_define_class_under(c_paludis_module, "ConfigFileError", c_configuration_error);
c_dep_list_error = rb_define_class_under(c_paludis_module, "DepListError", rb_eRuntimeError);
diff --git a/ruby/paludis_ruby.hh b/ruby/paludis_ruby.hh
index ec1ccaa..5bd91bb 100644
--- a/ruby/paludis_ruby.hh
+++ b/ruby/paludis_ruby.hh
@@ -34,7 +34,6 @@
#include <paludis/repository.hh>
#include <paludis/contents.hh>
#include <paludis/dep_tag.hh>
-#include <paludis/eapi.hh>
#include <paludis/util/stringify.hh>
#ifdef ENABLE_RUBY_QA
@@ -84,7 +83,6 @@ namespace paludis
VALUE dep_tag_to_value(tr1::shared_ptr<const DepTag>);
VALUE qualified_package_name_to_value(const QualifiedPackageName &);
VALUE contents_to_value(tr1::shared_ptr<const Contents>);
- VALUE eapi_to_value(const tr1::shared_ptr<const EAPI> &);
VersionSpec value_to_version_spec(VALUE v);
tr1::shared_ptr<const PackageID> value_to_package_id(VALUE);
diff --git a/ruby/portage_dep_parser.cc b/ruby/portage_dep_parser.cc
deleted file mode 100644
index d9430cf..0000000
--- a/ruby/portage_dep_parser.cc
+++ /dev/null
@@ -1,159 +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_ruby.hh>
-#include <paludis/portage_dep_parser.hh>
-#include <ruby.h>
-
-using namespace paludis;
-using namespace paludis::ruby;
-
-#define RUBY_FUNC_CAST(x) reinterpret_cast<VALUE (*)(...)>(x)
-
-namespace
-{
- static VALUE c_portage_dep_parser;
-
-#if CIARANM_REMOVED_THIS
- /*
- * call-seq:
- * PortageDepParser::parse(dep_string, spec_type, permit_any_deps, package_dep_parse_mode = PmPermissive) -> CompositeDepSpec
- *
- * Parse a given dependency string, and return an appropriate DepSpec tree.
- */
- VALUE
- portage_dep_parser_parse(VALUE, VALUE dep_string, VALUE policy)
- {
- try
- {
- return dep_spec_to_value(PortageDepParser::parse(StringValuePtr(dep_string),
- value_to_portage_dep_parser_policy(policy)));
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * PortageDepParser::parse_depend(dep_string, package_dep_parse_mode) -> CompositeDepSpec
- *
- * Convenience wrapper for parsing depend strings.
- */
- VALUE
- portage_dep_parser_parse_depend(VALUE, VALUE string, VALUE parse_mode)
- {
- try
- {
- return dep_spec_to_value(PortageDepParser::parse_depend(StringValuePtr(string), static_cast<PackageDepSpecParseMode>(NUM2INT(parse_mode))));
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * PortageDepParser::parse_license(dep_string) -> CompositeDepSpec
- *
- * Convenience wrapper for parsing license strings.
- */
- VALUE
- portage_dep_parser_parse_license(VALUE, VALUE string)
- {
- try
- {
- return dep_spec_to_value(PortageDepParser::parse_license(StringValuePtr(string)));
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * Policy::text_is_text_dep_spec(permit_any_deps) -> Policy
- *
- * Returns a new policy for a PlainTextDepSpec
- */
- VALUE
- portage_dep_parser_policy_text_is_text_dep_spec(VALUE, VALUE permit_any_deps)
- {
- try
- {
- bool b(! (permit_any_deps == Qnil || permit_any_deps == Qfalse));
- return portage_dep_parser_policy_to_value(PortageDepParser::Policy::text_is_text_dep_spec(b));
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-
- /*
- * call-seq:
- * Policy::text_is_text_dep_spec(permit_any_deps, parse_mode) -> Policy
- *
- * Returns a new policy for a PackageDepSpec
- */
- VALUE
- portage_dep_parser_policy_text_is_package_dep_spec(VALUE, VALUE permit_any_deps, VALUE parse_mode)
- {
- try
- {
- bool b(! (permit_any_deps == Qnil || permit_any_deps == Qfalse));
- return portage_dep_parser_policy_to_value(PortageDepParser::Policy::text_is_package_dep_spec(b,
- static_cast<PackageDepSpecParseMode>(NUM2INT(parse_mode))));
- }
- catch (const std::exception & e)
- {
- exception_to_ruby_exception(e);
- }
- }
-#endif
-
- void do_register_portage_dep_parser()
- {
- rb_require("singleton");
-
- /*
- * Document-module: Paludis::PortageDepParser
- *
- * The PortageDepParser module contains methods for converting string representations of a
- * dependency specification into a DepSpec instance.
- */
- c_portage_dep_parser = rb_define_module_under(paludis_module(), "PortageDepParser");
-
-#if CIARANM_REMOVED_THIS
- rb_define_singleton_method(c_portage_dep_parser, "parse",
- RUBY_FUNC_CAST(&portage_dep_parser_parse), 2);
- rb_define_singleton_method(c_portage_dep_parser, "parse_depend",
- RUBY_FUNC_CAST(&portage_dep_parser_parse_depend), 2);
- rb_define_singleton_method(c_portage_dep_parser, "parse_license",
- RUBY_FUNC_CAST(&portage_dep_parser_parse_license), 1);
-#endif
- }
-}
-
-RegisterRubyClass::Register paludis_ruby_register_portage_dep_parser PALUDIS_ATTRIBUTE((used))
- (&do_register_portage_dep_parser);
-
diff --git a/ruby/portage_dep_parser_TEST.rb b/ruby/portage_dep_parser_TEST.rb
deleted file mode 100644
index fb8316b..0000000
--- a/ruby/portage_dep_parser_TEST.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/usr/bin/env ruby
-# vim: set sw=4 sts=4 et tw=80 :
-
-#
-# 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
-#
-
-require 'test/unit'
-require 'Paludis'
-
-module Paludis
-### class TestCase_PortageDepParser < Test::Unit::TestCase
-### def text_false
-### PortageDepParser::Policy::text_is_text_dep_spec(false)
-### end
-###
-### def text_true
-### PortageDepParser::Policy::text_is_text_dep_spec(true)
-### end
-###
-### def package_false
-### PortageDepParser::Policy::text_is_package_dep_spec(false, PackageDepSpecParseMode::Permissive);
-### end
-###
-### def package_true
-### PortageDepParser::Policy::text_is_package_dep_spec(true, PackageDepSpecParseMode::Permissive);
-### end
-###
-### def test_many_args
-### spec = PortageDepParser::parse("foo/monkey", text_false)
-### assert_kind_of AllDepSpec, spec
-### assert_equal 1, spec.to_a.length
-### assert_equal "foo/monkey", spec.to_a.first.to_s
-### assert_kind_of PlainTextDepSpec, spec.to_a.first
-###
-### spec = PortageDepParser::parse("foo/monkey", text_true)
-### assert_kind_of AllDepSpec, spec
-### assert_equal 1, spec.to_a.length
-### assert_equal "foo/monkey", spec.to_a.first.to_s
-### assert_kind_of PlainTextDepSpec, spec.to_a.first
-###
-### spec = PortageDepParser::parse("foo/monkey", package_false)
-### assert_kind_of AllDepSpec, spec
-### assert_equal 1, spec.to_a.length
-### assert_equal "foo/monkey", spec.to_a.first.to_s
-### assert_kind_of PackageDepSpec, spec.to_a.first
-###
-### spec = PortageDepParser::parse("foo/monkey", package_true)
-### assert_kind_of AllDepSpec, spec
-### assert_equal 1, spec.to_a.length
-### assert_equal "foo/monkey", spec.to_a.first.to_s
-### assert_kind_of PackageDepSpec, spec.to_a.first
-###
-### assert_raise DepStringParseError do
-### PortageDepParser::parse("|| ( foo/bar )", package_false)
-### end
-###
-### assert_nothing_raised do
-### PortageDepParser::parse("|| ( foo/bar )", package_true)
-### end
-###
-### assert_raise DepStringParseError do
-### PortageDepParser::parse("|| ( foo/bar )", text_false)
-### end
-###
-### assert_nothing_raised do
-### PortageDepParser::parse("|| ( foo/bar )", text_true)
-### end
-### end
-###
-### def test_dep_string_nesting_error
-### assert_raise DepStringNestingError do
-### PortageDepParser::parse("|| ( foo/var ", package_true)
-### end
-### end
-### end
-end
-
-
diff --git a/src/clients/adjutrix/Makefile.am b/src/clients/adjutrix/Makefile.am
index 14825ef..39a0987 100644
--- a/src/clients/adjutrix/Makefile.am
+++ b/src/clients/adjutrix/Makefile.am
@@ -68,7 +68,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_NO_XTERM_TITLES="yes" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \
SYSCONFDIR="$(sysconfdir)" \
diff --git a/src/clients/contrarius/install.cc b/src/clients/contrarius/install.cc
index 36a1c8a..868c7da 100644
--- a/src/clients/contrarius/install.cc
+++ b/src/clients/contrarius/install.cc
@@ -38,7 +38,6 @@
#include <paludis/environment.hh>
#include <paludis/dep_list/exceptions.hh>
#include <paludis/query.hh>
-#include <paludis/eapi.hh>
#include <paludis/metadata_key.hh>
#include <paludis/mask.hh>
diff --git a/src/clients/contrarius/stage.cc b/src/clients/contrarius/stage.cc
index 8a0db12..edc3444 100644
--- a/src/clients/contrarius/stage.cc
+++ b/src/clients/contrarius/stage.cc
@@ -21,7 +21,6 @@
#include <paludis/util/tokeniser.hh>
#include <paludis/util/sequence.hh>
#include <paludis/config_file.hh>
-#include <paludis/portage_dep_parser.hh>
#include <paludis/package_database.hh>
#include <paludis/environments/adapted/adapted_environment.hh>
#include <paludis/query.hh>
diff --git a/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc b/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
index dd725a1..82c9297 100644
--- a/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
+++ b/src/clients/gtkpaludis/libgtkpaludis/version_info_model.cc
@@ -11,9 +11,7 @@
#include <paludis/package_database.hh>
#include <paludis/util/private_implementation_pattern-impl.hh>
#include <paludis/query.hh>
-#include <paludis/eapi.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <libwrapiter/libwrapiter_forward_iterator.hh>
#include <libwrapiter/libwrapiter_output_iterator.hh>
#include <list>
@@ -103,39 +101,31 @@ VersionInfoModel::populate_in_paludis_thread(tr1::shared_ptr<const PackageID> p)
if (p)
{
- if (p->eapi()->supported)
- {
- if (p->short_description_key())
- data->items.push_back(PopulateDataItem("Description", markup_escape(p->short_description_key()->value())));
+ if (p->short_description_key())
+ data->items.push_back(PopulateDataItem("Description", markup_escape(p->short_description_key()->value())));
- if (p->homepage_key())
- {
- DepSpecPrettyPrinter homepage_printer(0, false);
- p->homepage_key()->value()->accept(homepage_printer);
- if (! stringify(homepage_printer).empty())
- data->items.push_back(PopulateDataItem("Homepage", markup_escape(stringify(homepage_printer))));
- }
+ if (p->homepage_key())
+ data->items.push_back(PopulateDataItem("Homepage", markup_escape(p->homepage_key()->pretty_print_flat())));
- if (p->keywords_key())
+ if (p->keywords_key())
+ {
+ std::string km;
+ tr1::shared_ptr<const KeywordNameSet> keywords(p->keywords_key()->value());
+ for (KeywordNameSet::Iterator k(keywords->begin()), k_end(keywords->end()) ;
+ k != k_end ; ++k)
{
- std::string km;
- tr1::shared_ptr<const KeywordNameSet> keywords(p->keywords_key()->value());
- for (KeywordNameSet::Iterator k(keywords->begin()), k_end(keywords->end()) ;
- k != k_end ; ++k)
- {
- if (! km.empty())
- km.append(" ");
-
- tr1::shared_ptr<KeywordNameSet> kc(new KeywordNameSet);
- kc->insert(*k);
- if (_imp->query_window->environment()->accept_keywords(kc, *p))
- km.append(markup_bold(markup_escape(stringify(*k))));
- else
- km.append(markup_italic(markup_escape(stringify(*k))));
- }
-
- data->items.push_back(PopulateDataItem("Keywords", km));
+ if (! km.empty())
+ km.append(" ");
+
+ tr1::shared_ptr<KeywordNameSet> kc(new KeywordNameSet);
+ kc->insert(*k);
+ if (_imp->query_window->environment()->accept_keywords(kc, *p))
+ km.append(markup_bold(markup_escape(stringify(*k))));
+ else
+ km.append(markup_italic(markup_escape(stringify(*k))));
}
+
+ data->items.push_back(PopulateDataItem("Keywords", km));
}
}
diff --git a/src/clients/paludis/Makefile.am b/src/clients/paludis/Makefile.am
index b6240b3..a82bccd 100644
--- a/src/clients/paludis/Makefile.am
+++ b/src/clients/paludis/Makefile.am
@@ -83,7 +83,7 @@ TESTS_ENVIRONMENT = env \
PALUDIS_OPTIONS="" \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/repositories/e/ebuild/`" \
PALUDIS_EBUILD_DIR_FALLBACK="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories/e/ebuild/`" \
- PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/repositories/e/eapis/" \
PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
PALUDIS_REPOSITORY_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/repositories`" \
PALUDIS_ENVIRONMENT_SO_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/paludis/environments`" \
diff --git a/src/clients/paludis/install.cc b/src/clients/paludis/install.cc
index 8477298..41d700e 100644
--- a/src/clients/paludis/install.cc
+++ b/src/clients/paludis/install.cc
@@ -52,7 +52,6 @@
#include <paludis/hook.hh>
#include <paludis/query.hh>
-#include <paludis/eapi.hh>
#include <paludis/metadata_key.hh>
#include <paludis/mask.hh>
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 841edfa..118838d 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -73,6 +73,27 @@ void do_one_package_query(
cout << endl;
}
+namespace
+{
+ struct SetPrettyPrinter :
+ ConstVisitor<SetSpecTree>
+ {
+ std::ostringstream stream;
+
+ void visit_leaf(const PackageDepSpec & d)
+ {
+ stream << " " << d << std::endl;
+ }
+
+ void visit_sequence(const AllDepSpec &,
+ SetSpecTree::ConstSequenceIterator cur,
+ SetSpecTree::ConstSequenceIterator end)
+ {
+ std::for_each(cur, end, accept_visitor(*this));
+ }
+ };
+}
+
void do_one_set_query(
const tr1::shared_ptr<Environment>,
const std::string & q,
@@ -80,10 +101,10 @@ void do_one_set_query(
tr1::shared_ptr<const SetSpecTree::ConstItem> set)
{
cout << "* " << colour(cl_package_name, q) << endl;
- DepSpecPrettyPrinter packages(12);
+ SetPrettyPrinter packages;
set->accept(packages);
cout << " " << std::setw(22) << std::left << "Packages:" << std::setw(0)
- << endl << packages << endl;
+ << endl << packages.stream.str() << endl;
}
void do_one_query(
diff --git a/src/output/console_install_task.cc b/src/output/console_install_task.cc
index f413163..dfdffd0 100644
--- a/src/output/console_install_task.cc
+++ b/src/output/console_install_task.cc
@@ -34,7 +34,6 @@
#include <paludis/query.hh>
#include <paludis/repository.hh>
#include <paludis/package_database.hh>
-#include <paludis/eapi.hh>
#include <paludis/package_id.hh>
#include <paludis/metadata_key.hh>
#include <paludis/mask.hh>
diff --git a/src/output/console_query_task.cc b/src/output/console_query_task.cc
index acab258..84848dc 100644
--- a/src/output/console_query_task.cc
+++ b/src/output/console_query_task.cc
@@ -32,9 +32,7 @@
#include <paludis/query.hh>
#include <paludis/mask.hh>
#include <paludis/metadata_key.hh>
-#include <paludis/eapi.hh>
#include <paludis/package_database.hh>
-#include <paludis/dep_spec_pretty_printer.hh>
#include <paludis/environment.hh>
#include <paludis/package_id.hh>
#include <list>
@@ -174,12 +172,15 @@ namespace
{
private:
const ConsoleQueryTask * const task;
+ const Environment * const env;
const tr1::shared_ptr<const PackageID> id;
const MetadataKeyType type;
public:
- Displayer(const ConsoleQueryTask * const t, const tr1::shared_ptr<const PackageID> & i, const MetadataKeyType k) :
+ Displayer(const ConsoleQueryTask * const t, const Environment * const e,
+ const tr1::shared_ptr<const PackageID> & i, const MetadataKeyType k) :
task(t),
+ env(e),
id(i),
type(k)
{
@@ -213,31 +214,100 @@ namespace
void visit(const MetadataSpecTreeKey<DependencySpecTree> & k)
{
if (k.type() == type)
- task->display_metadata_dependency(k.human_name(), k.raw_name(), k.value(), false);
+ {
+ task->output_left_column(task->want_raw() ? k.human_name() + ":" : k.raw_name());
+ if (task->want_raw())
+ {
+ task->output_left_column(k.raw_name());
+ task->output_right_column(k.pretty_print_flat());
+ }
+ else
+ {
+ task->output_left_column(k.human_name() + ":");
+ task->output_right_column("");
+ task->output_stream() << k.pretty_print();
+ task->output_endl();
+ }
+ }
}
void visit(const MetadataSpecTreeKey<URISpecTree> & k)
{
if (k.type() == type)
- task->display_metadata_uri(k.human_name(), k.raw_name(), k.value(), true);
+ {
+ task->output_left_column(task->want_raw() ? k.human_name() + ":" : k.raw_name());
+ if (task->want_raw())
+ {
+ task->output_left_column(k.raw_name());
+ task->output_right_column(k.pretty_print_flat());
+ }
+ else
+ {
+ task->output_left_column(k.human_name() + ":");
+ task->output_stream() << k.pretty_print();
+ task->output_right_column("");
+ }
+ }
}
void visit(const MetadataSpecTreeKey<LicenseSpecTree> & k)
{
if (k.type() == type)
- task->display_metadata_license(k.human_name(), k.raw_name(), k.value(), id);
+ {
+ task->output_left_column(task->want_raw() ? k.human_name() + ":" : k.raw_name());
+ if (task->want_raw())
+ {
+ task->output_left_column(k.raw_name());
+ task->output_right_column(k.pretty_print_flat());
+ }
+ else
+ {
+ task->output_left_column(k.human_name() + ":");
+ LicenceDisplayer d(task->output_stream(), env, id);
+ k.value()->accept(d);
+ task->output_right_column("");
+ }
+ }
}
void visit(const MetadataSpecTreeKey<ProvideSpecTree> & k)
{
if (k.type() == type)
- task->display_metadata_provides(k.human_name(), k.raw_name(), k.value(), true);
+ {
+ task->output_left_column(task->want_raw() ? k.human_name() + ":" : k.raw_name());
+ if (task->want_raw())
+ {
+ task->output_left_column(k.raw_name());
+ task->output_right_column(k.pretty_print_flat());
+ }
+ else
+ {
+ task->output_left_column(k.human_name() + ":");
+ task->output_right_column("");
+ task->output_stream() << k.pretty_print();
+ task->output_endl();
+ }
+ }
}
void visit(const MetadataSpecTreeKey<RestrictSpecTree> & k)
{
if (k.type() == type)
- task->display_metadata_restrict(k.human_name(), k.raw_name(), k.value(), true);
+ {
+ task->output_left_column(task->want_raw() ? k.human_name() + ":" : k.raw_name());
+ if (task->want_raw())
+ {
+ task->output_left_column(k.raw_name());
+ task->output_right_column(k.pretty_print_flat());
+ }
+ else
+ {
+ task->output_left_column(k.human_name() + ":");
+ task->output_right_column("");
+ task->output_stream() << k.pretty_print();
+ task->output_endl();
+ }
+ }
}
void visit(const MetadataPackageIDKey & k)
@@ -267,27 +337,21 @@ namespace
void
ConsoleQueryTask::display_metadata(const PackageDepSpec &, const tr1::shared_ptr<const PackageID> & id) const
{
- if (! id->eapi()->supported)
- {
- display_metadata_key("EAPI", "EAPI", id->eapi()->name);
- return;
- }
-
- Displayer ds(this, id, mkt_significant);
+ Displayer ds(this, _imp->env, id, mkt_significant);
std::for_each(id->begin_metadata(), id->end_metadata(), accept_visitor(ds));
- Displayer dn(this, id, mkt_normal);
+ Displayer dn(this, _imp->env, id, mkt_normal);
std::for_each(id->begin_metadata(), id->end_metadata(), accept_visitor(dn));
if (want_deps() || want_raw())
{
- Displayer dd(this, id, mkt_dependencies);
+ Displayer dd(this, _imp->env, id, mkt_dependencies);
std::for_each(id->begin_metadata(), id->end_metadata(), accept_visitor(dd));
}
if (want_raw())
{
- Displayer dr(this, id, mkt_internal);
+ Displayer dr(this, _imp->env, id, mkt_internal);
std::for_each(id->begin_metadata(), id->end_metadata(), accept_visitor(dr));
}
}
@@ -312,26 +376,6 @@ ConsoleQueryTask::display_metadata_key(const std::string & k, const std::string
output_right_column(normalise(v));
}
-void
-ConsoleQueryTask::display_metadata_license(const std::string & k, const std::string & kk, tr1::shared_ptr<const LicenseSpecTree::ConstItem> l,
- const tr1::shared_ptr<const PackageID> & display_entry) const
-{
- output_left_column((want_raw() ? kk : k) + ":");
-
- if (want_raw())
- {
- DepSpecPrettyPrinter p(0, false);
- l->accept(p);
- output_right_column(stringify(p));
- }
- else
- {
- LicenceDisplayer d(output_stream(), _imp->env, display_entry);
- l->accept(d);
- output_right_column("");
- }
-}
-
namespace
{
struct IsEmpty :
@@ -381,61 +425,6 @@ namespace
}
}
-namespace
-{
- template <typename T_>
- void display_dep(const ConsoleQueryTask * const q, const std::string & k,
- const std::string & kk, tr1::shared_ptr<const T_> d, const bool one_line)
- {
- if (is_spec_empty(d))
- return;
-
- q->output_left_column((q->want_raw() ? kk : k) + ":");
-
- if (one_line)
- {
- DepSpecPrettyPrinter p(0, false);
- d->accept(p);
- q->output_stream() << p << std::endl;
- }
- else
- {
- q->output_right_column("");
- DepSpecPrettyPrinter p(q->left_column_width() + 5);
- d->accept(p);
- q->output_stream() << p;
- }
- }
-}
-
-void
-ConsoleQueryTask::display_metadata_dependency(const std::string & k, const std::string & kk,
- tr1::shared_ptr<const DependencySpecTree::ConstItem> d, const bool one_line) const
-{
- display_dep(this, k, kk, d, one_line);
-}
-
-void
-ConsoleQueryTask::display_metadata_uri(const std::string & k, const std::string & kk,
- tr1::shared_ptr<const URISpecTree::ConstItem> d, const bool one_line) const
-{
- display_dep(this, k, kk, d, one_line);
-}
-
-void
-ConsoleQueryTask::display_metadata_provides(const std::string & k, const std::string & kk,
- tr1::shared_ptr<const ProvideSpecTree::ConstItem> d, const bool one_line) const
-{
- display_dep(this, k, kk, d, one_line);
-}
-
-void
-ConsoleQueryTask::display_metadata_restrict(const std::string & k, const std::string & kk,
- tr1::shared_ptr<const RestrictSpecTree::ConstItem> d, const bool one_line) const
-{
- display_dep(this, k, kk, d, one_line);
-}
-
void
ConsoleQueryTask::display_metadata_pde(const std::string & k, const std::string & kk,
const PackageID & v) const
diff --git a/src/output/console_query_task.hh b/src/output/console_query_task.hh
index 46d44f4..8c40dcb 100644
--- a/src/output/console_query_task.hh
+++ b/src/output/console_query_task.hh
@@ -52,16 +52,6 @@ namespace paludis
virtual void display_metadata_key(const std::string &, const std::string &,
const std::string &) const;
- virtual void display_metadata_license(const std::string &, const std::string &,
- tr1::shared_ptr<const LicenseSpecTree::ConstItem>, const tr1::shared_ptr<const PackageID> &) const;
- virtual void display_metadata_dependency(const std::string &, const std::string &,
- tr1::shared_ptr<const DependencySpecTree::ConstItem>, const bool one_line) const;
- virtual void display_metadata_provides(const std::string &, const std::string &,
- tr1::shared_ptr<const ProvideSpecTree::ConstItem>, const bool one_line) const;
- virtual void display_metadata_uri(const std::string &, const std::string &,
- tr1::shared_ptr<const URISpecTree::ConstItem>, const bool one_line) const;
- virtual void display_metadata_restrict(const std::string &, const std::string &,
- tr1::shared_ptr<const RestrictSpecTree::ConstItem>, const bool one_line) const;
virtual void display_metadata_pde(const std::string &, const std::string &, const PackageID &) const;
virtual void display_metadata_time(const std::string &, const std::string &, time_t) const;
virtual void display_metadata_iuse(const std::string &, const std::string &, const std::string &,