* [gentoo-commits] proj/eselect:master commit in: libs/
@ 2013-01-05 13:47 Ulrich Mueller
0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Mueller @ 2013-01-05 13:47 UTC (permalink / raw
To: gentoo-commits
commit: 94cc23c8eb2dcafe1596dee6956e12c7415367a5
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 5 13:05:37 2013 +0000
Commit: Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jan 5 13:05:59 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=94cc23c8
Whitespace.
---
libs/package-manager.bash.in | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index 193c3fb..a34575d 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -44,12 +44,13 @@ run_paludis() {
arch() {
local ret=$(envvar sys-devel/gcc ARCH) suffix
- # $arch will be null if there's no current make.profile symlink
- # we cannot get a list of valid profiles without it.
- if [[ -z ${ret} ]] ; then
-
- if [[ -n ${ROOT} && ${ROOT} != "/" ]] ; then
- write_warning_msg "Failed to determine \${ARCH}. Is your make.profile symlink valid?"
+ # $arch will be null if there's no current make.profile symlink.
+ # We cannot get a list of valid profiles without it.
+ if [[ -z ${ret} ]]; then
+ if [[ -n ${ROOT} && ${ROOT} != "/" ]]; then
+ write_warning_msg \
+ "Failed to determine \${ARCH}." \
+ "Is your make.profile symlink valid?"
return 1
fi
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: libs/
@ 2013-01-13 13:10 Ulrich Mueller
0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Mueller @ 2013-01-13 13:10 UTC (permalink / raw
To: gentoo-commits
commit: f24af5afeb0c6be829fc61208d85cd2c5b36a593
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 13 12:45:36 2013 +0000
Commit: Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jan 13 12:45:36 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=f24af5af
Whitespace and quoting.
---
libs/core.bash.in | 28 ++++++++++++++--------------
1 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/libs/core.bash.in b/libs/core.bash.in
index 4431a8f..90b6621 100644
--- a/libs/core.bash.in
+++ b/libs/core.bash.in
@@ -18,7 +18,7 @@
# check_do function args
# Check that function exists, and call it with args.
check_do() {
- local function="${1}"
+ local function=$1
shift
if is_function "${function}" ; then
${function} "$@"
@@ -33,27 +33,27 @@ die() {
local item funcname="" sourcefile="" lineno="" n e s="yes"
# do we have a working write_error_msg?
- if is_function "write_error_msg" ; then
+ if is_function "write_error_msg"; then
e="write_error_msg"
else
e="echo"
fi
# quiet?
- if [[ ${1} == "-q" ]] ; then
+ if [[ $1 == "-q" ]]; then
s=""
shift
fi
$e "${@:-(no message)}"
- if [[ -n "${s}" ]] ; then
- echo "Call stack:" 1>&2
- for (( n = 1 ; n < ${#FUNCNAME[@]} ; ++n )) ; do
- funcname=${FUNCNAME[${n}]}
- sourcefile=$(basename ${BASH_SOURCE[${n}]})
- lineno=${BASH_LINENO[$(( n - 1 ))]}
- echo " * ${funcname} (${sourcefile}:${lineno})" 1>&2
+ if [[ -n ${s} ]]; then
+ echo "Call stack:" >&2
+ for (( n = 1; n < ${#FUNCNAME[@]}; ++n )); do
+ funcname=${FUNCNAME[n]}
+ sourcefile=$(basename ${BASH_SOURCE[n]})
+ lineno=${BASH_LINENO[n-1]}
+ echo " * ${funcname} (${sourcefile}:${lineno})" >&2
done
fi
@@ -72,8 +72,8 @@ do_action() {
ESELECT_MODULE_NAME="${action}"
ESELECT_COMMAND="${ESELECT_PROGRAM_NAME} ${ESELECT_MODULE_NAME}"
- [[ ${ESELECT_BINARY_NAME##*/} != ${ESELECT_PROGRAM_NAME} ]] && \
- ESELECT_COMMAND="${ESELECT_BINARY_NAME##*/}"
+ [[ ${ESELECT_BINARY_NAME##*/} != "${ESELECT_PROGRAM_NAME}" ]] \
+ && ESELECT_COMMAND="${ESELECT_BINARY_NAME##*/}"
modfile=$( es_find_module "${action}" )
(
@@ -81,7 +81,7 @@ do_action() {
|| die "Couldn't source ${ESELECT_DEFAULT_ACTIONS}"
source "${modfile}" 2>/dev/null \
|| die "Couldn't source ${modfile}"
- if [[ -z ${subaction} ]] ; then
+ if [[ -z ${subaction} ]]; then
check_do "do_${DEFAULT_ACTION:-usage}" "$@"
else
is_function "do_${subaction}" \
@@ -96,7 +96,7 @@ do_action() {
inherit() {
local x
for x in "$@"; do
- [[ -e "${ESELECT_CORE_PATH}/${x}.bash" ]] \
+ [[ -e ${ESELECT_CORE_PATH}/${x}.bash ]] \
|| die "Couldn't find ${x}.bash"
source "${ESELECT_CORE_PATH}/${x}.bash" \
|| die "Couldn't source ${x}.bash"
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: libs/
@ 2013-03-02 11:07 Ulrich Mueller
0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Mueller @ 2013-03-02 11:07 UTC (permalink / raw
To: gentoo-commits
commit: 3886c469547e839011897a86b782c420be52ca26
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 2 11:11:17 2013 +0000
Commit: Ulrich Mueller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Mar 2 11:11:17 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=3886c469
Update comment for relative_name function.
---
libs/path-manipulation.bash.in | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/libs/path-manipulation.bash.in b/libs/path-manipulation.bash.in
index aeee4be..0e02e0a 100644
--- a/libs/path-manipulation.bash.in
+++ b/libs/path-manipulation.bash.in
@@ -67,7 +67,8 @@ canonicalise() {
}
# relative_name
-# Convert filename $1 to be relative to directory $2 (both must exist).
+# Convert filename $1 to be relative to directory $2.
+# For both paths, all but the last component must exist.
relative_name() {
local path=$(canonicalise "$1") dir=$(canonicalise "$2") c
while [[ -n ${dir} ]]; do
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: libs/
@ 2013-11-10 20:24 Ulrich Müller
0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Müller @ 2013-11-10 20:24 UTC (permalink / raw
To: gentoo-commits
commit: 3b1430f118e4c696c4588f30b5b52cc6cbac76a6
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 10 18:06:34 2013 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Nov 10 18:06:34 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=3b1430f1
Cosmetic changes in output.bash.
---
libs/output.bash.in | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/libs/output.bash.in b/libs/output.bash.in
index 5c79c53..ac934bb 100644
--- a/libs/output.bash.in
+++ b/libs/output.bash.in
@@ -40,13 +40,13 @@ colours() {
# set output mode to $1
set_output_mode() {
- ESELECT_OUTPUT_MODE=${1}
+ ESELECT_OUTPUT_MODE=$1
}
# is_output_mode PUBLIC
# test if $1 is the current output mode
is_output_mode() {
- [[ ${ESELECT_OUTPUT_MODE} = ${1} ]]
+ [[ ${ESELECT_OUTPUT_MODE} = $1 ]]
}
# Determine width of terminal and set COLUMNS variable
@@ -72,7 +72,7 @@ write_warning_msg() {
write_list_start() {
is_output_mode brief && return
local colour=${COLOUR_LIST_HEADER} normal=${COLOUR_NORMAL}
- if [[ ${1} == "-p" ]] ; then
+ if [[ $1 == "-p" ]]; then
colour=; normal=
shift
fi
@@ -92,7 +92,7 @@ write_kv_list_entry() {
local normal=${COLOUR_NORMAL}
local IFS=$' \t\n'
- if [[ ${1} == "-p" ]] ; then
+ if [[ $1 == "-p" ]]; then
left=; right=; normal=
shift
fi
@@ -112,7 +112,7 @@ write_kv_list_entry() {
# if ${n} is less than or equal to zero then we have a long ${key}
# that will mess up the formatting of ${val}, so end the line, indent
# and let ${val} go on the next line.
- if [[ ${n} -le 0 ]] ; then
+ if [[ ${n} -le 0 ]]; then
echo
n=$(( 28 + ${#rindent} ))
fi
@@ -126,14 +126,14 @@ write_kv_list_entry() {
text=${val//\%%%??%%%/}
# only loop if it doesn't fit on the same line
- if [[ $(( ${n} + ${#text} )) -ge ${cols} ]] ; then
+ if [[ $(( ${n} + ${#text} )) -ge ${cols} ]]; then
local i=0 spc=""
rindent=$(space ${n})
cwords=( ${cwords} )
- for text in ${val} ; do
+ for text in ${val}; do
text=${text//\%%%??%%%/}
# put the word on the same line if it fits
- if [[ $(( ${n} + ${#spc} + ${#text} )) -lt ${cols} ]] ; then
+ if [[ $(( ${n} + ${#spc} + ${#text} )) -lt ${cols} ]]; then
echo -n -e "${spc}${cwords[i]}"
n=$(( ${n} + ${#spc} + ${#text} ))
# otherwise, start a new line and indent
@@ -157,7 +157,7 @@ write_numbered_list_entry() {
local left=${COLOUR_LIST_LEFT} right=${COLOUR_LIST_RIGHT}
local normal=${COLOUR_NORMAL}
- if [[ ${1} == "-p" ]] ; then
+ if [[ $1 == "-p" ]]; then
left=; right=; normal=
shift
fi
@@ -192,11 +192,11 @@ write_numbered_list() {
write_kv_list_entry ${p} "${m}" ""
fi
- while [[ $# -gt 0 ]] ; do
- item=${1}
+ while [[ $# -gt 0 ]]; do
+ item=$1
shift
- if [[ ${item##*\\} == "" ]] ; then
- item="${item%\\} ${1}"
+ if [[ ${item##*\\} == "" ]]; then
+ item="${item%\\} $1"
shift
fi
write_numbered_list_entry ${p} "${n}" "${item}"
@@ -208,7 +208,7 @@ write_numbered_list() {
# Apply text highlights. First arg is the 'restore' colour, second arg
# is the text.
apply_text_highlights() {
- local restore=${1:-${COLOUR_NORMAL}} text=${2}
+ local restore=${1:-${COLOUR_NORMAL}} text=$2
text="${text//?%%HI%%%/${COLOUR_HI}}"
text="${text//?%%WA%%%/${COLOUR_WARN}}"
text="${text//?%%RE%%%/${restore}}"
@@ -231,7 +231,7 @@ highlight_warning() {
# Mark list entry $1 as active/selected by placing a highlighted star
# (or $2 if set) behind it.
highlight_marker() {
- local text=${1} mark=${2-*}
+ local text=$1 mark=${2-*}
echo -n "${text}"
if [[ -n ${mark} ]] && ! is_output_mode brief; then
echo -n " "
@@ -243,7 +243,7 @@ highlight_marker() {
# Write $1 numbers of spaces
space() {
local n ret=""
- for (( n = 1 ; n <= ${1} ; ++n )) ; do
+ for (( n = 1; n <= $1; ++n )); do
ret="${ret} "
done
echo -n "${ret}"
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: libs/
@ 2013-11-19 8:17 Ulrich Müller
0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Müller @ 2013-11-19 8:17 UTC (permalink / raw
To: gentoo-commits
commit: ba92c398946c8608aaf8b0884d7ed2a7d2905586
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu Nov 14 23:56:22 2013 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Nov 15 08:01:31 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/eselect.git;a=commit;h=ba92c398
More cosmetic changes in output.bash.
---
libs/output.bash.in | 13 +++++--------
1 file changed, 5 insertions(+), 8 deletions(-)
diff --git a/libs/output.bash.in b/libs/output.bash.in
index 78e0c4f..5390792 100644
--- a/libs/output.bash.in
+++ b/libs/output.bash.in
@@ -90,6 +90,7 @@ write_kv_list_entry() {
local n text key val lindent rindent
local left=${COLOUR_LIST_LEFT} right=${COLOUR_LIST_RIGHT}
local normal=${COLOUR_NORMAL}
+ local cols=${COLUMNS:-80}
local IFS=$' \t\n'
if [[ $1 == "-p" ]]; then
@@ -117,19 +118,15 @@ write_kv_list_entry() {
n=$(( 28 + ${#rindent} ))
fi
- space ${n}
- echo -n -e "${right}"
+ echo -n -e "$(space ${n})${right}"
n=$(( 28 + ${#rindent} ))
- local cols=${COLUMNS:-80}
- local cwords=$(apply_text_highlights "${right}" "${val}")
-
text=${val//\%%%??%%%/}
# only loop if it doesn't fit on the same line
if [[ $(( ${n} + ${#text} )) -ge ${cols} ]]; then
local i=0 spc=""
rindent=$(space ${n})
- cwords=( ${cwords} )
+ local cwords=( $(apply_text_highlights "${right}" "${val}") )
for text in ${val}; do
text=${text//\%%%??%%%/}
# put the word on the same line if it fits
@@ -141,11 +138,11 @@ write_kv_list_entry() {
echo -n -e "\n${rindent}${cwords[i]}"
n=$(( ${#rindent} + ${#text} ))
fi
- i=$(( ${i} + 1 ))
+ (( i++ ))
spc=" "
done
else
- echo -n -e "${cwords}"
+ echo -n -e "$(apply_text_highlights "${right}" "${val}")"
fi
echo -e "${normal}"
}
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-commits] proj/eselect:master commit in: libs/
@ 2017-06-18 19:32 Ulrich Müller
0 siblings, 0 replies; 6+ messages in thread
From: Ulrich Müller @ 2017-06-18 19:32 UTC (permalink / raw
To: gentoo-commits
commit: 3f5b5bd616ae02a632ff03c2b95fbea510c0cf05
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 18 19:27:06 2017 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sun Jun 18 19:27:06 2017 +0000
URL: https://gitweb.gentoo.org/proj/eselect.git/commit/?id=3f5b5bd6
Whitespace.
libs/package-manager.bash.in | 34 +++++++++++++++++-----------------
1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index c675e7d..b2c5aba 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -70,23 +70,23 @@ arch() {
# Try to determine arch from HOSTTYPE and OSTYPE, which are
# derived from the GNU triplet (at build time of bash)
case ${HOSTTYPE} in
- aarch64*) ret=arm64 ;;
- alpha*) ret=alpha ;;
- arm*) ret=arm ;;
- hppa*) ret=hppa ;;
- i?86) ret=x86 ;;
- ia64*) ret=ia64 ;;
- m68k*) ret=m68k ;;
- mips*) ret=mips ;;
- nios2) ret=nios2 ;;
- or1k|or32*) ret=openrisc;;
- powerpc64*) ret=ppc64 ;;
- powerpc*) ret=ppc ;;
- riscv*) ret=riscv ;;
- s390*) ret=s390 ;;
- sh*) ret=sh ;;
- sparc*) ret=sparc ;;
- x86_64) ret=amd64 ;;
+ aarch64*) ret=arm64 ;;
+ alpha*) ret=alpha ;;
+ arm*) ret=arm ;;
+ hppa*) ret=hppa ;;
+ i?86) ret=x86 ;;
+ ia64*) ret=ia64 ;;
+ m68k*) ret=m68k ;;
+ mips*) ret=mips ;;
+ nios2) ret=nios2 ;;
+ or1k|or32*) ret=openrisc ;;
+ powerpc64*) ret=ppc64 ;;
+ powerpc*) ret=ppc ;;
+ riscv*) ret=riscv ;;
+ s390*) ret=s390 ;;
+ sh*) ret=sh ;;
+ sparc*) ret=sparc ;;
+ x86_64) ret=amd64 ;;
*)
write_warning_msg \
"Unknown architecture \"${HOSTTYPE}\"." \
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2017-06-18 19:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-19 8:17 [gentoo-commits] proj/eselect:master commit in: libs/ Ulrich Müller
-- strict thread matches above, loose matches on Subject: below --
2017-06-18 19:32 Ulrich Müller
2013-11-10 20:24 Ulrich Müller
2013-03-02 11:07 Ulrich Mueller
2013-01-13 13:10 Ulrich Mueller
2013-01-05 13:47 Ulrich Mueller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox