|
|
declare SEARCH_DIRS_MASK # List of dirs not to search | declare SEARCH_DIRS_MASK # List of dirs not to search |
| |
# Other globals: | # Other globals: |
|
declare OLDPROG # Previous pass through the progress meter |
declare EXACT_PKG # Versionated atom to emerge | declare EXACT_PKG # Versionated atom to emerge |
declare HEAD_TEXT # Feedback string about the search | declare HEAD_TEXT # Feedback string about the search |
declare LIST # Prefix for temporary filenames | declare LIST # Prefix for temporary filenames |
|
|
progress() { :; } | progress() { :; } |
else | else |
progress() { | progress() { |
|
local curProg=$(( $1 * 100 / $2 )) |
|
(( curProg == OLDPROG )) && return # no change, output nothing |
|
OLDPROG="$curProg" # must be a global variable |
(( $1 == $2 )) && local lb=$'\n' | (( $1 == $2 )) && local lb=$'\n' |
echo -ne '\r \r' |
echo -ne '\r \r'"[ $curProg% ] $lb" |
echo -n "[ $(( $1 * 100 / $2 ))% ] $lb" |
|
} | } |
progress $@ | progress $@ |
fi | fi |
|
|
sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:' | sed 's:/var/db/pkg/\(.*\)/CONTENTS:\1:' |
} | } |
fi | fi |
|
|
|
# Use the color preference from portage |
|
export NOCOLOR=$(portageq envvar NOCOLOR) |
|
[[ $NOCOLOR = yes || $NOCOLOR = true ]] && export RC_NOCOLOR=yes # HACK! (grr) |
|
source /etc/init.d/functions.sh |
|
|
# Normalize some EMERGE_OPTIONS | # Normalize some EMERGE_OPTIONS |
EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]/%-p/--pretend}) | EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]/%-p/--pretend}) |
EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]/%-f/--fetchonly}) | EMERGE_OPTIONS=(${EMERGE_OPTIONS[@]/%-f/--fetchonly}) |
|
|
]] | ]] |
| |
get_args "$@" | get_args "$@" |
# Use the color preference from portage |
|
export NOCOLOR=$(portageq envvar NOCOLOR) |
|
[[ $NOCOLOR = yes || $NOCOLOR = true ]] && export RC_NOCOLOR=yes # HACK! (grr) |
|
source /etc/init.d/functions.sh |
|
| |
einfo "Configuring search environment for $APP_NAME" | einfo "Configuring search environment for $APP_NAME" |
| |