configure 4.2.4: minor code improvements, output message changes

parent 938e174f
#!/bin/bash
#########################################################
# #
# This is BashStyle-NG #
# #
# Licensed under GNU GENERAL PUBLIC LICENSE v3 #
# #
# Copyright 2007 - 2015 Christopher Bratusek #
# #
#########################################################
export xVERSION=8.99
CODENAME="Nice Sprites"
CODENAME="Hotride"
ERR_MSG=""
......@@ -17,29 +26,29 @@ MODE=user
QUIET=false
PYTHON=$(which python3 || which python)
BINDIR="$PREFIX/bin"
PCDIR="$PREFIX/share/pkgconfig/"
DATADIR="$PREFIX/share/"
BINDIR="${PREFIX}/bin"
PCDIR="${PREFIX}/share/pkgconfig/"
DATADIR="${PREFIX}/share/"
PROFILEDIR="/etc/"
export OLDPATH=$PATH
export PATH="$PATH:/sbin:/usr/sbin:/usr/local/sbin"
export OLDPATH=${PATH}
export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
export_result ()
{
echo -e "MODE=\"$MODE\"\
\nPREFIX=\"$PREFIX\"\
\nDATADIR=\"$DATADIR/bashstyle-ng/\"\
echo -e "MODE=\"${MODE}\"\
\nPREFIX=\"${PREFIX}\"\
\nDATADIR=\"${DATADIR}/bashstyle-ng/\"\
\nDATADIR_LIST=( bin ui rc/{,ascii,dirinfo,functions,internal,settings,styles} termcap/{bar,body} vim/{,colors} )\
\nPROFILEDIR=\"$PROFILEDIR/\"\
\nBINDIR=\"$BINDIR\"\
\nLOCALEDIR=\"$DATADIR/locale/\"\
\nPROFILEDIR=\"${PROFILEDIR}/\"\
\nBINDIR=\"${BINDIR}\"\
\nLOCALEDIR=\"${DATADIR}/locale/\"\
\nLOCALEDIR_LIST=( {de,es,it,ru}/LC_MESSAGES/ )\
\nICONDIR=\"$DATADIR/icons/hicolor/32x32/apps/\"\
\nPCDIR=\"$PCDIR/\"\
\nDIRINFO_ENABLE=\"$DIRINFO_ENABLE\"\
\nBASHFILE=\"$BASHFILE\"\
\nMISSING=($MISSING )" | sed -e 's,\/\/,\/,g' >> $PWD/.configure/results
\nICONDIR=\"${DATADIR}/icons/hicolor/32x32/apps/\"\
\nPCDIR=\"${PCDIR}/\"\
\nDIRINFO_ENABLE=\"${DIRINFO_ENABLE}\"\
\nBASHFILE=\"${BASHFILE}\"\
\nMISSING=( ${MISSING} )" | sed -e 's,\/\/,\/,g' >> ${PWD}/.configure/results
}
#!/bin/bash
check ()
{
for dir in ${PATH//:/ }; do
if [[ -e ${dir}/${1} ]]; then
echo found && continue 2
fi
done
#########################################################
# #
# This is BashStyle-NG #
# #
# Licensed under GNU GENERAL PUBLIC LICENSE v3 #
# #
# Copyright 2007 - 2015 Christopher Bratusek #
# #
#########################################################
check () {
for dir in ${PATH//:/ }; do
[[ -e ${dir}/${1} ]] && (echo found && continue 2)
done
}
check_helper () {
if [[ ${APPS[@]} != "" ]]; then
section_message APP
check_apps "false" "${APPS[@]}"
fi
if [[ ${OPT_APPS[@]} != "" ]]; then
section_message OPT_APP
check_apps "true" "${OPT_APPS[@]}"
fi
if [[ ${SAPPS[@]} != "" ]]; then
section_message SBINAPP
check_apps "false" "${SAPPS[@]}"
fi
if [[ ${OPT_SAPPS[@]} != "" ]]; then
section_message OPT_SBINAPP
check_apps "true" "${OPT_SAPPS[@]}"
fi
[[ ${APPS[@]} ]] && (section_message APP && check_apps "false" "${APPS[@]}")
[[ ${OPT_APPS[@]} ]] && (section_message OPT_APP && check_apps "true" "${OPT_APPS[@]}")
[[ ${SAPPS[@]} ]] && (section_message SBINAPP && check_apps "false" "${SAPPS[@]}")
[[ ${OPT_SAPPS[@]} ]] && (section_message OPT_SBINAPP && check_apps "true" "${OPT_SAPPS[@]}")
check_python
if [[ ${PYMODS[@]} != "" ]]; then
section_message PYMOD
check_pymods "false" "${PYMODS[@]}"
fi
if [[ ${OPT_PYMODS[@]} != "" ]]; then
section_message OPT_PYMOD
check_pymods "true" "${OPT_PYMODS[@]}"
fi
if [[ ${LIBS[@]} != "" ]]; then
section_message LIB
check_libs "false" "${LIBS[@]}"
fi
if [[ ${OPT_LIBS[@]} != "" ]]; then
section_message OPT_LIB
check_libs "false" "${OPT_LIBS[@]}"
fi
if [[ ${GIR[@]} != "" ]]; then
section_message GIR
check_gir "false" "${GIR[@]}"
fi
if [[ ${OPT_GIR[@]} != "" ]]; then
section_message OPT_GIR
check_gir "false" "${OPT_GIR[@]}"
fi
[[ ${PYMODS[@]} ]] && (section_message PYMOD && check_pymods "false" "${PYMODS[@]}")
[[ ${OPT_PYMODS[@]} ]] && (section_message OPT_PYMOD && check_pymods "true" "${OPT_PYMODS[@]}")
[[ ${LIBS[@]} ]] && (section_message LIB && check_libs "false" "${LIBS[@]}")
[[ ${OPT_LIBS[@]} ]] && (section_message OPT_LIB && check_libs "false" "${OPT_LIBS[@]}")
[[ ${GIR[@]} ]] && (section_message GIR && check_gir "false" "${GIR[@]}")
[[ ${OPT_GIR[@]} ]] && (section_message OPT_GIR && check_gir "false" "${OPT_GIR[@]}")
}
......
#!/bin/bash
#########################################################
# #
# This is BashStyle-NG #
# #
# Licensed under GNU GENERAL PUBLIC LICENSE v3 #
# #
# Copyright 2007 - 2015 Christopher Bratusek #
# #
#########################################################
RED="\033[01;31m"
GREEN="\033[01;32m"
......
#!/bin/bash
#########################################################
# #
# This is BashStyle-NG #
# #
# Licensed under GNU GENERAL PUBLIC LICENSE v3 #
# #
# Copyright 2007 - 2015 Christopher Bratusek #
# #
#########################################################
section_message () {
if [[ $QUIET != "true" ]]; then
if [[ ${QUIET} != "true" ]]; then
case $1 in
APP )
echo -e "\n${RED}Required ${WHITE}Applications:\n"
;;
OPT_APP )
echo -e "\n${MAGENTA}Optional ${WHITE}Applications:\n"
;;
SBINAPP )
echo -e "\n${RED}Required ${WHITE}SuperUser Applications:\n"
;;
OPT_SBINAPP )
echo -e "\n${MAGENTA}Optional ${WHITE}SuperUser Applications:\n"
;;
PY )
echo -e "\n${RED}Python Interpreter${WHITE} > 2.6 && < 3.5:\n"
;;
PYMOD )
echo -e "\n${RED}Required ${WHITE}Python Modules:\n"
;;
OPT_PYMOD )
echo -e "\n${MAGENTA}Optional ${WHITE}Python Modules:\n"
;;
LIB )
echo -e "\n${RED}Required ${WHITE}Libraries:\n"
;;
OPT_LIB )
echo -e "\n${MAGENTA}Optional ${WHITE}Libraries:\n"
;;
GIR )
echo -e "\n${RED}Required ${WHITE}GIR Repositories:\n"
;;
OPT_GIR)
echo -e "\n${MAGENTA}Optional ${WHITE}GIR Repositories:\n"
;;
APP ) echo -e "\n${RED}< Required ${WHITE}Applications" ;;
OPT_APP ) echo -e "\n${MAGENTA}< Optional ${WHITE}Applications" ;;
SBINAPP ) echo -e "\n${RED}< Required ${WHITE}SuperUser Applications" ;;
OPT_SBINAPP ) echo -e "\n${MAGENTA}< Optional ${WHITE}SuperUser Applications" ;;
PY ) echo -e "\n${RED}< Python Interpreter${WHITE} > 2.6 && < 3.5" ;;
PYMOD ) echo -e "\n${RED}< Required ${WHITE}Python Modules" ;;
OPT_PYMOD ) echo -e "\n${MAGENTA}< Optional ${WHITE}Python Modules" ;;
LIB ) echo -e "\n${RED}< Required ${WHITE}Libraries" ;;
OPT_LIB ) echo -e "\n${MAGENTA}< Optional ${WHITE}Libraries" ;;
GIR ) echo -e "\n${RED}< Required ${WHITE}GIR Repositories" ;;
OPT_GIR) echo -e "\n${MAGENTA}< Optional ${WHITE}GIR Repositories" ;;
esac
fi
tput sgr0
......@@ -56,17 +32,17 @@ section_message () {
start_message () {
echo -e "\n${GREEN}BashStyle-NG${YELLOW} v${xVERSION} ${CYAN}${CODENAME}"
echo -e "\n${WHITE}Configuring ${GREEN}BashStyle-NG${YELLOW} v${xVERSION} ${CYAN}(${CODENAME})"
tput sgr0
}
ok_message () {
if [[ $QUIET != "true" ]]; then
if [[ ${QUIET} != "true" ]]; then
if [[ $2 != "" ]]; then
echo -e "${WHITE}\t+ ${CYAN}$1${MAGENTA} >${GREEN} O.K.${SILVER} ( $2 )"
else echo -e "${WHITE}\t+ ${CYAN}$1${MAGENTA} >${GREEN} O.K."
echo -e "${WHITE}\t+ ${CYAN}$1${MAGENTA} >${GREEN} OK${SILVER} ( $2 )"
else echo -e "${WHITE}\t+ ${CYAN}$1${MAGENTA} >${GREEN} OK"
fi
fi
tput sgr0
......@@ -75,26 +51,11 @@ ok_message () {
fail_message () {
case $1 in
m )
echo -e "${WHITE}\t+ ${CYAN}$2${MAGENTA} >${RED} !MISSING!"
;;
o )
echo -e "${WHITE}\t+ ${CYAN}$2${MAGENTA} >${RED} !OLDER THAN $3!"
;;
p )
echo -e "${WHITE}\t+ ${CYAN}Python ($PYTHON)${MAGENTA} >${RED} !MISSING!"
;;
p- )
echo -e "${WHITE}\t+ ${CYAN}Python ($PYTHON)${MAGENTA} >${RED} !OLDER THAN 2.7.0!"
;;
p+ )
echo -e "${WHITE}\t+ ${CYAN}Python ($PYTHON)${MAGENTA} >${RED} !IS 3.4 OR ABOVE!"
;;
m ) echo -e "${WHITE}\t+ ${CYAN}$2${MAGENTA} >${RED} !MISSING!" ;;
o ) echo -e "${WHITE}\t+ ${CYAN}$2${MAGENTA} >${RED} !OLDER THAN $3!" ;;
p ) echo -e "${WHITE}\t+ ${CYAN}Python ($PYTHON)${MAGENTA} >${RED} !MISSING!" ;;
p- ) echo -e "${WHITE}\t+ ${CYAN}Python ($PYTHON)${MAGENTA} >${RED} !OLDER THAN 2.7.0!" ;;
p+ ) echo -e "${WHITE}\t+ ${CYAN}Python ($PYTHON)${MAGENTA} >${RED} !IS 3.5 OR ABOVE!" ;;
esac
tput sgr0
......@@ -119,25 +80,29 @@ end_message () {
export PATH="$OLDPATH"
echo -e "\n${BLUE}Notes from configure:\
\n\n${YELLOW}Prefix:${WHITE}\t\t\t$PREFIX\
\n${YELLOW}Python:${WHITE}\t\t\t$PYTHON\
\n${YELLOW}Dirinfo Wrappers:${WHITE}\t$DIRINFO_ENABLE"
\n${YELLOW}Prefix\t\t\t${WHITE}>${MAGENTA} ${PREFIX}\
\n${YELLOW}Python\t\t\t${WHITE}>${MAGENTA} ${PYTHON}"
if [[ ${DIRINFO_ENABLE} == "true" ]]; then
echo -e "${YELLOW}Dirinfo Wrappers\t${WHITE}>${GREEN} Enabled"
else
echo -e "${YELLOW}Dirinfo Wrappers\t${WHITE}>${RED} Disabled"
fi
if [[ ${DISABLE_POSTINSTALL} ]]; then
echo -e "${YELLOW}Post-Install Tasks:${WHITE}\tDisabled"
else echo -e "${YELLOW}Post-Install Tasks:${WHITE}\tEnabled"
echo -e "${YELLOW}Post-Install Tasks\t${WHITE}>${RED} Disabled"
else echo -e "${YELLOW}Post-Install Tasks\t${WHITE}>${GREEN} Enabled"
fi
if [[ ${BASHFILE} ]]; then
echo -e "${YELLOW}System Bashrc:${WHITE}\t\t${BASHFILE}"
else echo -e "${YELLOW}System Bashrc:${WHITE}\t\tauto detection"
echo -e "${YELLOW}System Bashrc\t\t${WHITE}>${GREEN} ${BASHFILE}"
else echo -e "${YELLOW}System Bashrc\t\t${WHITE}>${RED} Auto-Detect"
fi
echo ""
echo
tput sgr0
}
help_message () {
echo -e "\n${GREEN}BashStyle-NG ${YELLOW}(configure 4.2.3) ${CYAN}help
echo -e "\n${GREEN}BashStyle-NG ${YELLOW}(configure 4.2.4) ${CYAN}help
\n${WHITE}Options:"
echo -e "${ORANGE}--help${WHITE} *|${GREEN} Display this help message\
\n${ORANGE}--mode=<mode>${WHITE} *|${GREEN} user (do checks) or maintainer (skip checks)\
......
#!/bin/bash
#########################################################
# #
# This is BashStyle-NG #
# #
# Licensed under GNU GENERAL PUBLIC LICENSE v3 #
# #
# Copyright 2007 - 2015 Christopher Bratusek #
# #
#########################################################
IN_FILES=( rc/nx-rc data/bashstyle data/bashstyle-ng.pc data/bashstyle.sh )
......
......@@ -128,6 +128,7 @@ Overview of changes in v9.0 "Nice Sprites"
* several improvements in "clock advanced" prompt style
* look for python3 by default, fallback to python
* updated copyright notices 2007 - 2015
* configure 4.2.4: minor code improvements, output message changes
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment