[paludis-commits] paludis.git (0.30) -- daf2af9 by David Leverton

git at git.pioto.org git at git.pioto.org
Thu Sep 11 16:31:15 EDT 2008


Module:    paludis.git
Branch:    0.30
Commit:    daf2af9612faf0fc391d79148766eda9b53aeae3
URL:       http://git.pioto.org/?p=paludis.git;a=commit;h=daf2af9612faf0fc391d79148766eda9b53aeae3

Author:    David Leverton <levertond at googlemail.com>
Committer: David Leverton <levertond at googlemail.com>
Date:      Thu Sep 11 21:04:02 2008 +0100

----

Remove eapi*_{src,pkg}_* support.

No longer planned for EAPI 2.

----

 paludis/repositories/e/e_repository_TEST.cc        |   40 -------
 paludis/repositories/e/e_repository_TEST_setup.sh  |  118 --------------------
 paludis/repositories/e/ebuild/2/pkg_nofetch.bash   |   38 ++++--
 paludis/repositories/e/ebuild/2/src_compile.bash   |   40 +++++--
 paludis/repositories/e/ebuild/2/src_configure.bash |   17 +---
 paludis/repositories/e/ebuild/2/src_install.bash   |   17 +---
 paludis/repositories/e/ebuild/2/src_prepare.bash   |   17 +---
 paludis/repositories/e/ebuild/2/src_test.bash      |   70 ++++++++++--
 paludis/repositories/e/ebuild/2/src_unpack.bash    |   38 ++++--
 9 files changed, 139 insertions(+), 256 deletions(-)


diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 4d80645..902e78d 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1480,46 +1480,6 @@ namespace test_cases
                 TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
                 id->perform_action(action);
             }
-
-            {
-                TestMessageSuffix suffix("eapi0_src_compile 2", true);
-                const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
-                                PackageDepSpec(parse_user_package_dep_spec("=cat/eapi0_src_compile-2",
-                                        &env, UserPackageDepSpecOptions()))))]->last());
-                TEST_CHECK(id);
-                TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
-                id->perform_action(action);
-            }
-
-            {
-                TestMessageSuffix suffix("eapi0_src_compile with ECONF_SOURCE 2", true);
-                const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
-                                PackageDepSpec(parse_user_package_dep_spec("=cat/eapi0_src_compile-with-econf_source-2",
-                                        &env, UserPackageDepSpecOptions()))))]->last());
-                TEST_CHECK(id);
-                TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
-                id->perform_action(action);
-            }
-
-            {
-                TestMessageSuffix suffix("eapi1_src_compile 2", true);
-                const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
-                                PackageDepSpec(parse_user_package_dep_spec("=cat/eapi1_src_compile-2",
-                                        &env, UserPackageDepSpecOptions()))))]->last());
-                TEST_CHECK(id);
-                TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
-                id->perform_action(action);
-            }
-
-            {
-                TestMessageSuffix suffix("eapi2_src_compile 2", true);
-                const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
-                                PackageDepSpec(parse_user_package_dep_spec("=cat/eapi2_src_compile-2",
-                                        &env, UserPackageDepSpecOptions()))))]->last());
-                TEST_CHECK(id);
-                TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "2");
-                id->perform_action(action);
-            }
         }
     } test_e_repository_install_eapi_2;
 #endif
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 19095a2..7f67c7e 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -1057,124 +1057,6 @@ src_compile() {
     [[ -e foo ]] || die
 }
 END
