aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-14 17:41:54 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-14 17:41:54 +0100
commit99e05bbc7636367ea70c4421fdbec1cc8d8ac199 (patch)
tree02ff4228fe6e714c3db91a74284a00cd0125d54d
parente2d26288b8f95705224d3d2a5d2f129d425e57f4 (diff)
parentbb6fdcdda9d450e056daff26df127e4081669090 (diff)
downloadpaludis-99e05bbc7636367ea70c4421fdbec1cc8d8ac199.tar.gz
paludis-99e05bbc7636367ea70c4421fdbec1cc8d8ac199.tar.xz
Merge commit 'github-com/eapi-3'
Merge in EAPI 3 work, but do not enable it.
-rw-r--r--.gitignore3
-rw-r--r--configure.ac2
-rw-r--r--paludis/repositories/e/Makefile.am19
-rw-r--r--paludis/repositories/e/depend_rdepend_TEST.cc230
-rwxr-xr-xpaludis/repositories/e/depend_rdepend_TEST_cleanup.sh10
-rwxr-xr-xpaludis/repositories/e/depend_rdepend_TEST_setup.sh76
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc142
-rw-r--r--paludis/repositories/e/e_repository_TEST_replacing.cc46
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_replacing_setup.sh51
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh237
-rw-r--r--paludis/repositories/e/eapi.cc6
-rw-r--r--paludis/repositories/e/eapi.hh12
-rw-r--r--paludis/repositories/e/eapis/0.conf3
-rw-r--r--paludis/repositories/e/eapis/3.conf55
-rw-r--r--paludis/repositories/e/eapis/Makefile.am5
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf3
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf3
-rw-r--r--paludis/repositories/e/ebuild.cc45
-rw-r--r--paludis/repositories/e/ebuild/0/build_functions.bash2
-rw-r--r--paludis/repositories/e/ebuild/0/src_compile.bash4
-rw-r--r--paludis/repositories/e/ebuild/0/src_install.bash4
-rw-r--r--paludis/repositories/e/ebuild/2/src_compile.bash4
-rw-r--r--paludis/repositories/e/ebuild/2/src_configure.bash4
-rw-r--r--paludis/repositories/e/ebuild/2/src_prepare.bash4
-rw-r--r--paludis/repositories/e/ebuild/3/Makefile.am44
-rw-r--r--paludis/repositories/e/ebuild/3/die_functions.bash25
-rw-r--r--paludis/repositories/e/ebuild/3/output_functions.bash30
-rw-r--r--paludis/repositories/e/ebuild/3/pkg_pretend.bash44
-rw-r--r--paludis/repositories/e/ebuild/3/src_install.bash76
-rw-r--r--paludis/repositories/e/ebuild/Makefile.am2
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash31
-rw-r--r--paludis/repositories/e/ebuild/utils/3/Makefile.am46
-rw-r--r--paludis/repositories/e/ebuild/utils/3/banned_in_eapi_328
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/3/docompress21
-rw-r--r--paludis/repositories/e/ebuild/utils/Makefile.am2
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/dodoc20
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/doins9
-rwxr-xr-xpaludis/repositories/e/ebuild/write_vdb_entry.bash28
-rw-r--r--paludis/repositories/e/pipe_command_handler.cc14
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc8
-rwxr-xr-xpaludis/repositories/e/vdb_repository_TEST_setup.sh49
-rw-r--r--paludis/util/echo_functions.bash.in1
42 files changed, 1405 insertions, 43 deletions
diff --git a/.gitignore b/.gitignore
index 3b0d4e8..e097f60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -220,6 +220,7 @@ paludis-*.*.*.tar.bz2
/paludis/repositories/e/aa_visitor_TEST
/paludis/repositories/e/dep_parser_TEST
/paludis/repositories/e/dep_spec_pretty_printer_TEST
+/paludis/repositories/e/depend_rdepend_TEST
/paludis/repositories/e/e_repository_TEST
/paludis/repositories/e/e_repository_TEST_ever
/paludis/repositories/e/e_repository_TEST_exlibs
@@ -227,6 +228,8 @@ paludis-*.*.*.tar.bz2
/paludis/repositories/e/e_repository_TEST_replacing
/paludis/repositories/e/e_repository_sets_TEST
/paludis/repositories/e/ebuild_flat_metadata_cache_TEST
+/paludis/repositories/e/ebuild/utils/3/dohard
+/paludis/repositories/e/ebuild/utils/3/dosed
/paludis/repositories/e/ebuild/utils/exheres-0/dohard
/paludis/repositories/e/ebuild/utils/exheres-0/dohtml
/paludis/repositories/e/ebuild/utils/exheres-0/donewins
diff --git a/configure.ac b/configure.ac
index 44d80b9..9a0c560 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1619,12 +1619,14 @@ AC_OUTPUT(
paludis/repositories/e/ebuild/0/Makefile
paludis/repositories/e/ebuild/1/Makefile
paludis/repositories/e/ebuild/2/Makefile
+ paludis/repositories/e/ebuild/3/Makefile
paludis/repositories/e/ebuild/Makefile
paludis/repositories/e/ebuild/exheres-0/Makefile
paludis/repositories/e/ebuild/kdebuild-1/Makefile
paludis/repositories/e/ebuild/paludis-1/Makefile
paludis/repositories/e/ebuild/pbin-1/Makefile
paludis/repositories/e/ebuild/utils/Makefile
+ paludis/repositories/e/ebuild/utils/3/Makefile
paludis/repositories/e/ebuild/utils/exheres-0/Makefile
paludis/repositories/e/ebuild/utils/kdebuild-1/Makefile
paludis/repositories/e/qa/Makefile
diff --git a/paludis/repositories/e/Makefile.am b/paludis/repositories/e/Makefile.am
index 357bd49..8ff1026 100644
--- a/paludis/repositories/e/Makefile.am
+++ b/paludis/repositories/e/Makefile.am
@@ -165,6 +165,20 @@ e_repository_TEST_LDADD = \
e_repository_TEST_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+depend_rdepend_TEST_SOURCES = depend_rdepend_TEST.cc
+
+depend_rdepend_TEST_LDADD = \
+ libpaludiserepository_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/repositories/fake/libpaludisfakerepository_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/libpaludisutil_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/util/test_extras.o \
+ $(top_builddir)/paludis/libpaludis_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/paludis/environments/test/libpaludistestenvironment_@PALUDIS_PC_SLOT@.la \
+ $(top_builddir)/test/libtest.a \
+ $(DYNAMIC_LD_LIBS)
+
+depend_rdepend_TEST_CXXFLAGS = $(AM_CXXFLAGS) -I$(top_srcdir) @PALUDIS_CXXFLAGS_NO_DEBUGGING@
+
e_repository_TEST_ever_SOURCES = e_repository_TEST_ever.cc
e_repository_TEST_ever_LDADD = \
@@ -395,6 +409,9 @@ EXTRA_DIST = \
dep_parser-se.cc \
dep_parser_TEST.cc \
dep_spec_pretty_printer_TEST.cc \
+ depend_rdepend_TEST.cc \
+ depend_rdepend_TEST_setup.sh \
+ depend_rdepend_TEST_cleanup.sh \
e_repository_TEST.cc \
e_repository_TEST_setup.sh \
e_repository_TEST_cleanup.sh \
@@ -452,6 +469,7 @@ BUILT_SOURCES = \
iuse-se.cc
check_SCRIPTS = \
+ depend_rdepend_TEST_setup.sh depend_rdepend_TEST_cleanup.sh \
e_repository_TEST_setup.sh e_repository_TEST_cleanup.sh \
e_repository_TEST_ever_setup.sh e_repository_TEST_ever_cleanup.sh \
e_repository_TEST_phases_setup.sh e_repository_TEST_phases_cleanup.sh \
@@ -544,6 +562,7 @@ TESTS = \
aa_visitor_TEST \
dep_parser_TEST \
dep_spec_pretty_printer_TEST \
+ depend_rdepend_TEST \
e_repository_TEST \
e_repository_TEST_ever \
e_repository_TEST_phases \
diff --git a/paludis/repositories/e/depend_rdepend_TEST.cc b/paludis/repositories/e/depend_rdepend_TEST.cc
new file mode 100644
index 0000000..6cc45e4
--- /dev/null
+++ b/paludis/repositories/e/depend_rdepend_TEST.cc
@@ -0,0 +1,230 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2009 Ciaran McCreesh
+ *
+ * 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/repositories/e/e_repository.hh>
+#include <paludis/repositories/e/vdb_repository.hh>
+#include <paludis/environments/test/test_environment.hh>
+#include <paludis/util/map.hh>
+#include <paludis/util/make_shared_ptr.hh>
+#include <paludis/util/make_named_values.hh>
+#include <paludis/util/wrapped_forward_iterator.hh>
+#include <paludis/util/sequence.hh>
+#include <paludis/repository_factory.hh>
+#include <paludis/repository.hh>
+#include <paludis/package_database.hh>
+#include <paludis/standard_output_manager.hh>
+#include <paludis/action.hh>
+#include <paludis/selection.hh>
+#include <paludis/generator.hh>
+#include <paludis/filtered_generator.hh>
+#include <paludis/filter.hh>
+#include <paludis/stringify_formatter.hh>
+#include <paludis/metadata_key.hh>
+#include <test/test_framework.hh>
+#include <test/test_runner.hh>
+
+using namespace test;
+using namespace paludis;
+
+namespace
+{
+ void cannot_uninstall(const std::tr1::shared_ptr<const PackageID> & id, const UninstallActionOptions &)
+ {
+ if (id)
+ throw InternalError(PALUDIS_HERE, "cannot uninstall");
+ }
+
+ std::tr1::shared_ptr<OutputManager> make_standard_output_manager(const Action &)
+ {
+ return make_shared_ptr(new StandardOutputManager);
+ }
+
+ std::string from_keys(const std::tr1::shared_ptr<const Map<std::string, std::string> > & m,
+ const std::string & k)
+ {
+ Map<std::string, std::string>::ConstIterator mm(m->find(k));
+ if (m->end() == mm)
+ return "";
+ else
+ return mm->second;
+ }
+
+ WantPhase want_all_phases(const std::string &)
+ {
+ return wp_yes;
+ }
+}
+
+namespace
+{
+ struct DependRdependTest : TestCase
+ {
+ const std::string eapi;
+ const bool special;
+
+ DependRdependTest(const std::string & e, bool s) :
+ TestCase("RDEPEND=DEPEND EAPI " + e),
+ eapi(e),
+ special(s)
+ {
+ }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+#ifdef ENABLE_VIRTUALS_REPOSITORY
+ ::setenv("PALUDIS_ENABLE_VIRTUALS_REPOSITORY", "yes", 1);
+#else
+ ::setenv("PALUDIS_ENABLE_VIRTUALS_REPOSITORY", "", 1);
+#endif
+
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+
+ std::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", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "repo"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "repo/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() / "depend_rdepend_TEST_dir" / "distdir"));
+ keys->insert("builddir", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "build"));
+ keys->insert("root", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "root"));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ std::tr1::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ v_keys->insert("format", "vdb");
+ v_keys->insert("names_cache", "/var/empty");
+ v_keys->insert("provides_cache", "/var/empty");
+ v_keys->insert("location", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "vdb"));
+ v_keys->insert("root", stringify(FSEntry::cwd() / "depend_rdepend_TEST_dir" / "root"));
+ std::tr1::shared_ptr<Repository> v_repo(VDBRepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, v_repo);
+
+#ifdef ENABLE_VIRTUALS_REPOSITORY
+ std::tr1::shared_ptr<Map<std::string, std::string> > iv_keys(new Map<std::string, std::string>);
+ iv_keys->insert("root", "/");
+ iv_keys->insert("format", "installed_virtuals");
+ env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ std::tr1::bind(from_keys, iv_keys, std::tr1::placeholders::_1)));
+ std::tr1::shared_ptr<Map<std::string, std::string> > v_keys(new Map<std::string, std::string>);
+ v_keys->insert("format", "virtuals");
+ env.package_database()->add_repository(-2, RepositoryFactory::get_instance()->create(&env,
+ std::tr1::bind(from_keys, v_keys, std::tr1::placeholders::_1)));
+#endif
+
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::destination>(v_repo),
+ value_for<n::make_output_manager>(&make_standard_output_manager),
+ value_for<n::perform_uninstall>(&cannot_uninstall),
+ value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
+ value_for<n::want_phase>(&want_all_phases)
+ ));
+
+ StringifyFormatter f;
+
+ {
+ std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Package(
+ QualifiedPackageName("cat/eapi" + eapi + "donly")))]->begin());
+
+ TEST_CHECK_EQUAL(id->build_dependencies_key()->pretty_print_flat(f), "the/depend");
+ if (special)
+ TEST_CHECK_EQUAL(id->run_dependencies_key()->pretty_print_flat(f), "the/depend");
+ else
+ TEST_CHECK_EQUAL(id->run_dependencies_key()->pretty_print_flat(f), "");
+
+ id->perform_action(action);
+
+ v_repo->invalidate();
+
+ std::tr1::shared_ptr<const PackageID> v_id(*env[selection::RequireExactlyOne(generator::Package(
+ QualifiedPackageName("cat/eapi" + eapi + "donly")) |
+ filter::SupportsAction<InstalledAction>())]->begin());
+
+ TEST_CHECK_EQUAL(v_id->build_dependencies_key()->pretty_print_flat(f), "the/depend");
+ if (special)
+ TEST_CHECK_EQUAL(v_id->run_dependencies_key()->pretty_print_flat(f), "the/depend");
+ else
+ TEST_CHECK_EQUAL(v_id->run_dependencies_key()->pretty_print_flat(f), "");
+ }
+
+ {
+ std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Package(
+ QualifiedPackageName("cat/eapi" + eapi + "ronly")))]->begin());
+
+ TEST_CHECK_EQUAL(id->build_dependencies_key()->pretty_print_flat(f), "");
+ TEST_CHECK_EQUAL(id->run_dependencies_key()->pretty_print_flat(f), "the/rdepend");
+
+ id->perform_action(action);
+
+ v_repo->invalidate();
+
+ std::tr1::shared_ptr<const PackageID> v_id(*env[selection::RequireExactlyOne(generator::Package(
+ QualifiedPackageName("cat/eapi" + eapi + "ronly")) |
+ filter::SupportsAction<InstalledAction>())]->begin());
+
+ TEST_CHECK_EQUAL(v_id->build_dependencies_key()->pretty_print_flat(f), "");
+ TEST_CHECK_EQUAL(v_id->run_dependencies_key()->pretty_print_flat(f), "the/rdepend");
+ }
+
+ {
+ std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Package(
+ QualifiedPackageName("cat/eapi" + eapi + "both")))]->begin());
+
+ TEST_CHECK_EQUAL(id->build_dependencies_key()->pretty_print_flat(f), "the/depend");
+ TEST_CHECK_EQUAL(id->run_dependencies_key()->pretty_print_flat(f), "the/rdepend");
+
+ id->perform_action(action);
+
+ v_repo->invalidate();
+
+ std::tr1::shared_ptr<const PackageID> v_id(*env[selection::RequireExactlyOne(generator::Package(
+ QualifiedPackageName("cat/eapi" + eapi + "both")) |
+ filter::SupportsAction<InstalledAction>())]->begin());
+
+ TEST_CHECK_EQUAL(v_id->build_dependencies_key()->pretty_print_flat(f), "the/depend");
+ TEST_CHECK_EQUAL(v_id->run_dependencies_key()->pretty_print_flat(f), "the/rdepend");
+ }
+ }
+ };
+}
+
+namespace test_cases
+{
+ DependRdependTest eapi_0("0", true);
+ DependRdependTest eapi_1("1", true);
+ DependRdependTest eapi_2("2", true);
+ DependRdependTest eapi_3("3", false);
+}
+
diff --git a/paludis/repositories/e/depend_rdepend_TEST_cleanup.sh b/paludis/repositories/e/depend_rdepend_TEST_cleanup.sh
new file mode 100755
index 0000000..f6c8211
--- /dev/null
+++ b/paludis/repositories/e/depend_rdepend_TEST_cleanup.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+if [ -d depend_rdepend_TEST_dir ] ; then
+ rm -fr depend_rdepend_TEST_dir
+else
+ true
+fi
+
+
diff --git a/paludis/repositories/e/depend_rdepend_TEST_setup.sh b/paludis/repositories/e/depend_rdepend_TEST_setup.sh
new file mode 100755
index 0000000..8a3491f
--- /dev/null
+++ b/paludis/repositories/e/depend_rdepend_TEST_setup.sh
@@ -0,0 +1,76 @@
+#!/usr/bin/env bash
+# vim: set ft=sh sw=4 sts=4 et :
+
+mkdir depend_rdepend_TEST_dir || exit 1
+cd depend_rdepend_TEST_dir || exit 1
+
+mkdir -p root/etc
+
+mkdir -p vdb
+touch vdb/THISISTHEVDB
+
+mkdir -p build
+ln -s build symlinked_build
+
+mkdir -p distdir
+
+mkdir -p repo/{profiles/profile,metadata,eclass} || exit 1
+cd repo || exit 1
+echo "test-repo" >> profiles/repo_name || exit 1
+echo "cat" >> profiles/categories || exit 1
+cat <<END > profiles/profile/virtuals
+END
+cat <<END > profiles/profile/make.defaults
+ARCH="test"
+USERLAND="GNU"
+KERNEL="linux"
+LIBC="glibc"
+CHOST="i286-badger-linux-gnu"
+END
+
+for e in 0 1 2 3 ; do
+
+ mkdir -p "cat/eapi${e}donly"
+ cat <<END > cat/eapi${e}donly/eapi${e}donly-1.ebuild || exit 1
+EAPI="${e}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+DEPEND="the/depend"
+END
+
+ mkdir -p "cat/eapi${e}ronly"
+ cat <<END > cat/eapi${e}ronly/eapi${e}ronly-1.ebuild || exit 1
+EAPI="${e}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+RDEPEND="the/rdepend"
+END
+
+ mkdir -p "cat/eapi${e}both"
+ cat <<END > cat/eapi${e}both/eapi${e}both-1.ebuild || exit 1
+EAPI="${e}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+DEPEND="the/depend"
+RDEPEND="the/rdepend"
+END
+
+done
+
+cd ..
+
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index d6506d8..29b7214 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1343,6 +1343,16 @@ namespace test_cases
TEST_CHECK(id);
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("econf disable dependency tracking", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/econf-disable-dependency-tracking-0",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
+ id->perform_action(action);
+ }
}
} test_e_repository_install_eapi_0;
@@ -1568,6 +1578,138 @@ namespace test_cases
}
} test_e_repository_install_eapi_2;
+ struct ERepositoryInstallEAPI3Test : TestCase
+ {
+ ERepositoryInstallEAPI3Test() : TestCase("install_eapi_3") { }
+
+ unsigned max_run_time() const
+ {
+ return 3000;
+ }
+
+ bool repeatable() const
+ {
+ return false;
+ }
+
+ void run()
+ {
+ TestEnvironment env;
+ env.set_paludis_command("/bin/false");
+ std::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", stringify(FSEntry::cwd() / "e_repository_TEST_dir" / "repo13"));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "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"));
+ std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
+ std::tr1::bind(from_keys, keys, std::tr1::placeholders::_1)));
+ env.package_database()->add_repository(1, repo);
+
+ std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
+ env.package_database()->add_repository(2, installed_repo);
+
+ InstallAction action(make_named_values<InstallActionOptions>(
+ value_for<n::destination>(installed_repo),
+ value_for<n::make_output_manager>(&make_standard_output_manager),
+ value_for<n::perform_uninstall>(&cannot_uninstall),
+ value_for<n::replacing>(make_shared_ptr(new PackageIDSequence)),
+ value_for<n::want_phase>(&want_all_phases)
+ ));
+
+ PretendAction pretend_action(make_named_values<PretendActionOptions>(
+ value_for<n::make_output_manager>(&make_standard_output_manager)
+ ));
+
+ {
+ TestMessageSuffix suffix("pkg_pretend", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/pkg_pretend-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(pretend_action);
+ TEST_CHECK(! pretend_action.failed());
+ }
+
+ {
+ TestMessageSuffix suffix("pkg_pretend-failure", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/pkg_pretend-failure-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(pretend_action);
+ TEST_CHECK(pretend_action.failed());
+ }
+
+ {
+ TestMessageSuffix suffix("default_src_install 3", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/default_src_install-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("docompress 3", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/docompress-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("dodoc -r", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/dodoc-r-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("doins -r symlink", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doins-r-symlink-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("banned functions 3", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/banned-functions-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
+
+ {
+ TestMessageSuffix suffix("econf disable dependency tracking", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/econf-disable-dependency-tracking-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+ }
+ } test_e_repository_install_eapi_3;
+
struct ERepositoryInstallEAPIKdebuild1Test : TestCase
{
ERepositoryInstallEAPIKdebuild1Test() : TestCase("install_eapi_kdebuild_1") { }
diff --git a/paludis/repositories/e/e_repository_TEST_replacing.cc b/paludis/repositories/e/e_repository_TEST_replacing.cc
index 4755321..b20360b 100644
--- a/paludis/repositories/e/e_repository_TEST_replacing.cc
+++ b/paludis/repositories/e/e_repository_TEST_replacing.cc
@@ -83,13 +83,20 @@ namespace
struct ReplacingTest : TestCase
{
+ const std::string eapi;
+ const std::string repo_path;
const std::string test;
const std::string replacing;
+ const std::string replacing_pkg_name;
- ReplacingTest(const std::string & s, const std::string & r) :
- TestCase(s),
+ ReplacingTest(const std::string & e, const std::string & p, const std::string & s, const std::string & r,
+ const std::string & n) :
+ TestCase(e + " " + s),
+ eapi(e),
+ repo_path(p),
test(s),
- replacing(r)
+ replacing(r),
+ replacing_pkg_name(n)
{
}
@@ -110,12 +117,13 @@ namespace
std::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", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "repo1"));
- keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "repo1/profiles/profile"));
+ keys->insert("location", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / repo_path));
+ keys->insert("profiles", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / repo_path
+ / "profiles/profile"));
keys->insert("layout", "exheres");
- keys->insert("eapi_when_unknown", "exheres-0");
- keys->insert("eapi_when_unspecified", "exheres-0");
- keys->insert("profile_eapi", "exheres-0");
+ keys->insert("eapi_when_unknown", eapi);
+ keys->insert("eapi_when_unspecified", eapi);
+ keys->insert("profile_eapi", eapi);
keys->insert("distdir", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "distdir"));
keys->insert("builddir", stringify(FSEntry::cwd() / "e_repository_TEST_replacing_dir" / "build"));
std::tr1::shared_ptr<Repository> repo(ERepository::repository_factory_create(&env,
@@ -123,14 +131,15 @@ namespace
env.package_database()->add_repository(1, repo);
std::tr1::shared_ptr<FakeInstalledRepository> installed_repo(new FakeInstalledRepository(&env, RepositoryName("installed")));
- installed_repo->add_version("cat", "pkg", "1")->set_slot(SlotName("1"));
- installed_repo->add_version("cat", "pkg", "2")->set_slot(SlotName("2"));
- installed_repo->add_version("cat", "pkg", "3")->set_slot(SlotName("3"));
+ installed_repo->add_version("cat", replacing_pkg_name, "1")->set_slot(SlotName("1"));
+ installed_repo->add_version("cat", replacing_pkg_name, "2")->set_slot(SlotName("2"));
+ installed_repo->add_version("cat", replacing_pkg_name, "3")->set_slot(SlotName("3"));
env.package_database()->add_repository(2, installed_repo);
const std::tr1::shared_ptr<const PackageIDSequence> rlist(env[selection::AllVersionsSorted(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec(replacing, &env, UserPackageDepSpecOptions())),
- MatchPackageOptions()))]);
+ MatchPackageOptions()) |
+ filter::SupportsAction<InstalledAction>())]);
InstallAction action(make_named_values<InstallActionOptions>(
value_for<n::destination>(installed_repo),
@@ -142,7 +151,8 @@ namespace
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/" + test,
- &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()) |
+ filter::SupportsAction<InstallAction>())]->last());
TEST_CHECK(id);
id->perform_action(action);
}
@@ -151,8 +161,12 @@ namespace
namespace test_cases
{
- ReplacingTest test_replace_none("replace-none", "cat/none");
- ReplacingTest test_replace_one("replace-one", "=cat/pkg-1");
- ReplacingTest test_replace_many("replace-many", "cat/pkg");
+ ReplacingTest test_exheres_0_replace_none("exheres-0", "repo1", "replace-none", "cat/none", "pkg");
+ ReplacingTest test_exheres_0_replace_one("exheres-0", "repo1", "replace-one", "=cat/pkg-1", "pkg");
+ ReplacingTest test_exheres_0_replace_many("exheres-0", "repo1", "replace-many", "cat/pkg", "pkg");
+
+ ReplacingTest test_3_replace_none("0", "repo2", "replace-none", "cat/none", "replace-none");
+ ReplacingTest test_3_replace_one("0", "repo2", "replace-one", "=cat/replace-one-1", "replace-one");
+ ReplacingTest test_3_replace_many("0", "repo2", "replace-many", "cat/replace-many", "replace-many");
}
diff --git a/paludis/repositories/e/e_repository_TEST_replacing_setup.sh b/paludis/repositories/e/e_repository_TEST_replacing_setup.sh
index 2bd7f3e..f03b411 100755
--- a/paludis/repositories/e/e_repository_TEST_replacing_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_replacing_setup.sh
@@ -27,6 +27,7 @@ cat <<'END' > packages/cat/replace-none/replace-none-1.exheres-0 || exit 1
WORK="${WORKBASE}"
PLATFORMS="test"
FOO=true
+SLOT="0"
pkg_setup() {
[[ -z "${REPLACING_IDS}" ]] || die "REPLACING_IDS is ${REPLACING_IDS}"
@@ -37,6 +38,7 @@ cat <<'END' > packages/cat/replace-one/replace-one-1.exheres-0 || exit 1
WORK="${WORKBASE}"
PLATFORMS="test"
FOO=true
+SLOT="0"
pkg_setup() {
[[ "${REPLACING_IDS}" == "cat/pkg-1:1::installed" ]] || die "REPLACING_IDS is ${REPLACING_IDS}"
@@ -47,6 +49,7 @@ cat <<'END' > packages/cat/replace-many/replace-many-1.exheres-0 || exit 1
WORK="${WORKBASE}"
PLATFORMS="test"
FOO=true
+SLOT="0"
pkg_setup() {
[[ "${REPLACING_IDS}" == \
@@ -55,5 +58,53 @@ pkg_setup() {
}
END
cd ..
+
+mkdir -p repo2/{profiles/profile,metadata,eclass} || exit 1
+cd repo2 || exit 1
+echo "test-repo-1" >> profiles/repo_name || exit 1
+echo "cat" >> metadata/categories.conf || exit 1
+cat <<END > profiles/profile/make.defaults
+CHOST="i286-badger-linux-gnu"
+SUBOPTIONS="LINGUAS"
+LINGUAS="en en_GB en_GB@UTF-8"
+USERLAND="GNU"
+OPTIONS="weasel spinach"
+ARCH="dead-badger"
+KERNEL="linux"
+END
+mkdir -p "packages/cat/replace-none"
+cat <<'END' > packages/cat/replace-none/replace-none-1.ebuild || exit 1
+S="${WORKDIR}"
+KEYWORDS="test"
+SLOT="0"
+EAPI="3"
+
+pkg_setup() {
+ [[ -z "${REPLACING_VERSIONS}" ]] || die "REPLACING_VERSIONS is ${REPLACING_VERSIONS}"
+}
+END
+mkdir -p "packages/cat/replace-one"
+cat <<'END' > packages/cat/replace-one/replace-one-1.ebuild || exit 1
+S="${WORKDIR}"
+KEYWORDS="test"
+SLOT="0"
+EAPI="3"
+
+pkg_setup() {
+ [[ "${REPLACING_VERSIONS}" == "1" ]] || die "REPLACING_VERSIONS is ${REPLACING_VERSIONS}"
+}
+END
+mkdir -p "packages/cat/replace-many"
+cat <<'END' > packages/cat/replace-many/replace-many-1.ebuild || exit 1
+S="${WORKDIR}"
+KEYWORDS="test"
+SLOT="0"
+EAPI="3"
+
+pkg_setup() {
+ [[ "${REPLACING_VERSIONS}" == "1 2 3" ]] || die "REPLACING_VERSIONS is ${REPLACING_VERSIONS}"
+}
+END
+cd ..
cd ..
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 9d58ae0..15c7c27 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -1213,6 +1213,243 @@ pkg_setup() {
[[ $LINGUAS == "enabled_en enabled_en_GB enabled_en_GB@UTF-8" ]] || die "LINGUAS=$LINGUAS is wrong"
}
END
+mkdir -p "cat/pkg_pretend"
+cat <<"END" > cat/pkg_pretend/pkg_pretend-3.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="enabled-weasel broccoli"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+pkg_pretend() {
+ einfo "This is my pkg_pretend. There are many like it, but this one is mine."
+}
+END
+mkdir -p "cat/pkg_pretend-failure"
+cat <<"END" > cat/pkg_pretend-failure/pkg_pretend-failure-3.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="enabled-weasel broccoli"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+pkg_pretend() {
+ die "This is my pkg_pretend. There are many like it, but this one is mine."
+}
+END
+mkdir -p "cat/default_src_install" || exit 1
+cat << 'END' > cat/default_src_install/default_src_install-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cat <<'EOF' >${WORKDIR}/Makefile
+all :
+ echo spork > README
+ echo monkey > README.txt
+ touch README.foo
+ echo gerbil > GERBIL
+
+install :
+ echo spork > $(DESTDIR)/EATME
+EOF
+}
+
+pkg_preinst() {
+ [[ -e ${D}/usr/share/doc/${PF}/README ]] || die README
+ [[ -e ${D}/usr/share/doc/${PF}/README.txt ]] || die README.txt
+ [[ -e ${D}/usr/share/doc/${PF}/README.foo ]] && die README.foo
+ [[ -e ${D}/usr/share/doc/${PF}/GERBIL ]] && die GERBIL
+ [[ -e ${D}/EATME ]] || die EATME
+}
+END
+mkdir -p "cat/docompress" || exit 1
+cat << 'END' > cat/docompress/docompress-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_install() {
+ docompress foo || die
+ docompress bar || die
+}
+END
+mkdir -p "cat/dodoc-r" || exit 1
+cat << 'END' > cat/dodoc-r/dodoc-r-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ mkdir one two three
+ echo foo > one/first
+ echo foo > two/second
+ echo foo > four
+ mkdir dot
+ mkdir dot/five
+ echo foo > dot/five/fifth
+}
+
+src_install() {
+ dodoc -r one two three four
+ cd dot
+ dodoc -r .
+}
+
+pkg_preinst() {
+ [[ -e ${D}/usr/share/doc/${PF}/one/first ]] || die one/first
+ [[ -e ${D}/usr/share/doc/${PF}/two/second ]] || die two/second
+ [[ -e ${D}/usr/share/doc/${PF}/four ]] || die four
+ [[ -e ${D}/usr/share/doc/${PF}/five/fifth ]] || die five/fifth
+}
+END
+mkdir -p "cat/doins-r-symlink" || exit 1
+cat << 'END' > cat/doins-r-symlink/doins-r-symlink-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ echo foo > foo
+ ln -s foo bar
+}
+
+src_install() {
+ insinto /foo
+ doins -r .
+}
+
+pkg_preinst() {
+ [[ -f ${D}/foo/foo ]] || die foo
+ [[ -L ${D}/foo/bar ]] || die bar
+ [[ $(readlink ${D}/foo/bar ) == foo ]] || die sym
+}
+END
+mkdir -p "cat/banned-functions"
+cat <<END > cat/banned-functions/banned-functions-3.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="\${WORKDIR}"
+
+src_install() {
+ touch foo
+ dohard foo bar
+}
+END
+mkdir -p "cat/econf-disable-dependency-tracking" || exit 1
+cat << 'END' > cat/econf-disable-dependency-tracking/econf-disable-dependency-tracking-0.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="0"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ cat <<'EOF' > configure
+#!/bin/sh
+
+if echo "$@" | grep -q 'disable-dependency-tracking' ; then
+ exit 1
+fi
+
+exit 0
+EOF
+
+ chmod +x configure
+}
+END
+cat << 'END' > cat/econf-disable-dependency-tracking/econf-disable-dependency-tracking-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+S="${WORKDIR}"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ cat <<'EOF' > configure
+#!/bin/sh
+
+if ! echo "$@" | grep -q 'disable-dependency-tracking' ; then
+ exit 1
+fi
+
+exit 0
+EOF
+
+ chmod +x configure
+}
+END
cd ..
mkdir -p repo14/{profiles/profile,metadata,eclass} || exit 1
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index d14a7e8..8a78e8a 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -86,7 +86,9 @@ namespace
value_for<n::env_pf>(check_get(k, "env_pf")),
value_for<n::env_portdir>(check_get(k, "env_portdir")),
value_for<n::env_replaced_by_id>(check_get(k, "env_replaced_by_id")),
+ value_for<n::env_replaced_by_version>(check_get(k, "env_replaced_by_version")),
value_for<n::env_replacing_ids>(check_get(k, "env_replacing_ids")),
+ value_for<n::env_replacing_versions>(check_get(k, "env_replacing_versions")),
value_for<n::env_t>(check_get(k, "env_t")),
value_for<n::env_use>(check_get(k, "env_use")),
value_for<n::env_use_expand>(check_get(k, "env_use_expand")),
@@ -161,6 +163,7 @@ namespace
value_for<n::load_modules>(check_get(k, "load_modules")),
value_for<n::must_not_change_after_source_variables>(check_get(k, "must_not_change_after_source_variables")),
value_for<n::must_not_change_variables>(check_get(k, "must_not_change_variables")),
+ value_for<n::no_s_workdir_fallback>(destringify_key<bool>(k, "no_s_workdir_fallback")),
value_for<n::non_empty_variables>(check_get(k, "non_empty_variables")),
value_for<n::rdepend_defaults_to_depend>(destringify_key<bool>(k, "rdepend_defaults_to_depend")),
value_for<n::require_use_expand_in_iuse>(destringify_key<bool>(k, "require_use_expand_in_iuse")),
@@ -207,8 +210,11 @@ namespace
std::tr1::shared_ptr<const EAPIToolsOptions> make_tool_options(const KeyValueConfigFile & k)
{
return make_shared_ptr(new EAPIToolsOptions(make_named_values<EAPIToolsOptions>(
+ value_for<n::dodoc_r>(destringify_key<bool>(k, "dodoc_r")),
+ value_for<n::doins_r_symlink>(destringify_key<bool>(k, "doins_r_symlink")),
value_for<n::doman_lang_filenames>(destringify_key<bool>(k, "doman_lang_filenames")),
value_for<n::dosym_mkdir>(destringify_key<bool>(k, "dosym_mkdir")),
+ value_for<n::econf_extra_options>(k.get("econf_extra_options")),
value_for<n::failure_is_fatal>(destringify_key<bool>(k, "failure_is_fatal")),
value_for<n::unpack_fix_permissions>(destringify_key<bool>(k, "unpack_fix_permissions")),
value_for<n::unpack_suffixes>(k.get("unpack_suffixes")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 4a77e49..d26e979 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -54,6 +54,8 @@ namespace paludis
struct description_use;
struct directory_if_exists_variables;
struct directory_variables;
+ struct dodoc_r;
+ struct doins_r_symlink;
struct doman_lang_filenames;
struct dosym_mkdir;
struct eapi;
@@ -74,6 +76,7 @@ namespace paludis
struct ebuild_uninstall;
struct ebuild_variable;
struct ebuild_new_upgrade_phase_order;
+ struct econf_extra_options;
struct eclass_must_not_set_variables;
struct env_a;
struct env_aa;
@@ -88,7 +91,9 @@ namespace paludis
struct env_pf;
struct env_portdir;
struct env_replaced_by_id;
+ struct env_replaced_by_version;
struct env_replacing_ids;
+ struct env_replacing_versions;
struct env_t;
struct env_use;
struct env_use_expand;
@@ -124,6 +129,7 @@ namespace paludis
struct must_not_change_after_source_variables;
struct must_not_change_variables;
struct name;
+ struct no_s_workdir_fallback;
struct no_slot_or_repo;
struct non_empty_variables;
struct package_dep_spec_parse_options;
@@ -282,7 +288,9 @@ namespace paludis
NamedValue<n::env_pf, std::string> env_pf;
NamedValue<n::env_portdir, std::string> env_portdir;
NamedValue<n::env_replaced_by_id, std::string> env_replaced_by_id;
+ NamedValue<n::env_replaced_by_version, std::string> env_replaced_by_version;
NamedValue<n::env_replacing_ids, std::string> env_replacing_ids;
+ NamedValue<n::env_replacing_versions, std::string> env_replacing_versions;
NamedValue<n::env_t, std::string> env_t;
NamedValue<n::env_use, std::string> env_use;
NamedValue<n::env_use_expand, std::string> env_use_expand;
@@ -344,6 +352,7 @@ namespace paludis
NamedValue<n::load_modules, std::string> load_modules;
NamedValue<n::must_not_change_after_source_variables, std::string> must_not_change_after_source_variables;
NamedValue<n::must_not_change_variables, std::string> must_not_change_variables;
+ NamedValue<n::no_s_workdir_fallback, bool> no_s_workdir_fallback;
NamedValue<n::non_empty_variables, std::string> non_empty_variables;
NamedValue<n::rdepend_defaults_to_depend, bool> rdepend_defaults_to_depend;
NamedValue<n::require_use_expand_in_iuse, bool> require_use_expand_in_iuse;
@@ -378,8 +387,11 @@ namespace paludis
struct EAPIToolsOptions
{
+ NamedValue<n::dodoc_r, bool> dodoc_r;
+ NamedValue<n::doins_r_symlink, bool> doins_r_symlink;
NamedValue<n::doman_lang_filenames, bool> doman_lang_filenames;
NamedValue<n::dosym_mkdir, bool> dosym_mkdir;
+ NamedValue<n::econf_extra_options, std::string> econf_extra_options;
NamedValue<n::failure_is_fatal, bool> failure_is_fatal;
NamedValue<n::unpack_fix_permissions, bool> unpack_fix_permissions;
NamedValue<n::unpack_suffixes, std::string> unpack_suffixes;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index b500917..21c7878 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -254,8 +254,11 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = true
doman_lang_filenames = false
+dodoc_r = false
+doins_r_symlink = false
dosym_mkdir = true
failure_is_fatal = false
+no_s_workdir_fallback = false
unpack_suffixes = tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,jar gz,Z,z bz2 rar,RAR lha,LHa,LHA,lzh a,deb tar.lzma lzma 7z,7Z
diff --git a/paludis/repositories/e/eapis/3.conf b/paludis/repositories/e/eapis/3.conf
new file mode 100644
index 0000000..21276ff
--- /dev/null
+++ b/paludis/repositories/e/eapis/3.conf
@@ -0,0 +1,55 @@
+# Configuration for EAPI 3
+# EAPI 3 is specified in PMS.
+
+source ${PALUDIS_EAPIS_DIR}/2.conf
+exported_name = 3
+can_be_pbin = true
+
+ebuild_functions = ${ebuild_functions} pkg_pretend
+
+ebuild_install = \
+ skipname=killold : killold ; \
+ skipname=init userpriv sandbox : init saveenv ; \
+ skipname=setup skipifno=setup clearenv : loadenv setup saveenv ; \
+ skipname=unpack skipifno=*sources,unpack sandbox userpriv clearenv : loadenv unpack saveenv ; \
+ skipname=prepare skipifno=*sources,unpack,prepare sandbox userpriv clearenv : loadenv prepare saveenv ; \
+ skipname=configure skipifno=*sources,unpack,prepare,configure sandbox userpriv clearenv : loadenv configure saveenv ; \
+ skipname=compile skipifno=*sources,unpack,prepare,configure,compile sandbox userpriv clearenv : loadenv compile saveenv ; \
+ skipname=test skipifno=*sources,unpack,prepare,configure,compile,test sandbox userpriv clearenv optional_tests : loadenv test saveenv ; \
+ skipname=install skipifno=*sources,unpack,prepare,configure,compile,test,install sandbox clearenv : loadenv install saveenv ; \
+ skipname=strip strip : ; \
+ skipname=preinst skipifno=preinst clearenv prepost : loadenv preinst saveenv ; \
+ skipname=merge merge : ; \
+ skipname=postinst skipifno=postinst clearenv prepost : loadenv postinst saveenv ; \
+ skipname=tidyup : tidyup
+
+ebuild_info = \
+ : killold ; \
+ sandbox userpriv : initmisc infovars info ; \
+ : tidyup
+
+env_aa =
+env_kv =
+env_replacing_versions = REPLACING_VERSIONS
+env_replaced_by_version = REPLACED_BY_VERSION
+
+package_dep_spec_parse_options = ${package_dep_spec_parse_options} \
+ allow_slot_equal_deps allow_slot_star_deps allow_use_dep_defaults
+
+ebuild_module_suffixes = 3 2 1 0
+utility_path_suffixes = 3 2 1 0
+
+ebuild_pretend = \
+ skipname=pretend skipifno=pretend sandbox userpriv : pretend
+
+dodoc_r = true
+doins_r_symlink = true
+failure_is_fatal = true
+no_s_workdir_fallback = true
+
+rdepend_defaults_to_depend = false
+
+unpack_suffixes = tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,jar gz,Z,z bz2 rar,RAR lha,LHa,LHA,lzh a,deb tar.lzma lzma 7z,7Z tar.xz xz
+
+econf_extra_options = --disable-dependency-tracking
+
diff --git a/paludis/repositories/e/eapis/Makefile.am b/paludis/repositories/e/eapis/Makefile.am
index c2e84f0..45290f1 100644
--- a/paludis/repositories/e/eapis/Makefile.am
+++ b/paludis/repositories/e/eapis/Makefile.am
@@ -14,11 +14,14 @@ eapis = \
pbin-1+paludis-1.conf \
pbin-1+exheres-0.conf
+future_eapis = \
+ 3.conf
+
eapidir = $(datadir)/paludis/eapis/
eapi_DATA = $(eapis)
-EXTRA_DIST = $(eapis)
+EXTRA_DIST = $(eapis) $(future_eapis)
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 582a79e..4833d1e 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -307,8 +307,11 @@ pipe_commands_no_slot_or_repo = false
unpack_unrecognised_is_fatal = true
unpack_fix_permissions = false
doman_lang_filenames = true
+dodoc_r = false
dosym_mkdir = false
+doins_r_symlink = false
failure_is_fatal = true
+no_s_workdir_fallback = true
unpack_suffixes = tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,jar gz,Z,z bz2 rar,RAR lha,LHa,LHA,lzh a,deb tar.lzma lzma 7z,7Z tar.xz xz
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index ccbfb58..c2a13e1 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -27,6 +27,7 @@ userpriv_cannot_use_root = false
has_optional_tests = false
has_recommended_tests = true
has_slow_tests = false
+no_s_workdir_fallback = false
vdb_from_env_variables = \
CATEGORY CHOST COUNTER DEPEND DESCRIPTION EAPI FEATURES \
@@ -266,7 +267,9 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = false
doman_lang_filenames = true
+dodoc_r = false
dosym_mkdir = false
+doins_r_symlink = false
failure_is_fatal = false
unpack_suffixes = tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,jar gz,Z,z bz2 rar,RAR lha,LHa,LHA,lzh a,deb tar.lzma lzma 7z,7Z tar.xz xz
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 64463c4..64103e7 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -193,14 +193,22 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->ebuild_options()->load_modules())
.with_setenv("PALUDIS_EBUILD_FUNCTIONS",
params.package_id()->eapi()->supported()->ebuild_options()->ebuild_functions())
+ .with_setenv("PALUDIS_NO_S_WORKDIR_FALLBACK",
+ params.package_id()->eapi()->supported()->ebuild_options()->no_s_workdir_fallback() ? "yes" : "")
.with_setenv("PALUDIS_BINARY_DISTDIR_VARIABLE",
params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_distdir())
+ .with_setenv("PALUDIS_ECONF_EXTRA_OPTIONS",
+ params.package_id()->eapi()->supported()->tools_options()->econf_extra_options())
.with_setenv("PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL",
params.package_id()->eapi()->supported()->tools_options()->unpack_unrecognised_is_fatal() ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_FIX_PERMISSIONS",
params.package_id()->eapi()->supported()->tools_options()->unpack_fix_permissions() ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_SUFFIXES",
params.package_id()->eapi()->supported()->tools_options()->unpack_suffixes())
+ .with_setenv("PALUDIS_DODOC_R",
+ params.package_id()->eapi()->supported()->tools_options()->dodoc_r() ? "yes" : "")
+ .with_setenv("PALUDIS_DOINS_R_SYMLINK",
+ params.package_id()->eapi()->supported()->tools_options()->doins_r_symlink() ? "yes" : "")
.with_setenv("PALUDIS_DOMAN_LANG_FILENAMES",
params.package_id()->eapi()->supported()->tools_options()->doman_lang_filenames() ? "yes" : "")
.with_setenv("PALUDIS_DOSYM_NO_MKDIR",
@@ -471,7 +479,20 @@ EbuildMetadataCommand::load(const std::tr1::shared_ptr<const EbuildID> & id)
id->load_build_depend(m.build_depend()->name(), m.build_depend()->description(), get(keys, m.build_depend()->name()), false);
if (! m.run_depend()->name().empty())
- id->load_run_depend(m.run_depend()->name(), m.run_depend()->description(), get(keys, m.run_depend()->name()), false);
+ {
+ if (id->eapi()->supported()->ebuild_options()->rdepend_defaults_to_depend())
+ {
+ if (! get(keys, "PALUDIS_EBUILD_RDEPEND_WAS_SET").empty())
+ id->load_run_depend(m.run_depend()->name(), m.run_depend()->description(),
+ get(keys, m.run_depend()->name()), false);
+ else
+ id->load_run_depend(m.run_depend()->name(), m.run_depend()->description(),
+ get(keys, "PALUDIS_EBUILD_DEPEND") + " " + get(keys, m.run_depend()->name()), false);
+ }
+ else
+ id->load_run_depend(m.run_depend()->name(), m.run_depend()->description(),
+ get(keys, m.run_depend()->name()), false);
+ }
if (! m.pdepend()->name().empty())
id->load_post_depend(m.pdepend()->name(), m.pdepend()->description(), get(keys, m.pdepend()->name()), false);
@@ -744,11 +765,28 @@ EbuildInstallCommand::extend_command(const Command & cmd)
if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_use_expand_hidden().empty())
result.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_use_expand_hidden(),
install_params.use_expand_hidden());
+
if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replacing_ids().empty())
result.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replacing_ids(),
join(indirect_iterator(install_params.replacing_ids()->begin()),
indirect_iterator(install_params.replacing_ids()->end()), " "));
+ if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replacing_versions().empty())
+ {
+ std::string s;
+ for (PackageIDSequence::ConstIterator i(install_params.replacing_ids()->begin()),
+ i_end(install_params.replacing_ids()->end()) ;
+ i != i_end ; ++i)
+ if ((*i)->name() == params.package_id()->name())
+ {
+ if (! s.empty())
+ s.append(" ");
+ s.append(stringify((*i)->version()));
+ }
+
+ result.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replacing_versions(), s);
+ }
+
for (Map<std::string, std::string>::ConstIterator
i(install_params.expand_vars()->begin()),
j(install_params.expand_vars()->end()) ; i != j ; ++i)
@@ -800,6 +838,11 @@ EbuildUninstallCommand::extend_command(const Command & cmd)
result.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replaced_by_id(),
stringify(*uninstall_params.replaced_by()));
+ if (! params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replaced_by_version().empty())
+ if (uninstall_params.replaced_by())
+ result.with_setenv(params.package_id()->eapi()->supported()->ebuild_environment_variables()->env_replaced_by_version(),
+ stringify(uninstall_params.replaced_by()->version()));
+
return result;
}
diff --git a/paludis/repositories/e/ebuild/0/build_functions.bash b/paludis/repositories/e/ebuild/0/build_functions.bash
index 608a432..ac8a177 100644
--- a/paludis/repositories/e/ebuild/0/build_functions.bash
+++ b/paludis/repositories/e/ebuild/0/build_functions.bash
@@ -72,6 +72,7 @@ econf()
--datadir=/usr/share \
--sysconfdir=/etc \
--localstatedir=/var/lib \
+ ${PALUDIS_ECONF_EXTRA_OPTIONS} \
${libcmd} "$@" ${LOCAL_EXTRA_ECONF} 1>&2
${LOCAL_ECONF_WRAPPER} "${ECONF_SOURCE}"/configure \
@@ -82,6 +83,7 @@ econf()
--datadir=/usr/share \
--sysconfdir=/etc \
--localstatedir=/var/lib \
+ ${PALUDIS_ECONF_EXTRA_OPTIONS} \
${libcmd} "$@" ${LOCAL_EXTRA_ECONF} || die "econf failed"
else
diff --git a/paludis/repositories/e/ebuild/0/src_compile.bash b/paludis/repositories/e/ebuild/0/src_compile.bash
index b48a701..4dcf9cd 100644
--- a/paludis/repositories/e/ebuild/0/src_compile.bash
+++ b/paludis/repositories/e/ebuild/0/src_compile.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -32,6 +32,8 @@ ebuild_f_compile()
{
if [[ -d "${S}" ]] ; then
cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -n "${PALUDIS_NO_S_WORKDIR_FALLBACK}" ]] ; then
+ die "\${S} (\"${S}\") does not exist"
elif [[ -d "${WORKDIR}" ]] ; then
cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
fi
diff --git a/paludis/repositories/e/ebuild/0/src_install.bash b/paludis/repositories/e/ebuild/0/src_install.bash
index 1939c50..1844842 100644
--- a/paludis/repositories/e/ebuild/0/src_install.bash
+++ b/paludis/repositories/e/ebuild/0/src_install.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -29,6 +29,8 @@ ebuild_f_install()
{
if [[ -d "${S}" ]] ; then
cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -n "${PALUDIS_NO_S_WORKDIR_FALLBACK}" ]] ; then
+ die "\${S} (\"${S}\") does not exist"
elif [[ -d "${WORKDIR}" ]] ; then
cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
fi
diff --git a/paludis/repositories/e/ebuild/2/src_compile.bash b/paludis/repositories/e/ebuild/2/src_compile.bash
index 21c3881..daa1420 100644
--- a/paludis/repositories/e/ebuild/2/src_compile.bash
+++ b/paludis/repositories/e/ebuild/2/src_compile.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
# Copyright (c) 2008 David Leverton
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
@@ -37,6 +37,8 @@ ebuild_f_compile()
{
if [[ -d "${S}" ]] ; then
cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -n "${PALUDIS_NO_S_WORKDIR_FALLBACK}" ]] ; then
+ die "\${S} (\"${S}\") does not exist"
elif [[ -d "${WORKDIR}" ]] ; then
cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
fi
diff --git a/paludis/repositories/e/ebuild/2/src_configure.bash b/paludis/repositories/e/ebuild/2/src_configure.bash
index e012f80..473f736 100644
--- a/paludis/repositories/e/ebuild/2/src_configure.bash
+++ b/paludis/repositories/e/ebuild/2/src_configure.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
# Copyright (c) 2008 David Leverton
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
@@ -35,6 +35,8 @@ ebuild_f_configure()
{
if [[ -d "${S}" ]] ; then
cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -n "${PALUDIS_NO_S_WORKDIR_FALLBACK}" ]] ; then
+ die "\${S} (\"${S}\") does not exist"
elif [[ -d "${WORKDIR}" ]] ; then
cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
fi
diff --git a/paludis/repositories/e/ebuild/2/src_prepare.bash b/paludis/repositories/e/ebuild/2/src_prepare.bash
index 876d930..886ed5b 100644
--- a/paludis/repositories/e/ebuild/2/src_prepare.bash
+++ b/paludis/repositories/e/ebuild/2/src_prepare.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
# Copyright (c) 2008 David Leverton
#
# Based in part upon ebuild.sh from Portage, which is Copyright 1995-2005
@@ -35,6 +35,8 @@ ebuild_f_prepare()
{
if [[ -d "${S}" ]] ; then
cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -n "${PALUDIS_NO_S_WORKDIR_FALLBACK}" ]] ; then
+ die "\${S} (\"${S}\") does not exist"
elif [[ -d "${WORKDIR}" ]] ; then
cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
fi
diff --git a/paludis/repositories/e/ebuild/3/Makefile.am b/paludis/repositories/e/ebuild/3/Makefile.am
new file mode 100644
index 0000000..4e1a4d0
--- /dev/null
+++ b/paludis/repositories/e/ebuild/3/Makefile.am
@@ -0,0 +1,44 @@
+MAINTAINERCLEANFILES = Makefile.in
+CLEANFILES = *~ *.epicfail
+SUBDIRS = .
+
+libexecprog3dir = $(libexecdir)/paludis/3
+
+libexecprog3_SCRIPTS = \
+ pkg_pretend.bash \
+ src_install.bash \
+ die_functions.bash \
+ output_functions.bash
+
+TESTS_ENVIRONMENT = env \
+ PALUDIS_EBUILD_DIR="$(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_EBUILD_MODULE_SUFFIXES="1 0" \
+ PALUDIS_EAPIS_DIR="$(top_srcdir)/paludis/eapis/" \
+ PALUDIS_DISTRIBUTIONS_DIR="$(top_srcdir)/paludis/distributions/" \
+ PALUDIS_DISTRIBUTION="gentoo" \
+ PALUDIS_OPTIONS="" \
+ PALUDIS_EBUILD_LOG_LEVEL="warning" \
+ PALUDIS_DEFAULT_OUTPUT_CONF="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/environments/paludis/tests_output.conf`" \
+ PALUDIS_OUTPUT_MANAGERS_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_srcdir)/paludis/environments/paludis/output_managers/`" \
+ TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
+ bash $(top_srcdir)/test/run_test.sh $(top_srcdir)/paludis/repositories/e/ebuild/run_test.bash
+
+TESTS =
+check_SCRIPTS = $(TESTS)
+
+EXTRA_DIST = $(libexecprog2_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/3/die_functions.bash b/paludis/repositories/e/ebuild/3/die_functions.bash
new file mode 100644
index 0000000..1bdaac1
--- /dev/null
+++ b/paludis/repositories/e/ebuild/3/die_functions.bash
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2009 Ciaran McCreesh
+#
+# 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
+
+ebuild_load_module --older die_functions
+
+nonfatal()
+{
+ PALUDIS_FAILURE_IS_FATAL= PALUDIS_FAILURE_IS_NONFATAL=yes "${@}"
+}
+
diff --git a/paludis/repositories/e/ebuild/3/output_functions.bash b/paludis/repositories/e/ebuild/3/output_functions.bash
new file mode 100644
index 0000000..dec0f3f
--- /dev/null
+++ b/paludis/repositories/e/ebuild/3/output_functions.bash
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
+#
+# 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
+
+ebuild_notice()
+{
+ [[ -z "${PALUDIS_PIPE_COMMANDS_SUPPORTED}" ]] && return
+ paludis_pipe_command LOG "$EAPI" "$@" >/dev/null
+}
+
+ebuild_section()
+{
+ echo -ne "${COLOUR_PURPLE}>>>${COLOUR_NORMAL} "
+ echo "$@"
+}
+
diff --git a/paludis/repositories/e/ebuild/3/pkg_pretend.bash b/paludis/repositories/e/ebuild/3/pkg_pretend.bash
new file mode 100644
index 0000000..18ab429
--- /dev/null
+++ b/paludis/repositories/e/ebuild/3/pkg_pretend.bash
@@ -0,0 +1,44 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2008 David Leverton
+#
+# 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
+
+default_pkg_pretend()
+{
+ :
+}
+
+pkg_pretend()
+{
+ default_pkg_pretend
+}
+
+ebuild_f_pretend()
+{
+ if hasq "pretend" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping pkg_pretend (SKIP_FUNCTIONS)"
+ else
+ echo
+ pkg_pretend
+ echo
+ fi
+ true
+}
+
diff --git a/paludis/repositories/e/ebuild/3/src_install.bash b/paludis/repositories/e/ebuild/3/src_install.bash
new file mode 100644
index 0000000..d768433
--- /dev/null
+++ b/paludis/repositories/e/ebuild/3/src_install.bash
@@ -0,0 +1,76 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
+#
+# 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
+
+default_src_install()
+{
+ if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]]; then
+ emake DESTDIR="${D}" install
+ fi
+ if ! declare -p DOCS >/dev/null 2>&1 ; then
+ local d
+ for d in README* ChangeLog AUTHORS NEWS TODO CHANGES \
+ THANKS BUGS FAQ CREDITS CHANGELOG ; do
+ [[ -s "${d}" ]] && dodoc "${d}"
+ done
+ elif declare -p DOCS | grep -q ’^declare -a ’ ; then
+ dodoc "${DOCS[@]}"
+ else
+ dodoc ${DOCS}
+ fi
+}
+
+src_install()
+{
+ default_src_install
+}
+
+ebuild_f_install()
+{
+ if [[ -d "${S}" ]] ; then
+ cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+ elif [[ -n "${PALUDIS_NO_S_WORKDIR_FALLBACK}" ]] ; then
+ die "\${S} (\"${S}\") does not exist"
+ elif [[ -d "${WORKDIR}" ]] ; then
+ cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+ fi
+
+ if hasq "install" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping src_install (SKIP_FUNCTIONS)"
+ else
+ if [[ $(type -t pre_src_install ) == "function" ]] ; then
+ ebuild_section "Starting pre_src_install"
+ pre_src_install
+ ebuild_section "Done pre_src_install"
+ fi
+
+ ebuild_section "Starting src_install"
+ src_install
+ ebuild_section "Done src_install"
+
+ if [[ $(type -t post_src_install ) == "function" ]] ; then
+ ebuild_section "Starting post_src_install"
+ post_src_install
+ ebuild_section "Done post_src_install"
+ fi
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/Makefile.am b/paludis/repositories/e/ebuild/Makefile.am
index 4f3ac0c..25543af 100644
--- a/paludis/repositories/e/ebuild/Makefile.am
+++ b/paludis/repositories/e/ebuild/Makefile.am
@@ -1,6 +1,6 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = *~ *.epicfail
-SUBDIRS = . 0 1 2 exheres-0 kdebuild-1 paludis-1 pbin-1 utils
+SUBDIRS = . 0 1 2 3 exheres-0 kdebuild-1 paludis-1 pbin-1 utils
AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 4741aa3..e54e22d 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -52,7 +52,8 @@ EBUILD_METADATA_VARIABLES="DEPEND RDEPEND PDEPEND IUSE SRC_URI DOWNLOADS RESTRIC
MYOPTIONS E_MYOPTIONS E_DEPENDENCIES BINARY_KEYWORDS BINARY_URI \
GENERATED_USING GENERATED_TIME BINARY_PLATFORMS REMOTE_IDS \
SUMMARY BUGS_TO UPSTREAM_DOCUMENTATION UPSTREAM_CHANGELOG \
- UPSTREAM_RELEASE_NOTES PROPERTIES PALUDIS_DECLARED_FUNCTIONS SLOT EAPI OPTIONS USE"
+ UPSTREAM_RELEASE_NOTES PROPERTIES PALUDIS_DECLARED_FUNCTIONS SLOT EAPI OPTIONS USE \
+ PALUDIS_EBUILD_RDEPEND_WAS_SET PALUDIS_EBUILD_DEPEND"
EBUILD_METADATA_VARIABLES_FROM_CPLUSPLUS="SLOT EAPI OPTIONS USE"
if [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] ; then
@@ -97,8 +98,24 @@ declare -r EBUILD_KILL_PID
ebuild_load_module()
{
- local t= d=
+ local older= t= d= save_excl= excl_v=
+ if [[ "${1}" == "--older" ]] ; then
+ shift
+ older=true
+ excl_v="EBUILD_MODULES_DIRS_EXCLUDE_${1}"
+ save_excl="${!excl_v}"
+ fi
+
for d in ${EBUILD_MODULES_DIRS}; do
+ local dx= x=
+ if [[ -n "${older}" ]] ; then
+ for dx in ${!excl_v} ; do
+ [[ "${dx}" == "${d}" ]] && x=true
+ done
+ fi
+ [[ -n "${x}" ]] && continue
+
+ [[ -n "${older}" ]] && export "${excl_v}"="${!excl_v} ${d}"
if [[ -f "${d}/${1}.bash" ]]; then
if ! source "${d}/${1}.bash"; then
type die &>/dev/null && eval die "\"Error loading module \${1}\""
@@ -110,6 +127,9 @@ ebuild_load_module()
t="${t:+${t}, }${d}"
fi
done
+
+ [[ -n "${older}" ]] && export "${excl_v}"="${save_excl}"
+
type die &>/dev/null && eval die "\"Couldn't find module \${1} (looked in \${t})\""
echo "Couldn't find module ${1} (looked in ${t})" 1>&2
exit 123
@@ -306,9 +326,10 @@ ebuild_load_ebuild()
[[ -f ${1} ]] || die "Ebuild '${1}' is not a file"
source ${1} || die "Error sourcing ebuild '${1}'"
- if [[ -n ${PALUDIS_RDEPEND_DEFAULTS_TO_DEPEND} ]] ; then
- [[ ${RDEPEND+set} != set ]] && RDEPEND=${DEPEND}
- fi
+ # we may or may not use this later
+ PALUDIS_EBUILD_RDEPEND_WAS_SET=
+ PALUDIS_EBUILD_DEPEND="${DEPEND}"
+ [[ ${RDEPEND+set} != set ]] || PALUDIS_EBUILD_RDEPEND_WAS_SET=true
for paludis_v in ${PALUDIS_SOURCE_MERGED_VARIABLES} ; do
paludis_e_v=E_${paludis_v}
diff --git a/paludis/repositories/e/ebuild/utils/3/Makefile.am b/paludis/repositories/e/ebuild/utils/3/Makefile.am
new file mode 100644
index 0000000..6bbb79a
--- /dev/null
+++ b/paludis/repositories/e/ebuild/utils/3/Makefile.am
@@ -0,0 +1,46 @@
+MAINTAINERCLEANFILES = Makefile.in
+SUBDIRS = .
+
+libexecprog3dir = $(libexecdir)/paludis/utils/3/
+
+libexecprog3_SCRIPTS = \
+ docompress \
+ dohard \
+ dosed \
+ banned_in_eapi_3
+
+TESTS_ENVIRONMENT = env \
+ 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/`" \
+ TOP_BUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise $(top_builddir)/`" \
+ PALUDIS_EBUILD_LOG_LEVEL="silent" \
+ PALUDIS_DISTRIBUTION="gentoo" \
+ PALUDIS_OPTIONS="" \
+ PALUDIS_NO_CHOWN="yes" \
+ TEST_SCRIPT_DIR="$(srcdir)/" \
+ PALUDIS_TMPDIR="`pwd`/" \
+ bash $(top_srcdir)/paludis/repositories/e/ebuild/utils/run_test.bash
+
+TESTS =
+EXTRA_DIST = $(TESTS)
+
+bannedscripts = dohard dosed
+
+$(bannedscripts) : banned_in_eapi_3
+ cat $? > $@
+ chmod +x $@
+
+CLEANFILES = *~ $(bannedscripts) *.epicfail
+
+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/utils/3/banned_in_eapi_3 b/paludis/repositories/e/ebuild/utils/3/banned_in_eapi_3
new file mode 100644
index 0000000..4d824ad
--- /dev/null
+++ b/paludis/repositories/e/ebuild/utils/3/banned_in_eapi_3
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+COLOUR_RED=$'\e[31;01m'
+COLOUR_NORMAL=$'\e[0m'
+
+echo "${COLOUR_RED}!!! Ebuild bug: '$(basename ${0} )' banned in EAPI 3${COLOUR_NORMAL}"
+echo "$(basename ${0} ): making ebuild PID ${EBUILD_KILL_PID} exit with error" 1>&2
+kill -s SIGUSR1 "${EBUILD_KILL_PID}"
+
+exit 123
+
diff --git a/paludis/repositories/e/ebuild/utils/3/docompress b/paludis/repositories/e/ebuild/utils/3/docompress
new file mode 100755
index 0000000..b7ec0cb
--- /dev/null
+++ b/paludis/repositories/e/ebuild/utils/3/docompress
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2009 Ciaran McCreesh
+#
+# 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 as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# 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
+
+exit 0
+
diff --git a/paludis/repositories/e/ebuild/utils/Makefile.am b/paludis/repositories/e/ebuild/utils/Makefile.am
index c47aab3..2cbaba4 100644
--- a/paludis/repositories/e/ebuild/utils/Makefile.am
+++ b/paludis/repositories/e/ebuild/utils/Makefile.am
@@ -1,5 +1,5 @@
MAINTAINERCLEANFILES = Makefile.in
-SUBDIRS = . exheres-0 kdebuild-1
+SUBDIRS = . 3 exheres-0 kdebuild-1
libexecprogdir = $(libexecdir)/paludis/utils
diff --git a/paludis/repositories/e/ebuild/utils/dodoc b/paludis/repositories/e/ebuild/utils/dodoc
index 00b64de..35d1472 100755
--- a/paludis/repositories/e/ebuild/utils/dodoc
+++ b/paludis/repositories/e/ebuild/utils/dodoc
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006 Stephen Bennett
-# Copyright (c) 2007 Ciaran McCreesh
+# Copyright (c) 2007, 2009 Ciaran McCreesh
#
# Based in part upon dodoc from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -28,6 +28,15 @@ if [[ ! -d ${!PALUDIS_IMAGE_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_IMAGE_DIR_VAR}} not valid; aborting"
fi
+recurse=false
+
+if [[ -n ${PALUDIS_DODOC_R} ]] ; then
+ if [[ $1 == "-r" ]] ; then
+ shift
+ recurse=true
+ fi
+fi
+
if [[ $# -lt 1 ]]; then
paludis_die_or_error "at least one argument needed"
fi
@@ -40,7 +49,13 @@ fi
ret=0
for x in "$@"; do
- if [[ -s "${x}" ]]; then
+ if $recurse && [[ -d "${x}" ]] ; then
+ (
+ export DOCDESTTREE="${DOCDESTTREE}/${x}"
+ cd "${x}"
+ ls * >/dev/null 2>&1 && dodoc -r *
+ )
+ elif [[ -s "${x}" ]]; then
install -m0644 "${x}" "${dir}"
elif [[ ! -e "${x}" ]]; then
echo "${0}: ${x} does not exist" >&2
@@ -50,3 +65,4 @@ done
[[ 0 != "${ret}" ]] && paludis_die_or_error "dodoc returned error ${ret}"
exit ${ret}
+
diff --git a/paludis/repositories/e/ebuild/utils/doins b/paludis/repositories/e/ebuild/utils/doins
index b39c07d..f1fe6b9 100755
--- a/paludis/repositories/e/ebuild/utils/doins
+++ b/paludis/repositories/e/ebuild/utils/doins
@@ -63,8 +63,13 @@ ret=0
for x in "$@"; do
if [[ -L ${x} ]]; then
- cp "${x}" "${!PALUDIS_TEMP_DIR_VAR}"
- mysrc="${!PALUDIS_TEMP_DIR_VAR}/$(basename "${x}")"
+ if [[ -n ${PALUDIS_DOINS_R_SYMLINK} ]] && [[ -n "${DOINSRECUR}" ]] ; then
+ ln -s "$(readlink ${x} )" "${!PALUDIS_IMAGE_DIR_VAR}${INSDESTTREE}/${x}"
+ continue
+ else
+ cp "${x}" "${!PALUDIS_TEMP_DIR_VAR}"
+ mysrc="${!PALUDIS_TEMP_DIR_VAR}/$(basename "${x}")"
+ fi
elif [[ -d ${x} ]]; then
if [[ ${DOINSRECUR} == "n" ]]; then
continue
diff --git a/paludis/repositories/e/ebuild/write_vdb_entry.bash b/paludis/repositories/e/ebuild/write_vdb_entry.bash
index f519420..23f9bb1 100755
--- a/paludis/repositories/e/ebuild/write_vdb_entry.bash
+++ b/paludis/repositories/e/ebuild/write_vdb_entry.bash
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
# vim: set sw=4 sts=4 et :
-# Copyright (c) 2006, 2007, 2008 Ciaran McCreesh
+# Copyright (c) 2006, 2007, 2008, 2009 Ciaran McCreesh
#
# 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
@@ -58,7 +58,24 @@ declare -r EBUILD_KILL_PID
ebuild_load_module()
{
+ local older= t= d= save_excl= excl_v=
+ if [[ "${1}" == "--older" ]] ; then
+ shift
+ older=true
+ excl_v="EBUILD_MODULES_DIRS_EXCLUDE_${1}"
+ save_excl="${!excl_v}"
+ fi
+
for d in ${EBUILD_MODULES_DIRS}; do
+ local dx= x=
+ if [[ -n "${older}" ]] ; then
+ for dx in ${!excl_v} ; do
+ [[ "${dx}" == "${d}" ]] && x=true
+ done
+ fi
+ [[ -n "${x}" ]] && continue
+
+ [[ -n "${older}" ]] && export "${excl_v}"="${!excl_v} ${d}"
if [[ -f "${d}/${1}.bash" ]]; then
if ! source "${d}/${1}.bash"; then
type die &>/dev/null && eval die "\"Error loading module \${1}\""
@@ -66,10 +83,15 @@ ebuild_load_module()
exit 123
fi
return
+ else
+ t="${t:+${t}, }${d}"
fi
done
- type die &>/dev/null && eval die "\"Couldn't find module \${1}\""
- echo "Couldn't find module ${1}" 1>&2
+
+ [[ -n "${older}" ]] && export "${excl_v}"="${save_excl}"
+
+ type die &>/dev/null && eval die "\"Couldn't find module \${1} (looked in \${t})\""
+ echo "Couldn't find module ${1} (looked in ${t})" 1>&2
exit 123
}
diff --git a/paludis/repositories/e/pipe_command_handler.cc b/paludis/repositories/e/pipe_command_handler.cc
index cfb1db0..d51a052 100644
--- a/paludis/repositories/e/pipe_command_handler.cc
+++ b/paludis/repositories/e/pipe_command_handler.cc
@@ -330,8 +330,18 @@ paludis::erepository::pipe_command_handler(const Environment * const environment
(var == eapi->supported()->ebuild_metadata_variables()->pdepend()->name()) ||
(var == eapi->supported()->ebuild_metadata_variables()->dependencies()->name()))
{
- std::tr1::shared_ptr<const DependencySpecTree> before(parse_depend(join(tokens.begin() + 4, tokens.end(), " "),
- environment, package_id, *eapi));
+ /* use the value in the metadata key, since RDEPEND in the
+ * ebuild env isn't modified for DEPEND=RDEPEND */
+ PackageID::MetadataConstIterator m(package_id->find_metadata(var));
+ if (m == package_id->end_metadata())
+ throw InternalError(PALUDIS_HERE, "oops. can't find key '" + var + "'");
+
+ const MetadataSpecTreeKey<DependencySpecTree> * mm(
+ simple_visitor_cast<const MetadataSpecTreeKey<DependencySpecTree> >(**m));
+ if (! mm)
+ throw InternalError(PALUDIS_HERE, "oops. key '" + var + "' isn't a DependencySpecTree key");
+
+ std::tr1::shared_ptr<const DependencySpecTree> before(mm->value());
std::tr1::shared_ptr<const DependencySpecTree> after(fix_locked_dependencies(
environment, *eapi, package_id, before));
StringifyFormatter ff;
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 3fff791..9a03b32 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -418,8 +418,8 @@ namespace test_cases
id->perform_action(uninstall_action);
}
}
- } test_phases_eapi_0("0"), test_phases_eapi_1("1"), test_phases_eapi_exheres_0("exheres-0"),
- test_phases_eapi_kdebuild_1("kdebuild-1");
+ } test_phases_eapi_0("0"), test_phases_eapi_1("1"), test_phases_eapi_2("2"), test_phases_eapi_3("3"),
+ test_phases_eapi_exheres_0("exheres-0"), test_phases_eapi_kdebuild_1("kdebuild-1");
struct VarsTest : TestCase
{
@@ -547,8 +547,8 @@ namespace test_cases
id->perform_action(uninstall_action);
}
}
- } test_vdb_vars_eapi_0("0"), test_vdb_vars_eapi_1("1"), test_vdb_vars_eapi_exheres_0("exheres-0"),
- test_vdb_vars_eapi_kdebuild_1("kdebuild-1");
+ } test_vdb_vars_eapi_0("0"), test_vdb_vars_eapi_1("1"), test_vdb_vars_eapi_2("2"),
+ test_vdb_vars_eapi_exheres_0("exheres-0"), test_vdb_vars_eapi_kdebuild_1("kdebuild-1");
struct NamesCacheIncrementalTest : TestCase
{
diff --git a/paludis/repositories/e/vdb_repository_TEST_setup.sh b/paludis/repositories/e/vdb_repository_TEST_setup.sh
index 868f46c..76ad7ff 100755
--- a/paludis/repositories/e/vdb_repository_TEST_setup.sh
+++ b/paludis/repositories/e/vdb_repository_TEST_setup.sh
@@ -141,6 +141,55 @@ pkg_config() {
}
END
+cat <<'END' > srcrepo/cat/target/target-2.ebuild
+EAPI="2"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+DEPEND="foo/bar"
+
+src_install() {
+ echo MONKEY > ${D}/monkey
+}
+
+pkg_info() {
+ echo "This is pkg_info"
+}
+
+pkg_config() {
+ echo "This is pkg_config"
+}
+END
+
+cat <<'END' > srcrepo/cat/target/target-3.ebuild
+EAPI="3"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+DEPEND="foo/bar"
+S="${WORKDIR}"
+
+src_install() {
+ echo MONKEY > ${D}/monkey
+}
+
+pkg_info() {
+ echo "This is pkg_info"
+}
+
+pkg_config() {
+ echo "This is pkg_config"
+}
+END
+
cat <<'END' > srcrepo/cat/target-exheres/target-exheres-0.ebuild
EAPI="exheres-0"
DESCRIPTION="The Description"
diff --git a/paludis/util/echo_functions.bash.in b/paludis/util/echo_functions.bash.in
index 65ee50a..e45b2b8 100644
--- a/paludis/util/echo_functions.bash.in
+++ b/paludis/util/echo_functions.bash.in
@@ -31,6 +31,7 @@ COLOUR_BLUE=$'\e[34;01m'
COLOUR_PINK=$'\e[35;01m'
COLOUR_CYAN=$'\e[36;01m'
COLOUR_BROWN=$'\e[33m'
+COLOUR_PURPLE=$'\e[35m'
if [[ ${PALUDIS_COLOURS} == pink ]]; then
COLOUR_GOOD=${COLOUR_PINK}