aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-03-05 10:49:08 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2008-03-05 10:49:08 +0000
commita814a9530164c0214a952654a864e0ae516c1f08 (patch)
tree02ab544b8b31f6ec19001666107ef21375532d05
parent14b6afbb966443b3fed7a1370773d3160b4d531b (diff)
downloadpaludis-a814a9530164c0214a952654a864e0ae516c1f08.tar.gz
paludis-a814a9530164c0214a952654a864e0ae516c1f08.tar.xz
Add initmisc, killoldmisc, tidyupmisc too
-rw-r--r--paludis/repositories/e/eapis/0.conf14
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf12
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf12
-rw-r--r--paludis/repositories/e/ebuild/0/builtin_initmisc.bash79
-rw-r--r--paludis/repositories/e/ebuild/0/builtin_killoldmisc.bash47
-rw-r--r--paludis/repositories/e/ebuild/0/builtin_tidyupmisc.bash43
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash5
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_initmisc.bash84
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_killoldmisc.bash51
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/builtin_tidyupmisc.bash48
-rw-r--r--paludis/repositories/e/vdb_repository_TEST.cc92
-rwxr-xr-xpaludis/repositories/e/vdb_repository_TEST_setup.sh158
12 files changed, 613 insertions, 32 deletions
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 884d0cd..68040a2 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -99,20 +99,26 @@ ebuild_uninstall = \
ebuild_pretend =
ebuild_info = \
- sandbox userpriv installed=true : infovars info ; \
- sandbox userpriv installed=false : infovars
+ : killoldmisc ; \
+ sandbox userpriv installed=true : initmisc infovars info ; \
+ sandbox userpriv installed=false : initmisc infovars ; \
+ : tidyupmisc
ebuild_metadata = \
sandbox userpriv noexec : metadata
ebuild_nofetch = \
- sandbox userpriv : nofetch
+ : killoldmisc ; \
+ sandbox userpriv : initmisc nofetch ; \
+ : tidyupmisc
ebuild_variable = \
sandbox userpriv : variable
ebuild_config = \
- sandbox : config
+ : killoldmisc ; \
+ sandbox : initmisc config ; \
+ : tidyupmisc
description_build_depend = Build dependencies
description_description = Description
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 5e1b805..37eb858 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -105,19 +105,25 @@ ebuild_pretend = \
sandbox userpriv : pretend
ebuild_info = \
- sandbox userpriv : infovars
+ : killoldmisc ; \
+ sandbox userpriv : initmisc infovars ; \
+ : tidyupmisc
ebuild_metadata = \
sandbox userpriv noexec : metadata
ebuild_nofetch = \
- sandbox userpriv : nofetch
+ : killoldmisc ; \
+ sandbox userpriv : initmisc nofetch ; \
+ : tidyupmisc
ebuild_variable = \
sandbox userpriv : variable
ebuild_config = \
- sandbox : config
+ : killoldmisc ; \
+ sandbox : initmisc config ; \
+ : tidyupmisc
metadata_build_depend =
metadata_run_depend =
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index d45696b..32bf92f 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -106,19 +106,25 @@ ebuild_pretend = \
sandbox userpriv : pretend
ebuild_info = \
- sandbox userpriv : infovars
+ : killoldmisc ; \
+ sandbox userpriv : initmisc infovars ; \
+ : tidyupmisc
ebuild_metadata = \
sandbox userpriv noexec : metadata
ebuild_nofetch = \
- sandbox userpriv : nofetch
+ : killoldmisc ; \
+ sandbox userpriv : initmisc nofetch ; \
+ : tidyupmisc
ebuild_variable = \
sandbox userpriv : variable
ebuild_config = \
- sandbox : config
+ : killoldmisc ; \
+ sandbox : initmisc config ; \
+ : tidyupmisc
metadata_build_depend = DEPEND
metadata_run_depend = RDEPEND
diff --git a/paludis/repositories/e/ebuild/0/builtin_initmisc.bash b/paludis/repositories/e/ebuild/0/builtin_initmisc.bash
new file mode 100644
index 0000000..a36c55c
--- /dev/null
+++ b/paludis/repositories/e/ebuild/0/builtin_initmisc.bash
@@ -0,0 +1,79 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 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
+
+builtin_initmisc()
+{
+ local a
+ for a in PALUDIS_NON_EMPTY_VARIABLES ${PALUDIS_NON_EMPTY_VARIABLES} ; do
+ [[ -z "${!a}" ]] && die "\$${a} unset or empty"
+ declare -r ${a}="${!a}"
+ done
+
+ for a in ${PALUDIS_DIRECTORY_VARIABLES} ; do
+ [[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
+ done
+
+ for a in ${PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES} ; do
+ [[ -e "${!a}" ]] && [[ ! -d "${!a}" ]] && \
+ die "\$${a} (\"${!a}\") exists but is not a directory"
+ done
+
+ for a in PALUDIS_TMPDIR ; do
+ if ! [[ -d "${!a}" ]] ; then
+ PALUDIS_EXTRA_DIE_MESSAGE="
+!!! '${!a}' should be a directory, but does not exist. For,
+!!! security reasons, Paludis will not try to create this directory
+!!! automatically. Please create it by hand and give it appropriate
+!!! permissions. Typically you should use:
+!!! mkdir ${!a}
+!!! chgrp ${PALUDIS_REDUCED_GID} ${!a}
+!!! chmod g+rwx ${!a}
+!!! chmod +s ${!a}
+!!! although other values may be more appropriate for your system.
+"
+ die "\$${a} (\"${!a}\") not a directory"
+ fi
+ done
+
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" ]] ; then
+ if type -p chflags &>/dev/null; then
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove flags from workdir"
+ fi
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove previous work"
+ fi
+
+ export T="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc/temp/"
+ mkdir -p "${T}" || die "Couldn't create \$T (\"${T}\")"
+ declare -r T="${T}"
+ export HOME="${T}"
+ export TMPDIR="${T}"
+}
+
+ebuild_f_initmisc()
+{
+ if hasq "initmisc" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_initmisc (RESTRICT)"
+ elif hasq "initmisc" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_initmisc (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_initmisc"
+ builtin_initmisc
+ ebuild_section "Done builtin_initmisc"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/0/builtin_killoldmisc.bash b/paludis/repositories/e/ebuild/0/builtin_killoldmisc.bash
new file mode 100644
index 0000000..506772f
--- /dev/null
+++ b/paludis/repositories/e/ebuild/0/builtin_killoldmisc.bash
@@ -0,0 +1,47 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 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
+
+builtin_killoldmisc()
+{
+ local a
+ for a in PF CATEGORY PALUDIS_TMPDIR ; do
+ [[ -z "${!a}" ]] && die "\$${a} unset or empty"
+ done
+
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" ]] ; then
+ if type -p chflags &>/dev/null; then
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove flags from workdir"
+ fi
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove previous work"
+ fi
+}
+
+ebuild_f_killoldmisc()
+{
+ if hasq "killoldmisc" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_killoldmisc (RESTRICT)"
+ elif hasq "killoldmisc" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_killoldmisc (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_killoldmisc"
+ builtin_killoldmisc
+ ebuild_section "Done builtin_killoldmisc"
+ fi
+}
+
+
diff --git a/paludis/repositories/e/ebuild/0/builtin_tidyupmisc.bash b/paludis/repositories/e/ebuild/0/builtin_tidyupmisc.bash
new file mode 100644
index 0000000..8dbc35a
--- /dev/null
+++ b/paludis/repositories/e/ebuild/0/builtin_tidyupmisc.bash
@@ -0,0 +1,43 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2008 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
+
+builtin_tidyupmisc()
+{
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" ]] ; then
+ if type -p chflags &>/dev/null; then
+ echo chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" 1>&2
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove flags from workdir"
+ fi
+ echo rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" 1>&2
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove work"
+ fi
+}
+
+ebuild_f_tidyupmisc()
+{
+ if hasq "tidyupmisc" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_tidyupmisc (RESTRICT)"
+ elif hasq "tidyupmisc" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_tidyupmisc (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_tidyupmisc"
+ builtin_tidyupmisc
+ ebuild_section "Done builtin_tidyupmisc"
+ fi
+}
+
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index c950b72..c4b106f 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -411,8 +411,9 @@ ebuild_main()
for action in $@ ; do
case ${action} in
- metadata|variable|init|initrm|killold|killoldrm|merge|unmerge|tidyup|tidyuprm|\
- strip|loadenv|saveenv|initbin|unpackbin|infovars|pivotbin|installbin)
+ metadata|variable|init|initmisc|initrm|killold|killoldmisc|killoldrm|merge|\
+ unmerge|tidyup|tidyupmisc|tidyuprm|strip|loadenv|saveenv|initbin|\
+ unpackbin|infovars|pivotbin|installbin)
ebuild_load_module builtin_${action}
;;
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_initmisc.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_initmisc.bash
new file mode 100644
index 0000000..11de213
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_initmisc.bash
@@ -0,0 +1,84 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 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
+
+builtin_initmisc()
+{
+ local a
+ for a in PALUDIS_NON_EMPTY_VARIABLES ${PALUDIS_NON_EMPTY_VARIABLES} ; do
+ [[ -z "${!a}" ]] && die "\$${a} unset or empty"
+ declare -r ${a}="${!a}"
+ done
+
+ for a in ${PALUDIS_DIRECTORY_VARIABLES} ; do
+ [[ -d "${!a}" ]] || die "\$${a} (\"${!a}\") not a directory"
+ done
+
+ for a in ${PALUDIS_DIRECTORY_IF_EXISTS_VARIABLES} ; do
+ [[ -e "${!a}" ]] && [[ ! -d "${!a}" ]] && \
+ die "\$${a} (\"${!a}\") exists but is not a directory"
+ done
+
+ for a in PALUDIS_TMPDIR ; do
+ if ! [[ -d "${!a}" ]] ; then
+ PALUDIS_EXTRA_DIE_MESSAGE="
+!!! '${!a}' should be a directory, but does not exist. For,
+!!! security reasons, Paludis will not try to create this directory
+!!! automatically. Please create it by hand and give it appropriate
+!!! permissions. Typically you should use:
+!!! mkdir ${!a}
+!!! chgrp ${PALUDIS_REDUCED_GID} ${!a}
+!!! chmod g+rwx ${!a}
+!!! chmod +s ${!a}
+!!! although other values may be more appropriate for your system.
+"
+ die "\$${a} (\"${!a}\") not a directory"
+ fi
+ done
+
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" ]] ; then
+ if type -p chflags &>/dev/null; then
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove flags from workdir"
+ fi
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove previous work"
+ fi
+
+ export T="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc/temp/"
+ mkdir -p "${T}" || die "Couldn't create \$T (\"${T}\")"
+ declare -r T="${T}"
+ export HOME="${T}"
+ export TMPDIR="${T}"
+}
+
+exheres_internal_initmisc()
+{
+ if hasq "initmisc" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_initmisc (RESTRICT)"
+ elif hasq "initmisc" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_initmisc (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_initmisc"
+ builtin_initmisc
+ ebuild_section "Done builtin_initmisc"
+ fi
+}
+
+ebuild_f_initmisc()
+{
+ exheres_internal_initmisc ""
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_killoldmisc.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_killoldmisc.bash
new file mode 100644
index 0000000..ae898c7
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_killoldmisc.bash
@@ -0,0 +1,51 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007, 2008 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
+
+builtin_killoldmisc()
+{
+ local a
+ for a in PF CATEGORY PALUDIS_TMPDIR ; do
+ [[ -z "${!a}" ]] && die "\$${a} unset or empty"
+ done
+
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" ]] ; then
+ if type -p chflags &>/dev/null; then
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove flags from workdir"
+ fi
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove previous work"
+ fi
+}
+
+exheres_internal_killoldmisc()
+{
+ if hasq "killoldmisc" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_killoldmisc (RESTRICT)"
+ elif hasq "killoldmisc" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_killoldmisc (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_killoldmisc"
+ builtin_killoldmisc
+ ebuild_section "Done builtin_killoldmisc"
+ fi
+}
+
+ebuild_f_killoldmisc()
+{
+ exheres_internal_killoldmisc ""
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/builtin_tidyupmisc.bash b/paludis/repositories/e/ebuild/exheres-0/builtin_tidyupmisc.bash
new file mode 100644
index 0000000..fd66ed0
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/builtin_tidyupmisc.bash
@@ -0,0 +1,48 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2008 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
+
+builtin_tidyupmisc()
+{
+ if [[ -e "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" ]] ; then
+ if type -p chflags &>/dev/null; then
+ echo chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" 1>&2
+ chflags -R 0 "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove flags from workdir"
+ fi
+ echo rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" 1>&2
+ rm -fr "${PALUDIS_TMPDIR}/${CATEGORY}/${PF}-misc" || die "Couldn't remove work"
+ fi
+}
+
+exheres_internal_tidyupmisc()
+{
+ if hasq "tidyupmisc" ${RESTRICT} ; then
+ ebuild_section "Skipping builtin_tidyupmisc (RESTRICT)"
+ elif hasq "tidyupmisc" ${SKIP_FUNCTIONS} ; then
+ ebuild_section "Skipping builtin_tidyupmisc (SKIP_FUNCTIONS)"
+ else
+ ebuild_section "Starting builtin_tidyupmisc"
+ builtin_tidyupmisc
+ ebuild_section "Done builtin_tidyupmisc"
+ fi
+}
+
+ebuild_f_tidyupmisc()
+{
+ exheres_internal_tidyupmisc ""
+}
+
diff --git a/paludis/repositories/e/vdb_repository_TEST.cc b/paludis/repositories/e/vdb_repository_TEST.cc
index 85d50d0..1b963c5 100644
--- a/paludis/repositories/e/vdb_repository_TEST.cc
+++ b/paludis/repositories/e/vdb_repository_TEST.cc
@@ -419,9 +419,15 @@ namespace test_cases
}
} test_vdb_repository_dependencies_rewriter;
- struct InstallReinstallUninstallTest : TestCase
+ struct PhasesTest : TestCase
{
- InstallReinstallUninstallTest() : TestCase("install / reinstall / uninstall") { }
+ const std::string eapi;
+
+ PhasesTest(const std::string & e) :
+ TestCase("phases eapi " + e),
+ eapi(e)
+ {
+ }
unsigned max_run_time() const
{
@@ -443,12 +449,12 @@ namespace test_cases
keys->insert("location", "vdb_repository_TEST_dir/srcrepo");
keys->insert("profiles", "vdb_repository_TEST_dir/srcrepo/profiles/profile");
keys->insert("layout", "traditional");
- keys->insert("eapi_when_unknown", "0");
- keys->insert("eapi_when_unspecified", "0");
+ keys->insert("eapi_when_unknown", eapi);
+ keys->insert("eapi_when_unspecified", eapi);
keys->insert("profile_eapi", "0");
keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", "vdb_repository_TEST_dir/root");
+ keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
tr1::shared_ptr<ERepository> repo(make_ebuild_repository(&env, keys));
env.package_database()->add_repository(1, repo);
@@ -458,7 +464,7 @@ namespace test_cases
keys->insert("provides_cache", "/var/empty");
keys->insert("location", "vdb_repository_TEST_dir/repo3");
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", "vdb_repository_TEST_dir/root");
+ keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
tr1::shared_ptr<Repository> vdb_repo(VDBRepository::make_vdb_repository(&env, keys));
env.package_database()->add_repository(0, vdb_repo);
@@ -473,10 +479,13 @@ namespace test_cases
(k::no_config_protect(), false)
);
+ InfoAction info_action;
+ ConfigAction config_action;
+
{
TestMessageSuffix suffix("install", true);
const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-1::srcrepo",
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
TEST_CHECK(id);
id->perform_action(install_action);
@@ -487,7 +496,7 @@ namespace test_cases
{
TestMessageSuffix suffix("reinstall", true);
const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-1::srcrepo",
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::srcrepo",
UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
TEST_CHECK(id);
id->perform_action(install_action);
@@ -496,19 +505,43 @@ namespace test_cases
vdb_repo->invalidate();
{
+ TestMessageSuffix suffix("info", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ id->perform_action(info_action);
+ }
+
+ {
+ TestMessageSuffix suffix("config", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ id->perform_action(config_action);
+ }
+
+ {
TestMessageSuffix suffix("uninstall", true);
const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/target-1::installed",
+ PackageDepSpec(parse_user_package_dep_spec("=cat/target-" + eapi + "::installed",
UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
TEST_CHECK(id);
id->perform_action(uninstall_action);
}
}
- } test_vdb_install_reinstall_uninstall;
+ } test_phases_eapi_0("0"), test_phases_eapi_1("1"), test_phases_eapi_exheres_0("exheres-0");
struct VarsTest : TestCase
{
- VarsTest() : TestCase("vars") { }
+ const std::string eapi;
+
+ VarsTest(const std::string & e) :
+ TestCase("vars eapi " + e),
+ eapi(e)
+ {
+ }
unsigned max_run_time() const
{
@@ -530,12 +563,12 @@ namespace test_cases
keys->insert("location", "vdb_repository_TEST_dir/srcrepo");
keys->insert("profiles", "vdb_repository_TEST_dir/srcrepo/profiles/profile");
keys->insert("layout", "traditional");
- keys->insert("eapi_when_unknown", "0");
- keys->insert("eapi_when_unspecified", "0");
+ keys->insert("eapi_when_unknown", eapi);
+ keys->insert("eapi_when_unspecified", eapi);
keys->insert("profile_eapi", "0");
keys->insert("distdir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "distdir"));
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", "vdb_repository_TEST_dir/root");
+ keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
tr1::shared_ptr<ERepository> repo(make_ebuild_repository(&env, keys));
env.package_database()->add_repository(1, repo);
@@ -545,7 +578,7 @@ namespace test_cases
keys->insert("provides_cache", "/var/empty");
keys->insert("location", "vdb_repository_TEST_dir/repo3");
keys->insert("builddir", stringify(FSEntry::cwd() / "vdb_repository_TEST_dir" / "build"));
- keys->insert("root", "vdb_repository_TEST_dir/root");
+ keys->insert("root", stringify(FSEntry("vdb_repository_TEST_dir/root").realpath()));
tr1::shared_ptr<Repository> vdb_repo(VDBRepository::make_vdb_repository(&env, keys));
env.package_database()->add_repository(0, vdb_repo);
@@ -560,10 +593,13 @@ namespace test_cases
(k::no_config_protect(), false)
);
+ InfoAction info_action;
+ ConfigAction config_action;
+
{
TestMessageSuffix suffix("vars", true);
const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/vars-1::srcrepo",
+ PackageDepSpec(parse_user_package_dep_spec("=cat/vars-" + eapi + "::srcrepo",
UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
TEST_CHECK(id);
id->perform_action(install_action);
@@ -574,7 +610,7 @@ namespace test_cases
{
TestMessageSuffix suffix("reinstall", true);
const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/vars-1::srcrepo",
+ PackageDepSpec(parse_user_package_dep_spec("=cat/vars-" + eapi + "::srcrepo",
UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
TEST_CHECK(id);
id->perform_action(install_action);
@@ -583,14 +619,32 @@ namespace test_cases
vdb_repo->invalidate();
{
+ TestMessageSuffix suffix("info", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/vars-" + eapi + "::installed",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ id->perform_action(info_action);
+ }
+
+ {
+ TestMessageSuffix suffix("config", true);
+ const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/vars-" + eapi + "::installed",
+ UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
+ TEST_CHECK(id);
+ id->perform_action(config_action);
+ }
+
+ {
TestMessageSuffix suffix("uninstall", true);
const tr1::shared_ptr<const PackageID> id(*env.package_database()->query(query::Matches(
- PackageDepSpec(parse_user_package_dep_spec("=cat/vars-1::installed",
+ PackageDepSpec(parse_user_package_dep_spec("=cat/vars-" + eapi + "::installed",
UserPackageDepSpecOptions()))), qo_require_exactly_one)->last());
TEST_CHECK(id);
id->perform_action(uninstall_action);
}
}
- } test_vdb_vars;
+ } test_vdb_vars_eapi_0("0"), test_vdb_vars_eapi_1("1"), test_vdb_vars_eapi_exheres_0("exheres-0");
}
diff --git a/paludis/repositories/e/vdb_repository_TEST_setup.sh b/paludis/repositories/e/vdb_repository_TEST_setup.sh
index bec42e3..17d99d5 100755
--- a/paludis/repositories/e/vdb_repository_TEST_setup.sh
+++ b/paludis/repositories/e/vdb_repository_TEST_setup.sh
@@ -82,7 +82,7 @@ echo "cat/pkg1 build: cat/pkg2 build,run: cat/pkg3 suggested: cat/pkg4 post: cat
mkdir -p repo3
-mkdir -p srcrepo/{profiles/profile,cat/{target,vars},eclass}
+mkdir -p srcrepo/{profiles/profile,cat/{target,vars}{,-exheres},eclass}
cat <<END > srcrepo/profiles/profile/make.defaults
ARCH=test
USERLAND="GNU"
@@ -91,7 +91,32 @@ CHOST="i286-badger-linux-gnu"
END
echo "srcrepo" > srcrepo/profiles/repo_name || exit 1
+cat <<'END' > srcrepo/cat/target/target-0.ebuild
+EAPI="0"
+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-1.ebuild
+EAPI="1"
DESCRIPTION="The Description"
HOMEPAGE="http://example.com/"
SRC_URI=""
@@ -104,9 +129,84 @@ 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-exheres/target-exheres-0.ebuild
+EAPI="exheres-0"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+MYOPTIONS=""
+LICENSE="GPL-2"
+PLATFORMS="test"
+DEPENDENCIES=""
+
+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/vars/vars-0.ebuild
+EAPI="0"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+DEPEND="foo/bar"
+
+pkg_setup() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+src_compile() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_preinst() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_prerm() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_info() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_config() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
END
cat <<'END' > srcrepo/cat/vars/vars-1.ebuild
+EAPI="1"
DESCRIPTION="The Description"
HOMEPAGE="http://example.com/"
SRC_URI=""
@@ -117,18 +217,74 @@ KEYWORDS="test"
DEPEND="foo/bar"
pkg_setup() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+src_compile() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_preinst() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_prerm() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_info() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_config() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+END
+
+cat <<'END' > srcrepo/cat/vars-exheres/vars-exheres-0.ebuild
+EAPI="exheres-0"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+MYOPTIONS=""
+LICENSE="GPL-2"
+PLATFORMS="test"
+DEPENDENCIES="foo/bar"
+
+pkg_setup() {
+ einfo "${EBUILD_PHASE}: T=${T}"
[[ -d "${T}" ]] || die "T not a dir"
}
src_compile() {
+ einfo "${EBUILD_PHASE}: T=${T}"
[[ -d "${T}" ]] || die "T not a dir"
}
pkg_preinst() {
+ einfo "${EBUILD_PHASE}: T=${T}"
[[ -d "${T}" ]] || die "T not a dir"
}
pkg_prerm() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_info() {
+ einfo "${EBUILD_PHASE}: T=${T}"
+ [[ -d "${T}" ]] || die "T not a dir"
+}
+
+pkg_config() {
+ einfo "${EBUILD_PHASE}: T=${T}"
[[ -d "${T}" ]] || die "T not a dir"
}
END