-mkdir -p "cat/eapi0_src_compile" || exit 1
-cat << END > cat/eapi0_src_compile/eapi0_src_compile-2.ebuild || exit 1
-EAPI="\${PV}"
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-src_unpack() {
-    cat <<EOF >configure
-#! /bin/sh
-echo 'all: ; touch foo' >Makefile
-EOF
-    chmod +x configure
-}
-
-src_configure() {
-    :
-}
-
-src_compile() {
-    eapi0_src_compile
-    [[ -e foo ]] || die
-}
-END
-mkdir -p "cat/eapi0_src_compile-with-econf_source" || exit 1
-cat << END > cat/eapi0_src_compile-with-econf_source/eapi0_src_compile-with-econf_source-2.ebuild || exit 1
-EAPI="\${PV}"
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-src_unpack() {
-    mkdir subdir
-    cat <<EOF >subdir/configure
-#! /bin/sh
-rm Makefile
-EOF
-    chmod +x subdir/configure
-    echo 'all: ; touch foo' >Makefile
-    ECONF_SOURCE=subdir
-}
-
-src_configure() {
-    :
-}
-
-src_compile() {
-    eapi0_src_compile
-    [[ -e foo ]] || die
-}
-END
-mkdir -p "cat/eapi1_src_compile" || exit 1
-cat << END > cat/eapi1_src_compile/eapi1_src_compile-2.ebuild || exit 1
-EAPI="\${PV}"
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-src_unpack() {
-    mkdir subdir
-    cat <<EOF >subdir/configure
-#! /bin/sh
-echo 'all: ; touch foo' >Makefile
-EOF
-    chmod +x subdir/configure
-    ECONF_SOURCE=subdir
-}
-
-src_configure() {
-    :
-}
-
-src_compile() {
-    eapi1_src_compile
-    [[ -e foo ]] || die
-}
-END
-mkdir -p "cat/eapi2_src_compile" || exit 1
-cat << END > cat/eapi2_src_compile/eapi2_src_compile-2.ebuild || exit 1
-EAPI="\${PV}"
-DESCRIPTION="The Description"
-HOMEPAGE="http://example.com/"
-SRC_URI=""
-SLOT="0"
-IUSE="spork"
-LICENSE="GPL-2"
-KEYWORDS="test"
-
-src_unpack() {
-    cat <<EOF >configure
-#! /bin/sh
-rm Makefile
-EOF
-    chmod +x configure
-    echo 'all: ; touch foo' >Makefile
-}
-
-src_configure() {
-    :
-}
-
-src_compile() {
-    eapi2_src_compile
-    [[ -e foo ]] || die
-}
-END
 mkdir -p "cat/econf-source-kdebuild"
 cat <<END > cat/econf-source-kdebuild/econf-source-kdebuild-1.kdebuild-1 || exit 1
 DESCRIPTION="The Description"
diff --git a/paludis/repositories/e/ebuild/2/pkg_nofetch.bash b/paludis/repositories/e/ebuild/2/pkg_nofetch.bash
index 8b53cbf..0479270 100644
--- a/paludis/repositories/e/ebuild/2/pkg_nofetch.bash
+++ b/paludis/repositories/e/ebuild/2/pkg_nofetch.bash
@@ -20,26 +20,38 @@
 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 # Place, Suite 330, Boston, MA  02111-1307  USA
 
-ebuild_load_module 0/pkg_nofetch
-eval "eapi0_$(declare -f pkg_nofetch)"
-
-eapi1_pkg_nofetch()
+default_pkg_nofetch()
 {
-    eapi0_pkg_nofetch
-}
+    [[ -z "${A}" ]] && return
 
-eapi2_pkg_nofetch()
-{
-    eapi0_pkg_nofetch
+    local f g=
+    for f in ${A} ; do
+        [[ -f "${DISTDIR}/${A}" ]] && continue
+        if [[ -z "${g}" ]] ; then
+            echo "The following files could not be fetched automatically for ${PN}:"
+            g=no
+        fi
+        echo "* ${f}"
+    done
 }
 
-default_pkg_nofetch()
+pkg_nofetch()
 {
-    eapi2_pkg_nofetch
+    default_pkg_nofetch
 }
 
