aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/Makefile.in15
-rwxr-xr-xbin/ebuild-env/ebuild-daemon.lib141
-rwxr-xr-xbin/ebuild-env/ebuild-daemon.sh252
-rwxr-xr-xbin/ebuild-env/ebuild-default-functions.sh1048
-rwxr-xr-xbin/ebuild-env/ebuild-functions.sh345
-rwxr-xr-xbin/ebuild-env/ebuild.sh702
-rw-r--r--bin/ebuild-env/isolated-functions.sh209
-rwxr-xr-xbin/ebuild-helpers/dobin27
-rwxr-xr-xbin/ebuild-helpers/doconfd14
-rwxr-xr-xbin/ebuild-helpers/dodir7
-rwxr-xr-xbin/ebuild-helpers/dodoc26
-rwxr-xr-xbin/ebuild-helpers/doenvd14
-rwxr-xr-xbin/ebuild-helpers/doexe28
-rwxr-xr-xbin/ebuild-helpers/dohard13
-rwxr-xr-xbin/ebuild-helpers/dohtml172
-rwxr-xr-xbin/ebuild-helpers/doinfo21
-rwxr-xr-xbin/ebuild-helpers/doinitd14
-rwxr-xr-xbin/ebuild-helpers/doins55
-rwxr-xr-xbin/ebuild-helpers/dojar54
-rwxr-xr-xbin/ebuild-helpers/dolib41
-rwxr-xr-xbin/ebuild-helpers/dolib.a7
-rwxr-xr-xbin/ebuild-helpers/dolib.so7
-rwxr-xr-xbin/ebuild-helpers/doman54
-rwxr-xr-xbin/ebuild-helpers/domo26
l---------bin/ebuild-helpers/donewins1
-rwxr-xr-xbin/ebuild-helpers/dosbin27
-rwxr-xr-xbin/ebuild-helpers/dosed22
-rwxr-xr-xbin/ebuild-helpers/dosym14
-rwxr-xr-xbin/ebuild-helpers/emake14
-rwxr-xr-xbin/ebuild-helpers/fowners7
-rwxr-xr-xbin/ebuild-helpers/fperms7
-rwxr-xr-xbin/ebuild-helpers/newbin13
-rwxr-xr-xbin/ebuild-helpers/newconfd13
-rwxr-xr-xbin/ebuild-helpers/newdoc13
-rwxr-xr-xbin/ebuild-helpers/newenvd13
-rwxr-xr-xbin/ebuild-helpers/newexe13
-rwxr-xr-xbin/ebuild-helpers/newinitd13
-rwxr-xr-xbin/ebuild-helpers/newins13
-rwxr-xr-xbin/ebuild-helpers/newlib.a13
-rwxr-xr-xbin/ebuild-helpers/newlib.so13
-rwxr-xr-xbin/ebuild-helpers/newman13
-rwxr-xr-xbin/ebuild-helpers/newsbin13
-rwxr-xr-xbin/ebuild-helpers/prepall86
-rwxr-xr-xbin/ebuild-helpers/prepalldocs57
-rwxr-xr-xbin/ebuild-helpers/prepallinfo8
-rwxr-xr-xbin/ebuild-helpers/prepallman9
-rwxr-xr-xbin/ebuild-helpers/prepallstrip10
-rwxr-xr-xbin/ebuild-helpers/prepinfo58
-rwxr-xr-xbin/ebuild-helpers/preplib25
-rwxr-xr-xbin/ebuild-helpers/preplib.so10
-rwxr-xr-xbin/ebuild-helpers/prepman61
-rwxr-xr-xbin/ebuild-helpers/prepstrip48
-rwxr-xr-xbin/etc-update423
-rw-r--r--bin/tests/test_resolver.py119
-rwxr-xr-xbin/utilities/clone_cache.py47
-rwxr-xr-xbin/utilities/hotshot-profile.py34
-rwxr-xr-xbin/utilities/pebuild.py14
-rwxr-xr-xbin/utilities/powner.py41
-rwxr-xr-xbin/utilities/pquery105
-rwxr-xr-xbin/utilities/regen.py81
-rwxr-xr-xbin/utilities/register_plugin.py79
61 files changed, 0 insertions, 4842 deletions
diff --git a/bin/Makefile.in b/bin/Makefile.in
deleted file mode 100755
index f98bae3c..00000000
--- a/bin/Makefile.in
+++ /dev/null
@@ -1,15 +0,0 @@
-PORTAGE_BASEDIR = @PORTAGE_BASE@
-INSTALL = @INSTALL@
-INSTALL_script = @INSTALL_PROGRAM@ -D -o 0 -g portage -m 755
-
-all:
-install:
- $(INSTALL) -d -m 755 -o 0-g portage $(DESTDIR)/$(PORTAGE_BASEDIR)/bin || exit 1
- find . -type f -maxdepth 1 -exec $(INSTALL_script) {} $(DESTDIR)/$(PORTAGE_BASEDIR)/bin/{} \; || exit 1
- rm $(DESTDIR)/$(PORTAGE_BASEDIR)/bin/Makefile* || exit 1
-
-distdir:
- find . -type f -maxdepth 1 -exec $(INSTALL_script) {} $(distdir)/{} \;
-clean:
-
-.PHONY: distdir install clean
diff --git a/bin/ebuild-env/ebuild-daemon.lib b/bin/ebuild-env/ebuild-daemon.lib
deleted file mode 100755
index a9da8022..00000000
--- a/bin/ebuild-env/ebuild-daemon.lib
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/bin/bash
-# ebuild-daemon.lib; daemon lib code.
-# Copyright 2005-2006 Brian Harring <ferringb@gmail.com>
-
-alias die='diefunc "$FUNCNAME" "$LINENO" "$?"'
-#alias listen='read -u 3 -t 10'
-alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ "${_pipestatus// /}" -eq 0 ]] || diefunc "$FUNCNAME" "$LINENO" "$_pipestatus"'
-
-
-# portageq hijack- redirects all requests back through the pipes and has the python side execute it.
-# much faster, also avoids the gpg/sandbox being active issues.
-portageq() {
- local line e alive
- if [ "${EBUILD_PHASE}" == "depend" ]; then
- echo "QA Notice: portageq() in global scope for ${CATEGORY}/${PF}" >&2
- fi
- speak "portageq $*"
- listen line
- declare -i e
- e=$(( ${line/return_code=} + 0 ))
- alive=1
- while [ $alive == 1 ]; do
- listen line
- if [ "$line" == "stop_text" ]; then
- alive=0
- else
- echo "portageq: $line"
- fi
- done
- return $e
-}
-
-# ask the python side to display sandbox complaints.
-request_sandbox_summary() {
- local line
- speak "request_sandbox_summary ${SANDBOX_LOG}"
- listen line
- while [ "$line" != "end_sandbox_summary" ]; do
- echo "$line"
- listen line
- done
-}
-
-# request the global confcache be transferred to $1 for usage.
-# flips the sandbox vars as needed.
-request_confcache() {
- if ! hasq confcache $FEATURES || ! hasq sandbox $FEATURES || hasq confcache $RESTRICT; then
- return 1
- fi
- local line
- speak "request_confcache $1"
- listen line s
- while [ "${line#request}" != "${line}" ]; do
- # var requests for updating the cache's ac_cv_env
- # send set, then val
- line="$(echo ${line#request})"
- if [ "${!line:+set}" == "set" ]; then
- speak set
- speak "${!line}"
- else
- speak unset
- fi
- listen line
- done
- if [ "${line:0:9}" == "location:" ]; then
- cp -v "${line:10}" $1
- elif [ "${line}" == "empty" ]; then
- echo ">>> Confcache is empty, starting anew"
- fi
- if hasq "${line/: *}" location empty; then
- echo ">>> Temporary configure cache file is $1"
- export PORTAGE_CONFCACHE_STATE=1
- export SANDBOX_DEBUG_LOG="${T}/debug_log"
- export SANDBOX_DEBUG=1
- return 0
- fi
- return 1
-}
-
-# notify python side configure calls are finished.
-update_confcache() {
- local line
- if [ "$PORTAGE_CONFCACHE_STATE" != "1" ]; then
- return 0
- fi
- unset SANDBOX_DEBUG
- unset PORTAGE_CONFCACHE_STATE
- if ! hasq sandbox $FEATURES; then
- echo "not updating confcache, sandbox isn't set in features" >&2
- return 1
- fi
- speak "update_confcache $SANDBOX_DEBUG_LOG $1"
- unset SANDBOX_DEBUG_LOG
- listen line
- if [ "$line" == "updated" ]; then
- return 0
- fi
- return 1
-}
-
-internal_inherit() {
- local line
- if [ "$#" != "1" ]; then
- die "internal_inherit accepts one arg, requested eclass location. $* is a bit much"
- fi
- speak "request_inherit $1"
- listen line
- if [ "$line" == "path" ]; then
- listen line;
- source "${line}" || die "failed sources inherit: ${line}"
- elif [ "$line" == "transfer" ]; then
- listen line;
- eval "$line" || die "failed evaluating eclass $x on an inherit transfer"
- else
- speak "failed"
- die "unknown inherit command from pythonic side, '$line' for eclass $x"
- fi
-}
-
-source_profiles() {
- local line
- speak request_profiles
- listen line
- while [ "$line" != end_request ]; do
- if [ "$line" == "path" ]; then
- listen line;
- source "${line}" || die "failed sourcing profile bashrc: ${line}"
- elif [ "$line" == "transfer" ]; then
- listen line;
- eval "$line" || die "failed evaluating profile bashrc: ${line}"
- else
- speak "failed"
- die "unknown profile bashrc transfer mode from pythonic side, '$line'"
- fi
- speak "next"
- listen line
- done
-}
-DONT_EXPORT_FUNCS="${DONT_EXPORT_FUNCS} $(declare -F | cut -s -d ' ' -f 3)"
-
-:
diff --git a/bin/ebuild-env/ebuild-daemon.sh b/bin/ebuild-env/ebuild-daemon.sh
deleted file mode 100755
index a982a068..00000000
--- a/bin/ebuild-env/ebuild-daemon.sh
+++ /dev/null
@@ -1,252 +0,0 @@
-#!/bin/bash
-# ebuild-daemon.sh; core ebuild processor handling code
-# Copyright 2004-2006 Brian Harring <ferringb@gmail.com>
-
-alias die='diefunc "$FUNCNAME" "$LINENO" "$?"'
-#alias listen='read -u 3 -t 10'
-alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ "${_pipestatus// /}" -eq 0 ]] || diefunc "$FUNCNAME" "$LINENO" "$_pipestatus"'
-
-# use listen/speak for talking to the running portage instance instead of echo'ing to the fd yourself.
-# this allows us to move the open fd's w/out issues down the line.
-listen() {
- if ! read -u ${EBD_READ_FD} $1; then
- echo "coms error, read failed: backing out of daemon."
- exit 1
- fi
-}
-
-speak() {
- echo "$*" >&${EBD_WRITE_FD}
-}
-declare -rf speak
-declare -r EBD_WRITE_FD EBD_READ_FD
-# ensure the other side is still there. Well, this moreso is for the python side to ensure
-# loading up the intermediate funcs succeeded.
-listen com
-if [ "$com" != "dude?" ]; then
- echo "serv init coms failed, received $com when expecting 'dude?'"
- exit 1
-fi
-speak "dude!"
-listen PORTAGE_BIN_PATH
-[ -z "$PORTAGE_BIN_PATH" ] && die "PORTAGE_BIN_PATH=$PORTAGE_BIN_PATH , bailing"
-declare -rx PORTAGE_BIN_PATH
-
-if ! source "${PORTAGE_BIN_PATH}/ebuild.sh" daemonize; then
- speak "failed"
- die "failed sourcing ${PORTAGE_BIN_PATH}/ebuild.sh"
-fi
-
-if [ ! -z "$SANDBOX_LOG" ]; then
- listen com
- if [ "$com" != "sandbox_log?" ]; then
- echo "unknown com '$com'"
- exit 1
- fi
- speak "$SANDBOX_LOG"
- declare -rx SANDBOX_LOG="$SANDBOX_LOG" # #="/tmp/sandbox-${P}-${PORTAGE_SANDBOX_PID}.log"
- addwrite $SANDBOX_LOG
-fi
-
-alive='1'
-re="$(readonly | cut -s -d '=' -f 1 | cut -s -d ' ' -f 3)"
-for x in $re; do
- if ! hasq $x "$DONT_EXPORT_VARS"; then
- DONT_EXPORT_VARS="${DONT_EXPORT_VARS} $x"
- fi
-done
-speak $re
-unset x re
-
-
-if ! source "${PORTAGE_BIN_PATH}/ebuild-daemon.lib"; then
- speak failed
- die "failed source ${PORTAGE_BIN_PATH}/ebuild-daemon.lib"
-fi
-
-DONT_EXPORT_FUNCS="$(declare -F | cut -s -d ' ' -f 3)"
-DONT_EXPORT_VARS="${DONT_EXPORT_VARS} alive com PORTAGE_LOGFILE cont"
-
-# depend's speed up. turn on qa interceptors by default, instead of flipping them on for each depends
-# call.
-export QA_CONTROLLED_EXTERNALLY="yes"
-enable_qa_interceptors
-
-if ! source "${PORTAGE_BIN_PATH}/ebuild-functions.sh"; then
- speak failed
- die "failed sourcing ${PORTAGE_LIB}/ebuild-functions.sh"
-fi
-
-export PORTAGE_PRELOADED_ECLASSES=''
-unset_colors
-
-
-# XXX this sucks even more then the rest, we're talking loss of chrome on a trailer hitch type suck.
-#PATH='/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:${PORTAGE_BIN_PATH}'
-while [ "$alive" == "1" ]; do
- com=''
- listen com
- case $com in
- process_ebuild*)
- # cleanse whitespace.
- phases="$(echo ${com#process_ebuild})"
- PORTAGE_SANDBOX_PID="$PPID"
- # note the (; forks. prevents the initialized ebd env from being polluted by ebuild calls.
- (
- if [ "${phases/depend/}" == "$phases" ]; then
- disable_qa_interceptors
- fi
- line=''
- cont=0
-
- while [ "$cont" == 0 ]; do
- line=''
- listen line
- if [ "$line" == "start_receiving_env" ]; then
- while listen line && [ "$line" != "end_receiving_env" ]; do #[ "$line" != "end_receiving_env" ]; do
-# if [[ "${line/SUDO_COMMAND}" != "${line}" ]] &&
-# [[ "${line/export}" == "${line}" ]]; then
-# on=1
-# echo "received $line" >&2
-# fi
- save_IFS
- IFS=$'\0'
- eval ${line};
- val=$?;
- restore_IFS
- if [ $val != "0" ]; then
- echo "err, env receiving threw an error for '$line': $?" >&2
-# echo "env_receiving_failed" >&2
- speak "env_receiving_failed"
- cont=1
- break
- fi
- if [ "${on:-unset}" != "unset" ]; then
- echo "sudo = ${SUDO_COMMAND}" >&2
- declare | grep -i sudo_command >&@
- echo "disabling" >&2
- unset on
- fi
- done
- if [ "$cont" == "0" ]; then
- speak "env_received"
- fi
- elif [ "${line:0:7}" == "logging" ]; then
- PORTAGE_LOGFILE="$(echo ${line#logging})"
-# echo "logging to $logfile" >&2
- speak "logging_ack"
- elif [ "${line:0:17}" == "set_sandbox_state" ]; then
- if [ $((${line:18})) -eq 0 ]; then
- export SANDBOX_DISABLED=1
-# echo "disabling sandbox due to '$line'" >&2
- else
- export SANDBOX_DISABLED=0
- export SANDBOX_VERBOSE="no"
-# echo "enabling sandbox" >&2
- fi
- elif [ "${line}" == "start_processing" ]; then
- cont=2
- else
- echo "received unknown com: $line" >&2
- fi
- done
- if [ "$cont" != 2 ]; then
- exit $cont
- else
- reset_sandbox
- if [ -n "$SANDBOX_LOG" ]; then
- addwrite $SANDBOX_LOG
- if [ -n "$PORTAGE_LOGFILE" ]; then
- addwrite "$PORTAGE_LOGFILE"
- fi
- fi
- if [ -z $RC_NOCOLOR ]; then
- set_colors
- fi
- if ! type -p filter-env &> /dev/null; then
- echo "couldn't find filter-env in $PATH" >&2
- die "can't find filter-env!"
- fi
-# speak "starting ${phases}"
-
- DONT_EXPORT_FUNCS="${DONT_EXPORT_FUNCS} ${PORTAGE_PRELOADED_ECLASSES}"
- for x in $DONT_EXPORT_FUNCS; do
- declare -fr $x &> /dev/null
- done
- for e in $phases; do
- if [ -z $PORTAGE_LOGFILE ]; then
- execute_phases ${e}
- ret=$?
- else
- # why do it this way rather then the old '[ -f ${T}/.succesfull }'?
- # simple. this allows the actual exit code to be used, rather then just stating no .success == 1 || 0
- # note this was
- # execute_phases ${e] &> >(umask 0002; tee -i -a $PORTAGE_LOGFILE)
- # less then bash v3 however hates it. And I hate less then v3.
- # circle of hate you see.
- execute_phases ${e} 2>&1 | {
- umask 0002
- tee -i -a $PORTAGE_LOGFILE
- }
- ret=${PIPESTATUS[0]}
- fi
- # if sandbox log exists, then there were complaints from it.
- # tell python to display the errors, then dump relevant vars for debugging.
- if [ -n "$SANDBOX_LOG" ] && [ -e "$SANDBOX_LOG" ]; then
- ret=1
- echo "sandbox exists- $SANDBOX_LOG"
- request_sandbox_summary
- echo "SANDBOX_ON:=${SANDBOX_ON:-unset}" >&2
- echo "SANDBOX_DISABLED:=${SANDBOX_DISABLED:-unset}" >&2
- echo "SANDBOX_READ:=${SANDBOX_READ:-unset}" >&2
- echo "SANDBOX_WRITE:=${SANDBOX_WRITE:-unset}" >&2
- echo "SANDBOX_PREDICT:=${SANDBOX_PREDICT:-unset}" >&2
- echo "SANDBOX_DEBUG:=${SANDBOX_DEBUG:-unset}" >&2
- echo "SANDBOX_DEBUG_LOG:=${SANDBOX_DEBUG_LOG:-unset}" >&2
- echo "SANDBOX_LOG:=${SANDBOX_LOG:-unset}" >&2
- echo "SANDBOX_ARMED:=${SANDBOX_ARMED:-unset}" >&2
- fi
- if [ "$ret" != "0" ]; then
- exit $(($ret))
- fi
- done
- fi
- )
- # post fork. tell python if it succeeded or not.
- if [ $? != 0 ]; then
- echo "phases failed"
- speak "phases failed"
- else
- speak "phases succeeded"
- fi
- ;;
- shutdown_daemon)
- alive="0"
- ;;
- preload_eclass*)
- echo "preloading eclasses into funcs." >&2
- disable_qa_interceptors
- success="succeeded"
- com="${com#preload_eclass }"
- for e in ${com}; do
- x="${e##*/}"
- x="${x%.eclass}"
- echo "preloading eclass $x" >&2
- if ! bash -n "$e"; then
- echo "errors detected in '$e'" >&2
- success='failed'
- break
- fi
- y="$( < $e)"
- eval "eclass_${x}_inherit() {
- $y
- }"
- done
- speak "preload_eclass ${success}"
- unset e x y success
- enable_qa_interceptors
- export PORTAGE_PRELOADED_ECLASSES="$PORTAGE_PRELOADED_ECLASSES ${com}"
- ;;
- esac
-done
-exit 0
diff --git a/bin/ebuild-env/ebuild-default-functions.sh b/bin/ebuild-env/ebuild-default-functions.sh
deleted file mode 100755
index 5311c9f8..00000000
--- a/bin/ebuild-env/ebuild-default-functions.sh
+++ /dev/null
@@ -1,1048 +0,0 @@
-#!/bin/bash
-# ebuild-default-functions.sh; default functions for ebuild env that aren't saved- specific to the portage instance.
-# Copyright 2005-2006 Brian Harring <ferringb@gmail.com>
-# Copyright 2004-2006 Gentoo Foundation
-
-has_version()
-{
- # if there is a predefined portageq call, use it.
- # why? Because if we're being called from an ebuild daemon/processor, it can hijack the call, and access the
- # running portage instance already, saving at least .5s in load up of portageq.
- # time emerge -s mod_php w/out the hijack == 23s
- # time emerge -s mod_php w/ the hijack == < 6s
- local -i e
- [ "${EBUILD_PHASE}" == "depend" ] && echo "QA Notice: has_version() in global scope: ${CATEGORY}/$PF" >&2
- # return shell-true/shell-false if exists.
- # Takes single depend-type atoms.
-
- # XXX: harring; portageq should be in path if there isn't a func. if not, well, tough cookies
- portageq 'has_version' "${ROOT}" "$1"
- return $?
-}
-
-best_version()
-{
- local -i e
- # see above
- portageq 'best_version' "${ROOT}" "$1"
- return $?
-}
-
-check_KV()
-{
- if [ -z "${KV}" ]; then
- eerror ""
- eerror "Could not determine your kernel version."
- eerror "Make sure that you have /usr/src/linux symlink."
- eerror "And that said kernel has been configured."
- eerror "You can also simply run the following command"
- eerror "in the kernel referenced by /usr/src/linux:"
- eerror " make include/linux/version.h"
- eerror ""
- die
- fi
-}
-
-# adds ".keep" files so that dirs aren't auto-cleaned
-keepdir()
-{
- dodir "$@"
- local x
- if [ "$1" == "-R" ] || [ "$1" == "-r" ]; then
- shift
- find "$@" -type d -printf "${D}/%p/.keep\n" | tr "\n" "\0" | $XARGS -0 -n100 touch || die "Failed to recursive create .keep files"
- else
- for x in "$@"; do
- touch "${D}/${x}/.keep" || die "Failed to create .keep in ${D}/${x}"
- done
- fi
-}
-
-# sandbox support functions
-addread()
-{
- export SANDBOX_READ="$SANDBOX_READ:$1"
-}
-
-addwrite()
-{
- export SANDBOX_WRITE="$SANDBOX_WRITE:$1"
-}
-
-adddeny()
-{
- export SANDBOX_DENY="$SANDBOX_DENY:$1"
-}
-
-addpredict()
-{
- export SANDBOX_PREDICT="$SANDBOX_PREDICT:$1"
-}
-
-unpack()
-{
- local x y myfail tarvars srcdir
- if [ "$USERLAND" == "BSD" ]; then
- tarvars=""
- else
- tarvars="--no-same-owner"
- fi
-
- [ -z "$*" ] && die "Nothing passed to the 'unpack' command"
-
- for x in "$@"; do
- echo ">>> Unpacking ${x} to ${PWD}"
- myfail="failure unpacking ${x}"
- y="${x%.*}"
- y="${y##*.}"
- if [ "${x:0:2}" == "./" ]; then
- srcdir=''
- else
- srcdir="${DISTDIR}"
- fi
-
- [ ! -s "${srcdir}/${x}" ] && die "$myfail: empty file"
-
- case "${x##*.}" in
- tar)
- tar ${tarvars} -xf "${src}${x}" || die "$myfail"
- ;;
- tgz)
- tar ${tarvars} -xzf "${srcdir}${x}" || die "$myfail"
- ;;
- tbz2)
- bzip2 -dc "${srcdir}${x}" | tar ${tarvars} -xf -
- assert "$myfail"
- ;;
- ZIP|zip|jar)
- unzip -qo "${srcdir}${x}" || die "$myfail"
- ;;
- gz|Z|z)
- if [ "${y}" == "tar" ]; then
- gzip -dc "${srcdir}${x}" | tar ${tarvars} -xf -
- assert "$myfail"
- else
- gzip -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
- fi
- ;;
- bz2)
- if [ "${y}" == "tar" ]; then
- bzip2 -dc "${srcdir}${x}" | tar ${tarvars} -xf -
- assert "$myfail"
- else
- bzip2 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
- fi
- ;;
- RAR|rar)
- unrar x -idq "${srcdir}/${x}" || die "$myfail"
- ;;
- LHa|LHA|lha|lzh)
- lha xqf "${srcdir}/${x}" || die "$myfail"
- ;;
- *)
- echo "unpack ${x}: file format not recognized. Ignoring."
- ;;
- esac
- done
-}
-
-dyn_setup()
-{
- MUST_EXPORT_ENV="yes"
- if [ "$USERLAND" == "Linux" ]; then
- # The next bit is to ease the broken pkg_postrm()'s
- # some of the gcc ebuilds have that nuke the new
- # /lib/cpp and /usr/bin/cc wrappers ...
-
- # Make sure we can have it disabled somehow ....
- if [ "${DISABLE_GEN_GCC_WRAPPERS}" != "yes" ]; then
- # Create /lib/cpp if missing or a symlink
- if [ -L /lib/cpp -o ! -e /lib/cpp ]; then
- [ -L /lib/cpp ] && rm -f /lib/cpp
- gen_wrapper /lib/cpp cpp
- fi
- # Create /usr/bin/cc if missing for a symlink
- if [ -L /usr/bin/cc -o ! -e /usr/bin/cc ]; then
- [ -L /usr/bin/cc ] && rm -f /usr/bin/cc
- gen_wrapper /usr/bin/cc gcc
- fi
- fi
- fi
- pkg_setup
-}
-
-dyn_unpack()
-{
- trap "abort_unpack" SIGINT SIGQUIT
- local newstuff="no"
- MUST_EXPORT_ENV="yes"
- if [ -e "${WORKDIR}" ]; then
- local x
- local checkme
- for x in ${AA}; do
- echo ">>> Checking ${x}'s mtime..."
- if [ "${DISTDIR}/${x}" -nt "${WORKDIR}" ]; then
- echo ">>> ${x} has been updated; recreating WORKDIR..."
- newstuff="yes"
- rm -rf "${WORKDIR}"
- break
- fi
- done
- if [ "${EBUILD}" -nt "${WORKDIR}" ]; then
- echo ">>> ${EBUILD} has been updated; recreating WORKDIR..."
- newstuff="yes"
- rm -rf "${WORKDIR}"
- fi
- fi
-
- install -m0700 -d "${WORKDIR}" || die "Failed to create dir '${WORKDIR}'"
- [ -d "$WORKDIR" ] && cd "${WORKDIR}"
- echo ">>> Unpacking source..."
- src_unpack
- echo ">>> Source unpacked."
- trap SIGINT SIGQUIT
-}
-
-abort_handler()
-{
- local msg
- if [ "$2" != "fail" ]; then
- msg="${EBUILD}: ${1} aborted; exiting."
- else
- msg="${EBUILD}: ${1} failed; exiting."
- fi
- echo
- echo "$msg"
- echo
- eval ${3}
- #unset signal handler
- trap SIGINT SIGQUIT
-}
-
-abort_compile()
-{
- abort_handler "src_compile" $1
- exit 1
-}
-
-abort_unpack()
-{
- abort_handler "src_unpack" $1
- exit 1
-}
-
-abort_package()
-{
- abort_handler "dyn_package" $1
- rm -f "${PKGDIR}"/All/${PF}.t*
- exit 1
-}
-
-abort_test()
-{
- abort_handler "dyn_test" $1
- exit 1
-}
-
-abort_install()
-{
- abort_handler "src_install" $1
- exit 1
-}
-
-dyn_compile()
-{
- MUST_EXPORT_ENV="yes"
- export DESTTREE=/usr
- export INSDESTTREE=""
- export EXEDESTTREE=""
- export DOCDESTTREE=""
- export INSOPTIONS="-m0644"
- export EXEOPTIONS="-m0755"
- export LIBOPTIONS="-m0644"
- export DIROPTIONS="-m0755"
- export MOPREFIX=${PN}
-
- trap "abort_compile" SIGINT SIGQUIT
- [ "${CFLAGS-unset}" != "unset" ] && export CFLAGS
- [ "${CXXFLAGS-unset}" != "unset" ] && export CXXFLAGS
- [ "${LIBCFLAGS-unset}" != "unset" ] && export LIBCFLAGS
- [ "${LIBCXXFLAGS-unset}" != "unset" ] && export LIBCXXFLAGS
- [ "${LDFLAGS-unset}" != "unset" ] && export LDFLAGS
- [ "${ASFLAGS-unset}" != "unset" ] && export ASFLAGS
-
- [ ! -z "${DISTCC_DIR}" ] && addwrite "${DISTCC_DIR}"
-
- if [ ! -e "${T}/build-info" ]; then
- mkdir "${T}/build-info"
- fi
- cp "${EBUILD}" "${T}/build-info/"
-
- if [ -d "${S}" ]; then
- cd "${S}"
- fi
- #our custom version of libtool uses $S and $D to fix
- #invalid paths in .la files
- export S D
- #some packages use an alternative to $S to build in, cause
- #our libtool to create problematic .la files
- export PWORKDIR="$WORKDIR"
- src_compile
- #|| abort_compile "fail"
- cd "${T}/build-info"
-
- echo "$ASFLAGS" > ASFLAGS
- echo "$CATEGORY" > CATEGORY
- echo "$CBUILD" > CBUILD
- echo "$CC" > CC
- echo "$CDEPEND" > CDEPEND
- echo "$CFLAGS" > CFLAGS
- echo "$CHOST" > CHOST
- echo "$CXX" > CXX
- echo "$CXXFLAGS" > CXXFLAGS
- echo "$DEPEND" > DEPEND
- echo "$EXTRA_ECONF" > EXTRA_ECONF
- echo "$FEATURES" > FEATURES
- echo "$INHERITED" > INHERITED
- echo "$IUSE" > IUSE
- echo "$PKGUSE" > PKGUSE
- echo "$LDFLAGS" > LDFLAGS
- echo "$LIBCFLAGS" > LIBCFLAGS
- echo "$LIBCXXFLAGS" > LIBCXXFLAGS
- echo "$LICENSE" > LICENSE
- echo "$PDEPEND" > PDEPEND
- echo "$PF" > PF
- echo "$PROVIDE" > PROVIDE
- echo "$RDEPEND" > RDEPEND
- echo "$RESTRICT" > RESTRICT
- echo "$SLOT" > SLOT
- echo "$USE" > USE
- export_environ "${T}/build-info/environment.bz2" 'bzip2 -c9'
- if hasq nostrip $FEATURES $RESTRICT; then
- touch DEBUGBUILD
- fi
- trap SIGINT SIGQUIT
-}
-
-
-dyn_test()
-{
- trap "abort_test" SIGINT SIGQUIT
-
- echo ">>> Test phase [enabled]: ${CATEGORY}/${PF}"
- MUST_EXPORT_ENV="yes"
- if [ -d "${S}" ]; then
- cd "${S}"
- fi
- src_test
- trap SIGINT SIGQUIT
-}
-
-stat_perms()
-{
- local f
- f=$(stat -c '%f' "$1")
- f=$(printf "%o" 0x$f)
- f=${f:${#f}-4}
- echo $f
-}
-
-
-dyn_install()
-{
- trap "abort_install" SIGINT SIGQUIT
- rm -rf "${D}"
- mkdir "${D}"
- if [ -d "${S}" ]; then
- cd "${S}"
- fi
- echo
- echo ">>> Install ${PF} into ${D} category ${CATEGORY}"
- #our custom version of libtool uses $S and $D to fix
- #invalid paths in .la files
- export S D
- #some packages uses an alternative to $S to build in, cause
- #our libtool to create problematic .la files
- export PWORKDIR="$WORKDIR"
- src_install
- #|| abort_install "fail"
- prepall
- cd "${D}"
-
- declare -i UNSAFE=0
- for i in $(find "${D}/" -type f -perm -2002); do
- UNSAFE=$(($UNSAFE + 1))
- echo "UNSAFE SetGID: $i"
- done
- for i in $(find "${D}/" -type f -perm -4002); do
- UNSAFE=$(($UNSAFE + 1))
- echo "UNSAFE SetUID: $i"
- done
-
- if type -p scanelf > /dev/null ; then
- # Make sure we disallow insecure RUNPATH/RPATH's
- # Don't want paths that point to the tree where the package was built
- # (older, broken libtools would do this). Also check for null paths
- # because the loader will search $PWD when it finds null paths.
- f=$(scanelf -qyRF '%r %p' "${D}" | grep -E "(${WORKDIR}|${D}|: |::|^ )")
- if [[ -n ${f} ]] ; then
- echo -ne '\a\n'
- echo "QA Notice: the following files contain insecure RUNPATH's"
- echo " Please file a bug about this at http://bugs.gentoo.org/"
- echo " For more information on this issue, kindly review:"
- echo " http://bugs.gentoo.org/81745"
- echo "${f}"
- echo -ne '\a\n'
- die "Insecure binaries detected"
- fi
-
- # Check for setid binaries but are not built with BIND_NOW
- f=$(scanelf -qyRF '%b %p' "${D}")
- if [[ -n ${f} ]] ; then
- echo -ne '\a\n'
- echo "QA Notice: the following files are setXid, dyn linked, and using lazy bindings"
- echo " This combination is generally discouraged. Try re-emerging the package:"
- echo " LDFLAGS='-Wl,-z,now' emerge ${PN}"
- echo "${f}"
- echo -ne '\a\n'
- [[ ${FEATURES/stricter} != "${FEATURES}" ]] \
- && die "Aborting due to lazy bindings"
- sleep 1
- fi
-
- # TEXTREL's are baaaaaaaad
- f=$(scanelf -qyRF '%t %p' "${D}")
- if [[ -n ${f} ]] ; then
- echo -ne '\a\n'
- echo "QA Notice: the following files contain runtime text relocations"
- echo " Text relocations require a lot of extra work to be preformed by the"
- echo " dynamic linker which will cause serious performance impact on IA-32"
- echo " and might not function properly on other architectures hppa for example."
- echo " If you are a programmer please take a closer look at this package and"
- echo " consider writing a patch which addresses this problem."
- echo "${f}"
- echo -ne '\a\n'
- [[ ${FEATURES/stricter} != "${FEATURES}" ]] \
- && die "Aborting due to textrels"
- sleep 1
- fi
-
- # Check for files with executable stacks
- f=$(scanelf -qyRF '%e %p' "${D}")
- if [[ -n ${f} ]] ; then
- echo -ne '\a\n'
- echo "QA Notice: the following files contain executable stacks"
- echo " Files with executable stacks will not work properly (or at all!)"
- echo " on some architectures/operating systems. A bug should be filed"
- echo " at http://bugs.gentoo.org/ to make sure the file is fixed."
- echo "${f}"
- echo -ne '\a\n'
- [[ ${FEATURES/stricter} != "${FEATURES}" ]] \
- && die "Aborting due to +x stack"
- sleep 1
- fi
-
- # Save NEEDED information
- scanelf -qyRF '%p %n' "${D}" | sed -e 's:^:/:' > "${T}/build-info/NEEDED"
- fi
-
- if [[ $UNSAFE > 0 ]]; then
- die "There are ${UNSAFE} unsafe files. Portage will not install them."
- fi
-
- local file s
-
- find "${D}/" -user portage -print | while read file; do
- ewarn "file $file was installed with user portage!"
- s=$(stat_perms "$file")
- chown root "$file"
- #XXX: Stable does not have the symlink test
- [ -h "$file" ] || chmod "$s" "$file"
- done
-
- find "${D}/" -group portage -print | while read file; do
- # Too annoying - uncommenting this as it's a regression
- #ewarn "file $file was installed with group portage!"
- s=$(stat_perms "$file")
- if [ "$USERLAND" == "BSD" ]; then
- chgrp wheel "$file"
- else
- chgrp root "$file"
- fi
- #XXX: Stable does not have the symlink test
- [ -h "$file" ] || chmod "$s" "$file"
- done
-
- if hasq multilib-strict ${FEATURES} && [ -x /usr/bin/file -a -x /usr/bin/find -a \
- -n "${MULTILIB_STRICT_DIRS}" -a -n "${MULTILIB_STRICT_DENY}" ]; then
- MULTILIB_STRICT_EXEMPT=${MULTILIB_STRICT_EXEMPT:-"(perl5|gcc|gcc-lib)"}
- for dir in ${MULTILIB_STRICT_DIRS}; do
- [ -d "${D}/${dir}" ] || continue
- for file in $(find ${D}/${dir} -type f | egrep -v "^${D}/${dir}/${MULTILIB_STRICT_EXEMPT}"); do
- file ${file} | egrep -q "${MULTILIB_STRICT_DENY}" && die "File ${file} matches a file type that is not allowed in ${dir}"
- done
- done
- fi
-
- echo ">>> Completed installing ${PF} into ${D}"
- echo
- MUST_EXPORT_ENV="yes"
- trap SIGINT SIGQUIT
-}
-
-dyn_postinst()
-{
- pkg_postinst
-}
-
-dyn_preinst()
-{
- # set IMAGE depending if this is a binary or compile merge
- local IMAGE=${D}
- [ "${EMERGE_FROM}" == "binary" ] && IMAGE=${PKG_TMPDIR}/${PF}/bin/
-
- # Make sure D is where the package expects it
- D=${IMAGE} pkg_preinst
-
- # remove man pages
- if hasq noman $FEATURES; then
- rm -fR "${IMAGE}"/usr/share/man
- fi
-
- # remove info pages
- if hasq noinfo $FEATURES; then
- rm -fR "${IMAGE}"/usr/share/info
- fi
-
- # remove docs
- if hasq nodoc $FEATURES; then
- rm -fR "${IMAGE}"/usr/share/doc
- fi
-
- # hopefully this will someday allow us to get rid of the no* feature flags
- # we don't want globbing for initial expansion, but afterwards, we do
- #XXX: rewrite this to use a while loop instead.
- local shopts=$-
- set -o noglob
- for no_inst in `echo "${INSTALL_MASK}"` ; do
- set +o noglob
- einfo "Removing ${no_inst}"
- # normal stuff
- rm -Rf "${IMAGE}"/${no_inst} &> /dev/null
- # we also need to handle globs (*.a, *.h, etc)
- find "${IMAGE}" -name ${no_inst} -exec rm -fR {} \; &> /dev/null
- done
- # set everything back the way we found it
- set +o noglob
- set -${shopts}
-
- # remove share dir if unnessesary
- if hasq nodoc $FEATURES -o hasq noman $FEATURES -o hasq noinfo $FEATURES; then
- rmdir "${IMAGE}"/usr/share &> /dev/null
- fi
-
- # Smart FileSystem Permissions
- if hasq sfperms $FEATURES; then
- for i in $(find "${IMAGE}"/ -type f -perm -4000); do
- ebegin ">>> SetUID: [chmod go-r] $i "
- chmod go-r "$i"
- eend $?
- done
- for i in $(find "${IMAGE}"/ -type f -perm -2000); do
- ebegin ">>> SetGID: [chmod o-r] $i "
- chmod o-r "$i"
- eend $?
- done
- fi
-
- # total suid control.
- if hasq suidctl $FEATURES > /dev/null ; then
- sfconf=/etc/portage/suidctl.conf
- echo ">>> Preforming suid scan in ${IMAGE}"
- for i in $(find "${IMAGE}"/ -type f \( -perm -4000 -o -perm -2000 \) ); do
- if [ -s "${sfconf}" ]; then
- suid=$(grep ^${i/${IMAGE}/}$ ${sfconf})
- if [ "${suid}" = "${i/${IMAGE}/}" ]; then
- echo "- ${i/${IMAGE}/} is an approved suid file"
- else
- echo ">>> Removing sbit on non registered ${i/${IMAGE}/}"
- sleepbeep 6
- chmod ugo-s "${i}"
- grep ^#${i/${IMAGE}/}$ ${sfconf} > /dev/null || {
- # sandbox prevents us from writing directly
- # to files outside of the sandbox, but this
- # can easly be bypassed using the addwrite() function
- addwrite "${sfconf}"
- echo ">>> Appending commented out entry to ${sfconf} for ${PF}"
- ls_ret=`ls -ldh "${i}"`
- echo "## ${ls_ret%${IMAGE}*}${ls_ret#*${IMAGE}}" >> ${sfconf}
- echo "#${i/${IMAGE}/}" >> ${sfconf}
- # no delwrite() eh?
- # delwrite ${sconf}
- }
- fi
- else
- echo "suidctl feature set but you are lacking a ${sfconf}"
- fi
- done
- fi
-
- # SELinux file labeling (needs to always be last in dyn_preinst)
- if hasq selinux $FEATURES || use selinux; then
- # only attempt to label if setfiles is executable
- # and 'context' is available on selinuxfs.
- if [ -f /selinux/context -a -x /usr/sbin/setfiles ]; then
- echo ">>> Setting SELinux security labels"
- if [ -f ${POLICYDIR}/file_contexts/file_contexts ]; then
- cp -f "${POLICYDIR}/file_contexts/file_contexts" "${T}"
- else
- make -C "${POLICYDIR}" FC=${T}/file_contexts "${T}/file_contexts"
- fi
-
- addwrite /selinux/context
- /usr/sbin/setfiles -r "${IMAGE}" "${T}/file_contexts" "${IMAGE}" \
- || die "Failed to set SELinux security labels."
- else
- # nonfatal, since merging can happen outside a SE kernel
- # like during a recovery situation
- echo "!!! Unable to set SELinux security labels"
- fi
- fi
- MUST_EXPORT_ENV="yes"
- trap SIGINT SIGQUIT
-}
-
-
-# debug-print() gets called from many places with verbose status information useful
-# for tracking down problems. The output is in $T/eclass-debug.log.
-# You can set ECLASS_DEBUG_OUTPUT to redirect the output somewhere else as well.
-# The special "on" setting echoes the information, mixing it with the rest of the
-# emerge output.
-# You can override the setting by exporting a new one from the console, or you can
-# set a new default in make.*. Here the default is "" or unset.
-
-# in the future might use e* from /etc/init.d/functions.sh if i feel like it
-debug-print()
-{
- if [ "$EBUILD_PHASE" == "depend" ] && [ -z "${PORTAGE_DEBUG}" ]; then
- return
- fi
- # if $T isn't defined, we're in dep calculation mode and
- # shouldn't do anything
- [ -z "$T" ] && return 0
-
- while [ "$1" ]; do
-
- # extra user-configurable targets
- if [ "$ECLASS_DEBUG_OUTPUT" == "on" ]; then
- echo "debug: $1"
- elif [ -n "$ECLASS_DEBUG_OUTPUT" ]; then
- echo "debug: $1" >> $ECLASS_DEBUG_OUTPUT
- fi
-
- # default target
- echo "$1" >> "${T}/eclass-debug.log"
- # let the portage user own/write to this file
- chmod g+w "${T}/eclass-debug.log" &>/dev/null
-
- shift
- done
-}
-
-# The following 2 functions are debug-print() wrappers
-
-debug-print-function()
-{
- str="$1: entering function"
- shift
- debug-print "$str, parameters: $*"
-}
-
-debug-print-section()
-{
- debug-print "now in section $*"
-}
-
-
-internal_inherit()
-{
- # default, backwards compatible beast.
- local location overlay
- location="${ECLASSDIR}/${1}.eclass"
-
- if [ -n "$PORTDIR_OVERLAY" ]; then
- local overlay
- for overlay in ${PORTDIR_OVERLAY}; do
- if [ -e "${overlay}/eclass/${1}.eclass" ]; then
- location="${overlay}/eclass/${1}.eclass"
- debug-print " eclass exists: ${location}"
- fi
- done
- fi
- debug-print "inherit: $1 -> $location"
- source "$location" || die "died sourcing $location in inherit()"
- return 0
-}
-
-# Sources all eclasses in parameters
-declare -ix ECLASS_DEPTH=0
-inherit()
-{
- local SAVED_INHERIT_COUNT=0 INHERITED_ALREADY=0
-
- if [[ $ECLASS_DEPTH < 0 ]] && [ "${EBUILD_PHASE}" == "depend" ]; then
- echo "QA Notice: ${CATEGORY}/${PF} makes multiple inherit calls: $1" >&2
- SAVED_INHERIT_COUNT=$ECLASS_DEPTH
- ECLASS_DEPTH=0
- fi
- if hasq $1 $INHERITED && [ "${EBUILD_PHASE}" == "depend" ]; then
- #echo "QA notice: $1 is inherited multiple times: ${CATEGORY}/${PF}" >&2
- INHERITED_ALREADY=1
- fi
- ECLASS_DEPTH=$(($ECLASS_DEPTH + 1))
- if [[ $ECLASS_DEPTH > 1 ]]; then
- debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})"
- fi
-
- local location olocation
- local PECLASS
-
- local B_IUSE
- local B_DEPEND
- local B_RDEPEND
- local B_CDEPEND
- local B_PDEPEND
- while [ -n "$1" ]; do
-
- # PECLASS is used to restore the ECLASS var after recursion.
- PECLASS="$ECLASS"
- export ECLASS="$1"
-
- if [ "$EBUILD_PHASE" != "depend" ]; then
- if ! hasq $ECLASS $INHERITED; then
- echo
- echo "QA Notice: ECLASS '$ECLASS' illegal conditional inherit in $CATEGORY/$PF" >&2
- echo
- fi
- fi
-
- #We need to back up the value of DEPEND and RDEPEND to B_DEPEND and B_RDEPEND
- #(if set).. and then restore them after the inherit call.
-
- #turn off glob expansion
- set -f
-
- # Retain the old data and restore it later.
- unset B_IUSE B_DEPEND B_RDEPEND B_CDEPEND B_PDEPEND
- [ "${IUSE-unset}" != "unset" ] && B_IUSE="${IUSE}"
- [ "${DEPEND-unset}" != "unset" ] && B_DEPEND="${DEPEND}"
- [ "${RDEPEND-unset}" != "unset" ] && B_RDEPEND="${RDEPEND}"
- [ "${CDEPEND-unset}" != "unset" ] && B_CDEPEND="${CDEPEND}"
- [ "${PDEPEND-unset}" != "unset" ] && B_PDEPEND="${PDEPEND}"
- unset IUSE DEPEND RDEPEND CDEPEND PDEPEND
- #turn on glob expansion
- set +f
- if ! internal_inherit "$1"; then
- die "failed sourcing $1 in inherit()"
- fi
-
- #turn off glob expansion
- set -f
-
- # If each var has a value, append it to the global variable E_* to
- # be applied after everything is finished. New incremental behavior.
- [ "${IUSE-unset}" != "unset" ] && export E_IUSE="${E_IUSE} ${IUSE}"
- [ "${DEPEND-unset}" != "unset" ] && export E_DEPEND="${E_DEPEND} ${DEPEND}"
- [ "${RDEPEND-unset}" != "unset" ] && export E_RDEPEND="${E_RDEPEND} ${RDEPEND}"
- [ "${CDEPEND-unset}" != "unset" ] && export E_CDEPEND="${E_CDEPEND} ${CDEPEND}"
- [ "${PDEPEND-unset}" != "unset" ] && export E_PDEPEND="${E_PDEPEND} ${PDEPEND}"
-
- [ "${B_IUSE-unset}" != "unset" ] && IUSE="${B_IUSE}"
- [ "${B_IUSE-unset}" != "unset" ] || unset IUSE
-
- [ "${B_DEPEND-unset}" != "unset" ] && DEPEND="${B_DEPEND}"
- [ "${B_DEPEND-unset}" != "unset" ] || unset DEPEND
-
- [ "${B_RDEPEND-unset}" != "unset" ] && RDEPEND="${B_RDEPEND}"
- [ "${B_RDEPEND-unset}" != "unset" ] || unset RDEPEND
-
- [ "${B_CDEPEND-unset}" != "unset" ] && CDEPEND="${B_CDEPEND}"
- [ "${B_CDEPEND-unset}" != "unset" ] || unset CDEPEND
-
- [ "${B_PDEPEND-unset}" != "unset" ] && PDEPEND="${B_PDEPEND}"
- [ "${B_PDEPEND-unset}" != "unset" ] || unset PDEPEND
-
- #turn on glob expansion
- set +f
-
- if hasq $1 $INHERITED && [ $INHERITED_ALREADY == 0 ]; then
-#
-# enable this one eclasses no longer fool with eclass and inherited.
-# if [ "${EBUILD_PHASE}" == "depend" ]; then
-# echo "QA Notice: ${CATEGORY}/${PF}: eclass $1 is incorrectly setting \$INHERITED." >&2
-# fi
- :
- else
- INHERITED="$INHERITED $ECLASS"
- fi
- export ECLASS="$PECLASS"
-
- shift
- done
- ECLASS_DEPTH=$(($ECLASS_DEPTH - 1))
- if [[ $ECLASS_DEPTH == 0 ]]; then
- ECLASS_DEPTH=$(($SAVED_INHERIT_COUNT - 1))
- fi
-}
-
-# Exports stub functions that call the eclass's functions, thereby making them default.
-# For example, if ECLASS="base" and you call "EXPORT_FUNCTIONS src_unpack", the following
-# code will be eval'd:
-# src_unpack() { base_src_unpack; }
-EXPORT_FUNCTIONS()
-{
- if [ -z "$ECLASS" ]; then
- echo "EXPORT_FUNCTIONS without a defined ECLASS" >&2
- exit 1
- fi
- while [ "$1" ]; do
- debug-print "EXPORT_FUNCTIONS: ${1} -> ${ECLASS}_${1}"
- eval "$1() { ${ECLASS}_$1 "\$@" ; }" > /dev/null
- shift
- done
-}
-
-# adds all parameters to E_DEPEND and E_RDEPEND, which get added to DEPEND
-# and RDEPEND after the ebuild has been processed. This is important to
-# allow users to use DEPEND="foo" without frying dependencies added by an
-# earlier inherit. It also allows RDEPEND to work properly, since a lot
-# of ebuilds assume that an unset RDEPEND gets its value from DEPEND.
-# Without eclasses, this is true. But with them, the eclass may set
-# RDEPEND itself (or at least used to) which would prevent RDEPEND from
-# getting its value from DEPEND. This is a side-effect that made eclasses
-# have unreliable dependencies.
-
-newdepend()
-{
- debug-print-function newdepend $*
- debug-print "newdepend: E_DEPEND=$E_DEPEND E_RDEPEND=$E_RDEPEND"
-
- while [ -n "$1" ]; do
- case $1 in
- "/autotools")
- do_newdepend DEPEND sys-devel/autoconf sys-devel/automake sys-devel/make
- ;;
- "/c")
- do_newdepend DEPEND sys-devel/gcc virtual/libc
- do_newdepend RDEPEND virtual/libc
- ;;
- *)
- do_newdepend DEPEND $1
- ;;
- esac
- shift
- done
-}
-
-newrdepend()
-{
- debug-print-function newrdepend $*
- do_newdepend RDEPEND $1
-}
-
-newcdepend()
-{
- debug-print-function newcdepend $*
- do_newdepend CDEPEND $1
-}
-
-newpdepend()
-{
- debug-print-function newpdepend $*
- do_newdepend PDEPEND $1
-}
-
-do_newdepend()
-{
- # This function does a generic change determining whether we're in an
- # eclass or not. If we are, we change the E_* variables for deps.
- debug-print-function do_newdepend $*
- [ -z "$1" ] && die "do_newdepend without arguments"
-
- # Grab what we're affecting... Figure out if we're affecting eclasses.
- [[ ${ECLASS_DEPTH} > 0 ]] && TARGET="E_$1"
- [[ ${ECLASS_DEPTH} > 0 ]] || TARGET="$1"
- shift # $1 was a variable name.
-
- while [ -n "$1" ]; do
- # This bit of evil takes TARGET and uses it to evaluate down to a
- # variable. This is a sneaky way to make this infinately expandable.
- # The normal translation of this would look something like this:
- # E_DEPEND="${E_DEPEND} $1" :::::: Cool, huh? :)
- eval export ${TARGET}=\"\${${TARGET}} \$1\"
- shift
- done
-}
-
-# 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}"
-}
-
-QA_INTERCEPTORS="javac java-config python python-config perl grep egrep fgrep sed gcc g++ cc bash awk nawk pkg-config"
-enable_qa_interceptors()
-{
-
- # Turn of extended glob matching so that g++ doesn't get incorrectly matched.
- shopt -u extglob
-
- # QA INTERCEPTORS
- local FUNC_SRC BIN BODY BIN_PATH
- for BIN in ${QA_INTERCEPTORS}; do
- BIN_PATH=$(type -pf ${BIN})
- if [ "$?" != "0" ]; then
- BODY="echo \"*** missing command: ${BIN}\" >&2; return 127"
- else
- BODY="${BIN_PATH} \"\$@\"; return \$?"
- fi
- FUNC_SRC="function ${BIN}() {
- echo -n \"QA Notice: ${BIN} in global scope: \" >&2
- if [ \$ECLASS_DEPTH -gt 0 ]; then
- echo \"eclass \${ECLASS}\" >&2
- else
- echo \"\${CATEGORY}/\${PF}\" >&2
- fi
- ${BODY}
- }";
- eval "$FUNC_SRC" || echo "error creating QA interceptor ${BIN}" >&2
- done
-}
-
-disable_qa_interceptors()
-{
- for x in $QA_INTERCEPTORS; do
- unset -f $x
- done
-}
-
-useq()
-{
- local u="${1}"
- local neg=0
- if [ "${u:0:1}" == "!" ]; then
- u="${u:1}"
- neg=1
- fi
- local x
-
- # Make sure we have this USE flag in IUSE
- if ! hasq "${u}" ${IUSE} ${E_IUSE} && ! hasq "${u}" ${PORTAGE_ARCHLIST} selinux; then
- echo "QA Notice: USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}" >&2
- fi
-
- for x in ${USE}; do
- if [ "${x}" == "${u}" ]; then
- if [ ${neg} -eq 1 ]; then
- return 1
- else
- return 0
- fi
- fi
- done
- if [ ${neg} -eq 1 ]; then
- return 0
- else
- return 1
- fi
-}
-
-usev()
-{
- if useq ${1}; then
- echo "${1}"
- return 0
- fi
- return 1
-}
-
-# Used to generate the /lib/cpp and /usr/bin/cc wrappers
-gen_wrapper()
-{
- cat > $1 << END
-#!/bin/sh
-
-$2 "\$@"
-END
-
- chmod 0755 $1
-}
-
-insopts()
-{
- INSOPTIONS=""
- for x in $*; do
- #if we have a debug build, let's not strip anything
- if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then
- continue
- else
- INSOPTIONS="$INSOPTIONS $x"
- fi
- done
- export INSOPTIONS
-}
-
-diropts()
-{
- DIROPTIONS=""
- for x in $*; do
- DIROPTIONS="${DIROPTIONS} $x"
- done
- export DIROPTIONS
-}
-
-exeopts()
-{
- EXEOPTIONS=""
- for x in $*; do
- #if we have a debug build, let's not strip anything
- if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then
- continue
- else
- EXEOPTIONS="$EXEOPTIONS $x"
- fi
- done
- export EXEOPTIONS
-}
-
-libopts()
-{
- LIBOPTIONS=""
- for x in $*; do
- #if we have a debug build, let's not strip anything
- if hasq nostrip $FEATURES $RESTRICT && [ "$x" == "-s" ]; then
- continue
- else
- LIBOPTIONS="$LIBOPTIONS $x"
- fi
- done
- export LIBOPTIONS
-}
-
-DONT_EXPORT_VARS="${DONT_EXPORT_VARS} ECLASS_DEPTH"
-true
diff --git a/bin/ebuild-env/ebuild-functions.sh b/bin/ebuild-env/ebuild-functions.sh
deleted file mode 100755
index 8dfc02fc..00000000
--- a/bin/ebuild-env/ebuild-functions.sh
+++ /dev/null
@@ -1,345 +0,0 @@
-#!/bin/bash
-# ebuild-functions.sh; ebuild env functions, saved with the ebuild (not specific to the portage version).
-# Copyright 2004-2005 Gentoo Foundation
-
-use()
-{
- if useq ${1}; then
- return 0
- fi
- return 1
-}
-
-has()
-{
- if hasq "$@"; then
- return 0
- fi
- return 1
-}
-
-use_with()
-{
- if [ -z "$1" ]; then
- echo "!!! use_with() called without a parameter." >&2
- echo "!!! use_with <USEFLAG> [<flagname> [value]]" >&2
- return
- fi
-
- local UW_SUFFIX=""
- if [ ! -z "${3}" ]; then
- UW_SUFFIX="=${3}"
- fi
-
- local UWORD="$2"
- if [ -z "${UWORD}" ]; then
- UWORD="$1"
- fi
-
- if useq $1; then
- echo "--with-${UWORD}${UW_SUFFIX}"
- return 0
- else
- echo "--without-${UWORD}"
- return 1
- fi
-}
-
-use_enable()
-{
- if [ -z "$1" ]; then
- echo "!!! use_enable() called without a parameter." >&2
- echo "!!! use_enable <USEFLAG> [<flagname> [value]]" >&2
- return
- fi
-
- local UE_SUFFIX=""
- if [ ! -z "${3}" ]; then
- UE_SUFFIX="=${3}"
- fi
-
- local UWORD="$2"
- if [ -z "${UWORD}" ]; then
- UWORD="$1"
- fi
-
- if useq $1; then
- echo "--enable-${UWORD}${UE_SUFFIX}"
- return 0
- else
- echo "--disable-${UWORD}"
- return 1
- fi
-}
-
-econf()
-{
- local ret
- ECONF_SOURCE="${ECONF_SOURCE:-.}"
- if [ -x "${ECONF_SOURCE}/configure" ]; then
- if ! hasq autoconfig $RESTRICT; then
- if [ -e /usr/share/gnuconfig/ ]; then
- local x
- for x in $(find ${WORKDIR} -type f '(' -name config.guess -o -name config.sub ')' ); do
- echo " * econf: updating ${x/${WORKDIR}\/} with /usr/share/gnuconfig/${x##*/}"
- cp -f "/usr/share/gnuconfig/${x##*/}" "${x}"
- chmod a+x "${x}"
- done
- fi
- fi
- if [ ! -z "${CBUILD}" ]; then
- EXTRA_ECONF="--build=${CBUILD} ${EXTRA_ECONF}"
- fi
-
- # if the profile defines a location to install libs to aside from default, pass it on.
- # if the ebuild passes in --libdir, they're responsible for the conf_libdir fun.
- LIBDIR_VAR="LIBDIR_${ABI}"
- if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
- CONF_LIBDIR="${!LIBDIR_VAR}"
- fi
- unset LIBDIR_VAR
- if [ -n "${CONF_LIBDIR}" ] && [ "${*/--libdir}" == "$*" ]; then
- if [ "${*/--exec-prefix}" != "$*" ]; then
- local args="$(echo $*)"
- local -a pref=($(echo ${args/*--exec-prefix[= ]}))
- CONF_PREFIX=${pref}
- [ "${CONF_PREFIX:0:1}" != "/" ] && CONF_PREFIX="/${CONF_PREFIX}"
- elif [ "${*/--prefix}" != "$*" ]; then
- local args="$(echo $*)"
- local -a pref=($(echo ${args/*--prefix[= ]}))
- CONF_PREFIX=${pref}
- [ "${CONF_PREFIX:0:1}" != "/" ] && CONF_PREFIX="/${CONF_PREFIX}"
- else
- CONF_PREFIX="/usr"
- fi
- export CONF_PREFIX
- [ "${CONF_LIBDIR:0:1}" != "/" ] && CONF_LIBDIR="/${CONF_LIBDIR}"
-
- CONF_LIBDIR_RESULT="${CONF_PREFIX}${CONF_LIBDIR}"
- for X in 1 2 3; do
- # The escaping is weird. It will break if you escape the last one.
- CONF_LIBDIR_RESULT="${CONF_LIBDIR_RESULT//\/\///}"
- done
-
- EXTRA_ECONF="--libdir=${CONF_LIBDIR_RESULT} ${EXTRA_ECONF}"
- fi
- local EECONF_CACHE
- if request_confcache "${T}/local_cache"; then
- EECONF_CACHE="--cache-file=${T}/local_cache"
- fi
- echo ${ECONF_SOURCE}/configure \
- --prefix=/usr \
- --host=${CHOST} \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --datadir=/usr/share \
- --sysconfdir=/etc \
- --localstatedir=/var/lib \
- ${EXTRA_ECONF} \
- ${EECONF_CACHE} \
- "$@"
-
- if ! ${ECONF_SOURCE}/configure \
- --prefix=/usr \
- --host=${CHOST} \
- --mandir=/usr/share/man \
- --infodir=/usr/share/info \
- --datadir=/usr/share \
- --sysconfdir=/etc \
- --localstatedir=/var/lib \
- ${EXTRA_ECONF} \
- ${EECONF_CACHE} \
- "$@" ; then
-
- if [ -s config.log ]; then
- echo
- echo "!!! Please attach the config.log to your bug report:"
- echo "!!! ${PWD}/config.log"
- fi
- die "econf failed"
- fi
-
- # store the returned exit code. don't rely on update_confcache returning true.
- ret=$?
- update_confcache "${T}/local_cache"
- return $ret
- else
- die "no configure script found"
- fi
-}
-
-strip_duplicate_slashes ()
-{
- if [ -n "${1}" ]; then
- local removed="${1/\/\///}"
- [ "${removed}" != "${removed/\/\///}" ] && removed=$(strip_duplicate_slashes "${removed}")
- echo ${removed}
- fi
-}
-
-einstall()
-{
- # CONF_PREFIX is only set if they didn't pass in libdir above
- LIBDIR_VAR="LIBDIR_${ABI}"
- if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
- CONF_LIBDIR="${!LIBDIR_VAR}"
- fi
- unset LIBDIR_VAR
- if [ -n "${CONF_LIBDIR}" ] && [ "${CONF_PREFIX:-unset}" != "unset" ]; then
- EI_DESTLIBDIR="${D}/${CONF_PREFIX}/${CONF_LIBDIR}"
- EI_DESTLIBDIR="$(strip_duplicate_slashes ${EI_DESTLIBDIR})"
- EXTRA_EINSTALL="libdir=${EI_DESTLIBDIR} ${EXTRA_EINSTALL}"
- unset EI_DESTLIBDIR
- fi
-
- if [ -f ./[mM]akefile -o -f ./GNUmakefile ] ; then
- if [ ! -z "${PORTAGE_DEBUG}" ]; then
- make -n prefix=${D}/usr \
- datadir=${D}/usr/share \
- infodir=${D}/usr/share/info \
- localstatedir=${D}/var/lib \
- mandir=${D}/usr/share/man \
- sysconfdir=${D}/etc \
- ${EXTRA_EINSTALL} \
- "$@" install
- fi
- make prefix=${D}/usr \
- datadir=${D}/usr/share \
- infodir=${D}/usr/share/info \
- localstatedir=${D}/var/lib \
- mandir=${D}/usr/share/man \
- sysconfdir=${D}/etc \
- ${EXTRA_EINSTALL} \
- "$@" install || die "einstall failed"
- else
- die "no Makefile found"
- fi
-}
-
-pkg_setup()
-{
- return
-}
-
-pkg_nofetch()
-{
- [ -z "${SRC_URI}" ] && return
-
- echo "!!! The following are listed in SRC_URI for ${PN}:"
- for MYFILE in `echo ${SRC_URI}`; do
- echo "!!! $MYFILE"
- done
-}
-
-src_unpack()
-{
- if [ "${A}" != "" ]; then
- unpack ${A}
- fi
-}
-
-src_compile()
-{
- if [ -x ./configure ]; then
- econf || die "econf failed"
- fi
- if [ -f Makefile ] || [ -f GNUmakefile ] || [ -f makefile ]; then
- emake || die "emake failed"
- fi
-}
-
-src_test()
-{
- addpredict /
- if make check -n &> /dev/null; then
- echo ">>> Test phase [check]: ${CATEGORY}/${PF}"
- if ! make check; then
- hasq test $FEATURES && die "Make check failed. See above for details."
- hasq test $FEATURES || eerror "Make check failed. See above for details."
- fi
- elif make test -n &> /dev/null; then
- echo ">>> Test phase [test]: ${CATEGORY}/${PF}"
- if ! make test; then
- hasq test $FEATURES && die "Make test failed. See above for details."
- hasq test $FEATURES || eerror "Make test failed. See above for details."
- fi
- else
- echo ">>> Test phase [none]: ${CATEGORY}/${PF}"
- fi
- SANDBOX_PREDICT="${SANDBOX_PREDICT%:/}"
-}
-
-src_install()
-{
- return
-}
-
-pkg_preinst()
-{
- return
-}
-
-pkg_postinst()
-{
- return
-}
-
-pkg_prerm()
-{
- return
-}
-
-pkg_postrm()
-{
- return
-}
-
-into()
-{
- if [ $1 == "/" ]; then
- export DESTTREE=""
- else
- export DESTTREE=$1
- if [ ! -d "${D}${DESTTREE}" ]; then
- install -d "${D}${DESTTREE}"
- fi
- fi
-}
-
-insinto()
-{
- if [ "$1" == "/" ]; then
- export INSDESTTREE=""
- else
- export INSDESTTREE=$1
- if [ ! -d "${D}${INSDESTTREE}" ]; then
- install -d "${D}${INSDESTTREE}"
- fi
- fi
-}
-
-exeinto()
-{
- if [ "$1" == "/" ]; then
- export EXEDESTTREE=""
- else
- export EXEDESTTREE="$1"
- if [ ! -d "${D}${EXEDESTTREE}" ]; then
- install -d "${D}${EXEDESTTREE}"
- fi
- fi
-}
-
-docinto()
-{
- if [ "$1" == "/" ]; then
- export DOCDESTTREE=""
- else
- export DOCDESTTREE="$1"
- if [ ! -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}" ]; then
- install -d "${D}usr/share/doc/${PF}/${DOCDESTTREE}"
- fi
- fi
-}
-
-true
diff --git a/bin/ebuild-env/ebuild.sh b/bin/ebuild-env/ebuild.sh
deleted file mode 100755
index 7c99ac32..00000000
--- a/bin/ebuild-env/ebuild.sh
+++ /dev/null
@@ -1,702 +0,0 @@
-#!/bin/bash
-# ebuild.sh; ebuild phase processing, env handling
-# Copyright 2005-2006 Brian Harring <ferringb@gmail.com>
-# Copyright 2004-2005 Gentoo Foundation
-
-# general phase execution path-
-# execute_phases is called, which sets EBUILD_PHASE, and then depending on the phase,
-# loads or initializes. Env is init'd for non src based stages if the env isn't found- otherwise
-# it loads the environ via load_environ call. In cases where env isn't found for phases setup -> merge,
-# it bails (theres no way the env should be missing- exemption is setup phase).
-#
-# for env filtering for restoration and reloading, note the updates to DONT_EXPORT_(VARS|FUNCS).
-# those vars are basically used to track what shouldn't be saved/restored. Whitespace seperated,
-# those vars can support posix (think egrep) regex. They should hold all vars/funcs that are internal
-# ebuild.sh vars. Basically, filter all vars/funcs that are specific to ebuild.sh, not the ebuild.
-#
-# after loading the env, user defined pre hooks are executed, dyn_${EBUILD_PHASE} is executed,
-# and the post hooks are executed. If the env needs to be flushed to disk, MUST_EXPORT_ENV is set to
-# "yes", and execute_phases will dump it to ${T}/environment.
-#
-# few notes on general env stuff- if it's not ebuild specific or a user option, it's typically marked
-# readonly. This limits users, but also helps to ensure that reloaded envs from older portages don't
-# overwrite an internal ebd.sh function that has since changed.
-ORIG_VARS=`declare | egrep '^[^[:space:]{}()]+=' | cut -s -d '=' -f 1`
-ORIG_FUNCS=`declare -F | cut -s -d ' ' -f 3`
-DONT_EXPORT_FUNCS='portageq speak'
-DONT_EXPORT_VARS="ORIG_VARS GROUPS ORIG_FUNCS FUNCNAME DAEMONIZED CCACHE.* DISTCC.* AUTOCLEAN CLEAN_DELAY SYNC
-\(TMP\|\)DIR FEATURES CONFIG_PROTECT.* P\?WORKDIR \(FETCH\|RESUME\) COMMAND RSYNC_.* GENTOO_MIRRORS
-\(DIST\|FILES\|RPM\|ECLASS\)DIR HOME MUST_EXPORT_ENV QA_CONTROLLED_EXTERNALLY COLORTERM COLS ROWS HOSTNAME
-myarg SANDBOX_.* BASH.* EUID PPID SHELLOPTS UID ACCEPT_\(KEYWORDS\|LICENSE\) BUILD\(_PREFIX\|DIR\) T DIRSTACK
-DISPLAY \(EBUILD\)\?_PHASE PORTAGE_.* RC_.* SUDO_.* IFS PATH LD_PRELOAD ret line phases D EMERGE_FROM
-PORT\(_LOGDIR\|DIR\(_OVERLAY\)\?\) ROOT TERM _ done e ENDCOLS PROFILE_.* BRACKET BAD WARN GOOD NORMAL EBUILD ECLASS LINENO
-HILITE IMAGE TMP"
-# flip this on to enable extra noisy output for debugging.
-#DEBUGGING="yes"
-
-# XXX: required for migration from .51 to this.
-if [ -z "$PORTAGE_BIN_PATH" ]; then
- declare -rx PORTAGE_BIN_PATH="/usr/lib/portage/bin"
-fi
-
-# knock the sandbox vars back to the defaults.
-reset_sandbox() {
- export SANDBOX_ON="1"
- export SANDBOX_PREDICT="${SANDBOX_PREDICT:+${SANDBOX_PREDICT}:}/proc/self/maps:/dev/console:/usr/lib/portage/pym:/dev/random"
- export SANDBOX_WRITE="${SANDBOX_WRITE:+${SANDBOX_WRITE}:}/dev/shm"
- export SANDBOX_READ="${SANDBOX_READ:+${SANDBOX_READ}:}/dev/shm"
- local s
- for x in CCACHE_DIR DISTCC_DIR D WORKDIR T; do
- if [ -n "${!x}" ]; then
- addread "${!x}"
- addwrite "${!x}"
- fi
- done
-}
-
-# Prevent aliases from causing portage to act inappropriately.
-# Make sure it's before everything so we don't mess aliases that follow.
-unalias -a
-
-# We need this next line for "die" and "assert". It expands
-# It _must_ preceed all the calls to die and assert.
-shopt -s expand_aliases
-
-# Unset some variables that break things.
-unset GZIP BZIP BZIP2 CDPATH GREP_OPTIONS GREP_COLOR GLOB_IGNORE
-
-alias die='diefunc "$FUNCNAME" "$LINENO" "$?"'
-alias assert='_pipestatus="${PIPESTATUS[*]}"; [[ "${_pipestatus// /}" -eq 0 ]] || diefunc "$FUNCNAME" "$LINENO" "$_pipestatus"'
-alias save_IFS='[ "${IFS:-unset}" != "unset" ] && portage_old_IFS="${IFS}"'
-alias restore_IFS='if [ "${portage_old_IFS:-unset}" != "unset" ]; then IFS="${portage_old_IFS}"; unset portage_old_IFS; else unset IFS; fi'
-
-diefunc() {
- set +x
- local funcname="$1" lineno="$2" exitcode="$3"
- shift 3
- echo >&2
- echo "!!! ERROR: $CATEGORY/$PF failed." >&2
- dump_trace 2 >&2
- echo "!!! ${*:-(no error message)}" >&2
- echo "!!! If you need support, post the topmost build error, NOT this status message." >&2
- if [ "${EBUILD_PHASE/depend}" == "${EBUILD_PHASE}" ]; then
- for x in ${EBUILD_DEATH_HOOKS}; do
- ${x} ${1} ${2} ${3} "${@}" >&2 1>&2
- done
- fi
- echo >&2
- exit 1
-}
-
-
-shopt -s extdebug &> /dev/null
-
-# usage- first arg is the number of funcs on the stack to ignore.
-# defaults to 1 (ignoring dump_trace)
-dump_trace() {
- local funcname="" sourcefile="" lineno="" n e s="yes"
-
- declare -i strip=1
-
- if [[ -n $1 ]]; then
- strip=$(( $1 ))
- fi
-
- echo "Call stack:"
- for (( n = ${#FUNCNAME[@]} - 1, p = ${#BASH_ARGV[@]} ; n > $strip ; n-- )) ; do
- funcname=${FUNCNAME[${n} - 1]}
- sourcefile=$(basename ${BASH_SOURCE[${n}]})
- lineno=${BASH_LINENO[${n} - 1]}
- # Display function arguments
- args=
- if [[ -n "${BASH_ARGV[@]}" ]]; then
- for (( j = 0 ; j < ${BASH_ARGC[${n} - 1]} ; ++j )); do
- newarg=${BASH_ARGV[$(( p - j - 1 ))]}
- args="${args:+${args} }'${newarg}'"
- done
- (( p -= ${BASH_ARGC[${n} - 1]} ))
- fi
- echo " ${sourcefile}, line ${lineno}: Called ${funcname}${args:+ ${args}}"
- done
-}
-
-killparent() {
- trap INT
- kill ${PORTAGE_MASTER_PID}
-}
-
-hasq() {
- local x
-
- local me=$1
- shift
-
- # All the TTY checks really only help out depend. Which is nice.
- # Logging kills all this anyway. Everything becomes a pipe. --NJ
- for x in "$@"; do
- if [ "${x}" == "${me}" ]; then
- return 0
- fi
- done
- return 1
-}
-
-hasv() {
- if hasq "$@"; then
- echo "${1}"
- return 0
- fi
- return 1
-}
-
-#if no perms are specified, dirs/files will have decent defaults
-#(not secretive, but not stupid)
-umask 022
-
-# the sandbox is disabled by default except when overridden in the relevant stages
-export SANDBOX_ON="0"
-
-gen_func_filter() {
- if [ "$#" == "1" ]; then
- echo -n "$1"
- return
- fi
- echo -n "\($1"
- shift
- while [ -n "$1" ]; do
- # expand .* to a sane range
- echo -n "\|${1//.*/[A-Za-z0-9_-+./]*}"
- shift
- done
- echo -n "\)"
-}
-
-gen_var_filter() {
- if [ "$#" == 1 ]; then
- echo -n "$1"
- return
- fi
- echo -n "\($1"
- shift
- while [ -n "$1" ]; do
- # expand .* to a sane range
- echo -n "\|${1//.*/[A-Za-z0-9_+]*}"
- shift
- done
- echo -n "\)"
-}
-
-# func for beeping and delaying a defined period of time.
-sleepbeep() {
- if [ ! "$#" -lt 3 ] || [ ! "$#" -gt 0 ]; then
- echo "sleepbeep requires one arg- number of beeps"
- echo "additionally, can supply a 2nd arg- interval between beeps (defaults to 0.25s"
- die "invalid call to sleepbeep"
- fi
- local count=$(($1))
- local interval="${2:-0.25}"
- while [ $count -gt 0 ]; do
- echo -en "\a";
- sleep $interval &> /dev/null
- count=$(($count - 1))
- done
- return 0
-}
-
-# selectively saves the environ- specifically removes things that have been marked to not be exported.
-# dump the environ to stdout.
-dump_environ() {
- # scope it so we can pass the output through a sed correction for newlines.
- local x y;
- #env dump, if it doesn't match a var pattern, stop processing, else print only if
- #it doesn't match one of the filter lists.
- # vars, then funcs.
- declare | sed -n "/[a-zA-Z0-9_]\+=/! { q; }; /^$(gen_var_filter ${DONT_EXPORT_VARS} f x)=/! p;"
- fails=
- for x in $(declare -F | sed -n "s/^declare -f[^ ]* \+\([^ ]\+\) *\$/\1/; /^$(gen_func_filter ${DONT_EXPORT_FUNCS})$/! p;"); do
- y=$(declare -f "$x" 2> /dev/null)
- if [[ $? != 0 ]]; then
- # older bash that lacks declare -f x-y validity check fix.
- fails="$fails $x"
- else
- echo "$y"
- fi
- done
- if [ -n "$fails" ]; then
- declare | filter-env -F -f "${fails// /,}" -v '.*' | sed -e '/^[[:space:]]*$/d'
- fi
- unset fails
- if ! hasq "--no-attributes" "$@"; then
- echo $'reinstate_loaded_env_attributes ()\n{'
-# echo "echo starting reinstate \${EBUILD_PHASE}>&2;"
- for y in export 'declare -i' readonly; do
- x=$(${y} | sed -n "s:^declare \(-[^ ]\+ \)*\([A-Za-z0-9_+]\+\)\(=.*$\)\?$:\2:; /^$(gen_var_filter ${DONT_EXPORT_VARS} x y)$/! p;")
- [ -n "$x" ] && echo " ${y} $(echo $x);"
-# echo "echo dump- $y $(echo $x) >&2;"
-# echo "echo dump- $y original was $(echo $(${y})) >&2"
- done
-
- # if it's just declare -f some_func, filter it, else drop it if it's one of the filtered funcs
- declare -F | sed -n "/^declare -[^ ]\( \|[^ ]? $(gen_func_filter ${DONT_EXPORT_FUNCS})$\)\?/d; s/^/ /;s/;*$/;/p;"
-
- shopt -p | sed -e 's:^: :; s/;*$/;/;'
- echo "}"
- fi
-
-# debug-print "dumped"
- if [ -n "${DEBUGGING}" ]; then
- echo "#dumping debug info"
- echo "#var filter..."
- echo "#$(gen_var_filter ${DONT_EXPORT_VARS} f x | sort)"
- echo "#"
- echo "#funcs"
- declare -F | sed -e 's:^:# :'
- echo "#"
- echo "#func filter..."
- echo "#$(gen_func_filter ${DONT_EXPORT_FUNCS} | sort)"
- echo "#DONT_EXPORT_VARS follow"
- for x in `echo $DONT_EXPORT_VARS | sort`; do
- echo "# $x";
- done
- echo ""
- echo "#DONT_EXPORT_FUNCS follow"
- for x in `echo $DONT_EXPORT_FUNCS | sort`; do
- echo "# $x";
- done
- fi
-}
-
-# dump environ to $1, optionally piping it through $2 and redirecting $2's output to $1.
-export_environ() {
- local temp_umask
- if [ "${1:-unset}" == "unset" ]; then
- die "export_environ requires at least one arguement"
- fi
-
- #the spaces on both sides are important- otherwise, the later ${DONT_EXPORT_VARS/ temp_umask /} won't match.
- #we use spaces on both sides, to ensure we don't remove part of a variable w/ the same name-
- # ex: temp_umask_for_some_app == _for_some_app.
- #Do it with spaces on both sides.
-
- DONT_EXPORT_VARS="${DONT_EXPORT_VARS} temp_umask "
- temp_umask=`umask`
- umask 0002
-
- debug-print "exporting env for ${EBUILD_PHASE} to $1, using optional post-processor '${2:-none}'"
-
- if [ "${2:-unset}" == "unset" ]; then
- dump_environ > "$1"
- else
- dump_environ | $2 > "$1"
- fi
- chown portage:portage "$1" &>/dev/null
- chmod 0664 "$1" &>/dev/null
-
- DONT_EXPORT_VARS="${DONT_EXPORT_VARS/ temp_umask /}"
-
- umask $temp_umask
- debug-print "exported."
-}
-
-# reload a saved env, applying usual filters to the env prior to eval'ing it.
-load_environ() {
- local src e ret
- # localize these so the reload doesn't have the ability to change them
- local DONT_EXPORT_VARS="${DONT_EXPORT_VARS} src e ret"
- local DONT_EXPORT_FUNCS="${DONT_EXPORT_FUNCS} load_file declare"
- local SANDBOX_STATE=$SANDBOX_ON
- local EBUILD_PHASE=$EBUILD_PHASE
- local reload_failure=0
- SANDBOX_ON=0
-
- SANDBOX_READ="/bin:${SANDBOX_READ}:/dev/urandom:/dev/random:$PORTAGE_BIN_PATH"
- SANDBOX_ON=$SANDBOX_STATE
-
- if [ -n "$DEBUGGING" ]; then
- echo "loading env for $EBUILD_PHASE" >&2
- fi
-
- if [ -z "$1" ]; then
- die "load_environ called with no args, need args"
- fi
- src="$1"
- [ -n "$DEBUGGING" ] && echo "loading environment from $src" >&2
-
- # XXX: note all of the *very careful* handling of bash env dumps through this code, and the fact
- # it took 4 months to get it right. There's a reason you can't just pipe the $(export) to a file.
- # They were implemented wrong, as I stated when the export kludge was added.
- # so we're just dropping the attributes. .51-r4 should carry a fixed version, .51 -> .51-r3
- # aren't worth the trouble. Drop all inline declare's that would be executed.
- # potentially handle this via filter-env?
- # ~harring
- load_file() {
- if [ "${src%bz2}" != "${src}" ]; then
- bzcat "${src}"
- else
- cat "${src}"
- fi
- }
- if [ -f "$src" ]; then
- # double exec.
-# #2<>>(grep -v 'readonly' >&2)";
-# ; } 2<>>(grep -v 'readonly' >&2)";
-
- eval "$(
- unset DEBUGGING;
- function declare() {
- :
- };
- shopt -s execfail;
- eval "$(load_file "$src")"
- shopt -u execfail;
- unset -f declare load_file;
- # leave the existing reinstate attribs in place
- dump_environ --no-attributes;
- )"
- ret=$?
- else
- echo "ebuild=${EBUILD}, phase $EBUILD_PHASE" >&2
- ret=1
- fi
- unset -f load_file &> /dev/null;
- return $(( $ret ))
-}
-
-# walk the cascaded profile src'ing it's various bashrcs.
-# overriden by daemon normally.
-source_profiles() {
- local dir
- save_IFS
- # XXX: Given the following unset, is this set needed?
- IFS=$'\n'
- for dir in ${PROFILE_PATHS}; do
- # Must unset it so that it doesn't mess up assumptions in the RCs.
- unset IFS
- if [ -f "${dir}/profile.bashrc" ]; then
- source "${dir}/profile.bashrc"
- fi
- done
- restore_IFS
- if [ -f "$PORTAGE_BASHRC" ]; then
- source "$PORTAGE_BASHRC"
- fi
-}
-
-# do all profile, bashrc's, and ebuild sourcing. Should only be called in setup phase, unless the
-# env is *completely* missing, as it is occasionally for ebuilds during prerm/postrm.
-init_environ() {
-# echo "initializating environment" >&2
- OCC="$CC"
- OCXX="$CXX"
-
-
- # XXX this too, sucks.
-# export PATH="/sbin:/usr/sbin:/usr/lib/portage/bin:/bin:/usr/bin"
- if [ "${EBUILD_PHASE}" == "setup" ]; then
- #we specifically save the env so it's not stomped on by sourcing.
- #bug 51552
- dump_environ --no-attributes > "${T}/.temp_env"
-
- if [ "$USERLAND" == "GNU" ]; then
- local PORTAGE_SHIFTED_PATH="$PATH"
- source /etc/profile.env &>/dev/null
- PATH="${PORTAGE_SHIFTED_PATH:+${PORTAGE_SHIFTED_PATH}}${PATH:+:${PATH}}"
- fi
- #shift path. I don't care about 51552, I'm not using the env's supplied path, alright? :)
-
- #restore the saved env vars.
- if ! load_environ "${T}/.temp_env"; then
- #this shouldn't happen.
- die "failed to load ${T}/.tmp_env- fs is readonly?"
- fi
-
- rm "${T}/.temp_env"
- source_profiles
- fi
-
- if [ "${EBUILD_PHASE}" != "depend" ]; then
- [ ! -z "$OCC" ] && export CC="$OCC"
- [ ! -z "$OCXX" ] && export CXX="$OCXX"
-
- fi
-
- # if daemonized, it's already loaded these funcs.
- if [ "$DAEMONIZED" != "yes" ]; then
- source "${PORTAGE_BIN_PATH}/ebuild-functions.sh" || die "failed sourcing ebuild-functions.sh"
- fi
- SANDBOX_ON="1"
- export S=${WORKDIR}/${P}
-
- # Expand KEYWORDS
- # We need to turn off pathname expansion for -* in KEYWORDS and
- # we need to escape ~ to avoid tilde expansion (damn bash) :)
- set -f
- KEYWORDS="$(echo ${KEYWORDS//~/\\~})"
- set +f
-
- unset IUSE DEPEND RDEPEND CDEPEND PDEPEND
- unset E_IUSE E_DEPEND E_RDEPEND E_CDEPEND E_PDEPEND
-
- if [ ! -f "${EBUILD}" ]; then
- echo "bailing, ebuild not found at '$EBUILD'"
- die "EBUILD=${EBUILD}; problem is, it doesn't exist. bye." >&2
- fi
-
-# eval "$(cat "${EBUILD}"; echo ; echo 'true')" || die "error sourcing ebuild"
- source "${EBUILD}"
- if [ "${EBUILD_PHASE}" != "depend" ]; then
- RESTRICT="${PORTAGE_RESTRICT}"
- unset PORTAGE_RESTRICT
- fi
-
- [ -z "${ERRORMSG}" ] || die "${ERRORMSG}"
-
- hasq nostrip ${RESTRICT} && export DEBUGBUILD=1
-
- #a reasonable default for $S
- if [ "$S" = "" ]; then
- export S=${WORKDIR}/${P}
- fi
-
- #some users have $TMP/$TMPDIR to a custom dir in their home ...
- #this will cause sandbox errors with some ./configure
- #scripts, so set it to $T.
- export TMP="${T}"
- export TMPDIR="${T}"
-
- # Note: this next line is not the same as export RDEPEND=${RDEPEND:-${DEPEND}}
- # That will test for unset *or* NULL (""). We want just to set for unset...
-
- #turn off glob expansion from here on in to prevent *'s and ? in the DEPEND
- #syntax from getting expanded :) Fixes bug #1473
-# set -f
- if [ "${RDEPEND-unset}" == "unset" ]; then
- export RDEPEND="${DEPEND}"
- debug-print "RDEPEND: not set... Setting to: ${DEPEND}"
- fi
-
- #add in dependency info from eclasses
- IUSE="$IUSE $E_IUSE"
- DEPEND="${DEPEND} ${E_DEPEND}"
- RDEPEND="$RDEPEND $E_RDEPEND"
- CDEPEND="$CDEPEND $E_CDEPEND"
- PDEPEND="$PDEPEND $E_PDEPEND"
-
- unset E_IUSE E_DEPEND E_RDEPEND E_CDEPEND E_PDEPEND
-# set +f
-
-# declare -r DEPEND RDEPEND SLOT SRC_URI RESTRICT HOMEPAGE LICENSE DESCRIPTION
-# declare -r KEYWORDS INHERITED IUSE CDEPEND PDEPEND PROVIDE
-# echo "DONT_EXPORT_FUNCS=$DONT_EXPORT_FUNCS" >&2
-}
-
-# short version. think these should be sourced via at the daemons choice, rather then defacto.
-source "${PORTAGE_BIN_PATH}/ebuild-default-functions.sh" || die "failed sourcing ebuild-default-functions.sh"
-source "${PORTAGE_BIN_PATH}/isolated-functions.sh" || die "failed sourcing stripped down functions.sh"
-
-# general func to call for phase execution. this handles necessary env loading/dumping, and executing pre/post/dyn
-# calls.
-execute_phases() {
- local ret
- for myarg in $*; do
- EBUILD_PHASE="$myarg"
- MUST_EXPORT_ENV="no"
- case $EBUILD_PHASE in
- nofetch)
- init_environ
- pkg_nofetch
- ;;
- prerm|postrm|preinst|postinst|config)
- export SANDBOX_ON="0"
-
- if ! load_environ "${PORT_ENV_FILE}"; then
- #hokay. this sucks.
- ewarn
- ewarn "failed to load env"
- ewarn "this installed pkg may not behave correctly"
- ewarn
- sleepbeep 10
- fi
-
- if type reinstate_loaded_env_attributes &> /dev/null; then
- reinstate_loaded_env_attributes
- unset -f reinstate_loaded_env_attributes
- fi
- [ "$PORTAGE_DEBUG" == "1" ] && set -x
- type -p pre_pkg_${EBUILD_PHASE} &> /dev/null && pre_pkg_${EBUILD_PHASE}
- if type -p dyn_${EBUILD_PHASE}; then
- dyn_${EBUILD_PHASE}
- else
- pkg_${EBUILD_PHASE}
- fi
- ret=0
- type -p post_pkg_${EBUILD_PHASE} &> /dev/null && post_pkg_${EBUILD_PHASE}
- [ "$PORTAGE_DEBUG" == "1" ] && set +x
- ;;
- clean)
- einfo "clean phase is now handled in the python side of portage."
- einfo "ebuild-daemon calls it correctly, upgrading from vanilla portage to ebd"
- einfo "always triggers this though. Please ignore it."
- ;;
- unpack|compile|test|install)
- if [ "${SANDBOX_DISABLED="0"}" == "0" ]; then
- export SANDBOX_ON="1"
- else
- export SANDBOX_ON="0"
- fi
-
- if ! load_environ ${T}/environment; then
- ewarn
- ewarn "failed to load env. This is bad, bailing."
- die "unable to load saved env for phase $EBUILD_PHASE, unwilling to continue"
- fi
- if type reinstate_loaded_env_attributes &> /dev/null; then
-# echo "reinstating attribs" >&2
- reinstate_loaded_env_attributes
- unset -f reinstate_loaded_env_attributes
- fi
- [ "$PORTAGE_DEBUG" == "1" ] && set -x
- type -p pre_src_${EBUILD_PHASE} &> /dev/null && pre_src_${EBUILD_PHASE}
- dyn_${EBUILD_PHASE}
- ret=0
- type -p post_src_${EBUILD_PHASE} &> /dev/null && post_src_${EBUILD_PHASE}
- [ "$PORTAGE_DEBUG" == "1" ] && set +x
- export SANDBOX_ON="0"
- ;;
- setup)
- #pkg_setup needs to be out of the sandbox for tmp file creation;
- #for example, awking and piping a file in /tmp requires a temp file to be created
- #in /etc. If pkg_setup is in the sandbox, both our lilo and apache ebuilds break.
-
- export SANDBOX_ON="0"
-
- [ ! -z "${DISTCC_LOG}" ] && addwrite "$(dirname ${DISTCC_LOG})"
-
- local x
- # if they aren't set, then holy hell ensues. deal.
-
- [ -z "${CCACHE_SIZE}" ] && export CCACHE_SIZE="500M"
- ccache -M ${CCACHE_SIZE} &> /dev/null
- init_environ
- MUST_EXPORT_ENV="yes"
-
- [ "$PORTAGE_DEBUG" == "1" ] && set -x
- type -p pre_pkg_${EBUILD_PHASE} &> /dev/null && pre_pkg_${EBUILD_PHASE}
- dyn_${EBUILD_PHASE}
- ret=0;
- type -p post_pkg_${EBUILD_PHASE} &> /dev/null && post_pkg_${EBUILD_PHASE}
- [ "$PORTAGE_DEBUG" == "1" ] && set +x
-
- ;;
- depend)
- SANDBOX_ON="1"
- MUST_EXPORT_ENV="no"
-
- trap 'killparent' INT
- if [ -z "$QA_CONTROLLED_EXTERNALLY" ]; then
- enable_qa_interceptors
- fi
-
- init_environ
-
- if [ -z "$QA_CONTROLLED_EXTERNALLY" ]; then
- disable_qa_interceptors
- fi
- trap - INT
-
- set -f
- [ "${DEPEND:-unset}" != "unset" ] && speak "key DEPEND=$(echo $DEPEND)"
- [ "${RDEPEND:-unset}" != "unset" ] && speak "key RDEPEND=$(echo $RDEPEND)"
- [ "$SLOT:-unset}" != "unset" ] && speak "key SLOT=$(echo $SLOT)"
- [ "$SRC_URI:-unset}" != "unset" ] && speak "key SRC_URI=$(echo $SRC_URI)"
- [ "$RESTRICT:-unset}" != "unset" ] && speak "key RESTRICT=$(echo $RESTRICT)"
- [ "$HOMEPAGE:-unset}" != "unset" ] && speak "key HOMEPAGE=$(echo $HOMEPAGE)"
- [ "$LICENSE:-unset}" != "unset" ] && speak "key LICENSE=$(echo $LICENSE)"
- [ "$DESCRIPTION:-unset}" != "unset" ] && speak "key DESCRIPTION=$(echo $DESCRIPTION)"
- [ "$KEYWORDS:-unset}" != "unset" ] && speak "key KEYWORDS=$(echo $KEYWORDS)"
- [ "$INHERITED:-unset}" != "unset" ] && speak "key INHERITED=$(echo $INHERITED)"
- [ "$IUSE:-unset}" != "unset" ] && speak "key IUSE=$(echo $IUSE)"
- [ "$CDEPEND:-unset}" != "unset" ] && speak "key CDEPEND=$(echo $CDEPEND)"
- [ "$PDEPEND:-unset}" != "unset" ] && speak "key PDEPEND=$(echo $PDEPEND)"
- [ "$PROVIDE:-unset}" != "unset" ] && speak "key PROVIDE=$(echo $PROVIDE)"
- [ "$EAPI:-unset}" != "unset" ] && speak "key EAPI=$(echo $EAPI)"
- set +f
- ;;
- *)
- export SANDBOX_ON="1"
- echo "Please specify a valid command: $EBUILD_PHASE isn't valid."
- echo
- dyn_help
- exit 1
- ;;
- esac
-
- if [ "${MUST_EXPORT_ENV}" == "yes" ]; then
- export_environ "${PORT_ENV_FILE:-${T}/environment}"
- MUST_EXPORT_ENV="no"
- fi
- done
- return ${ret:-0}
-}
-
-#echo, everything has been sourced. now level the read-only's.
-if [ "$*" != "daemonize" ]; then
- for x in ${DONT_EXPORT_FUNCS}; do
- declare -fr "$x"
- done
- unset x
-fi
-
-f="$(declare | {
- read l;
- while [ "${l% \(\)}" == "$l" ]; do
- echo "${l/=*}";
- read l;
- done;
- unset l
- })"
-
-#update the don't export filters.
-if [ -z "${ORIG_VARS}" ]; then
- DONT_EXPORT_VARS="${DONT_EXPORT_VARS} ${f}"
-else
- DONT_EXPORT_VARS="${DONT_EXPORT_VARS} $(echo "${f}" | egrep -v "^$(gen_var_filter ${ORIG_VARS})\$")"
-fi
-unset f
-
-# I see no differance here...
-if [ -z "${ORIG_FUNCS}" ]; then
- DONT_EXPORT_FUNCS="${DONT_EXPORT_FUNCS} $(declare -F | cut -s -d ' ' -f 3)"
-else
- DONT_EXPORT_FUNCS="${DONT_EXPORT_FUNCS} $(declare -F | cut -s -d ' ' -f 3 )"
-fi
-set +f
-
-export XARGS
-if [ "$(id -nu)" == "portage" ] ; then
- export USER=portage
-fi
-set +H -h
-# if we're being src'd for our functions, do nothing. if called directly, define a few necessary funcs.
-if [ "$*" != "daemonize" ]; then
-
- if [ "${*/depend}" != "$*" ]; then
- speak() {
- echo "$*" >&4
- }
- declare -rf speak
- fi
- if [ -z "${NOCOLOR}" ]; then
- set_colors
- else
- unset_colors
- fi
- unset x
- execute_phases $*
- exit 0
-else
- DAEMONIZED="yes"
- export DAEMONIZED
- readonly DAEMONIZED
-fi
-:
diff --git a/bin/ebuild-env/isolated-functions.sh b/bin/ebuild-env/isolated-functions.sh
deleted file mode 100644
index 20be25e7..00000000
--- a/bin/ebuild-env/isolated-functions.sh
+++ /dev/null
@@ -1,209 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header$
-
-# Internal logging function, don't use this in ebuilds
-elog_base() {
- local messagetype
- [ -z "${1}" -o -z "${T}" -o ! -d "${T}/logging" ] && return 1
- case "${1}" in
- INFO|WARN|ERROR|LOG)
- messagetype="${1}"
- shift
- ;;
- *)
- echo -e " ${BAD}*${NORMAL} Invalid use of internal function elog_base(), next message will not be logged"
- return 1
- ;;
- esac
- echo "$*" >> ${T}/logging/${EBUILD_PHASE}.${messagetype}
- return 0
-}
-
-elog() {
- elog_base LOG "$*"
- echo -e " ${GOOD}*${NORMAL} $*"
- 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() {
- einfon "$*\n"
- LAST_E_CMD="einfo"
- return 0
-}
-
-einfon() {
- elog_base INFO "$*"
- [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo -ne " ${GOOD}*${NORMAL} $*"
- LAST_E_CMD="einfon"
- return 0
-}
-
-ewarn() {
- elog_base WARN "$*"
- [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo -e " ${WARN}*${NORMAL} ${RC_INDENTATION}$*"
- LAST_E_CMD="ewarn"
- return 0
-}
-
-eerror() {
- elog_base ERROR "$*"
- [[ ${RC_ENDCOL} != "yes" && ${LAST_E_CMD} == "ebegin" ]] && echo
- echo -e " ${BAD}*${NORMAL} ${RC_INDENTATION}$*"
- LAST_E_CMD="eerror"
- return 0
-}
-
-ebegin() {
- local msg="$*" dots spaces=${RC_DOT_PATTERN//?/ }
- if [[ -n ${RC_DOT_PATTERN} ]] ; then
- dots=$(printf "%$(( COLS - 3 - ${#RC_INDENTATION} - ${#msg} - 7 ))s" '')
- dots=${dots//${spaces}/${RC_DOT_PATTERN}}
- msg="${msg}${dots}"
- else
- msg="${msg} ..."
- fi
- einfon "${msg}"
- [[ ${RC_ENDCOL} == "yes" ]] && echo
- LAST_E_LEN=$(( 3 + ${#RC_INDENTATION} + ${#msg} ))
- LAST_E_CMD="ebegin"
- return 0
-}
-
-_eend() {
- local retval=${1:-0} efunc=${2:-eerror} msg
- shift 2
-
- if [[ ${retval} == "0" ]] ; then
- msg="${BRACKET}[ ${GOOD}ok${BRACKET} ]${NORMAL}"
- else
- if [[ -n $* ]] ; then
- ${efunc} "$*"
- fi
- msg="${BRACKET}[ ${BAD}!!${BRACKET} ]${NORMAL}"
- fi
-
- if [[ ${RC_ENDCOL} == "yes" ]] ; then
- echo -e "${ENDCOL} ${msg}"
- else
- [[ ${LAST_E_CMD} == ebegin ]] || LAST_E_LEN=0
- printf "%$(( COLS - LAST_E_LEN - 6 ))s%b\n" '' "${msg}"
- fi
-
- return ${retval}
-}
-
-eend() {
- local retval=${1:-0}
- shift
-
- _eend ${retval} eerror "$*"
-
- return ${retval}
-}
-
-KV_major() {
- [[ -z $1 ]] && return 1
-
- local KV=$@
- echo "${KV%%.*}"
-}
-
-KV_minor() {
- [[ -z $1 ]] && return 1
-
- local KV=$@
- KV=${KV#*.}
- echo "${KV%%.*}"
-}
-
-KV_micro() {
- [[ -z $1 ]] && return 1
-
- local KV=$@
- KV=${KV#*.*.}
- echo "${KV%%[^[:digit:]]*}"
-}
-
-KV_to_int() {
- [[ -z $1 ]] && return 1
-
- local KV_MAJOR=$(KV_major "$1")
- local KV_MINOR=$(KV_minor "$1")
- local KV_MICRO=$(KV_micro "$1")
- local KV_int=$(( KV_MAJOR * 65536 + KV_MINOR * 256 + KV_MICRO ))
-
- # We make version 2.2.0 the minimum version we will handle as
- # a sanity check ... if its less, we fail ...
- if [[ ${KV_int} -ge 131584 ]] ; then
- echo "${KV_int}"
- return 0
- fi
-
- return 1
-}
-
-_RC_GET_KV_CACHE=""
-get_KV() {
- [[ -z ${_RC_GET_KV_CACHE} ]] \
- && _RC_GET_KV_CACHE=$(uname -r)
-
- echo $(KV_to_int "${_RC_GET_KV_CACHE}")
-
- return $?
-}
-
-unset_colors() {
- COLS="25 80"
- ENDCOL=
-
- GOOD=
- WARN=
- BAD=
- NORMAL=
- HILITE=
- BRACKET=
-}
-
-set_colors() {
- COLS=${COLUMNS:-0} # bash's internal COLUMNS variable
- (( COLS == 0 )) && COLS=$(set -- `stty size 2>/dev/null` ; echo $2)
- (( COLS > 0 )) || (( COLS = 80 ))
- COLS=$((${COLS} - 8)) # width of [ ok ] == 7
-
- ENDCOL=$'\e[A\e['${COLS}'C' # Now, ${ENDCOL} will move us to the end of the
- # column; irregardless of character width
-
- GOOD=$'\e[32;01m'
- WARN=$'\e[33;01m'
- BAD=$'\e[31;01m'
- HILITE=$'\e[36;01m'
- BRACKET=$'\e[34;01m'
- NORMAL=$'\e[0m'
-}
-
-RC_ENDCOL="yes"
-RC_INDENTATION=''
-RC_DEFAULT_INDENT=2
-RC_DOT_PATTERN=''
-true
diff --git a/bin/ebuild-helpers/dobin b/bin/ebuild-helpers/dobin
deleted file mode 100755
index a3269ede..00000000
--- a/bin/ebuild-helpers/dobin
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dobin,v 1.13 2004/10/04 13:56:50 vapier Exp $
-
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-if [[ ! -d ${D}${DESTTREE}/bin ]] ; then
- install -d "${D}${DESTTREE}/bin" || exit 2
-fi
-
-ret=0
-
-for x in "$@" ; do
- if [[ -e ${x} ]] ; then
- install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/bin"
- else
- echo "!!! ${0##*/}: ${x} does not exist" 1>&2
- false
- fi
- ((ret+=$?))
-done
-
-exit ${ret}
diff --git a/bin/ebuild-helpers/doconfd b/bin/ebuild-helpers/doconfd
deleted file mode 100755
index e9ea1fdf..00000000
--- a/bin/ebuild-helpers/doconfd
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/doconfd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $
-
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-exec \
-env \
-INSDESTTREE="/etc/conf.d/" \
-doins "$@"
diff --git a/bin/ebuild-helpers/dodir b/bin/ebuild-helpers/dodir
deleted file mode 100755
index bc4f7f57..00000000
--- a/bin/ebuild-helpers/dodir
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dodir,v 1.5 2004/10/04 13:56:50 vapier Exp $
-
-slash=/
-exec install -d ${DIROPTIONS} "${@/#${slash}/${D}${slash}}"
diff --git a/bin/ebuild-helpers/dodoc b/bin/ebuild-helpers/dodoc
deleted file mode 100755
index 60b6a274..00000000
--- a/bin/ebuild-helpers/dodoc
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-if [ $# -lt 1 ] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-dir="${D}usr/share/doc/${PF}/${DOCDESTTREE}"
-if [ ! -d "${dir}" ] ; then
- install -d "${dir}"
-fi
-
-ret=0
-for x in "$@" ; do
- if [ -s "${x}" ] ; then
- install -m0644 "${x}" "${dir}"
- gzip -f -9 "${dir}/${x##*/}"
- elif [ ! -e "${x}" ] ; then
- echo "dodoc: ${x} does not exist" 1>&2
- ((++ret))
- fi
-done
-
-exit ${ret}
diff --git a/bin/ebuild-helpers/doenvd b/bin/ebuild-helpers/doenvd
deleted file mode 100755
index 5232ed90..00000000
--- a/bin/ebuild-helpers/doenvd
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/doenvd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $
-
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-exec \
-env \
-INSDESTTREE="/etc/env.d/" \
-doins "$@"
diff --git a/bin/ebuild-helpers/doexe b/bin/ebuild-helpers/doexe
deleted file mode 100755
index 818c8a5b..00000000
--- a/bin/ebuild-helpers/doexe
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/doexe,v 1.10.2.1 2004/12/06 03:01:43 carpaski Exp $
-
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-if [[ ! -d ${D}${EXEDESTTREE} ]] ; then
- install -d "${D}${EXEDESTTREE}"
-fi
-
-for x in "$@" ; do
- if [ -L "${x}" ] ; then
- cp "${x}" "${T}"
- mysrc="${T}"/$(/usr/bin/basename "${x}")
- elif [ -d "${x}" ] ; then
- vecho "doexe: warning, skipping directory ${x}"
- continue
- else
- mysrc="${x}"
- fi
- install ${EXEOPTIONS} "${mysrc}" "${D}${EXEDESTTREE}"
-done
diff --git a/bin/ebuild-helpers/dohard b/bin/ebuild-helpers/dohard
deleted file mode 100755
index 03b5e67a..00000000
--- a/bin/ebuild-helpers/dohard
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dohard,v 1.6 2004/10/04 13:56:50 vapier Exp $
-
-if [[ $# -ne 2 ]] ; then
- echo "$0: two arguments needed" 1>&2
- exit 1
-fi
-
-target=$1
-linkname=$2
-exec ln -f "${D}${target}" "${D}${linkname}"
diff --git a/bin/ebuild-helpers/dohtml b/bin/ebuild-helpers/dohtml
deleted file mode 100755
index ac31e809..00000000
--- a/bin/ebuild-helpers/dohtml
+++ /dev/null
@@ -1,172 +0,0 @@
-#!/usr/bin/python
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dohtml,v 1.14.2.1 2004/10/27 14:39:29 jstubbs Exp $
-
-#
-# Typical usage:
-# dohtml -r docs/*
-# - put all files and directories in docs into /usr/share/doc/${PF}/html
-# dohtml foo.html
-# - put foo.html into /usr/share/doc/${PF}/html
-#
-#
-# Detailed usage:
-# dohtml <list-of-files>
-# - will install the files in the list of files (space-separated list) into
-# /usr/share/doc/${PF}/html, provided the file ends in .html, .png, .jpg
-# or .css
-# dohtml -r <list-of-files-and-directories>
-# - will do as 'dohtml', but recurse into all directories, as long as the
-# directory name is not CVS
-# dohtml -A jpe,java [-r] <list-of-files[-and-directories]>
-# - will do as 'dohtml' but add .jpe,.java (default filter list is
-# added to your list)
-# dohtml -a png,gif,html,htm [-r] <list-of-files[-and-directories]>
-# - will do as 'dohtml' but filter on .png,.gif,.html,.htm (default filter
-# list is ignored)
-# dohtml -x CVS,SCCS,RCS -r <list-of-files-and-directories>
-# - will do as 'dohtml -r', but ignore directories named CVS, SCCS, RCS
-#
-
-import os
-import string
-import sys
-import types
-
-def dodir(path):
- os.system("install -d '%s'" % path)
-
-def dofile(src,dst):
-
- os.system("install -m0644 '%s' '%s'" % (src, dst))
-
-def install(basename, dirname, options, prefix=""):
-
- fullpath = basename
- if prefix: fullpath = prefix + "/" + fullpath
- if dirname: fullpath = dirname + "/" + fullpath
-
- if options.DOCDESTTREE:
- destdir = options.D + "usr/share/doc/" + options.PF + "/" + options.DOCDESTTREE + "/" + options.doc_prefix + "/" + prefix
- else:
- destdir = options.D + "usr/share/doc/" + options.PF + "/html/" + options.doc_prefix + "/" + prefix
-
- if os.path.isfile(fullpath):
- ext = os.path.splitext(basename)[1]
- if (len(ext) and ext[1:] in options.allowed_exts) or basename in options.allowed_files:
- dodir(destdir)
- dofile(fullpath, destdir + "/" + basename)
- elif options.recurse and os.path.isdir(fullpath) and \
- basename not in options.disallowed_dirs:
- for i in os.listdir(fullpath):
- pfx = basename
- if prefix: pfx = prefix + "/" + pfx
- install(i, dirname, options, pfx)
- else:
- return False
- return True
-
-
-class OptionsClass:
- def __init__(self):
- self.PF = ""
- self.D = ""
- self.DOCDESTTREE = ""
-
- if os.environ.has_key("PF"):
- self.PF = os.environ["PF"]
- if os.environ.has_key("D"):
- self.D = os.environ["D"]
- if os.environ.has_key("DOCDESTTREE"):
- self.DOCDESTTREE = os.environ["DOCDESTTREE"]
-
- self.allowed_exts = [ 'png', 'gif', 'html', 'htm', 'jpg', 'css', 'js' ]
- self.allowed_files = []
- self.disallowed_dirs = [ 'CVS' ]
- self.recurse = False
- self.verbose = False
- self.doc_prefix = ""
-
-def print_help():
- opts = OptionsClass()
-
- print "dohtml [-a .foo,.bar] [-A .foo,.bar] [-f foo,bar] [-x foo,bar]"
- print " [-r] [-V] <file> [file ...]"
- print
- print " -a Set the list of allowed to those that are specified."
- print " Default:", string.join(opts.allowed_exts, ",")
- print " -A Extend the list of allowed file types."
- print " -f Set list of allowed extensionless file names."
- print " -x Set directories to be excluded from recursion."
- print " Default:", string.join(opts.disallowed_dirs, ",")
- print " -r Install files and directories recursively."
- print " -V Be verbose."
- print
-
-def parse_args():
- options = OptionsClass()
- args = []
-
- x = 1
- while x < len(sys.argv):
- arg = sys.argv[x]
- if arg in ["-h","-r","-V"]:
- if arg == "-h":
- print_help()
- sys.exit(0)
- elif arg == "-r":
- options.recurse = True
- elif arg == "-V":
- options.verbose = True
- elif sys.argv[x] in ["-A","-a","-f","-x","-p"]:
- x += 1
- if x == len(sys.argv):
- print_help()
- sys.exit(0)
- elif arg == "-p":
- options.doc_prefix = sys.argv[x]
- else:
- values = string.split(sys.argv[x], ",")
- if arg == "-A":
- options.allowed_exts.extend(values)
- elif arg == "-a":
- options.allowed_exts = values
- elif arg == "-f":
- options.allowed_files = values
- elif arg == "-x":
- options.disallowed_dirs = values
- else:
- args.append(sys.argv[x])
- x += 1
-
- return (options, args)
-
-def main():
-
- (options, args) = parse_args()
-
- if type(options.allowed_exts) == types.StringType:
- options.allowed_exts = options.allowed_exts.split(",")
-
- if options.verbose:
- print "Allowed extensions:", options.allowed_exts
- print "Document prefix : '" + options.doc_prefix + "'"
- print "Allowed files :", options.allowed_files
-
- success = True
-
- for x in args:
- basename = os.path.basename(x)
- dirname = os.path.dirname(x)
- success = success and install(basename, dirname, options)
-
- if success:
- retcode = 0
- else:
- retcode = 1
-
- sys.exit(retcode)
-
-if __name__ == "__main__":
- main()
diff --git a/bin/ebuild-helpers/doinfo b/bin/ebuild-helpers/doinfo
deleted file mode 100755
index 67b163b1..00000000
--- a/bin/ebuild-helpers/doinfo
+++ /dev/null
@@ -1,21 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/doinfo,v 1.7 2004/10/04 13:56:50 vapier Exp $
-
-if [ ${#} -lt 1 ] ; then
- echo "doinfo: at least one argument needed"
- exit 1
-fi
-if [ ! -d "${D}usr/share/info" ] ; then
- install -d "${D}usr/share/info"
-fi
-
-for x in "$@" ; do
- if [ -e "${x}" ] ; then
- install -m0644 "${x}" "${D}usr/share/info"
- gzip -f -9 "${D}usr/share/info/${x##*/}"
- else
- echo "doinfo: ${x} does not exist"
- fi
-done
diff --git a/bin/ebuild-helpers/doinitd b/bin/ebuild-helpers/doinitd
deleted file mode 100755
index 8aae1b38..00000000
--- a/bin/ebuild-helpers/doinitd
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/doinitd,v 1.2.2.1 2005/01/13 04:51:56 vapier Exp $
-
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-exec \
-env \
-EXEDESTTREE="/etc/init.d/" \
-doexe "$@"
diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
deleted file mode 100755
index f35cbc63..00000000
--- a/bin/ebuild-helpers/doins
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/doins,v 1.7.2.2 2004/12/17 22:25:13 carpaski Exp $
-
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-
-if [ $# -lt 1 ] ; then
- echo "${0}: at least one argument needed"
- exit 1
-fi
-
-if [ "${1}" == "-r" ] ; then
- DOINSRECUR=y
- shift
-else
- DOINSRECUR=n
-fi
-[ -z "${INSDEPTH}" ] && declare -i INSDEPTH=0
-if [ ${INSDEPTH} -gt 30 ] ; then
- echo "${0}: sanity check ... 30 directories is too much :("
- exit 1
-fi
-
-if [ "${INSDESTTREE%${D}*}" == "" ]; then
- vecho "-------------------------------------------------------" 1>&2
- vecho "You should not use \${D} with helpers." 1>&2
- vecho " --> ${INSDESTTREE}" 1>&2
- vecho "-------------------------------------------------------" 1>&2
- #exit 1
-fi
-
-[ ! -d "${D}${INSDESTTREE}" ] && dodir "${INSDESTTREE}"
-
-for x in "$@" ; do
- if [ -L "$x" ] ; then
- cp "$x" "${T}"
- mysrc="${T}/$(/usr/bin/basename "${x}")"
- elif [ -d "$x" ] ; then
- if [ "${DOINSRECUR}" == "n" ] ; then
- continue
- fi
-
- mydir="${INSDESTTREE}/$(basename "${x}")"
- find "${x}" -mindepth 1 -maxdepth 1 -exec \
- env \
- INSDESTTREE="${mydir}" \
- INSDEPTH=$((INSDEPTH+1)) \
- doins -r {} \;
- continue
- else
- mysrc="${x}"
- fi
- install ${INSOPTIONS} "${mysrc}" "${D}${INSDESTTREE}"
-done
diff --git a/bin/ebuild-helpers/dojar b/bin/ebuild-helpers/dojar
deleted file mode 100755
index e61015ef..00000000
--- a/bin/ebuild-helpers/dojar
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dojar,v 1.8 2004/10/04 13:56:50 vapier Exp $
-# Author Karl Trygve Kalleberg <karltk@gentoo.org>
-
-#
-# Typical usage:
-# dojar foo.jar bar.jar
-# - installs foo.jar and bar.jar into /usr/share/${PN}/lib, and adds them
-# both to /usr/share/${PN}/classpath.env
-#
-# Detailed usage
-# dojar <list-of-jars>
-# - installs <list-of-jars> into /usr/share/${PN}/lib and adds each to
-# /usr/share/${PN}/classpath.env.
-#
-# The classpath.env file is currently merely a convenience for the user as
-# it allows him to:
-# export CLASSPATH=${CLASSPATH}:`cat /usr/share/foo/classpath.env`
-#
-# For many packages that set FOO_HOME, placing the jar files into
-# lib will allow the user to set FOO_HOME=/usr/share/foo and have the
-# scripts work as expected.
-#
-# Possibly a jarinto will be needed in the future.
-#
-
-if [ -z "$JARDESTTREE" ] ; then
- JARDESTTREE="lib"
-fi
-
-jarroot="${DESTTREE}/share/${PN}/"
-jardest="${DESTTREE}/share/${PN}/${JARDESTTREE}/"
-pf="${D}${jarroot}/package.env"
-
-dodir "${jardest}"
-
-for i in $* ; do
- bn="$(basename $i)"
-
- if [ -f "$pf" ] ; then
- oldcp=$(grep "CLASSPATH=" "$pf" | sed "s/CLASSPATH=//")
- grep -v "CLASSPATH=" "$pf" > "${pf}.new"
- echo "CLASSPATH=${oldcp}:${jardest}${bn}" >> "${pf}.new"
- mv "${pf}.new" "$pf"
- else
- echo "DESCRIPTION=\"${DESCRIPTION}\"" > "$pf"
- echo "CLASSPATH=${jardest}${bn}" >> "$pf"
- fi
-
- cp "$i" "${D}${jardest}/"
- chmod 0444 "${D}${jardest}/${bn}"
-done
diff --git a/bin/ebuild-helpers/dolib b/bin/ebuild-helpers/dolib
deleted file mode 100755
index 1a615257..00000000
--- a/bin/ebuild-helpers/dolib
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dolib,v 1.8.2.2 2005/01/12 02:07:15 carpaski Exp $
-
-# Setup ABI cruft
-LIBDIR_VAR="LIBDIR_${ABI}"
-if [[ -n ${ABI} && -n ${!LIBDIR_VAR} ]] ; then
- CONF_LIBDIR=${!LIBDIR_VAR}
-fi
-unset LIBDIR_VAR
-# we need this to default to lib so that things dont break
-CONF_LIBDIR=${CONF_LIBDIR:-lib}
-libdir="${D}${DESTTREE}/${CONF_LIBDIR}"
-
-
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-if [[ ! -d ${libdir} ]] ; then
- install -d "${libdir}" || exit 1
-fi
-
-ret=0
-
-for x in "$@" ; do
- if [[ -e ${x} ]] ; then
- if [[ ! -L ${x} ]] ; then
- install ${LIBOPTIONS} "${x}" "${libdir}"
- else
- ln -s "$(readlink "${x}")" "${libdir}/${x##*/}"
- fi
- else
- echo "!!! ${0##*/}: ${x} does not exist" 1>&2
- false
- fi
- ((ret+=$?))
-done
-
-exit ${ret}
diff --git a/bin/ebuild-helpers/dolib.a b/bin/ebuild-helpers/dolib.a
deleted file mode 100755
index c4df4a46..00000000
--- a/bin/ebuild-helpers/dolib.a
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dolib.a,v 1.8 2004/10/10 10:07:20 carpaski Exp $
-
-exec env LIBOPTIONS="-m0644" \
- dolib "$@"
diff --git a/bin/ebuild-helpers/dolib.so b/bin/ebuild-helpers/dolib.so
deleted file mode 100755
index efd8c169..00000000
--- a/bin/ebuild-helpers/dolib.so
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dolib.so,v 1.12 2004/10/10 10:07:20 carpaski Exp $
-
-exec env LIBOPTIONS="-m0755" \
- dolib "$@"
diff --git a/bin/ebuild-helpers/doman b/bin/ebuild-helpers/doman
deleted file mode 100755
index 2ed65ffc..00000000
--- a/bin/ebuild-helpers/doman
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/doman,v 1.13.2.2 2005/07/29 05:55:34 vapier Exp $
-
-source "${PORTAGE_BIN_PATH:-/usr/lib/portage/bin}"/isolated-functions.sh
-
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-i18n=""
-
-ret=0
-
-for x in "$@" ; do
- if [[ ${x:0:6} == "-i18n=" ]] ; then
- i18n=${x:6}/
- continue
- fi
- if [[ ${x} == ".keep" ]] ; then
- continue
- fi
-
- suffix=${x##*.}
-
- if [[ ${suffix} == "gz" ]] ; then
- realname=${x%.*}
- suffix=${realname##*.}
- vecho "QA Notice: you should let portage compress '${realname}' for you" 2>&1
- fi
-
- mandir=${i18n}man${suffix:0:1}
-
- if echo ${mandir} | egrep -q 'man[0-9n](|f|p|pm)$' -; then
- if [[ -s ${x} ]] ; then
- if [[ ! -d ${D}/usr/share/man/${mandir} ]] ; then
- install -d "${D}/usr/share/man/${mandir}"
- fi
-
- install -m0644 "${x}" "${D}/usr/share/man/${mandir}"
- ((ret+=$?))
- elif [[ ! -e ${x} ]] ; then
- vecho "doman: ${x} does not exist" 1>&2
- ((++ret))
- fi
- else
- vecho "doman: '${x}' is probably not a man page; skipping" 1>&2
- ((++ret))
- fi
-done
-
-exit ${ret}
diff --git a/bin/ebuild-helpers/domo b/bin/ebuild-helpers/domo
deleted file mode 100755
index 82950590..00000000
--- a/bin/ebuild-helpers/domo
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/domo,v 1.6 2004/10/04 13:56:50 vapier Exp $
-
-mynum=${#}
-if [ ${mynum} -lt 1 ] ; then
- echo "${0}: at least one argument needed"
- exit 1
-fi
-if [ ! -d "${D}${DESTTREE}/share/locale" ] ; then
- install -d "${D}${DESTTREE}/share/locale/"
-fi
-
-for x in "$@" ; do
- if [ -e "${x}" ] ; then
- mytiny="${x##*/}"
- mydir="${D}${DESTTREE}/share/locale/${mytiny%.*}/LC_MESSAGES"
- if [ ! -d "${mydir}" ] ; then
- install -d "${mydir}"
- fi
- install -m0644 "${x}" "${mydir}/${MOPREFIX}.mo"
- else
- echo "${0}: ${x} does not exist"
- fi
-done
diff --git a/bin/ebuild-helpers/donewins b/bin/ebuild-helpers/donewins
deleted file mode 120000
index 59a0db27..00000000
--- a/bin/ebuild-helpers/donewins
+++ /dev/null
@@ -1 +0,0 @@
-newins \ No newline at end of file
diff --git a/bin/ebuild-helpers/dosbin b/bin/ebuild-helpers/dosbin
deleted file mode 100755
index 30aa7893..00000000
--- a/bin/ebuild-helpers/dosbin
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dosbin,v 1.11 2004/10/04 13:56:50 vapier Exp $
-
-if [[ $# -lt 1 ]] ; then
- echo "$0: at least one argument needed" 1>&2
- exit 1
-fi
-
-if [[ ! -d ${D}${DESTTREE}/sbin ]] ; then
- install -d "${D}${DESTTREE}/sbin" || exit 2
-fi
-
-ret=0
-
-for x in "$@" ; do
- if [[ -e ${x} ]] ; then
- install -m0755 -o ${PORTAGE_INST_UID:-0} -g ${PORTAGE_INST_GID:-0} "${x}" "${D}${DESTTREE}/sbin"
- else
- echo "!!! ${0##*/}: ${x} does not exist" 1>&2
- false
- fi
- ((ret+=$?))
-done
-
-exit ${ret}
diff --git a/bin/ebuild-helpers/dosed b/bin/ebuild-helpers/dosed
deleted file mode 100755
index bf6538e6..00000000
--- a/bin/ebuild-helpers/dosed
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dosed,v 1.7 2004/10/04 13:56:50 vapier Exp $
-
-mysed="s:${D}::g"
-
-for x in "$@" ; do
- y="${D}${x}"
- if [ -a "${y}" ] ; then
- if [ -f "${y}" ] ; then
- mysrc="${T}/${y##*/}"
- cp "${y}" "${mysrc}"
- sed -e "${mysed}" "${mysrc}" > "${y}"
- else
- echo "${y} is not a regular file!"
- exit 1
- fi
- else
- mysed="${x}"
- fi
-done
diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym
deleted file mode 100755
index e0af15e2..00000000
--- a/bin/ebuild-helpers/dosym
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: /var/cvsroot/gentoo-src/portage/bin/dosym,v 1.7 2004/10/04 13:56:50 vapier Exp $
-
-if [[ $# -ne 2 ]] ; then
- echo "$0: two arguments needed" 1>&2
- exit 1
-fi
-
-destdir=${2%/*}
-[[ ! -d ${D}${destdir} ]] && dodir "${destdir}"
-
-exec ln -snf "$1" "${D}$2"
diff --git a/bin/ebuild-helpers/emake b/bin/ebuild-helpers/emake
deleted file mode 100755
index b7ae1f15..00000000
--- a/bin/ebuild-helpers/emake
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: emake 1912 2005-08-25 03:54:42Z ferringb $
-#
-# emake: Supplies some default parameters to GNU make. At the moment the
-# only parameter supplied is -jN, where N is a number of
-# parallel processes that should be ideal for the running host
-# (e.g. on a single-CPU machine, N=2). The MAKEOPTS variable
-# is set in /etc/make.globals. We don't source
-# /etc/make.globals here because emake is only called from an
-# ebuild.
-
-exec make ${MAKEOPTS} ${EXTRA_EMAKE} "$@"
diff --git a/bin/ebuild-helpers/fowners b/bin/ebuild-helpers/fowners
deleted file mode 100755
index 99f0685c..00000000
--- a/bin/ebuild-helpers/fowners
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: fowners 1912 2005-08-25 03:54:42Z ferringb $
-
-slash=/
-exec chown "${@/#${slash}/${D}${slash}}"
diff --git a/bin/ebuild-helpers/fperms b/bin/ebuild-helpers/fperms
deleted file mode 100755
index 383894eb..00000000
--- a/bin/ebuild-helpers/fperms
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: fperms 1912 2005-08-25 03:54:42Z ferringb $
-
-slash=/
-exec chmod "${@/#${slash}/${D}${slash}}"
diff --git a/bin/ebuild-helpers/newbin b/bin/ebuild-helpers/newbin
deleted file mode 100755
index ba7852d1..00000000
--- a/bin/ebuild-helpers/newbin
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newbin 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "Nothing defined to do."
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-dobin "${T}/${2}"
diff --git a/bin/ebuild-helpers/newconfd b/bin/ebuild-helpers/newconfd
deleted file mode 100755
index e9f2aa5d..00000000
--- a/bin/ebuild-helpers/newconfd
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newconfd 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "$0: nothing defined to do" 1>&2
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-exec doconfd "${T}/${2}"
diff --git a/bin/ebuild-helpers/newdoc b/bin/ebuild-helpers/newdoc
deleted file mode 100755
index bc56d73a..00000000
--- a/bin/ebuild-helpers/newdoc
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newdoc 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "newdoc: Nothing defined to do" 1>&2
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-exec dodoc "${T}/${2}"
diff --git a/bin/ebuild-helpers/newenvd b/bin/ebuild-helpers/newenvd
deleted file mode 100755
index 68cf65c6..00000000
--- a/bin/ebuild-helpers/newenvd
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newenvd 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "$0: nothing defined to do" 1>&2
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-exec doenvd "${T}/${2}"
diff --git a/bin/ebuild-helpers/newexe b/bin/ebuild-helpers/newexe
deleted file mode 100755
index 4769694f..00000000
--- a/bin/ebuild-helpers/newexe
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newexe 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "Nothing defined to do."
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-doexe "${T}/${2}"
diff --git a/bin/ebuild-helpers/newinitd b/bin/ebuild-helpers/newinitd
deleted file mode 100755
index f461bba4..00000000
--- a/bin/ebuild-helpers/newinitd
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newinitd 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "$0: nothing defined to do" 1>&2
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-exec doinitd "${T}/${2}"
diff --git a/bin/ebuild-helpers/newins b/bin/ebuild-helpers/newins
deleted file mode 100755
index bb89feb8..00000000
--- a/bin/ebuild-helpers/newins
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newins 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "Error: Nothing defined to do."
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-doins "${T}/${2}"
diff --git a/bin/ebuild-helpers/newlib.a b/bin/ebuild-helpers/newlib.a
deleted file mode 100755
index ac4b0351..00000000
--- a/bin/ebuild-helpers/newlib.a
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newlib.a 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "Error: Nothing defined to do."
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-dolib.a "${T}/${2}"
diff --git a/bin/ebuild-helpers/newlib.so b/bin/ebuild-helpers/newlib.so
deleted file mode 100755
index 5dec75ab..00000000
--- a/bin/ebuild-helpers/newlib.so
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newlib.so 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "Error: Nothing defined to do."
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-dolib.so "${T}/${2}"
diff --git a/bin/ebuild-helpers/newman b/bin/ebuild-helpers/newman
deleted file mode 100755
index 0081851e..00000000
--- a/bin/ebuild-helpers/newman
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newman 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "newman: Nothing defined to do" 1>&2
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-exec doman "${T}/${2}"
diff --git a/bin/ebuild-helpers/newsbin b/bin/ebuild-helpers/newsbin
deleted file mode 100755
index ab9f397f..00000000
--- a/bin/ebuild-helpers/newsbin
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: newsbin 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "${T}" ] || [ -z "${2}" ] ; then
- echo "Nothing defined to do."
- exit 1
-fi
-
-rm -rf "${T}/${2}"
-cp "${1}" "${T}/${2}"
-dosbin "${T}/${2}"
diff --git a/bin/ebuild-helpers/prepall b/bin/ebuild-helpers/prepall
deleted file mode 100755
index a53fb6ac..00000000
--- a/bin/ebuild-helpers/prepall
+++ /dev/null
@@ -1,86 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: prepall 2394 2005-12-17 17:23:07Z vapier $
-
-prepallman
-prepallinfo
-prepallstrip
-
-# this should help to ensure that all (most?) shared libraries are executable
-# and that all libtool scripts / static libraries are not executable
-for i in "${D}"opt/*/lib{,32,64} \
- "${D}"lib{,32,64} \
- "${D}"usr/lib{,32,64} \
- "${D}"usr/X11R6/lib{,32,64} ; do
- [[ ! -d ${i} ]] && continue
-
- for j in "${i}"/*.so.* "${i}"/*.so ; do
- [[ ! -e ${j} ]] && continue
- [[ -L ${j} ]] && continue
- [[ -x ${j} ]] && continue
- echo "making executable: /${j/${D}/}"
- chmod +x "${j}"
- done
-
- for j in "${i}"/*.a "${i}"/*.la ; do
- [[ ! -e ${j} ]] && continue
- [[ -L ${j} ]] && continue
- [[ ! -x ${j} ]] && continue
- echo "removing executable bit: /${j/${D}/}"
- chmod -x "${j}"
- done
-done
-
-# When installing static libraries into /usr/lib and shared libraries into
-# /lib, we have to make sure we have a linker script in /usr/lib along side
-# the static library, or gcc will utilize the static lib when linking :(.
-# http://bugs.gentoo.org/4411
-for a in "${D}"usr/lib*/*.a ; do
- s=${a%.a}.so
- if [[ ! -e ${s} ]] ; then
- s=${s%usr/*}${s##*/usr/}
- if [[ -e ${s} ]] ; then
- echo -e "\aQA Notice: missing gen_usr_ldscript for ${s##*/}\a"
- sleep 1
- fi
- fi
-done
-
-# Make sure people don't store libtool files or static libs in /lib
-f=$(ls "${D}"lib*/*.{a,la} 2>/dev/null)
-if [[ -n ${f} ]] ; then
- echo -e "\n\aQA Notice: excessive files found in the / partition\a"
- echo "${f}"
- sleep 1
-fi
-
-# Verify that the libtool files don't contain bogus $D entries.
-for a in "${D}"usr/lib*/*.la ; do
- s=${a##*/}
- if grep -qs "${D}" "${a}" ; then
- echo -e "\n\aQA Notice: ${s} appears to contain PORTAGE_TMPDIR paths\a"
- sleep 1
- fi
-done
-
-if type -p scanelf > /dev/null ; then
-
-# Run some sanity checks on shared libraries
-for d in "${D}"lib* "${D}"usr/lib* ; do
- f=$(scanelf -ByF '%S %p' "${d}"/lib*.so* | gawk '$2 == "" { print }')
- if [[ -n ${f} ]] ; then
- echo -e "\n\aQA Notice: the following shared libraries lack a SONAME\a"
- echo "${f}"
- sleep 1
- fi
-
- f=$(scanelf -ByF '%n %p' "${d}"/lib*.so* | gawk '$2 == "" { print }')
- if [[ -n ${f} ]] ; then
- echo -e "\n\aQA Notice: the following shared libraries lack NEEDED entries\a"
- echo "${f}"
- sleep 1
- fi
-done
-
-fi
diff --git a/bin/ebuild-helpers/prepalldocs b/bin/ebuild-helpers/prepalldocs
deleted file mode 100755
index e71c6e45..00000000
--- a/bin/ebuild-helpers/prepalldocs
+++ /dev/null
@@ -1,57 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: prepalldocs 1912 2005-08-25 03:54:42Z ferringb $
-
-dir="${D}usr/share/doc"
-
-[ ! -d "${dir}" ] && exit 0
-
-z=$(find "${dir}" \
- '(' -type f -or -type l ')' \
- -not -name '*.gz' \
- -not -name '*.bz2' \
- -not -name '*.Z' \
- -not -name '*.js' \
- 2>/dev/null)
-
-[ -z "${z}" ] && exit 0
-
-PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip}
-PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9}
-if [ -z "${PORTAGE_COMPRESS_SUFFIX}" ] ; then
- case ${PORTAGE_COMPRESS} in
- gzip) suffix="gz";;
- bzip2) suffix="bz2";;
- *) echo "prepalldocs error: please set PORTAGE_COMPRESS_SUFFIX in make.conf" 1>&2
- exit 1;;
- esac
-fi
-
-echo "doc: ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS}"
-for y in ${z} ; do
- if [ -L "${y}" ] ; then
- # Symlink ...
- mylink=${y}
- linkto=$(readlink "${y}")
-
- if [ "${linkto##*.}" != "${suffix}" ] ; then
- linkto="${linkto}.${suffix}"
- fi
- if [ "${mylink##*.}" != "${suffix}" ] ; then
- mylink="${mylink}.${suffix}"
- fi
-
- echo " link fixed ${mylink##*/}"
- ln -snf "${linkto}" "${mylink}"
- if [ "${y}" != "${mylink}" ] ; then
- echo " link removed ${y##*/}"
- rm -f "${y}"
- fi
- else
- if [ "${y##*.}" != "${suffix}" ] ; then
- echo " compressing ${y##*/}"
- "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f "${y}"
- fi
- fi
-done
diff --git a/bin/ebuild-helpers/prepallinfo b/bin/ebuild-helpers/prepallinfo
deleted file mode 100755
index 220391e4..00000000
--- a/bin/ebuild-helpers/prepallinfo
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: prepallinfo 1912 2005-08-25 03:54:42Z ferringb $
-
-[ ! -d "${D}usr/share/info" ] && exit 0
-
-exec prepinfo
diff --git a/bin/ebuild-helpers/prepallman b/bin/ebuild-helpers/prepallman
deleted file mode 100755
index 77b570a2..00000000
--- a/bin/ebuild-helpers/prepallman
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: prepallman 1912 2005-08-25 03:54:42Z ferringb $
-
-for x in $(find "${D}" -name man -type d -printf '%P\n') ; do
- prepman ${x%/man}
- export prepallman_banner=no
-done
diff --git a/bin/ebuild-helpers/prepallstrip b/bin/ebuild-helpers/prepallstrip
deleted file mode 100755
index e55e1119..00000000
--- a/bin/ebuild-helpers/prepallstrip
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: prepallstrip 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ "${FEATURES//*nostrip*/true}" == "true" ] || [ "${RESTRICT//*nostrip*/true}" == "true" ] ; then
- exit 0
-fi
-
-exec prepstrip "${D}"
diff --git a/bin/ebuild-helpers/prepinfo b/bin/ebuild-helpers/prepinfo
deleted file mode 100755
index 85af0869..00000000
--- a/bin/ebuild-helpers/prepinfo
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: prepinfo 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "$1" ] ; then
- z="${D}usr/share/info"
-else
- if [ -d "${D}$1/share/info" ] ; then
- z="${D}$1/share/info"
- else
- z="${D}$1/info"
- fi
-fi
-
-[ ! -d "${z}" ] && exit 0
-
-rm -f "${z}"/dir{,.old}{,.info{,.gz,.bz2,.Z}}
-
-PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip}
-PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9}
-if [ -z "${PORTAGE_COMPRESS_SUFFIX}" ] ; then
- case ${PORTAGE_COMPRESS} in
- gzip) suffix="gz";;
- bzip2) suffix="bz2";;
- *) echo "prepinfo: error fixing links: please set PORTAGE_COMPRESS_SUFFIX in make.conf" 1>&2
- exit 1;;
- esac
-fi
-
-echo "info: ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS}"
-
-for x in `find "${z}"/ \( -type f -or -type l \) -maxdepth 1 -mindepth 1 2>/dev/null` ; do
- if [ -L "${x}" ] ; then
- # Symlink ...
- mylink=${x}
- linkto=$(readlink "${x}")
-
- if [ "${linkto##*.}" != "${suffix}" ] ; then
- linkto="${linkto}.${suffix}"
- fi
- if [ "${mylink##*.}" != "${suffix}" ] ; then
- mylink="${mylink}.${suffix}"
- fi
-
- echo "fixing GNU info symlink: ${mylink##*/}"
- ln -snf "${linkto}" "${mylink}"
- if [ "${x}" != "${mylink}" ] ; then
- echo "removing old symlink: ${x##*/}"
- rm -f "${x}"
- fi
- else
- if [ "${x##*.}" != "${suffix}" ] ; then
- echo "compressing GNU info page: ${x##*/}"
- "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f "${x}"
- fi
- fi
-done
diff --git a/bin/ebuild-helpers/preplib b/bin/ebuild-helpers/preplib
deleted file mode 100755
index ce2a27fa..00000000
--- a/bin/ebuild-helpers/preplib
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: preplib 1912 2005-08-25 03:54:42Z ferringb $
-
-LIBDIR_VAR="LIBDIR_${ABI}"
-if [ -n "${ABI}" -a -n "${!LIBDIR_VAR}" ]; then
- CONF_LIBDIR="${!LIBDIR_VAR}"
-fi
-unset LIBDIR_VAR
-
-if [ -z "${CONF_LIBDIR}" ]; then
- # we need this to default to lib so that things dont break
- CONF_LIBDIR="lib"
-fi
-
-if [ -z "$1" ] ; then
- z="${D}usr/${CONF_LIBDIR}"
-else
- z="${D}$1/${CONF_LIBDIR}"
-fi
-
-if [ -d "${z}" ] ; then
- ldconfig -n -N "${z}"
-fi
diff --git a/bin/ebuild-helpers/preplib.so b/bin/ebuild-helpers/preplib.so
deleted file mode 100755
index 0b88cc91..00000000
--- a/bin/ebuild-helpers/preplib.so
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2004 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: preplib.so 1912 2005-08-25 03:54:42Z ferringb $
-
-for x in "$@" ; do
- if [ -d "${D}${x}" ] ; then
- ldconfig -n -N "${D}${x}"
- fi
-done
diff --git a/bin/ebuild-helpers/prepman b/bin/ebuild-helpers/prepman
deleted file mode 100755
index 5a6f05f1..00000000
--- a/bin/ebuild-helpers/prepman
+++ /dev/null
@@ -1,61 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: prepman 1912 2005-08-25 03:54:42Z ferringb $
-
-if [ -z "$1" ] ; then
- z="${D}usr/share/man"
-else
- z="${D}$1/man"
-fi
-
-[ ! -d "${z}" ] && exit 0
-
-PORTAGE_COMPRESS=${PORTAGE_COMPRESS:-gzip}
-PORTAGE_COMPRESS_FLAGS=${PORTAGE_COMPRESS_FLAGS:--9}
-if [ -z "${PORTAGE_COMPRESS_SUFFIX}" ] ; then
- case ${PORTAGE_COMPRESS} in
- gzip) suffix="gz";;
- bzip2) suffix="bz2";;
- *) echo "prepman error: please set PORTAGE_COMPRESS_SUFFIX in make.conf" 1>&2
- exit 1;;
- esac
-fi
-
-if [ -z "${prepallman_banner}" ] ; then
- echo "man: ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS}"
-fi
-
-for x in `find "${z}"/ -type d 2>/dev/null` ; do
- for y in `find "${x}"/ \( -type f -or -type l \) ! -name '.keep' -maxdepth 1 -mindepth 1 2>/dev/null` ; do
- if [ -L "${y}" ] ; then
- # Symlink ...
- mylink=${y}
- linkto=$(readlink "${y}")
-
- # Do NOT change links to directories
- if [ -d "${z}/${linkto}" ] ; then
- continue
- fi
-
- if [ "${linkto##*.}" != "${suffix}" ] ; then
- linkto="${linkto}.${suffix}"
- fi
- if [ "${mylink##*.}" != "${suffix}" ] ; then
- mylink="${mylink}.${suffix}"
- fi
-
- echo " link fixed ${mylink##*/}"
- ln -snf "${linkto}" "${mylink}"
- if [ "${y}" != "${mylink}" ] ; then
- echo " link removed ${y##*/}"
- rm -f "${y}"
- fi
- else
- if [ "${y##*.}" != "${suffix}" ] && [ ! -d "${y}" ] ; then
- echo " compressing ${y##*/}"
- "${PORTAGE_COMPRESS}" ${PORTAGE_COMPRESS_FLAGS} -f "${y}"
- fi
- fi
- done
-done
diff --git a/bin/ebuild-helpers/prepstrip b/bin/ebuild-helpers/prepstrip
deleted file mode 100755
index 2e03cb91..00000000
--- a/bin/ebuild-helpers/prepstrip
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: prepstrip 2228 2005-11-01 01:35:23Z vapier $
-
-if [ "${FEATURES//*nostrip*/true}" == "true" ] || [ "${RESTRICT//*nostrip*/true}" == "true" ] ; then
- echo "nostrip"
- STRIP="/bin/false"
- PORTAGE_STRIP_FLAGS=""
-else
- STRIP=${STRIP:-${CHOST}-strip}
- type -p -- ${STRIP} > /dev/null || STRIP=strip
- PORTAGE_STRIP_FLAGS=${PORTAGE_STRIP_FLAGS:---strip-unneeded}
-fi
-
-banner=1
-retval=0
-
-for x in "$@" ; do
- if [ -d "${x}" ]; then
- # We only want files. So make a pass for each directory and call again.
- find "${x}" -type f \( -perm -0100 -or -perm -0010 -or -perm -0001 -or -name '*.so' -or -name '*.so.*' \) -print0 |
- $XARGS -0 -n500 prepstrip
- else
- if [ ${banner} -eq 1 ] ; then
- echo "strip: ${STRIP} ${PORTAGE_STRIP_FLAGS}"
- banner=0
- fi
-
- f=$(file "${x}") || continue
- [ -z "${f}" ] && continue
-
- if [ -z "${f/*current ar archive*/}" ]; then
- echo " ${x:${#D}:${#x}}"
- ${STRIP} -g "${x}"
- fi
- if [ -z "${f/*SB executable*/}" ]; then
- echo " ${x:${#D}:${#x}}"
- ${STRIP} "${x}"
- fi
- if [ -z "${f/*SB shared object*/}" ]; then
- echo " ${x:${#D}:${#x}}"
- ${STRIP} ${PORTAGE_STRIP_FLAGS} "${x}"
- fi
- fi
-done
-
-exit ${retval}
diff --git a/bin/etc-update b/bin/etc-update
deleted file mode 100755
index ce5ac568..00000000
--- a/bin/etc-update
+++ /dev/null
@@ -1,423 +0,0 @@
-#!/bin/bash
-# Copyright 1999-2005 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id: etc-update 2221 2005-11-01 01:32:07Z vapier $
-
-# Author Brandon Low <lostlogic@gentoo.org>
-#
-# Previous version (from which I've borrowed a few bits) by:
-# Jochem Kossen <j.kossen@home.nl>
-# Leo Lipelis <aeoo@gentoo.org>
-# Karl Trygve Kalleberg <karltk@gentoo.org>
-
-export PORTAGE_CALLER="etc-update"
-
-if type -p gsed >/dev/null ; then
- function sed() { gsed "$@"; }
-fi
-
-function get_config() {
- item=$1
-
- # First strip off comment lines, then grab the configuration
- # item. If there's more than one of the same configuration item,
- # then allow the last setting to take precedence.
- cut -d'#' -f1-1 /etc/etc-update.conf | \
- sed -ne "s/^ *$item *= *\([\"']\{0,1\}\)\(.*\)\1/\2/p" |sed -e '$p;d'
-}
-
-function scan() {
-
- echo "Scanning Configuration files..."
- rm -rf ${TMP}/files > /dev/null 2>&1
- mkdir ${TMP}/files || die "Failed mkdir command!" 1
- count=0
- input=0
-
- # Sanity check to make sure diff exists and works
- if ! diff -v &>/dev/null ; then
- echo "ERROR: 'diff' does not seem to work, aborting"
- exit 1
- fi
-
- for path in ${CONFIG_PROTECT} ; do
- [ ! -d ${path} ] && continue
-
- ofile=""
- for file in `find ${path}/ -iname "._cfg????_*" |
- sed -e "s:\(^.*/\)\(\._cfg[0-9]*_\)\(.*$\):\1\2\3\%\2\%\3:" |
- sort -t'%' -k3 -k2 | LANG=POSIX LC_ALL=POSIX cut -f1 -d'%'`; do
- rpath=`echo "${file/\/\///}" | sed -e "s:/[^/]*$::"`
- rfile=`echo "${file/\/\///}" | sed -e "s:^.*/::"`
- for mpath in ${CONFIG_PROTECT_MASK}; do
- if [[ "${rpath}" == "${mpath}"* ]]; then
- mv ${rpath}/${rfile} ${rpath}/${rfile:10}
- break
- fi
- done
- [ ! -f ${file} ] && continue
-
-
- if [[ "${ofile:10}" != "${rfile:10}" ]] ||
- [[ ${opath} != ${rpath} ]]; then
- MATCHES=0
- if [[ "${EU_AUTOMERGE}" == "yes" ]]; then
- if [ ! -e "${rpath}/${rfile}" ] || [ ! -e "${rpath}/${rfile:10}" ]; then
- MATCHES=0
- else
- diff -Bbua ${rpath}/${rfile} ${rpath}/${rfile:10} | egrep '^[+-]' | egrep -v '^[+-][\t ]*#|^--- |^\+\+\+ ' | egrep -qv '^[-+][\t ]*$'
- MATCHES=$?
- fi
- elif [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
- grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
- MATCHES=1
- fi
- if [[ "${MATCHES}" == "1" ]]; then
- echo "Automerging trivial changes in: ${rfile:10}"
- mv ${rpath}/${rfile} ${rpath}/${rfile:10}
- continue
- else
- count=${count}+1
- echo "${rpath}/${rfile:10}" > ${TMP}/files/${count}
- echo "${rpath}/${rfile}" >> ${TMP}/files/${count}
- ofile="${rfile}"
- opath="${rpath}"
- continue
- fi
- fi
-
- if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}|
- grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
- mv ${rpath}/${rfile} ${rpath}/${ofile}
- continue
- else
- echo "${rpath}/${rfile}" >> ${TMP}/files/${count}
- ofile="${rfile}"
- opath="${rpath}"
- fi
- done
- done
-
-}
-
-function sel_file() {
- local -i isfirst=0
- until [ -f ${TMP}/files/${input} ] || [ ${input} == -1 ] || [ ${input} == -3 ]; do
- local numfiles=$(ls ${TMP}/files|wc -l)
- local numwidth=${#numfiles}
- for file in $(ls ${TMP}/files|sort -n); do
- if (( ${isfirst} == 0 )); then
- isfirst=${file}
- fi
- numshow=$(printf "%${numwidth}i${PAR} " ${file})
- spacer=${numshow//?/ }
- echo -n "${numshow}"
- if (( ${mode} == 0 )); then
- spacedit=0
- for word in $(<${TMP}/files/${file}); do
- if (( ${spacedit} == 1 )); then
- echo -n "${spacer}"
- else
- spacedit=1
- fi
- echo ${word}
- done
- else
- head -n1 ${TMP}/files/${file}
- fi
- done > ${TMP}/menuitems
-
- if [ "${OVERWRITE_ALL}" == "yes" ]; then
- input=0
- else
- if (( ${mode} == 0 )); then
- echo "The following is the list of files which need updating, each
-configuration file is followed by a list of possible replacement files."
- else
- local my_title="Please select a file to update"
- fi
-
- if (( ${mode} == 0 )); then
- cat ${TMP}/menuitems
- echo "Please select a file to edit by entering the corresponding number."
- echo " (don't use -3 or -5 if you're unsure what to do)"
- echo " (-1 to exit) (-3 to auto merge all remaining files)"
- echo -n " (-5 to auto-merge AND not use 'mv -i'): "
- read input
- else
- dialog --title "${title}" --menu "${my_title}" \
- 0 0 0 $(echo -e "-1 Exit\n$(<${TMP}/menuitems)") \
- 2> ${TMP}/input
- input=$(<${TMP}/input)
- fi
- if (( ${input} == -5 )); then
- input=-3
- export mv_opts=""
- fi
- if (( ${input} == -3 )); then
- input=0
- export OVERWRITE_ALL="yes"
- fi
- fi # -3 automerge
- if (( ${input} == 0 )); then
- input=${isfirst}
- fi
- done
-}
-
-function do_file() {
- echo
- local -i my_input
- local -i fcount=0
- until (( $(wc -l < ${TMP}/files/${input}) < 2 )); do
- my_input=0
- if (( $(wc -l < ${TMP}/files/${input}) == 2 )); then
- my_input=1
- fi
- until (( ${my_input} > 0 )) && (( ${my_input} < $(wc -l < ${TMP}/files/${input}) )); do
- fcount=0
-
- if [ "${OVERWRITE_ALL}" == "yes" ]; then
- my_input=0
- else
- for line in $(<${TMP}/files/${input}); do
- if (( ${fcount} > 0 )); then
- echo -n "${fcount}${PAR} "
- echo "${line}"
- else
- if (( ${mode} == 0 )); then
- echo "Below are the new config files for ${line}:"
- else
- local my_title="Please select a file to process for ${line}"
- fi
- fi
- fcount=${fcount}+1
- done > ${TMP}/menuitems
-
- if (( ${mode} == 0 )); then
- cat ${TMP}/menuitems
- echo -n "Please select a file to process (-1 to exit this file): "
- read my_input
- else
- dialog --title "${title}" --menu "${my_title}" \
- 0 0 0 `echo -e "$(<${TMP}/menuitems)\n${fcount} Exit"` \
- 2> ${TMP}/input
- my_input=$(<${TMP}/input)
- fi
- fi # OVERWRITE_ALL
-
- if (( ${my_input} == 0 )); then
- my_input=1
- elif (( ${my_input} == -1 )); then
- input=0
- return
- elif (( ${my_input} == ${fcount} )); then
- break
- fi
- done
- if (( ${my_input} == ${fcount} )); then
- break
- fi
-
- fcount=${my_input}+1
-
- file=$(sed -e "${fcount}p;d" ${TMP}/files/${input})
- ofile=$(head -n1 ${TMP}/files/${input})
-
- do_cfg "${file}" "${ofile}"
-
- sed -e "${fcount}!p;d" ${TMP}/files/${input} > ${TMP}/files/sed
- mv ${TMP}/files/sed ${TMP}/files/${input}
-
- if (( ${my_input} == -1 )); then
- break
- fi
- done
- echo
- rm ${TMP}/files/${input}
- count=${count}-1
-}
-
-function do_cfg() {
-
- local file="${1}"
- local ofile="${2}"
- local -i my_input=0
-
- until (( ${my_input} == -1 )) || [ ! -f ${file} ]; do
- if [ "${OVERWRITE_ALL}" == "yes" ]; then
- my_input=1
- else
- showdiffcmd=$(echo "${diff_command}" |
- sed -e "s:%file1:${ofile}:" -e "s:%file2:${file}:")
-
- if [ "${using_editor}" == 0 ]; then
- (
- echo "Showing differences between ${ofile} and ${file}"
- ${showdiffcmd}
- ) | ${pager}
- else
- echo "Beginning of differences between ${ofile} and ${file}"
- ${showdiffcmd}
- echo "End of differences between ${ofile} and ${file}"
- fi
- if [ -L "${file}" ]; then
- echo
- echo "-------------------------------------------------------------"
- echo "NOTE: File is a symlink to another file. REPLACE recommended."
- echo " The original file may simply have moved. Please review."
- echo "-------------------------------------------------------------"
- echo
- fi
- echo -n "1) Replace original with update
-2) Delete update, keeping original as is
-3) Interactively merge original with update
-4) Show differences again
-Please select from the menu above (-1 to ignore this update): "
- read my_input
- fi
-
- case ${my_input} in
- 1) echo "Replacing ${ofile} with ${file}"
- mv ${mv_opts} ${file} ${ofile}
- my_input=-1
- continue
- ;;
- 2) echo "Deleting ${file}"
- rm ${rm_opts} ${file}
- continue
- ;;
- 3) do_merge "${file}" "${ofile}"
- my_input=${?}
-# [ ${my_input} == 255 ] && my_input=-1
- continue
- ;;
- 4) continue
- ;;
- *) continue
- ;;
- esac
- done
-}
-
-function do_merge() {
-
- local file="${1}"
- local ofile="${2}"
- local mfile="${2}.merged"
- local -i my_input=0
- echo "${file} ${ofile} ${mfile}"
-
- if [ -e ${mfile} ] ; then
- echo "A previous version of the merged file exists, cleaning..."
- rm ${rm_opts} ${mfile}
- fi
-
- until (( ${my_input} == -1 )); do
- echo "Merging ${file} and ${ofile}"
- `echo "${merge_command}" |
- sed -e "s:%merged:${mfile}:g" \
- -e "s:%orig:${ofile}:g" \
- -e "s:%new:${file}:g"`
- until (( ${my_input} == -1 )); do
- echo -n "1) Replace ${ofile} with merged file
-2) Show differences between merged file and original
-3) Remerge original with update
-4) Edit merged file
-5) Return to the previous menu
-Please select from the menu above (-1 to exit, losing this merge): "
- read my_input
- case ${my_input} in
- 1) echo "Replacing ${ofile} with ${mfile}"
- chmod --reference=${ofile} ${mfile}
- mv ${mv_opts} ${mfile} ${ofile}
- rm ${rm_opts} ${file}
- return 255
- ;;
- 2) ( echo "Showing differences between ${ofile} and ${mfile}"
- `echo "${diff_command}" | \
- sed -e "s:%file1:${ofile}:" \
- -e "s:%file2:${mfile}:"` ) | ${pager}
- continue
- ;;
- 3) break
- ;;
- 4) ${EDITOR:-nano -w} "${mfile}"
- continue
- ;;
- 5) rm ${rm_opts} ${mfile}
- return 0
- ;;
- *) continue
- ;;
- esac
- done
- done
- rm ${rm_opts} ${mfile}
- return 255
-}
-
-function die() {
- trap "" term
- trap "" kill
- echo "Exiting: ${1}"
- rm -rf ${TMP}
- exit ${2}
-}
-
-#
-# Run the script
-#
-scriptname=$(basename $0)
-
-trap die term
-
-export PORTAGE_TMPDIR=$(/usr/lib/portage/bin/portageq envvar PORTAGE_TMPDIR)
-
-TMP="${PORTAGE_TMPDIR}/$$"
-rm -rf ${TMP} 2> /dev/null
-mkdir ${TMP} || die "failed mkdir command!" 1
-
-# I need the CONFIG_PROTECT value
-CONFIG_PROTECT=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT)
-CONFIG_PROTECT_MASK=$(/usr/lib/portage/bin/portageq envvar CONFIG_PROTECT_MASK)
-
-# load etc-config's configuration
-EU_AUTOMERGE=`get_config eu_automerge`
-rm_opts=`get_config rm_opts`
-mv_opts=`get_config mv_opts`
-cp_opts=`get_config cp_opts`
-pager=`get_config pager`
-diff_command=`get_config diff_command`
-using_editor=`get_config using_editor`
-merge_command=`get_config merge_command`
-declare -i mode=`get_config mode`
-[ -z ${mode} ] && mode=0
-[ -z "${pager}" ] && pager="cat"
-
-#echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts"
-#echo "pager: $pager, diff_command: $diff_command, merge_command: $merge_command"
-
-if (( ${mode} == 0 )); then
- PAR=")"
-else
- PAR=""
-fi
-
-declare -i count=0
-declare -i input=0
-declare title="Gentoolkit's etc-update tool!"
-
-scan
-
-until (( ${input} == -1 )); do
- if (( ${count} == 0 )); then
- die "Nothing left to do; exiting. :)" 0
- fi
- sel_file
- if (( ${input} != -1 )); then
- do_file
- fi
-done
-
-die "User termination!" 0
diff --git a/bin/tests/test_resolver.py b/bin/tests/test_resolver.py
deleted file mode 100644
index 5c0ece6e..00000000
--- a/bin/tests/test_resolver.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/python
-
-from pkgcore.config import load_config
-from pkgcore.resolver import plan
-from pkgcore.package.atom import atom
-from pkgcore.util.lists import flatten, stable_unique
-from pkgcore.util.repo_utils import get_raw_repos
-
-def pop_paired_args(args, arg, msg):
- rets = []
- if not isinstance(arg, (tuple, list)):
- arg = [arg]
- for a in arg:
- try:
- while True:
- i = args.index(a)
- args.pop(i)
- if len(args) == i:
- raise Exception("%s needs to be followed by an arg: %s" % (a, msg))
- rets.append(args.pop(i))
- except ValueError:
- pass
- return rets
-
-def pop_arg(args, *arg):
-
- ret = False
- for a in arg:
- try:
- while True:
- args.remove(a)
- ret = True
- except ValueError:
- pass
- return ret
-
-
-if __name__ == "__main__":
- import sys
- args = sys.argv[1:]
-
- if pop_arg(args, "-h", "--help"):
- print "args supported, [-D || --deep], [[-u || --upgrade] | [-m || --max-upgrade]] and -s (system|world) [-d || --debug]"
- print "can specify additional atoms when specifying -s, no atoms/sets available, defaults to sys-apps/portage"
- sys.exit(1)
- if pop_arg(args, "-d", "--debug"):
- plan.limiters.add(None)
- trigger_pdb = pop_arg(args, "-p", "--pdb")
- empty_vdb = pop_arg(args, "-e", "--empty")
- upgrade = pop_arg(args, "-u", "--upgrade")
- max = pop_arg(args, "-m", "--max-upgrade")
- ignore_failures = pop_arg(args, None, "--ignore-failures")
- if max and max == upgrade:
- print "can only choose max, or upgrade"
- sys.exit(1)
- if max:
- strategy = plan.merge_plan.force_max_version_strategy
- elif upgrade:
- strategy = plan.merge_plan.prefer_highest_version_strategy
- else:
- strategy = plan.merge_plan.prefer_reuse_strategy
-
- deep = bool(pop_arg(args, "-D", "--deep"))
-
- conf = load_config()
-
- set_targets = pop_paired_args(args, ["--set", "-s"], "pkg sets to enable")
- if set_targets:
- print "using pkgset(s): %s" % (", ".join("'%s'" % x.strip() for x in set_targets))
- set_targets = [a for t in set_targets for a in conf.pkgset[t]]
- #map(atom, conf.pkgset[l]) for l in set_targets], restriction.base)
-
- if not args:
- if set_targets:
- atoms = set_targets
- else:
- print "resolving sys-apps/portage since no atom supplied"
- atoms = [atom("sys-apps/portage")]
- else:
- atoms = [atom(x) for x in args] + set_targets
-
- atoms = stable_unique(atoms)
- domain = conf.domain["livefs domain"]
- vdb, repo = domain.vdb[0], domain.repos[0]
- resolver = plan.merge_plan(vdb, repo, pkg_selection_strategy=strategy, verify_vdb=deep)
- ret = True
- failures = []
- import time
- start_time = time.time()
- for restrict in atoms:
- print "\ncalling resolve for %s..." % restrict
- ret = resolver.add_atom(restrict)
- if ret:
- print "ret was",ret
- print "resolution failed"
- failures.append(restrict)
- if not ignore_failures:
- break
- if failures:
- print "\nfailures encountered-"
- for restrict in failures:
- print "failed '%s'\npotentials-" % restrict
- match_count = 0
- for r in get_raw_repos(repo):
- l = r.match(restrict)
- if l:
- print "repo %s: [ %s ]" % (r, ", ".join(str(x) for x in l))
- match_count += len(l)
- if not match_count:
- print "no matches found in %s" % repo
- print
- if not ignore_failures:
- sys.exit(2)
-
- print "\nbuildplan"
- for op, pkgs in resolver.state.iter_pkg_ops():
- print "%s %s" % (op.ljust(8), ", ".join(str(y) for y in reversed(pkgs)))
- print "result was successfull, 'parently- took %.2f seconds" % (time.time() - start_time)
-
diff --git a/bin/utilities/clone_cache.py b/bin/utilities/clone_cache.py
deleted file mode 100755
index 30e9b60e..00000000
--- a/bin/utilities/clone_cache.py
+++ /dev/null
@@ -1,47 +0,0 @@
-#!/usr/bin/python
-# Copyright: 2005-2006 Brian Harring <ferringb@gmail.com>
-# License: GPL2
-
-import pkgcore.config, sys, time
-
-if __name__ == "__main__":
- verbose = 0
- if len(sys.argv) not in (3,4):
- print "I need 2 args, cache label to read from, cache label to write to, with -v optional for verbose"
- elif len(sys.argv) == 4:
- verbose = 1
- c=pkgcore.config.load_config()
- try: cache1 = c.cache[sys.argv[1]]
- except KeyError:
- print "read cache label '%s' isn't defined." % sys.argv[1]
- sys.exit(1)
- try: cache2 = c.cache[sys.argv[2]]
- except KeyError:
- print "write cache label '%s' isn't defined." % sys.argv[2]
- sys.exit(1)
-
- if cache2.readonly:
- print "can't update cache label '%s', it's marked readonly." % sys.argv[2]
- sys.exit(2)
- if not cache2.autocommits:
- cache2.sync_rate = 1000
- if verbose: print "grabbing cache2's existing keys"
- valid = set()
- start = time.time()
- if verbose:
- for k,v in cache1.iteritems():
- print "updating %s" % k
- cache2[k] = v
- valid.add(k)
- else:
- for k,v in cache1.iteritems():
- cache2[k] = v
- valid.add(k)
-
- for x in cache2.iterkeys():
- if not x in valid:
- if verbose: print "deleting %s" % x
- del cache2[x]
-
- if verbose:
- print "took %i seconds" % int(time.time() - start)
diff --git a/bin/utilities/hotshot-profile.py b/bin/utilities/hotshot-profile.py
deleted file mode 100755
index 11ed90ca..00000000
--- a/bin/utilities/hotshot-profile.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/python
-from optparse import OptionParser
-import sys, os
-import hotshot
-
-# When invoked as main program, invoke the profiler on a script
-if __name__ == '__main__':
- usage = "hotshot.py [-o output_file_path] [-s sort] scriptfile [arg] ..."
- if not sys.argv[1:]:
- print "Usage: ", usage
- sys.exit(2)
-
- class ProfileParser(OptionParser):
- def __init__(self, usage):
- OptionParser.__init__(self)
- self.usage = usage
-
- parser = ProfileParser(usage)
- parser.allow_interspersed_args = False
- parser.add_option('-o', '--outfile', dest="outfile",
- help="Save stats to <outfile>", default=None)
- parser.add_option('-s', '--sort', dest="sort",
- help="Sort order when printing to stdout, based on pstats.Stats class", default=-1)
-
- (options, args) = parser.parse_args()
- sys.argv[:] = args
-
- if (len(sys.argv) > 0):
- sys.path.insert(0, os.path.dirname(sys.argv[0]))
- prof = hotshot.Profile(options.outfile)
- prof.run('execfile(%r)' % (sys.argv[0],)) #, options.outfile, options.sort)
- prof.close()
- else:
- print "Usage: ", usage
diff --git a/bin/utilities/pebuild.py b/bin/utilities/pebuild.py
deleted file mode 100755
index fbe22fe7..00000000
--- a/bin/utilities/pebuild.py
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/python
-import sys
-if len(sys.argv) <= 2:
- print "need atom, phases"
- sys.exit(1)
-pkg = sys.argv[1]
-phases = sys.argv[2:]
-from pkgcore.config import load_config
-p=load_config().domain['livefs domain'].repos[0][pkg];
-b=p.build();
-phase_funcs = [getattr(b, x) for x in phases]
-for phase, f in zip(phases, phase_funcs):
- print "\nexecuting phase %s" % phase
- f()
diff --git a/bin/utilities/powner.py b/bin/utilities/powner.py
deleted file mode 100755
index 8c35813d..00000000
--- a/bin/utilities/powner.py
+++ /dev/null
@@ -1,41 +0,0 @@
-#!/usr/bin/python
-
-import sys, time
-from pkgcore.restrictions import packages, values
-from pkgcore.config import load_config
-from pkgcore.fs.util import normpath
-
-def grab_arg(arg, args):
- val = False
- try:
- while True:
- args.remove(arg)
- val = True
- except ValueError:
- pass
- return val
-
-if __name__ == "__main__":
- a = sys.argv[1:]
- if grab_arg("--help", a) or grab_arg("-h", a) or not a:
- print "need at least one arg, file to find the owner of"
- print "default matching mode is return after first match, however if [ --all || -a ] is specified"
- print "all owners are return"
- print "Multiple args are further restrictions on a match- pkg must own all of the files"
- sys.exit(1)
- all = grab_arg("-a", a) or grab_arg("--all", a)
- repo = load_config().domain["livefs domain"].vdb[0]
- restrict = packages.PackageRestriction("contents", values.ContainmentMatch(
- *[normpath(x) for x in a]))
- start_time = time.time()
- count = 0
- print "query- %s, returning all matches? %s" % (restrict, all)
- for pkg in repo.itermatch(restrict):
- print "pkg: %s" % (pkg)
- count += 1
- if not all:
- break
- print "found %i matches in %.2f seconds" % (count, time.time() - start_time)
- if count:
- sys.exit(0)
- sys.exit(1)
diff --git a/bin/utilities/pquery b/bin/utilities/pquery
deleted file mode 100755
index 908402af..00000000
--- a/bin/utilities/pquery
+++ /dev/null
@@ -1,105 +0,0 @@
-#!/usr/bin/python
-# Copyright: 2005-2006 Brian Harring <ferringb@gmail.com>
-# License: GPL2
-
-import os
-from pkgcore.package.atom import atom
-from pkgcore.restrictions import packages, values, boolean
-from pkgcore.util.currying import pre_curry
-from pkgcore.util import repo_utils, commandline
-
-def grab_arg(arg, args):
- val = False
- try:
- while True:
- args.remove(arg)
- val = True
- except ValueError:
- pass
- return val
-
-if __name__ == "__main__":
- import sys, pkgcore.config
- a = sys.argv[1:]
- raw = grab_arg("--raw", a)
- force_vdb = grab_arg("--vdb", a)
- force_virtuals = grab_arg("--virtuals-only", a)
- disable_virtuals = grab_arg("--disable-virtuals", a)
-
- if "--atomstr" in a:
- def atomstr(a, l=False):
- if l:
- l = iter(a)
- else:
- l = [a]
- s = []
- for x in l:
- if isinstance(x, atom):
- s.append(x.atom_str())
- else:
- s.append(str(x))
- return ' '.join(s)
- del a[a.index("--atomstr")]
- else:
- atomstr = lambda x, y=False: str(x)
-
- if len(a) == 0 or "--help" in a or (force_virtuals and disable_virtuals) or ("--max" in a and "--min" in a):
- print "supported args: [--raw] [--virtuals-only || --disable-virtuals ] [--vdb] [ --max || --min ] [--atomstr] [atom [ --attr attr ] ]*"
- sys.exit(1)
- conf = pkgcore.config.load_config()
- if len(conf.domain) != 1:
- print "sorry, I don't know about domains aside from using the only one I find"
- sys.exit(2)
- domain = conf.domain.items()[0][1]
- repos = []
- if force_vdb:
- repos = conf.domain["livefs domain"].vdb
- else:
- repos = conf.domain["livefs domain"].repos
- if raw:
- repos = repo_utils.get_raw_repos(repos)
- if force_virtuals:
- repos = repo_utils.get_virtual_repos(repo_utils.get_raw_repos(repos))
- elif disable_virtuals:
- repos = repo_utils.get_virtual_repos(repo_utils.get_raw_repos(repos), False)
-
- atoms = []
- attr = []
- while "--attr" in a:
- i = a.index("--attr")
- a.pop(i)
- try:
- attr.append(a.pop(i))
- except IndexError:
- print "need an arg to --attr!"
- sys.exit(1)
-
- results_filter = lambda a: a
- def less_pissy_builtins(func, *args, **kwds):
- try:
- return func(*args, **kwds)
- except ValueError:
- return []
- for s, f in (("--min", min), ("--max", max)):
- func = pre_curry(lambda inner_func,a: [inner_func(a)],
- pre_curry(less_pissy_builtins, f))
- if grab_arg(s, a):
- results_filter = func
-
- atoms = map(commandline.generate_restriction, a)
-
- if len(atoms) > 1:
- atoms = packages.OrRestriction(*atoms)
- for a in atoms:
- for repo in repos:
- for pkg in results_filter(repo.itermatch(a, sorter=pre_curry(sorted, reverse=True))):
- try: print str(atomstr(pkg))
- except AttributeError:
- print str(pkg)
- for x in attr:
- try: print "attr '%s' == %s" % (x, atomstr(getattr(pkg, x), True))
- except AttributeError, ae:
- print "attr '%s' exception: %s" % (x, ae)
- print
-
- sys.exit(0)
diff --git a/bin/utilities/regen.py b/bin/utilities/regen.py
deleted file mode 100755
index 9bae8bfd..00000000
--- a/bin/utilities/regen.py
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/usr/bin/python
-import threading, Queue
-import sys
-import time
-from pkgcore.config import load_config
-
-def regen_iter(iterable):
- for x in iterable:
- try:
- x.keywords
- except RuntimeError:
- raise
- except Exception, e:
- print "caught exception %s for %s" % (e, x)
-
-def reclaim_threads(threads):
- for x in threads:
- try:
- x.join()
- except RuntimeError:
- raise
- except Exception, e:
- print "caught exception %s reclaiming thread" % e
-
-
-if __name__ == "__main__":
- if len(sys.argv) > 2:
- print "need a single optional arg, # of threads to spawn"
- sys.exit(1)
- elif len(sys.argv) == 2:
- try:
- thread_count = int(sys.argv[1])
- if thread_count < 1:
- raise ValueError
- except ValueError:
- print "arg must be an integer, and greater then 0"
- sys.exit(1)
- else:
- thread_count = 1
- repo = load_config().repo["rsync repo"]
- start_time = time.time()
- count = 0
- if thread_count == 1:
- def passthru(iterable):
- global count
- for x in iterable:
- count += 1
- yield x
- regen_iter(passthru(repo))
- else:
- queue = Queue.Queue(thread_count*2)
- kill = threading.Event()
- kill.clear()
- def iter_queue(kill, qlist, timeout=0.25):
- while not kill.isSet():
- try:
- yield qlist.get(timeout=timeout)
- except Queue.Empty:
- continue
- regen_threads = [threading.Thread(target=regen_iter, args=(iter_queue(kill, queue),)) for x in xrange(thread_count)]
- print "starting %d thread" % thread_count
- try:
- for x in regen_threads:
- x.start()
- print "started"
- # now we feed the queue.
- for pkg in repo:
- count += 1
- queue.put(pkg)
- except Exception:
- kill.set()
- reclaim_threads(regen_threads)
- raise
-
- # by now, queue is fed. reliable for our uses since the queue is only subtracted from.
- while not queue.empty():
- time.sleep(.5)
- kill.set()
- reclaim_threads(regen_threads)
- assert queue.empty()
- print "finished %d nodes in in %.2f seconds" % (count, time.time() - start_time)
diff --git a/bin/utilities/register_plugin.py b/bin/utilities/register_plugin.py
deleted file mode 100755
index 0a2219de..00000000
--- a/bin/utilities/register_plugin.py
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/usr/bin/python
-# Copyright: 2005-2006 Brian Harring <ferringb@gmail.com>
-# License: GPL2
-
-import pkgcore.plugins
-from pkgcore.util.modules import load_attribute
-import sys
-
-def set(ptype, magic, version, namespace):
- load_attribute(namespace)
- # loaded.
- pkgcore.plugins.register(ptype, magic, version, namespace, replace=True)
-
-def cleanse(ptype, magic, version):
- pkgcore.plugins.deregister(ptype, magic, version)
-
-def get_list(ptype=None):
- return pkgcore.plugins.query_plugins(ptype)
-
-if __name__ == "__main__":
- args = sys.argv[1:]
- ret = 0
- if "-l" in args:
- args.pop(args.index("-l"))
- if len(args) == 0:
- args = [None]
- for x in args:
- print "querying %s" % str(x)
- try:
- i = get_list(x).items()
- if x is not None:
- i = [(x, dict(i))]
- for k,v in i:
- print
- try:
- l = max(len(y) for y in v.keys()) + 4
- print "%s => " % k
- for y in v.keys():
- print "%s: %s, %s" % (y.rjust(l), v[y]["namespace"], v[y]["version"])
- except ValueError:
- print "%s => no plugins found" % k
- print
- except Exception, e:
- print "caught exception %s querying" % e
- ret = 1
- elif "-s" in args:
- args.pop(args.index("-s"))
- if len(args) != 4:
- print "need 4 args- ptype magic version namespace"
- sys.exit(1)
- print "registering namespace(%s) as type(%s) constant(%s), ver(%s)" % (args[3], args[0], args[1], args[2])
- set(*args)
- elif "-r" in args:
- args.pop(args.index("-r"))
- if len(args) != 3:
- print "need 3 args- ptype magic version"
- sys.exit(1)
- print "deregistering type(%s) constant(%s) ver(%s)" % (args[0], args[1], args[2])
- cleanse(*args)
- elif "-p" in args:
- args.pop(args.index("-p"))
- if len(args) != 0:
- print "no args allowed currently"
- sys.exit(1)
- for ptype, v in get_list(None).iteritems():
- for magic, vals in v.iteritems():
- print "%s -s %s %s %s %s" % (sys.argv[0], ptype, magic, vals["version"], vals["namespace"])
- else:
- if "--help" not in args:
- print "command required"
- print
- print "options available: -s, -r, -l"
- print "-s ptype magic ver namespace"
- print "-r ptype magic ver"
- print "-l [ptype]"
- print
- if "--help" not in args:
- sys.exit(1)
- sys.exit(0)