From 4e457e0efd0e5fd5df24c7e9ed63b02d0196ea8d Mon Sep 17 00:00:00 2001 From: Jouke Witteveen Date: Fri, 28 Dec 2012 02:38:58 +0100 Subject: Forking netcfg to netctl (1/2) This commit contains the moving of files. --- src/hooks/fancy | 90 --------------------------------------------------- src/hooks/initscripts | 35 -------------------- 2 files changed, 125 deletions(-) delete mode 100755 src/hooks/fancy delete mode 100755 src/hooks/initscripts (limited to 'src/hooks') diff --git a/src/hooks/fancy b/src/hooks/fancy deleted file mode 100755 index a64514e..0000000 --- a/src/hooks/fancy +++ /dev/null @@ -1,90 +0,0 @@ -# Fancy output is for terminal output only. -[[ -t 1 ]] || return - - -### Fancy Logging/Error reporting - -function report_err { - print_prefixed "${FANCY_OTHER}" "${FANCY_HIGHLIGHT}$*" -} - -function report_notice { - print_prefixed "${FANCY_OTHER}" "$*" -} - -function report_try { - printf "${FANCY_OTHER}${PREFIX_BUSY}${FANCY_NORMAL} %s " "$*" - report_busy - REPORT_TRYING=1 -} - -function report_fail { - if [[ -n "$*" ]]; then - if [[ -n "$REPORT_TRYING" ]]; then - report_append "$*" - report_failed - REPORT_TRYING= - else - print_prefixed "${FANCY_FAILED}" "${FANCY_HIGHLIGHT}$*" - fi - elif [[ -n "$REPORT_TRYING" ]]; then - report_failed - REPORT_TRYING= - fi -} - -function report_success { - if [[ -n "$*" ]]; then - if [[ -n "$REPORT_TRYING" ]]; then - report_append "$*" - report_done - REPORT_TRYING= - else - print_prefixed "${FANCY_DONE}" "$*" - fi - elif [[ -n "$REPORT_TRYING" ]]; then - report_done - REPORT_TRYING= - fi -} - -function report_append { - printf -- "${RESTORE_POSITION}${FANCY_OTHER}-${FANCY_NORMAL} %s " "$*" -} - -function report_busy { - printf "${CURSOR_STATUS} [${FANCY_BUSY} BUSY ${FANCY_NORMAL}] " -} - -function report_failed { - printf "${CURSOR_STATUS} [${FANCY_FAILED}FAILED${FANCY_NORMAL}]\n" -} - -function report_done { - printf "${CURSOR_STATUS} [${FANCY_DONE} DONE ${FANCY_NORMAL}]\n" -} - -function print_prefixed { - local c_prefix=$1 - shift - printf "${c_prefix}${PREFIX_ATTENTION}${FANCY_NORMAL} %s${FANCY_NORMAL}\n" "$*" -} - - -SAVE_POSITION=$(tput sc) -RESTORE_POSITION=$(tput rc) -COLUMNS=$(tput cols) -(( COLUMNS == 0 )) && COLUMNS=80 -CURSOR_STATUS=${SAVE_POSITION}$(tput hpa $(( COLUMNS - 10 )) ) - -FANCY_NORMAL=$(tput sgr0) -FANCY_HIGHLIGHT=${FANCY_NORMAL}$(tput bold) -FANCY_BUSY=${FANCY_NORMAL}$(tput setaf 6) # cyan -FANCY_FAILED=${FANCY_HIGHLIGHT}$(tput setaf 1) # red -FANCY_DONE=${FANCY_HIGHLIGHT}$(tput setaf 2) # green -FANCY_OTHER=${FANCY_HIGHLIGHT}$(tput setaf 4) # blue - -PREFIX_BUSY="::" -PREFIX_ATTENTION=" >" - -# vim: ft=sh ts=4 et sw=4: diff --git a/src/hooks/initscripts b/src/hooks/initscripts deleted file mode 100755 index 07003c8..0000000 --- a/src/hooks/initscripts +++ /dev/null @@ -1,35 +0,0 @@ -# Use initscripts output formatting. -# This hook must be loaded after 'fancy'. - -[[ ${FANCY_NORMAL+x} = x && -f /etc/rc.d/functions ]] || return -. /etc/rc.conf -. /etc/rc.d/functions - - -function report_try { - stat_busy "$*" - REPORT_TRYING=1 -} - -function report_append { - stat_append "- $*" -} - -function report_failed { - stat_fail -} - -function report_done { - stat_done -} - - -FANCY_NORMAL=$C_CLEAR -FANCY_HIGHLIGHT=$C_H1 -FANCY_FAILED=$C_FAIL -FANCY_DONE=$C_DONE -FANCY_OTHER=$C_OTHER - -PREFIX_ATTENTION=$PREFIX_HL - -# vim: ft=sh ts=4 et sw=4: -- cgit v1.2.3-24-g4f1b