drop dead functions
authorBrian Harring <ferringb@gmail.com>
Fri, 14 Sep 2012 04:40:41 +0000 (21:40 -0700)
committerZac Medico <zmedico@gentoo.org>
Fri, 14 Sep 2012 06:55:44 +0000 (23:55 -0700)
Specifically, esyslog, {un,}set_unless_changed, and remove_path_entry.

bin/bashrc-functions.sh
bin/ebuild.sh
bin/isolated-functions.sh
bin/save-ebuild-env.sh

index 4da55858192e73d0417d3d62852e6c1b03acd70b..9fdf999fef0df6476c8cfa383176d1000dbb92c6 100644 (file)
@@ -33,61 +33,6 @@ strip_duplicate_slashes() {
        fi
 }
 
-# this is a function for removing any directory matching a passed in pattern from
-# PATH
-remove_path_entry() {
-       save_IFS
-       IFS=":"
-       stripped_path="${PATH}"
-       while [ -n "$1" ]; do
-               cur_path=""
-               for p in ${stripped_path}; do
-                       if [ "${p/${1}}" == "${p}" ]; then
-                               cur_path="${cur_path}:${p}"
-                       fi
-               done
-               stripped_path="${cur_path#:*}"
-               shift
-       done
-       restore_IFS
-       PATH="${stripped_path}"
-}
-
-# Set given variables unless these variable have been already set (e.g. during emerge
-# invocation) to values different than values set in make.conf.
-set_unless_changed() {
-       if [[ $# -lt 1 ]]; then
-               die "${FUNCNAME}() requires at least 1 argument: VARIABLE=VALUE"
-       fi
-
-       local argument value variable
-       for argument in "$@"; do
-               if [[ ${argument} != *=* ]]; then
-                       die "${FUNCNAME}(): Argument '${argument}' has incorrect syntax"
-               fi
-               variable="${argument%%=*}"
-               value="${argument#*=}"
-               if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-                       eval "${variable}=\"\${value}\""
-               fi
-       done
-}
-
-# Unset given variables unless these variable have been set (e.g. during emerge
-# invocation) to values different than values set in make.conf.
-unset_unless_changed() {
-       if [[ $# -lt 1 ]]; then
-               die "${FUNCNAME}() requires at least 1 argument: VARIABLE"
-       fi
-
-       local variable
-       for variable in "$@"; do
-               if eval "[[ \${${variable}} == \$(env -u ${variable} portageq envvar ${variable}) ]]"; then
-                       unset ${variable}
-               fi
-       done
-}
-
 KV_major() {
        [[ -z $1 ]] && return 1
 
index 51e90d7cc1896dc2f2039ebfc50dc130a7863137..5178a37538473150a88f46ebc8a99d17fb0f530f 100755 (executable)
@@ -23,8 +23,8 @@ else
        for x in diropts docompress exeopts get_KV insopts \
                keepdir KV_major KV_micro KV_minor KV_to_int \
                libopts register_die_hook register_success_hook \
-               remove_path_entry set_unless_changed strip_duplicate_slashes \
-               unset_unless_changed use_with use_enable ; do
+               strip_duplicate_slashes \
+               use_with use_enable ; do
                eval "${x}() {
                        if has \"\${EAPI:-0}\" 4-python; then
                                die \"\${FUNCNAME}() calls are not allowed in global scope\"
@@ -136,12 +136,6 @@ fi
 # the sandbox is disabled by default except when overridden in the relevant stages
 export SANDBOX_ON=0
 
-esyslog() {
-       # Custom version of esyslog() to take care of the "Red Star" bug.
-       # MUST follow functions.sh to override the "" parameter problem.
-       return 0
-}
-
 # Ensure that $PWD is sane whenever possible, to protect against
 # exploitation of insecure search path for python -c in ebuilds.
 # See bug #239560.
index 37e5f2de054a0d7d1d1aee5e4c2cfa99f5d06345..154506e67d85c3058b5b43cce9a3632a52d3893e 100644 (file)
@@ -294,24 +294,6 @@ elog() {
        return 0
 }
 
-esyslog() {
-       local pri=
-       local tag=
-
-       if [ -x /usr/bin/logger ]
-       then
-               pri="$1"
-               tag="$2"
-
-               shift 2
-               [ -z "$*" ] && return 0
-
-               /usr/bin/logger -p "${pri}" -t "${tag}" -- "$*"
-       fi
-
-       return 0
-}
-
 einfo() {
        elog_base INFO "$*"
        [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
index 37438a5d917f31579978ddc62dc95af0c3ec6b2f..6b38e5d9a0f699ae812a6ef36b86f7d90d9b0afd 100644 (file)
@@ -49,7 +49,7 @@ save_ebuild_env() {
        unset -f assert assert_sigpipe_ok \
                dump_trace die \
                quiet_mode vecho elog_base eqawarn elog \
-               esyslog einfo einfon ewarn eerror ebegin _eend eend KV_major \
+               einfo einfon ewarn eerror ebegin _eend eend KV_major \
                KV_minor KV_micro KV_to_int get_KV unset_colors set_colors has \
                has_phase_defined_up_to \
                hasv hasq qa_source qa_call \
@@ -64,9 +64,9 @@ save_ebuild_env() {
                dyn_compile dyn_test dyn_install \
                dyn_preinst dyn_pretend dyn_help debug-print debug-print-function \
                debug-print-section helpers_die inherit EXPORT_FUNCTIONS \
-               nonfatal register_success_hook remove_path_entry \
+               nonfatal register_success_hook \
                save_ebuild_env filter_readonly_variables preprocess_ebuild_env \
-               set_unless_changed unset_unless_changed source_all_bashrcs \
+               source_all_bashrcs \
                ebuild_main ebuild_phase ebuild_phase_with_hooks \
                _ebuild_arg_to_phase _ebuild_phase_funcs default \
                _hasg _hasgq _unpack_tar \