aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-07 17:11:43 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2007-07-07 17:11:43 +0000
commitc56e814eeec40fa78402ccb15ea651d7af70f091 (patch)
treea79cd3b14b89f634cfbb407638d59f5b2871bfac
parent96f6b8b7bad21d59dc41bbfd19c29ecaf6f03d2c (diff)
downloadpaludis-c56e814eeec40fa78402ccb15ea651d7af70f091.tar.gz
paludis-c56e814eeec40fa78402ccb15ea651d7af70f091.tar.xz
use -> option, useq -> optionq etc for exheres
-rw-r--r--configure.ac23
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/Makefile.am4
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/echo_functions.bash.in248
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/list_functions.bash90
4 files changed, 353 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index b33f1a3..64608e2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1203,27 +1203,28 @@ AC_OUTPUT(
paludis/eapis/Makefile
paludis/environments/Makefile
paludis/environments/adapted/Makefile
+ paludis/environments/no_config/Makefile
paludis/environments/paludis/Makefile
paludis/environments/portage/Makefile
- paludis/environments/no_config/Makefile
paludis/environments/test/Makefile
paludis/fetchers/Makefile
paludis/merger/Makefile
paludis/repositories/Makefile
paludis/repositories/cran/Makefile
paludis/repositories/cran/cran/Makefile
- paludis/repositories/fake/Makefile
- paludis/repositories/gems/Makefile
paludis/repositories/e/Makefile
- paludis/repositories/e/ebuild/Makefile
paludis/repositories/e/ebuild/0/Makefile
- paludis/repositories/e/ebuild/exheres-0/Makefile
+ paludis/repositories/e/ebuild/Makefile
paludis/repositories/e/ebuild/digests/Makefile
+ paludis/repositories/e/ebuild/echo_functions.bash
+ paludis/repositories/e/ebuild/exheres-0/Makefile
+ paludis/repositories/e/ebuild/exheres-0/echo_functions.bash
paludis/repositories/e/ebuild/utils/Makefile
paludis/repositories/e/ebuild/utils/exheres-0/Makefile
- paludis/repositories/e/ebuild/echo_functions.bash
paludis/repositories/e/ebuild/work_around_broken_utilities.bash
paludis/repositories/e/qa/Makefile
+ paludis/repositories/fake/Makefile
+ paludis/repositories/gems/Makefile
paludis/repositories/virtuals/Makefile
paludis/selinux/Makefile
paludis/syncers/Makefile
@@ -1234,19 +1235,19 @@ AC_OUTPUT(
ruby/Makefile
ruby/demos/Makefile
src/Makefile
- src/output/Makefile
- src/common_args/Makefile
src/clients/Makefile
+ src/clients/adjutrix/Makefile
src/clients/contrarius/Makefile
src/clients/gtkpaludis/Makefile
+ src/clients/gtkpaludis/libgtkpaludis/Makefile
src/clients/gtkpaludis/vtemm/Makefile
- src/clients/gtkpaludis/vtemm/defs/Makefile
src/clients/gtkpaludis/vtemm/converts/Makefile
- src/clients/gtkpaludis/libgtkpaludis/Makefile
+ src/clients/gtkpaludis/vtemm/defs/Makefile
src/clients/inquisitio/Makefile
src/clients/paludis/Makefile
src/clients/qualudis/Makefile
- src/clients/adjutrix/Makefile
+ src/common_args/Makefile
+ src/output/Makefile
test/Makefile
vim/Makefile
vim/ftdetect/Makefile
diff --git a/paludis/repositories/e/ebuild/exheres-0/Makefile.am b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
index 1798b8b..6450fcf 100644
--- a/paludis/repositories/e/ebuild/exheres-0/Makefile.am
+++ b/paludis/repositories/e/ebuild/exheres-0/Makefile.am
@@ -6,7 +6,9 @@ libexecprogexheresdir = $(libexecdir)/paludis/exheres-0
libexecprogexheres_SCRIPTS = \
builtin_fetch.bash \
- pkg_nofetch.bash
+ pkg_nofetch.bash \
+ list_functions.bash \
+ echo_functions.bash
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="$(top_srcdir)/paludis/repositories/e/ebuild/" \
diff --git a/paludis/repositories/e/ebuild/exheres-0/echo_functions.bash.in b/paludis/repositories/e/ebuild/exheres-0/echo_functions.bash.in
new file mode 100644
index 0000000..995701f
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/echo_functions.bash.in
@@ -0,0 +1,248 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+@GENERATED_FILE@
+
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+#
+# 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
+
+[[ -z ${PALUDIS_COLOURS} ]] && PALUDIS_COLOURS=@COLOURSCHEME@
+
+COLOUR_GREEN=$'\e[32;01m'
+COLOUR_YELLOW=$'\e[33;01m'
+COLOUR_RED=$'\e[31;01m'
+COLOUR_BLUE=$'\e[34;01m'
+COLOUR_PINK=$'\e[35;01m'
+
+if [[ ${PALUDIS_COLOURS} == pink ]]; then
+ COLOUR_GOOD=${COLOUR_PINK}
+ COLOUR_WARN=${COLOUR_YELLOW}
+ COLOUR_BAD=${COLOUR_RED}
+ COLOUR_BRACKET=${COLOUR_PINK}
+else
+ COLOUR_GOOD=${COLOUR_GREEN}
+ COLOUR_WARN=${COLOUR_YELLOW}
+ COLOUR_BAD=${COLOUR_RED}
+ COLOUR_BRACKET=${COLOUR_BLUE}
+fi
+
+COLOUR_NORMAL=$'\e[0m'
+PALUDIS_ENDCOL=$'\e[A\e['$(( ${COLUMNS:-80} - 7 ))'G'
+
+paludis_ecmd()
+{
+ local cmd="$1" hook="$2" prefix="$3" message="$4" newline="$5"
+
+ echo -n "${prefix}${message}"
+ [[ -z "${newline}" ]] && echo
+
+ if type perform_hook &>/dev/null ; then
+ if [[ -n "${hook}" ]] ; then
+ MESSAGE="${message}" perform_hook "${hook}"
+ fi
+ fi
+}
+
+einfon()
+{
+ paludis_ecmd \
+ "einfon" \
+ "einfo" \
+ "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
+ "$*" \
+ "no"
+}
+
+einfo()
+{
+ paludis_ecmd \
+ "einfo" \
+ "einfo" \
+ "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
+ "$*"
+}
+
+einfo_unhooked()
+{
+ paludis_ecmd \
+ "einfo" \
+ "" \
+ "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
+ "$*"
+}
+
+elog()
+{
+ paludis_ecmd \
+ "elog" \
+ "elog" \
+ "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
+ "$*"
+
+ if [[ -n "${PALUDIS_ELOG_FILE}" ]] ; then
+ echo "$@" >> "${PALUDIS_ELOG_FILE}"
+ fi
+}
+
+ewarn()
+{
+ paludis_ecmd \
+ "ewarn" \
+ "ewarn" \
+ "`echo -ne " ${COLOUR_WARN}*${COLOUR_NORMAL} "`" \
+ "$*"
+}
+
+eerror()
+{
+ paludis_ecmd \
+ "eerror" \
+ "eerror" \
+ "`echo -ne " ${COLOUR_BAD}*${COLOUR_NORMAL} "`" \
+ "$*"
+}
+
+ebegin()
+{
+ paludis_ecmd \
+ "ebegin" \
+ "einfo" \
+ "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
+ "$* ..."
+}
+
+ebegin_unhooked()
+{
+ paludis_ecmd \
+ "ebegin" \
+ "" \
+ "`echo -ne " ${COLOUR_GOOD}*${COLOUR_NORMAL} "`" \
+ "$* ..."
+}
+
+_eend()
+{
+ local retval=${1:-0} efunc=${2:-eerror} msg
+ shift 2
+
+ if [[ ${retval} == 0 ]]; then
+ msg="${COLOUR_BRACKET}[ ${COLOUR_GOOD}ok${COLOUR_BRACKET} ]${COLOUR_NORMAL}"
+ else
+ if [[ -n "$*" ]]; then
+ ${efunc} $*
+ fi
+ msg="${COLOUR_BRACKET}[ ${COLOUR_BAD}!!${COLOUR_BRACKET} ]${COLOUR_NORMAL}"
+ fi
+
+ echo -e "${PALUDIS_ENDCOL} ${msg}"
+
+ return ${retval}
+}
+
+eend()
+{
+ local retval=${1:-0}
+ shift
+ _eend ${retval} eerror "$*"
+ return ${retval}
+}
+
+ewend()
+{
+ local retval=${1:-0}
+ shift
+ _eend ${retval} ewarn "$*"
+ return ${retval}
+}
+
+use_with()
+{
+ die "Function 'use_with' banned in this EAPI"
+}
+
+use_enable()
+{
+ die "Function 'use_enable' banned in this EAPI"
+}
+
+option_with()
+{
+ if optionq "${1}" ; then
+ echo "--with-${2:-${1}}${3+=${3}}"
+ else
+ echo "--without-${2:-${1}}"
+ fi
+}
+
+option_enable()
+{
+ if optionq "${1}" ; then
+ echo "--enable-${2:-${1}}${3+=${3}}"
+ else
+ echo "--disable-${2:-${1}}"
+ fi
+}
+
+ebuild_notice_level()
+{
+ case "$1" in
+ debug)
+ echo "1";
+ ;;
+
+ qa)
+ echo "2";
+ ;;
+
+ warning)
+ echo "3";
+ ;;
+
+ silent)
+ echo "4";
+ ;;
+
+ *)
+ echo "[WARNING.EBUILD] Bad value '$1' for qa level" 1>&2
+ echo "2";
+ ;;
+ esac
+}
+
+ebuild_notice()
+{
+ local level="$1"
+ shift
+
+ local level_num=$(ebuild_notice_level "${level}" )
+ local min_level_num=$(ebuild_notice_level "${PALUDIS_EBUILD_LOG_LEVEL}" )
+
+ if [[ "${level_num}" -ge "${min_level_num}" ]] ; then
+ local upper_level=$(echo ${level} | ${ebuild_real_tr:-tr} '[:lower:]' '[:upper:]' )
+ echo -n "${EBUILD_PROGRAM_NAME:-ebuild.bash}@$(${ebuild_real_date:-date} +%s ): " 1>&2
+ echo "[${upper_level}.EBUILD] $* (from ${EBUILD:-?})" 1>&2
+ fi
+ true
+}
+
+ebuild_section()
+{
+ echo ">>> $*"
+}
+
diff --git a/paludis/repositories/e/ebuild/exheres-0/list_functions.bash b/paludis/repositories/e/ebuild/exheres-0/list_functions.bash
new file mode 100644
index 0000000..34bbba8
--- /dev/null
+++ b/paludis/repositories/e/ebuild/exheres-0/list_functions.bash
@@ -0,0 +1,90 @@
+#!/bin/bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2006, 2007 Ciaran McCreesh <ciaranm@ciaranm.org>
+#
+# 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
+
+use()
+{
+ die "Function 'use' banned in this EAPI"
+}
+
+usev()
+{
+ die "Function 'usev' banned in this EAPI"
+}
+
+useq()
+{
+ die "Function 'useq' banned in this EAPI"
+}
+
+option()
+{
+ optionq "${1}"
+}
+
+optionv()
+{
+ if optionq "${1}" ; then
+ echo "${1#!}"
+ return 0
+ else
+ return 1
+ fi
+}
+
+optionq()
+{
+ if ! hasq "${1#!}" "${MYOPTIONS}" ; then
+ die "optionq ${1} called but ${1#!} not in \${MYOPTIONS}=${MYOPTIONS}"
+ fi
+
+ if [[ "${1:0:1}" == "!" ]] ; then
+ ! hasq "${1#!}" "${OPTIONS}"
+ else
+ hasq "${1}" "${OPTIONS}"
+ fi
+}
+
+has()
+{
+ hasq "${@}"
+}
+
+hasv()
+{
+ if hasq "${@}" ; then
+ echo "${1}"
+ return 0
+ else
+ return 1
+ fi
+}
+
+hasq()
+{
+ local x= want="$1"
+ shift
+ for x in $@ ; do
+ [[ "${x}" == "${want}" ]] && return 0
+ done
+ return 1
+}
+