From c94e1368e754c1345c9213b700420e468fdc13fa Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 17 Apr 2015 16:42:41 +0200 Subject: Merged from Anevia. --- 01_Internal.zsh | 2 +- 10_Environment.zsh | 2 +- 12_Prompts.zsh | 3 ++- zsh-syntax-highlighting | 2 +- zshrc | 5 +++-- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/01_Internal.zsh b/01_Internal.zsh index 881ec07..217b013 100644 --- a/01_Internal.zsh +++ b/01_Internal.zsh @@ -685,7 +685,7 @@ _process_tree() { for leaf in ${@:-$$} do - ps -eo pid,ppid,command | awk -v leaf="$leaf" \ + ps -eo pid,ppid,command 2>&- | awk -v leaf="$leaf" \ '{ parent[$1]=$2 ; command[$1]=$3 ; diff --git a/10_Environment.zsh b/10_Environment.zsh index c793d3c..6d33610 100644 --- a/10_Environment.zsh +++ b/10_Environment.zsh @@ -94,7 +94,7 @@ HISTSIZE=$(( $SAVEHIST * 1.10 )) export GPG_TTY=`tty` # YeahConsole.. -if ( ps x | grep $$ -B1 | grep -q yeahconsole ) +if ( ps x 2>&- | grep $$ -B1 | grep -q yeahconsole ) then _yeahconsole=true fi diff --git a/12_Prompts.zsh b/12_Prompts.zsh index d252b05..c8b791f 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -315,7 +315,8 @@ __two_lines_prompt () PS1_+=$(__show_date) PS1_+=" -"$C_$_prompt_colors[user]$_C"${USER:-%n}"$C_$_prompt_colors[arob]$_C"@"$C_$_prompt_colors[host]$_C"%M${SSH_CLIENT:+ ← $(host ${SSH_CLIENT/ */} | awk '{ gsub(/\.$/, "", $NF); gsub(/.'$DOMAIN'$/, "", $NF); print $NF }')} "$CURDIR${VCSBRANCH:+ $VCSBRANCH} +"$C_$_prompt_colors[user]$_C"${USER:-%n}"$C_$_prompt_colors[arob]$_C"@"$C_$_prompt_colors[host]$_C"%M${SSH_CLIENT:+ ← $(host ${SSH_CLIENT/ */} | awk '/not found/ { print "'${SSH_CLIENT/ */}'" ; exit } { gsub(/\.$/, "", $NF); gsub(/.'$DOMAIN'$/, "", $NF); print $NF }')} "$CURDIR${VCSBRANCH:+ $VCSBRANCH} + __debug "-----------------> extra..." PS1_+=$(__ps1_extrainfo) __debug "-----------------> PS1..." diff --git a/zsh-syntax-highlighting b/zsh-syntax-highlighting index 3dc5741..5320f1e 160000 --- a/zsh-syntax-highlighting +++ b/zsh-syntax-highlighting @@ -1 +1 @@ -Subproject commit 3dc574190071ef59054f6d693132410b37aa3ae4 +Subproject commit 5320f1e18d5782e29a6637937e37a3aecf9327bb diff --git a/zshrc b/zshrc index 8c1a7f6..499ad3c 100644 --- a/zshrc +++ b/zshrc @@ -6,12 +6,12 @@ # # If you want to add a file, name it specifically in the form # -# $ZDOTDIR/??_*.zsh +# $ZDOTDIR/??_*.zsh # # Where "??" should be a two-digit number. # With that, file ``10_Toto.zsh'' would be parsed before # file ``20_Tutu.zsh'', allowing you ordering your scripts. -# +# # If you want to make user, host or network specific configurations, # add your specific scripts to the folders # - "sys:$(uname -s)" for OS-specific conf, @@ -38,6 +38,7 @@ HOST=$HOST:r HOST=${HOST:-$(hostname -s)} DOMAIN=$(hostname -a 2>&-| sed 's/^[^\.]*\.\?//') DOMAIN=${DOMAIN:-$(hostname -d 2>&-)} +DOMAIN=${DOMAIN:-$(hostname -y 2>&-)} [ "$DOMAIN" = "" -o "$DOMAIN" = "localdomain" -o "$DOMAIN" = "(none)" ] && DOMAIN=$(grep "^search " /etc/resolv.conf | cut -d' ' -f2) ## Agent de clefs SSH/GPG -- cgit v1.2.3 From 459669b7cc58abf3958e16d2df7998c1cad8e02d Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 17 Apr 2015 16:43:28 +0200 Subject: [net:foret] Funcs. --- net:foret/Functions.zsh | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 net:foret/Functions.zsh diff --git a/net:foret/Functions.zsh b/net:foret/Functions.zsh new file mode 100644 index 0000000..0a77351 --- /dev/null +++ b/net:foret/Functions.zsh @@ -0,0 +1,34 @@ + +_cn () { + local _CN=/usr/local/Cavium_Networks/ + local SDK MODEL GCC + case $1 in + ([Oo]+*) MODEL=OCTEON_CN58XX + SDK=${2:-OCTEON-SDK-1.7.2} + case $1 in + (*-) GCC=tools ;; + (*) GCC=tools-gcc-4.7.2 ;; + esac + TARGET=OCTEONPLUS_64-CAVIUMSE-SMP-PERF-EXTFLOW ;; + ([Oo]2*) case $1 in + (O*) MODEL=OCTEON_CN68XX ;; + (o*) MODEL=OCTEON_CN66XX ;; + esac + SDK=${2:-cnUSERS-SDK-2.3} + case $1 in + (*-) GCC=tools ;; + (*) GCC=tools-gcc-4.7.2 ;; + esac + TARGET=OCTEON2_64-CAVIUMSE-SMP-PERF-EXTFLOW ;; + (*) TARGET=x86_64-LSB-SMP-PERF-EXTFLOW + unset OCTEON_ROOT ;; + esac + PATH=${(j/:/)$(echo ${${(s/:/)PATH}##/usr/local/Cavium_Networks/*})} + if [ -n "$SDK" ] + then + pushd $_CN/$SDK > /dev/null 2>&1 + source ./env-setup $MODEL --runtime-model --tools=$GCC + popd > /dev/null 2>&1 + fi +} + -- cgit v1.2.3