-pkg_nofetch()
+ebuild_f_nofetch()
 {
-    default_pkg_nofetch
+    local old_sandbox_write="${SANDBOX_WRITE}"
+    [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${SANDBOX_WRITE+${SANDBOX_WRITE}:}${DISTDIR}"
+    if hasq "nofetch" ${SKIP_FUNCTIONS} ; then
+        ebuild_section "Skipping pkg_nofetch (SKIP_FUNCTIONS)"
+    else
+        ebuild_section "Starting pkg_nofetch"
+        pkg_nofetch
+        ebuild_section "Done pkg_nofetch"
+    fi
+    [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_WRITE="${old_sandbox_write}"
+    true
 }
 
diff --git a/paludis/repositories/e/ebuild/2/src_compile.bash b/paludis/repositories/e/ebuild/2/src_compile.bash
index 5d23504..21c3881 100644
--- a/paludis/repositories/e/ebuild/2/src_compile.bash
+++ b/paludis/repositories/e/ebuild/2/src_compile.bash
@@ -21,26 +21,44 @@
 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 # Place, Suite 330, Boston, MA  02111-1307  USA
 
-ebuild_load_module 0/src_compile
-eval "eapi0_$(declare -f src_compile)"
-
-ebuild_load_module 1/src_compile
-eval "eapi1_$(declare -f src_compile)"
-
-eapi2_src_compile()
+default_src_compile()
 {
     if [[ -f Makefile ]] || [[ -f makefile ]] || [[ -f GNUmakefile ]] ; then
         emake || die "emake failed"
     fi
 }
 
-default_src_compile()
+src_compile()
 {
-    eapi2_src_compile
+    default_src_compile
 }
 
-src_compile()
+ebuild_f_compile()
 {
-    default_src_compile
+    if [[ -d "${S}" ]] ; then
+        cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+    elif [[ -d "${WORKDIR}" ]] ; then
+        cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+    fi
+
+    if hasq "compile" ${SKIP_FUNCTIONS} ; then
+        ebuild_section "Skipping src_compile (SKIP_FUNCTIONS)"
+    else
+        if [[ $(type -t pre_src_compile ) == "function" ]] ; then
+            ebuild_section "Starting pre_src_compile"
+            pre_src_compile
+            ebuild_section "Done pre_src_compile"
+        fi
+
+        ebuild_section "Starting src_compile"
+        src_compile
+        ebuild_section "Done src_compile"
+
+        if [[ $(type -t post_src_compile ) == "function" ]] ; then
+            ebuild_section "Starting post_src_compile"
+            post_src_compile
+            ebuild_section "Done post_src_compile"
+        fi
+    fi
 }
 
diff --git a/paludis/repositories/e/ebuild/2/src_configure.bash b/paludis/repositories/e/ebuild/2/src_configure.bash
index d2ec9ad..e012f80 100644
--- a/paludis/repositories/e/ebuild/2/src_configure.bash
+++ b/paludis/repositories/e/ebuild/2/src_configure.bash
@@ -21,24 +21,9 @@
 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 # Place, Suite 330, Boston, MA  02111-1307  USA
 
-eapi0_src_configure()
-{
-    die "${FUNCNAME} is not supported"
-}
-
-eapi1_src_configure()
-{
-    die "${FUNCNAME} is not supported"
-}
-
-eapi2_src_configure()
-{
-    [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf
-}
-
 default_src_configure()
 {
-    eapi2_src_configure
+    [[ -x ${ECONF_SOURCE:-.}/configure ]] && econf
 }
 
 src_configure()
diff --git a/paludis/repositories/e/ebuild/2/src_install.bash b/paludis/repositories/e/ebuild/2/src_install.bash
index 55d967f..08a2c89 100644
--- a/paludis/repositories/e/ebuild/2/src_install.bash
+++ b/paludis/repositories/e/ebuild/2/src_install.bash
@@ -22,23 +22,8 @@
 
 ebuild_load_module 0/src_install
 
-eapi0_src_install()
-{
-    die "${FUNCNAME} is not supported"
-}
-
-eapi1_src_install()
-{
-    die "${FUNCNAME} is not supported"
-}
-
-eapi2_src_install()
-{
-    die "${FUNCNAME} is not supported"
-}
-
 default_src_install()
 {
-    eapi2_src_install
+    die "${FUNCNAME} is not supported"
 }
 
diff --git a/paludis/repositories/e/ebuild/2/src_prepare.bash b/paludis/repositories/e/ebuild/2/src_prepare.bash
index 8e02299..876d930 100644
--- a/paludis/repositories/e/ebuild/2/src_prepare.bash
+++ b/paludis/repositories/e/ebuild/2/src_prepare.bash
@@ -21,24 +21,9 @@
 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 # Place, Suite 330, Boston, MA  02111-1307  USA
 
-eapi0_src_prepare()
-{
-    die "${FUNCNAME} is not supported"
-}
-
-eapi1_src_prepare()
-{
-    die "${FUNCNAME} is not supported"
-}
-
-eapi2_src_prepare()
-{
-    :
-}
-
 default_src_prepare()
 {
-    eapi2_src_prepare
+    :
 }
 
 src_prepare()
diff --git a/paludis/repositories/e/ebuild/2/src_test.bash b/paludis/repositories/e/ebuild/2/src_test.bash
index 5ca2cba..c5298a1 100644
--- a/paludis/repositories/e/ebuild/2/src_test.bash
+++ b/paludis/repositories/e/ebuild/2/src_test.bash
@@ -20,26 +20,70 @@
 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 # Place, Suite 330, Boston, MA  02111-1307  USA
 
-ebuild_load_module 0/src_test
-eval "eapi0_$(declare -f src_test)"
-
-eapi1_src_test()
+default_src_test()
 {
-    eapi0_src_test
+    if [[ -f Makefile ]] || [[ -f GNUmakefile ]] || [[ -f makefile ]] ; then
+        echo "Makefile found, looking for potential test targets"
+        if make -j1 -n check ; then
+            echo "Found check target"
+            emake -j1 check || die "make check failed"
+        elif make -j1 -n test ; then
+            echo "Found test target"
+            emake -j1 test || die "make test failed"
+        else
+            echo "No check or test target, skipping tests"
+        fi
+    else
+        echo "No Makefile, skipping tests"
+    fi
 }
 
-eapi2_src_test()
+src_test()
 {
-    eapi0_src_test
+    default_src_test
 }
 
-default_src_test()
+ebuild_f_test()
 {
-    eapi2_src_test
-}
+    local old_sandbox_predict="${SANDBOX_PREDICT}"
+    [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_PREDICT="${SANDBOX_PREDICT+${SANDBOX_PREDICT}:}/"
 
-src_test()
-{
-    default_src_test
+    local save_PALUDIS_EXTRA_DIE_MESSAGE="${PALUDIS_EXTRA_DIE_MESSAGE}"
+    export PALUDIS_EXTRA_DIE_MESSAGE="
+!!! This package failed inside the test phase. You should read
+!!!    http://paludis.pioto.org/faq/stricter.html#testfailures
+!!! for more information on packages with test phase failures.
+"
+
+    if [[ -d "${S}" ]] ; then
+        cd "${S}" || die "cd to \${S} (\"${S}\") failed"
+    elif [[ -d "${WORKDIR}" ]] ; then
+        cd "${WORKDIR}" || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
+    fi
+
+    if hasq "test" ${SKIP_FUNCTIONS} ; then
+        ebuild_section "Skipping src_test (SKIP_FUNCTIONS)"
+    else
+        if [[ $(type -t pre_src_test ) == "function" ]] ; then
+            ebuild_section "Starting pre_src_test"
+            pre_src_test
+            ebuild_section "Done pre_src_test"
+        fi
+
+        ebuild_section "Starting src_test"
+        src_test
+        ebuild_section "Done src_test"
+
+        if [[ $(type -t post_src_test ) == "function" ]] ; then
+            ebuild_section "Starting post_src_test"
+            post_src_test
+            ebuild_section "Done post_src_test"
+        fi
+    fi
+
+    export PALUDIS_EXTRA_DIE_MESSAGE="${save_PALUDIS_EXTRA_DIE_MESSAGE}"
+
+    [[ -z "${PALUDIS_DO_NOTHING_SANDBOXY}" ]] && SANDBOX_PREDICT="${old_sandbox_predict}"
+    true
 }
 
diff --git a/paludis/repositories/e/ebuild/2/src_unpack.bash b/paludis/repositories/e/ebuild/2/src_unpack.bash
index 827d7c1..f97c203 100644
--- a/paludis/repositories/e/ebuild/2/src_unpack.bash
+++ b/paludis/repositories/e/ebuild/2/src_unpack.bash
@@ -20,26 +20,38 @@
 # this program; if not, write to the Free Software Foundation, Inc., 59 Temple
 # Place, Suite 330, Boston, MA  02111-1307  USA
 
-ebuild_load_module 0/src_unpack
-eval "eapi0_$(declare -f src_unpack)"
-
-eapi1_src_unpack()
+default_src_unpack()
 {
-    eapi0_src_unpack
+    [[ -n "${A}" ]] && unpack ${A}
 }
 
-eapi2_src_unpack()
+src_unpack()
 {
-    eapi0_src_unpack
+    default_src_unpack
 }
 
-default_src_unpack()
+ebuild_f_unpack()
 {
-    eapi2_src_unpack
-}
+    cd ${WORKDIR} || die "cd to \${WORKDIR} (\"${WORKDIR}\") failed"
 
-src_unpack()
-{
-    default_src_unpack
+    if hasq "unpack" ${SKIP_FUNCTIONS} ; then
+        ebuild_section "Skipping src_unpack (SKIP_FUNCTIONS)"
+    else
+        if [[ $(type -t pre_src_unpack ) == "function" ]] ; then
+            ebuild_section "Starting pre_src_unpack"
+            pre_src_unpack
+            ebuild_section "Done pre_src_unpack"
+        fi
+
+        ebuild_section "Starting src_unpack"
+        src_unpack
+        ebuild_section "Done src_unpack"
+
+        if [[ $(type -t post_src_unpack ) == "function" ]] ; then
+            ebuild_section "Starting post_src_unpack"
+            post_src_unpack
+            ebuild_section "Done post_src_unpack"
+        fi
+    fi
 }
 
---


More information about the paludis-commits mailing list