aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-07 20:40:14 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-11 14:58:01 +0100
commit434e2031c0a72d88185d572fba0bae71ed426256 (patch)
treed6c6778e120dc7bb634a07bc07f04b8787e73146
parent674784b9301e9f2e10d8876098a5604f5602c8ad (diff)
downloadpaludis-434e2031c0a72d88185d572fba0bae71ed426256.tar.gz
paludis-434e2031c0a72d88185d572fba0bae71ed426256.tar.xz
EAPI 3 has fatal, nonfatal
-rw-r--r--paludis/repositories/e/eapis/3.conf1
-rw-r--r--paludis/repositories/e/ebuild/3/Makefile.am1
-rw-r--r--paludis/repositories/e/ebuild/3/die_functions.bash25
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash21
-rwxr-xr-xpaludis/repositories/e/ebuild/write_vdb_entry.bash28
5 files changed, 72 insertions, 4 deletions
diff --git a/paludis/repositories/e/eapis/3.conf b/paludis/repositories/e/eapis/3.conf
index 931263f..47105ed 100644
--- a/paludis/repositories/e/eapis/3.conf
+++ b/paludis/repositories/e/eapis/3.conf
@@ -42,6 +42,7 @@ ebuild_pretend = \
dodoc_r = true
doins_r_symlink = true
+failure_is_fatal = true
rdepend_defaults_to_depend = false
diff --git a/paludis/repositories/e/ebuild/3/Makefile.am b/paludis/repositories/e/ebuild/3/Makefile.am
index 696bf97..4e1a4d0 100644
--- a/paludis/repositories/e/ebuild/3/Makefile.am
+++ b/paludis/repositories/e/ebuild/3/Makefile.am
@@ -7,6 +7,7 @@ libexecprog3dir = $(libexecdir)/paludis/3
libexecprog3_SCRIPTS = \
pkg_pretend.bash \
src_install.bash \
+ die_functions.bash \
output_functions.bash
TESTS_ENVIRONMENT = env \
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/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index 52af55b..e54e22d 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -98,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}\""
@@ -111,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
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
}