aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-18 17:06:13 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-10-18 17:06:13 +0000
commitdc66c51d73ebf688cc7173e132a84f89b2cc5075 (patch)
tree54e347e38b572a1da177797c4c17b1a9c702bd88
parentcd429b7e6da4a46da2890d9151ce359f7592242c (diff)
downloadpaludis-dc66c51d73ebf688cc7173e132a84f89b2cc5075.tar.gz
paludis-dc66c51d73ebf688cc7173e132a84f89b2cc5075.tar.xz
EAPI 1 support. Fixes: ticket:402. Fixes: ticket:403. Fixes: ticket:404. Fixes: ticket:405
-rw-r--r--configure.ac1
-rw-r--r--paludis/dep_spec.cc10
-rw-r--r--paludis/dep_spec.se2
-rw-r--r--paludis/name.cc2
-rw-r--r--paludis/name.se2
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc57
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh26
-rw-r--r--paludis/repositories/e/eapis/1.conf156
-rw-r--r--paludis/repositories/e/eapis/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/1/Makefile.am35
-rw-r--r--paludis/repositories/e/ebuild/1/src_compile.bash62
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am2
12 files changed, 355 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 0823c0b..8014960 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1305,6 +1305,7 @@ AC_OUTPUT(
paludis/repositories/e/Makefile
paludis/repositories/e/eapis/Makefile
paludis/repositories/e/ebuild/0/Makefile
+ paludis/repositories/e/ebuild/1/Makefile
paludis/repositories/e/ebuild/Makefile
paludis/repositories/e/ebuild/echo_functions.bash
paludis/repositories/e/ebuild/exheres-0/Makefile
diff --git a/paludis/dep_spec.cc b/paludis/dep_spec.cc
index 3000631..1f1ba55 100644
--- a/paludis/dep_spec.cc
+++ b/paludis/dep_spec.cc
@@ -300,10 +300,12 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
break;
case pds_pm_eapi_0:
+ case pds_pm_eapi_1:
Log::get_instance()->message(ll_warning, lc_context, "[] dependencies not safe for use with this EAPI");
break;
case pds_pm_eapi_0_strict:
+ case pds_pm_eapi_1_strict:
throw PackageDepSpecError("[] dependencies not safe for use with this EAPI");
}
@@ -416,11 +418,13 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
break;
case pds_pm_eapi_0:
+ case pds_pm_eapi_1:
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:
+ case pds_pm_eapi_1_strict:
throw PackageDepSpecError("Repository dependencies not allowed with this EAPI");
}
@@ -436,6 +440,8 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
case pds_pm_unspecific:
case pds_pm_permissive:
case pds_pm_exheres_0:
+ case pds_pm_eapi_1:
+ case pds_pm_eapi_1_strict:
case last_pds_pm:
break;
@@ -471,10 +477,12 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
break;
case pds_pm_eapi_0:
+ case pds_pm_eapi_1:
Log::get_instance()->message(ll_warning, lc_context, "~> dependencies not safe for use with this EAPI");
break;
case pds_pm_eapi_0_strict:
+ case pds_pm_eapi_1_strict:
throw PackageDepSpecError("~> dependencies not safe for use with this EAPI");
}
@@ -536,6 +544,7 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
case pds_pm_permissive:
case last_pds_pm:
case pds_pm_eapi_0:
+ case pds_pm_eapi_1:
Log::get_instance()->message(ll_qa, lc_context,
"Package dep spec '" + ss + "' uses * "
"with operator '" + stringify(op) +
@@ -543,6 +552,7 @@ PackageDepSpec::_do_parse(const std::string & ss, const PackageDepSpecParseMode
break;
case pds_pm_eapi_0_strict:
+ case pds_pm_eapi_1_strict:
case pds_pm_exheres_0:
throw PackageDepSpecError(
"Package dep spec '" + ss + "' uses * "
diff --git a/paludis/dep_spec.se b/paludis/dep_spec.se
index b915880..47c3a7a 100644
--- a/paludis/dep_spec.se
+++ b/paludis/dep_spec.se
@@ -8,6 +8,8 @@ make_enum_PackageDepSpecParseMode()
key pds_pm_eapi_0 "EAPI 0"
key pds_pm_eapi_0_strict "EAPI 0, errors for non-permitted things"
+ key pds_pm_eapi_1 "EAPI 1"
+ key pds_pm_eapi_1_strict "EAPI 1, 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/name.cc b/paludis/name.cc
index de9daec..dfd1464 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -387,6 +387,8 @@ namespace
/* fall through */
case iuse_pm_permissive:
+ case iuse_pm_eapi_1:
+ case iuse_pm_eapi_1_strict:
return '-' == s[0] ? use_disabled : use_enabled;
case iuse_pm_eapi_0_strict:
diff --git a/paludis/name.se b/paludis/name.se
index b9c6059..664f805 100644
--- a/paludis/name.se
+++ b/paludis/name.se
@@ -25,6 +25,8 @@ make_enum_IUseFlagParseMode()
key iuse_pm_eapi_0 "EAPI 0"
key iuse_pm_eapi_0_strict "EAPI 0, errors for non-permitted things"
+ key iuse_pm_eapi_1 "EAPI 1"
+ key iuse_pm_eapi_1_strict "EAPI 1, errors for non-permitted things"
key iuse_pm_exheres_0 "EAPI exheres-0"
key iuse_pm_permissive "Permissive"
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 6c5fad9..6b33825 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -26,6 +26,7 @@
#include <paludis/environments/test/test_environment.hh>
#include <paludis/util/system.hh>
#include <paludis/util/visitor-impl.hh>
+#include <paludis/util/visitor_cast.hh>
#include <paludis/util/tr1_functional.hh>
#include <paludis/util/map.hh>
#include <paludis/util/set.hh>
@@ -1078,9 +1079,65 @@ namespace test_cases
TEST_CHECK(id);
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("econf source 0", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec("=cat/econf-source-0", pds_pm_unspecific)), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataStringKey>(**id->find_metadata("EAPI"))->value(), "0");
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
}
} test_e_repository_install_eapi_0;
+ struct ERepositoryInstallEAPI1Test : TestCase
+ {
+ ERepositoryInstallEAPI1Test() : TestCase("install_eapi_1") { }
+
+ unsigned max_run_time() const
+ {
+ return 300;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ tr1::shared_ptr<Map<std::string, std::string> > keys(new Map<std::string, std::string>);
+ keys->insert("format", "ebuild");
+ keys->insert("names_cache", "/var/empty");
+ keys->insert("location", "e_repository_TEST_dir/repo13");
+ keys->insert("profiles", "e_repository_TEST_dir/repo13/profiles/profile");
+ keys->insert("layout", "traditional");
+ keys->insert("eapi_when_unknown", "0");
+ keys->insert("eapi_when_unspecified", "0");
+ keys->insert("profile_eapi", "0");
+ keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "build"));
+ tr1::shared_ptr<ERepository> repo(make_ebuild_repository(&env, keys));
+ env.package_database()->add_repository(1, repo);
+
+ tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ env.package_database()->add_repository(2, installed_repo);
+
+ InstallAction action(InstallActionOptions::create()
+ .debug_build(iado_none)
+ .checks(iaco_default)
+ .no_config_protect(false)
+ .destination(installed_repo)
+ );
+
+ {
+ TestMessageSuffix suffix("econf source 1", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec("=cat/econf-source-1", pds_pm_unspecific)), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataStringKey>(**id->find_metadata("EAPI"))->value(), "1");
+ id->perform_action(action);
+ }
+ }
+ } test_e_repository_install_eapi_1;
+
struct ERepositoryInstallExheres0Test : TestCase
{
ERepositoryInstallExheres0Test() : TestCase("install_exheres_0") { }
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 423cea2..ad8311d 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -552,6 +552,32 @@ src_compile() {
emake monkey
}
END
+mkdir -p "cat/econf-source"
+cat <<END > cat/econf-source/econf-source-0.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_unpack() {
+ ECONF_SOURCE=subdir
+ mkdir \${S}
+ cd \${S}
+ mkdir subdir
+ echo 'touch monkey' > subdir/configure
+ chmod +x subdir/configure
+}
+
+src_install() {
+ insinto /usr/bin
+ doins monkey || die "no monkey"
+}
+END
+cp cat/econf-source/econf-source-{0,1}.ebuild || exit 1
cd ..
mkdir -p repo14/{profiles/profile,metadata,eclass} || exit 1
diff --git a/paludis/repositories/e/eapis/1.conf b/paludis/repositories/e/eapis/1.conf
new file mode 100644
index 0000000..f86a95d
--- /dev/null
+++ b/paludis/repositories/e/eapis/1.conf
@@ -0,0 +1,156 @@
+# Configuration for EAPI 0
+# EAPI 0 is the default EAPI used by Gentoo. It is specified in PMS.
+
+package_dep_spec_parse_mode = eapi_1
+strict_package_dep_spec_parse_mode = eapi_1_strict
+dependency_spec_tree_parse_mode = eapi_0
+iuse_flag_parse_mode = eapi_1
+strict_iuse_flag_parse_mode = eapi_1_strict
+breaks_portage = false
+uri_supports_arrow = false
+rdepend_defaults_to_depend = true
+use_expand_separator = _
+want_portage_emulation_vars = true
+require_use_expand_in_iuse = false
+support_eclasses = true
+support_exlibs = false
+utility_path_suffixes =
+ebuild_module_suffixes = 1
+
+vdb_from_env_variables = \
+ CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
+ HOMEPAGE INHERITED IUSE KEYWORDS LICENSE PDEPEND PF \
+ PROVIDE RDEPEND SLOT SRC_URI USE CONFIG_PROTECT CONFIG_PROTECT_MASK \
+ VDB_FORMAT PKGMANAGER USE_EXPAND
+
+vdb_from_env_unless_empty_variables = \
+ ASFLAGS CBUILD CC CFLAGS CHOST CTARGET CXX CXXFLAGS \
+ EXTRA_ECONF EXTRA_EINSTALL EXTRA_EMAKE LDFLAGS LIBCXXFLAGS \
+ REPOSITORY RESTRICT
+
+non_empty_variables = \
+ P PV PR PN PVR PF CATEGORY FILESDIR ECLASSDIR PORTDIR \
+ DISTDIR KV PALUDIS_TMPDIR PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR \
+ USERLAND KERNEL ARCH CHOST PALUDIS_COMMAND ROOT
+
+directory_variables = \
+ ECLASSDIR PORTDIR DISTDIR
+
+directory_if_exists_variables = \
+ FILESDIR
+
+ebuild_must_not_set_variables =
+
+source_merged_variables = \
+ IUSE DEPEND RDEPEND PDEPEND KEYWORDS
+
+must_not_change_variables = \
+ SLOT
+
+save_variables = \
+ USE USE_EXPAND USE_EXPAND_HIDDEN \$USE_EXPAND
+
+save_base_variables = \
+ CONFIG_PROTECT CONFIG_PROTECT_MASK
+
+save_unmodifiable_variables = \
+ SLOT EAPI KEYWORDS ROOT \
+ PALUDIS_TMPDIR PALUDIS_CONFIG_DIR PALUDIS_BASHRC_FILES \
+ PALUDIS_HOOK_DIRS PALUDIS_FETCHERS_DIRS PALUDIS_SYNCERS_DIRS \
+ PALUDIS_COMMAND PALUDIS_REDUCED_UID PALUDIS_REDUCED_GID \
+ PALUDIS_EBUILD_LOG_LEVEL PALUDIS_EBUILD_DIR PALUDIS_UTILITY_PATH_SUFFIXES \
+ PALUDIS_EBUILD_MODULE_SUFFIXES PALUDIS_NON_EMPTY_VARIABLES \
+ PALUDIS_DIRECTORY_VARIABLES PALUDIS_EBUILD_MUST_NOT_SET_VARIABLES \
+ PALUDIS_SAVE_VARIABLES PALUDIS_SAVE_BASE_VARIABLES \
+ PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES PALUDIS_SOURCE_MERGED_VARIABLES \
+ PALUDIS_MUST_NOT_CHANGE_VARIABLES PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND \
+ ECLASSDIR ECLASSDIRS EXLIBSDIRS PALUDIS_VARIABLE PALUDIS_PROFILE_DIR \
+ PALUDIS_PROFILE_DIRS PALUDIS_LOADSAVEENV_DIR
+
+ebuild_install = \
+ : prepare ; \
+ userpriv sandbox : init saveenv ; \
+ : loadenv setup saveenv ; \
+ sandbox userpriv : loadenv unpack compile saveenv ; \
+ sandbox userpriv checkphase checks=always : loadenv test saveenv ; \
+ sandbox : loadenv install saveenv ; \
+ prepost : loadenv strip preinst saveenv ; \
+ merge : ; \
+ prepost : loadenv postinst saveenv ; \
+ : tidyup
+
+ebuild_uninstall = \
+ : prerm saveenv ; \
+ unmerge : ; \
+ : loadenv postrm ;
+
+ebuild_pretend =
+
+ebuild_info = \
+ sandbox userpriv installed=true : infovars info ; \
+ sandbox userpriv installed=false : infovars
+
+ebuild_metadata = \
+ sandbox userpriv noexec : metadata
+
+ebuild_nofetch = \
+ sandbox userpriv : nofetch
+
+ebuild_variable = \
+ sandbox userpriv : variable
+
+ebuild_config = \
+ sandbox : config
+
+description_build_depend = Build dependencies
+description_description = Description
+description_eapi = EAPI
+description_eclass_keywords = Eclass Keywords
+description_homepage = Homepage
+description_inherited = Inherited
+description_iuse = Relevant USE flags
+description_keywords = Keywords
+description_license = License
+description_pdepend = Post dependencies
+description_provide = Provided packages
+description_restrict = Restrictions
+description_run_depend = Run dependencies
+description_slot = Slot
+description_src_uri = Source URI
+description_use = Selected USE flags
+
+metadata_build_depend = DEPEND
+metadata_description = DESCRIPTION
+metadata_eapi = EAPI
+metadata_eclass_keywords = E_KEYWORDS
+metadata_homepage = HOMEPAGE
+metadata_inherited = INHERITED
+metadata_iuse = IUSE
+metadata_keywords = KEYWORDS
+metadata_license = LICENSE
+metadata_pdepend = PDEPEND
+metadata_provide = PROVIDE
+metadata_restrict = RESTRICT
+metadata_run_depend = RDEPEND
+metadata_slot = SLOT
+metadata_src_uri = SRC_URI
+
+env_use = USE
+env_use_expand = USE_EXPAND
+env_use_expand_hidden = USE_EXPAND_HIDDEN
+env_aa = AA
+env_arch = ARCH
+env_kv = KV
+env_accept_keywords = ACCEPT_KEYWORDS
+env_portdir = PORTDIR
+env_distdir = DISTDIR
+
+uri_labels = \
+ default = URIMirrorsThenListedLabel ; \
+ default-restrict-fetch = URIManualOnlyLabel ; \
+ default-restrict-mirror = URILocalMirrorsOnlyLabel
+
+restrict_mirror = mirror nomirror
+restrict_fetch = fetch nofetch
+
+
diff --git a/paludis/repositories/e/eapis/Makefile.am b/paludis/repositories/e/eapis/Makefile.am
index 454e3db..6eea9e7 100644
--- a/paludis/repositories/e/eapis/Makefile.am
+++ b/paludis/repositories/e/eapis/Makefile.am
@@ -4,6 +4,7 @@ SUBDIRS =
eapis = \
0.conf \
+ 1.conf \
exheres-0.conf \
paludis-1.conf
diff --git a/paludis/repositories/e/ebuild/1/Makefile.am b/paludis/repositories/e/ebuild/1/Makefile.am
new file mode 100644
index 0000000..4a0dbea
--- /dev/null
+++ b/paludis/repositories/e/ebuild/1/Makefile.am
@@ -0,0 +1,35 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~
+SUBDIRS = .
+
+libexecprogexheresdir = $(libexecdir)/paludis/1
+
+libexecprogexheres_SCRIPTS = \
+ src_compile.bash
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
+ PALUDIS_DISTRIBUTION="gentoo" \
+ PALUDIS_EBUILD_LOG_LEVEL="warning" \
+ TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
+
+TESTS =
+check_SCRIPTS = $(TESTS)
+
+EXTRA_DIST = $(libexecprogexheres_SCRIPTS)
+
+built-sources : $(BUILT_SOURCES)
+ for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
+
+distcheck-deps-local : $(DISTCHECK_DEPS)
+
+distcheck-deps : distcheck-deps-subdirs
+
+distcheck-deps-subdirs :
+ for s in $(SUBDIRS) . ; do if test x$$s = x. ; then make distcheck-deps-local || exit 1 ; \
+ else $(MAKE) -C $$s distcheck-deps || exit 1 ; fi ; done
+
diff --git a/paludis/repositories/e/ebuild/1/src_compile.bash b/paludis/repositories/e/ebuild/1/src_compile.bash
new file mode 100644
index 0000000..ace7a8a
--- /dev/null
+++ b/paludis/repositories/e/ebuild/1/src_compile.bash
@@ -0,0 +1,62 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+#
+# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
+# Gentoo Foundation and distributed under the terms of the GNU General
+# Public License v2.
+#
+# 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
+
+src_compile()
+{
+ [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf
+ if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
+ emake || die "emake failed"
+ fi
+}
+
+ebuild_f_compile()
+{
+ if [[ -d "${S}" ]] ; then
+ cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -d "${WORKDIR}" ]] ; then
+ cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+ fi
+
+ if hasq "compile" ${RESTRICT} ; then
+ ebuild_section "Skipping src_compile (RESTRICT)"
+ elif hasq "compile" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_compile (SKIP_FUNCTIONS)"
+ else
+ if [[ $(type -t pre_src_compile ) == "function" ]] ; then
+ ebuild_section "Starting pre_src_compile"
+ pre_src_compile
+ ebuild_section "Done pre_src_compile"
+ fi
+
+ ebuild_section "Starting src_compile"
+ src_compile
+ ebuild_section "Done src_compile"
+
+ if [[ $(type -t post_src_compile ) == "function" ]] ; then
+ ebuild_section "Starting post_src_compile"
+ post_src_compile
+ ebuild_section "Done post_src_compile"
+ fi
+ fi
+}
+
+
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index 1a1a097..e05f78c 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = *~
-SUBDIRS = . 0 exheres-0 utils
+SUBDIRS = . 0 1 exheres-0 utils
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@