Revert making pushd/popd fatal due to humongous breakage. Add a warning message instead.
authorMichał Górny <mgorny@gentoo.org>
Sun, 27 Nov 2011 09:57:20 +0000 (09:57 +0000)
committerMichał Górny <mgorny@gentoo.org>
Sun, 27 Nov 2011 09:57:20 +0000 (09:57 +0000)
eclass/ChangeLog
eclass/autotools-utils.eclass

index 5c3c3f9f3b22d3bbe7ef8c853a0dbf40550c85f7..718dde05e094a3eb1799d5651e2c87dd46a873e6 100644 (file)
@@ -1,6 +1,10 @@
 # ChangeLog for eclass directory
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.29 2011/11/27 09:17:35 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.30 2011/11/27 09:57:20 mgorny Exp $
+
+  27 Nov 2011; Michał Górny <mgorny@gentoo.org> autotools-utils.eclass:
+  Revert making pushd/popd fatal due to humongous breakage. Add a warning
+  message instead.
 
   27 Nov 2011; Michał Górny <mgorny@gentoo.org> autotools-utils.eclass:
   Denote that autotools-utils must not be mixed with econf/emake.
index 16dabbc1c4c94778e44baa80cd1a974a7c5cac84..0aa1679337e7e0a30cb0a6861e12a2e1482e7e0a 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2011 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.28 2011/11/27 09:17:35 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/autotools-utils.eclass,v 1.29 2011/11/27 09:57:20 mgorny Exp $
 
 # @ECLASS: autotools-utils.eclass
 # @MAINTAINER:
@@ -205,6 +205,15 @@ remove_libtool_files() {
                        rm -f "${f}" || die
                fi
        done
+
+       # check for invalid eclass use
+       # this is the most commonly used function, so do it here
+       _check_build_dir
+       if [[ ! -d "${AUTOTOOLS_BUILD_DIR}" ]]; then
+               eqawarn "autotools-utils used but autotools-utils_src_configure was never called."
+               eqawarn "This is not supported and never was. Please report a bug against"
+               eqawarn "the offending ebuild. This will become a fatal error in a near future."
+       fi
 }
 
 # @FUNCTION: autotools-utils_src_prepare
@@ -250,9 +259,9 @@ autotools-utils_src_configure() {
 
        _check_build_dir
        mkdir -p "${AUTOTOOLS_BUILD_DIR}" || die "mkdir '${AUTOTOOLS_BUILD_DIR}' failed"
-       pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+       pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
        base_src_configure "${econfargs[@]}" "$@"
-       popd > /dev/null || die
+       popd > /dev/null
 }
 
 # @FUNCTION: autotools-utils_src_compile
@@ -262,9 +271,9 @@ autotools-utils_src_compile() {
        debug-print-function ${FUNCNAME} "$@"
 
        _check_build_dir
-       pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+       pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
        base_src_compile "$@"
-       popd > /dev/null || die
+       popd > /dev/null
 }
 
 # @FUNCTION: autotools-utils_src_install
@@ -279,9 +288,9 @@ autotools-utils_src_install() {
        debug-print-function ${FUNCNAME} "$@"
 
        _check_build_dir
-       pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+       pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
        base_src_install "$@"
-       popd > /dev/null || die
+       popd > /dev/null
 
        # Remove libtool files and unnecessary static libs
        remove_libtool_files
@@ -294,8 +303,8 @@ autotools-utils_src_test() {
        debug-print-function ${FUNCNAME} "$@"
 
        _check_build_dir
-       pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null || die
+       pushd "${AUTOTOOLS_BUILD_DIR}" > /dev/null
        # Run default src_test as defined in ebuild.sh
        default_src_test
-       popd > /dev/null || die
+       popd > /dev/null
 }