aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-26 22:21:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-05-26 22:21:38 +0000
commit3faf8fd9388c11ee2cda92f43dd3843dae57cfd4 (patch)
treec83bf89f61ef049b82fd2a678b5527cd92523b88
parent2dfff28604226456472edd45f755376f871d362c (diff)
downloadpaludis-3faf8fd9388c11ee2cda92f43dd3843dae57cfd4.tar.gz
paludis-3faf8fd9388c11ee2cda92f43dd3843dae57cfd4.tar.xz
More EAPI work
-rw-r--r--paludis/dep_spec.cc7
-rw-r--r--paludis/dep_spec.se5
-rw-r--r--paludis/eapi.cc62
-rw-r--r--paludis/eapi.sr8
-rw-r--r--paludis/merger/Makefile.am2
-rw-r--r--paludis/name.cc1
-rw-r--r--paludis/name.se5
-rw-r--r--paludis/portage_dep_parser.cc1
-rw-r--r--paludis/portage_dep_parser.se1
-rw-r--r--paludis/portage_dep_parser_TEST.cc25
-rw-r--r--paludis/repositories/gentoo/ebuild_entries.cc2
-rw-r--r--paludis/util/files.m41
-rw-r--r--paludis/util/make_shared_ptr-fwd.hh38
-rw-r--r--paludis/util/make_shared_ptr.hh36
-rw-r--r--python/eapi.cc3
-rwxr-xr-xpython/eapi_TEST.py1
-rw-r--r--ruby/eapi.cc2
-rw-r--r--ruby/eapi_TEST.rb4
18 files changed, 169 insertions, 35 deletions
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 35bca4f..36fc18e 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -307,6 +307,7 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
{
switch (mode)
{
+ case pds_pm_exheres_0:
case pds_pm_unspecific:
case pds_pm_permissive:
case last_pds_pm:
@@ -432,8 +433,9 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
Log::get_instance()->message(ll_warning, lc_context, "Repository dependencies not safe for use with this EAPI");
break;
+ case pds_pm_exheres_0:
case pds_pm_eapi_0_strict:
- throw PackageDepSpecError("Repository dependencies not safe for use with this EAPI");
+ throw PackageDepSpecError("Repository dependencies not allowed with this EAPI");
}
_imp->repository.reset(new RepositoryName(s.substr(repo_p + 2)));
@@ -447,6 +449,7 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
{
case pds_pm_unspecific:
case pds_pm_permissive:
+ case pds_pm_exheres_0:
case last_pds_pm:
break;
@@ -477,6 +480,7 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
{
case pds_pm_unspecific:
case pds_pm_permissive:
+ case pds_pm_exheres_0:
case last_pds_pm:
break;
@@ -553,6 +557,7 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
break;
case pds_pm_eapi_0_strict:
+ case pds_pm_exheres_0:
throw PackageDepSpecError(
"Package dep spec '" + ss + "' uses * "
"with operator '" + stringify(op) + "'");
diff --git a/paludis/dep_spec.se b/paludis/dep_spec.se
index 2da9c3d..89dddbe 100644
--- a/paludis/dep_spec.se
+++ b/paludis/dep_spec.se
@@ -5,8 +5,9 @@ make_enum_PackageDepSpecParseMode()
{
prefix pds_pm
- key pds_pm_eapi_0 "EAPI-0"
- key pds_pm_eapi_0_strict "EAPI-0, errors for non-permitted things"
+ key pds_pm_eapi_0 "EAPI 0"
+ key pds_pm_eapi_0_strict "EAPI 0, errors for non-permitted things"
+ key pds_pm_exheres_0 "EAPI exheres-0"
key pds_pm_permissive "Permissive"
key pds_pm_unspecific "Permissive, and allow unspecific cat/pkg"
diff --git a/paludis/eapi.cc b/paludis/eapi.cc
index 1f20e14..592d2ba 100644
--- a/paludis/eapi.cc
+++ b/paludis/eapi.cc
@@ -33,21 +33,59 @@ namespace paludis
Implementation()
{
- values.insert(std::make_pair("0", EAPI("0", tr1::shared_ptr<SupportedEAPI>(new SupportedEAPI(
- pds_pm_eapi_0, pds_pm_eapi_0_strict, dst_pm_eapi_0,
- iuse_pm_eapi_0, iuse_pm_eapi_0_strict, false, false)))));
+ values.insert(std::make_pair("0", EAPI("0", tr1::shared_ptr<SupportedEAPI>(new SupportedEAPI(SupportedEAPI::create()
+ .package_dep_spec_parse_mode(pds_pm_eapi_0)
+ .strict_package_dep_spec_parse_mode(pds_pm_eapi_0_strict)
+ .dependency_spec_tree_parse_mode(dst_pm_eapi_0)
+ .iuse_flag_parse_mode(iuse_pm_eapi_0)
+ .strict_iuse_flag_parse_mode(iuse_pm_eapi_0_strict)
+ .breaks_portage(false)
+ .has_pkg_pretend(false)
+ .want_aa_var(true)
+ .want_arch_var(true)
+ .want_portage_emulation_vars(true)
+ .require_use_expand_in_iuse(false))))));
- values.insert(std::make_pair("", EAPI("", tr1::shared_ptr<SupportedEAPI>(new SupportedEAPI(
- pds_pm_eapi_0, pds_pm_eapi_0_strict, dst_pm_eapi_0,
- iuse_pm_eapi_0, iuse_pm_eapi_0_strict, false, false)))));
+ values.insert(std::make_pair("", values.find("0")->second));
- values.insert(std::make_pair("paludis-1", EAPI("paludis-1", tr1::shared_ptr<SupportedEAPI>(new SupportedEAPI(
- pds_pm_permissive, pds_pm_permissive, dst_pm_paludis_1,
- iuse_pm_permissive, iuse_pm_permissive, true, true)))));
+ values.insert(std::make_pair("paludis-1", EAPI("paludis-1", tr1::shared_ptr<SupportedEAPI>(new SupportedEAPI(SupportedEAPI::create()
+ .package_dep_spec_parse_mode(pds_pm_permissive)
+ .strict_package_dep_spec_parse_mode(pds_pm_permissive)
+ .dependency_spec_tree_parse_mode(dst_pm_paludis_1)
+ .iuse_flag_parse_mode(iuse_pm_permissive)
+ .strict_iuse_flag_parse_mode(iuse_pm_permissive)
+ .breaks_portage(true)
+ .has_pkg_pretend(true)
+ .want_aa_var(false)
+ .want_arch_var(true)
+ .want_portage_emulation_vars(false)
+ .require_use_expand_in_iuse(false))))));
- values.insert(std::make_pair("CRAN-1", EAPI("CRAN-1", tr1::shared_ptr<SupportedEAPI>(new SupportedEAPI(
- pds_pm_permissive, pds_pm_permissive, dst_pm_eapi_0,
- iuse_pm_permissive, iuse_pm_permissive, true, false)))));
+ values.insert(std::make_pair("CRAN-1", EAPI("CRAN-1", tr1::shared_ptr<SupportedEAPI>(new SupportedEAPI(SupportedEAPI::create()
+ .package_dep_spec_parse_mode(pds_pm_permissive)
+ .strict_package_dep_spec_parse_mode(pds_pm_eapi_0_strict)
+ .dependency_spec_tree_parse_mode(dst_pm_eapi_0)
+ .iuse_flag_parse_mode(iuse_pm_permissive)
+ .strict_iuse_flag_parse_mode(iuse_pm_permissive)
+ .breaks_portage(true)
+ .has_pkg_pretend(false)
+ .want_aa_var(false)
+ .want_arch_var(false)
+ .want_portage_emulation_vars(false)
+ .require_use_expand_in_iuse(false))))));
+
+ values.insert(std::make_pair("exheres-0", EAPI("exheres-0", tr1::shared_ptr<SupportedEAPI>(new SupportedEAPI(SupportedEAPI::create()
+ .package_dep_spec_parse_mode(pds_pm_exheres_0)
+ .strict_package_dep_spec_parse_mode(pds_pm_exheres_0)
+ .dependency_spec_tree_parse_mode(dst_pm_exheres_0)
+ .iuse_flag_parse_mode(iuse_pm_exheres_0)
+ .strict_iuse_flag_parse_mode(iuse_pm_exheres_0)
+ .breaks_portage(true)
+ .has_pkg_pretend(true)
+ .want_aa_var(false)
+ .want_arch_var(false)
+ .want_portage_emulation_vars(false)
+ .require_use_expand_in_iuse(true))))));
}
};
}
diff --git a/paludis/eapi.sr b/paludis/eapi.sr
index 3a67a20..56a4b8e 100644
--- a/paludis/eapi.sr
+++ b/paludis/eapi.sr
@@ -5,12 +5,16 @@ 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 iuse_flag_parse_mode IUseFlagParseMode
key strict_iuse_flag_parse_mode IUseFlagParseMode
key breaks_portage bool
- key has_pretend_phase bool
+
+ key has_pkg_pretend bool
+ key want_aa_var bool
+ key want_arch_var bool
+ key want_portage_emulation_vars bool
+ key require_use_expand_in_iuse bool
allow_named_args
diff --git a/paludis/merger/Makefile.am b/paludis/merger/Makefile.am
index 1b1e4d9..e8cb4e7 100644
--- a/paludis/merger/Makefile.am
+++ b/paludis/merger/Makefile.am
@@ -2,7 +2,7 @@ CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
DISTCLEANFILES = \
merger-sr.hh merger-sr.cc entry_type-se.hh entry_type-se.cc \
- unmerger-sr.hh unmerger-sr.cc
+ unmerger-sr.hh unmerger-sr.cc merger-se.hh merger-se.cc
BUILT_SOURCES = $(DISTCLEANFILES)
MAINTAINERCLEANFILES = Makefile.in
diff --git a/paludis/name.cc b/paludis/name.cc
index f424082..ed62af1 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -366,6 +366,7 @@ namespace
return '-' == s[0] ? use_disabled : use_enabled;
case iuse_pm_eapi_0_strict:
+ case iuse_pm_exheres_0:
throw IUseFlagNameError(s, "+/- prefixed IUSE flag names not allowed in this EAPI");
case last_iuse_pm:
diff --git a/paludis/name.se b/paludis/name.se
index 67b5adf..fd4af25 100644
--- a/paludis/name.se
+++ b/paludis/name.se
@@ -22,8 +22,9 @@ make_enum_IUseFlagParseMode()
{
prefix iuse_pm
- key iuse_pm_eapi_0 "EAPI-0"
- key iuse_pm_eapi_0_strict "EAPI-0, errors for non-permitted things"
+ key iuse_pm_eapi_0 "EAPI 0"
+ key iuse_pm_eapi_0_strict "EAPI 0, errors for non-permitted things"
+ key iuse_pm_exheres_0 "EAPI exheres-0"
key iuse_pm_permissive "Permissive"
doxygen_comment << "END"
diff --git a/paludis/portage_dep_parser.cc b/paludis/portage_dep_parser.cc
index 51650ed..df9a619 100644
--- a/paludis/portage_dep_parser.cc
+++ b/paludis/portage_dep_parser.cc
@@ -210,6 +210,7 @@ namespace
return false;
case dst_pm_paludis_1:
+ case dst_pm_exheres_0:
return true;
case last_dst_pm:
diff --git a/paludis/portage_dep_parser.se b/paludis/portage_dep_parser.se
index 29287a1..91e4ecf 100644
--- a/paludis/portage_dep_parser.se
+++ b/paludis/portage_dep_parser.se
@@ -6,6 +6,7 @@ make_enum_DependencySpecTreeParseMode()
prefix dst_pm
key dst_pm_eapi_0 "EAPI 0"
+ key dst_pm_exheres_0 "EAPI exheres-0"
key dst_pm_paludis_1 "EAPI paludis-1"
doxygen_comment << "END"
diff --git a/paludis/portage_dep_parser_TEST.cc b/paludis/portage_dep_parser_TEST.cc
index f104605..e4c1b62 100644
--- a/paludis/portage_dep_parser_TEST.cc
+++ b/paludis/portage_dep_parser_TEST.cc
@@ -128,10 +128,6 @@ namespace test_cases
}
} test_dep_spec_parser_packages;
- /**
- * \test Test PortageDepParser with an any group.
- *
- */
struct PortageDepParserAnyTest : TestCase
{
PortageDepParserAnyTest() : TestCase("any") { }
@@ -145,6 +141,27 @@ namespace test_cases
}
} test_dep_spec_parser_any;
+ struct PortageDepParserAnyUseTest : TestCase
+ {
+ PortageDepParserAnyUseTest() : TestCase("any use") { }
+
+ void run()
+ {
+ DepSpecPrettyPrinter d(0, false);
+ PortageDepParser::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 ) )",
+ EAPIData::get_instance()->eapi_from_string("paludis-1"))->accept(d), DepStringError);
+
+ DepSpecPrettyPrinter e(0, false);
+ PortageDepParser::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.
*
diff --git a/paludis/repositories/gentoo/ebuild_entries.cc b/paludis/repositories/gentoo/ebuild_entries.cc
index 0b6f0c2..3afd40c 100644
--- a/paludis/repositories/gentoo/ebuild_entries.cc
+++ b/paludis/repositories/gentoo/ebuild_entries.cc
@@ -690,7 +690,7 @@ EbuildEntries::pretend(const QualifiedPackageName & q, const VersionSpec & v,
if (! metadata->eapi.supported)
return true;
- if (! metadata->eapi.supported->has_pretend_phase)
+ if (! metadata->eapi.supported->has_pkg_pretend)
return true;
PackageDatabaseEntry e(q, v, _imp->portage_repository->name());
diff --git a/paludis/util/files.m4 b/paludis/util/files.m4
index 1cc66fd..a6bc53d 100644
--- a/paludis/util/files.m4
+++ b/paludis/util/files.m4
@@ -24,6 +24,7 @@ add(`instantiation_policy', `hh', `test')
add(`is_file_with_extension', `hh', `cc', `se', `test', `testscript')
add(`join', `hh', `test')
add(`log', `hh', `cc', `se', `test')
+add(`make_shared_ptr', `hh', `fwd')
add(`operators', `hh')
add(`options', `hh', `cc', `test')
add(`output_wrapper', `test', `testscript')
diff --git a/paludis/util/make_shared_ptr-fwd.hh b/paludis/util/make_shared_ptr-fwd.hh
new file mode 100644
index 0000000..5b1921b
--- /dev/null
+++ b/paludis/util/make_shared_ptr-fwd.hh
@@ -0,0 +1,38 @@
+/* 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_UTIL_MAKE_SHARED_PTR_FWD_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_MAKE_SHARED_PTR_FWD_HH 1
+
+#include <paludis/util/attributes.hh>
+
+namespace paludis
+{
+ namespace tr1
+ {
+ template <typename T_>
+ class shared_ptr;
+ }
+
+ template <typename T_>
+ tr1::shared_ptr<T_>
+ make_shared_ptr(T_ * const t) PALUDIS_ATTRIBUTE((warn_unused_result));
+}
+
+#endif
diff --git a/paludis/util/make_shared_ptr.hh b/paludis/util/make_shared_ptr.hh
new file mode 100644
index 0000000..777dea8
--- /dev/null
+++ b/paludis/util/make_shared_ptr.hh
@@ -0,0 +1,36 @@
+/* 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_UTIL_MAKE_SHARED_PTR_HH
+#define PALUDIS_GUARD_PALUDIS_UTIL_MAKE_SHARED_PTR_HH 1
+
+#include <paludis/util/tr1_memory.hh>
+#include <paludis/util/make_shared_ptr-fwd.hh>
+
+namespace paludis
+{
+ template <typename T_>
+ tr1::shared_ptr<T_>
+ make_shared_ptr(T_ * const t)
+ {
+ return tr1::shared_ptr<T_>(t);
+ }
+}
+
+#endif
diff --git a/python/eapi.cc b/python/eapi.cc
index 7a5f174..c224328 100644
--- a/python/eapi.cc
+++ b/python/eapi.cc
@@ -48,9 +48,6 @@ void PALUDIS_VISIBLE expose_eapi()
se.def_readonly("breaks_portage", &SupportedEAPI::breaks_portage,
"[ro] bool"
);
- se.def_readonly("has_pretend_phase", &SupportedEAPI::has_pretend_phase,
- "[ro] bool"
- );
bp::class_<EAPI>
e("EAPI",
diff --git a/python/eapi_TEST.py b/python/eapi_TEST.py
index 1b3b3c9..c390e1b 100755
--- a/python/eapi_TEST.py
+++ b/python/eapi_TEST.py
@@ -50,7 +50,6 @@ class TestCase_EAPI(unittest.TestCase):
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))
- self.assert_(isinstance(eapi.supported.has_pretend_phase, bool))
if __name__ == "__main__":
unittest.main()
diff --git a/ruby/eapi.cc b/ruby/eapi.cc
index bcccc55..36d9c1f 100644
--- a/ruby/eapi.cc
+++ b/ruby/eapi.cc
@@ -176,8 +176,6 @@ namespace
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_define_method(c_supported_eapi, "has_pretend_phase?",
- RUBY_FUNC_CAST((&BoolMember<&SupportedEAPI::has_pretend_phase>::fetch)), 0);
rb_require("singleton");
diff --git a/ruby/eapi_TEST.rb b/ruby/eapi_TEST.rb
index 0c24c34..dfe6997 100644
--- a/ruby/eapi_TEST.rb
+++ b/ruby/eapi_TEST.rb
@@ -105,10 +105,6 @@ module Paludis
def test_breaks_portage?
assert !supported.breaks_portage?
end
-
- def test_has_pretend_phase?
- assert !supported.has_pretend_phase?
- end
end
end