This commit is contained in:
Jacob Hrbek 2020-07-25 01:46:30 +02:00
parent f13a22b745
commit 020fe7122c
9 changed files with 30 additions and 26 deletions

@ -44,12 +44,14 @@
# Maintainer info # Maintainer info
UPSTREAM="https://github.com/RXT0112/Zernit" UPSTREAM="https://github.com/RXT0112/Zernit"
UPSTREAM_NAME="RiXotStudio"
UPSTREAM_EMAIL="rxt0112@rixotstudio.cz"
MAINTAINER_EMAIL="kreyren@rixotstudio.cz" MAINTAINER_EMAIL="kreyren@rixotstudio.cz"
MAINTAINER_NICKNAME="kreyren" MAINTAINER_NICKNAME="kreyren"
MAINTAINER_NAME="Jacob" MAINTAINER_NAME="Jacob"
MAINTAINER_SURNAME="Hrbek" MAINTAINER_SURNAME="Hrbek"
# FIXME: _=${var:="some text"} is less verbose and less error prone than [ -z "$var" ] && var="some text" # FIXME-SUGGESTION: _=${var:="some text"} is less verbose and less error prone than [ -z "$var" ] && var="some text"
# Command overrides # Command overrides
## These may be required on some systems ## These may be required on some systems
@ -121,6 +123,8 @@ MAINTAINER_SURNAME="Hrbek"
# ebench # ebench
[ -z "$EBENCH_FORMAT_STRING_START" ] && EBENCH_FORMAT_STRING="BENCHMARK: Starting benchmark for action %s\n" [ -z "$EBENCH_FORMAT_STRING_START" ] && EBENCH_FORMAT_STRING="BENCHMARK: Starting benchmark for action %s\n"
[ -z "$EBENCH_FORMAT_STRING_RESULT" ] && EBENCH_FORMAT_STRING="BENCHMARK: Action %s took $SECONDS seconds\n" [ -z "$EBENCH_FORMAT_STRING_RESULT" ] && EBENCH_FORMAT_STRING="BENCHMARK: Action %s took $SECONDS seconds\n"
# invoke_privileged
[ -z "$INVOKE_PRIVILEGED_FORMAT_STRING_QUESTION" ] && INVOKE_PRIVILEGED_FORMAT_STRING_QUESTION="### PRIVILEGED ACCESS REQUEST ###\n\n\s\n"
# Exit on anything unexpected # Exit on anything unexpected
set -e set -e

@ -208,4 +208,4 @@ die() { funcname="die"
unset funcname unset funcname
exit 255 exit 255
esac esac
}; alias die='die "$LINENO"' }; alias die='die "${LINENO:-0}"'

@ -16,7 +16,7 @@ ebench() { funcname="ebench"
case "$SKIP_BENCHMARK" in case "$SKIP_BENCHMARK" in
1) 1)
unset funcname unset funcname
exit 0 ;; return 0 ;;
0|"") edebug 3 "Benchmark was not skipped" ;; 0|"") edebug 3 "Benchmark was not skipped" ;;
*) die 23 "Variable SKIP_BENCHMARK has unexpected value '$SKIP_BENCHMARK', expecting only '1' or blank" *) die 23 "Variable SKIP_BENCHMARK has unexpected value '$SKIP_BENCHMARK', expecting only '1' or blank"
esac esac
@ -28,11 +28,11 @@ ebench() { funcname="ebench"
efixme "Variable 'SECONDS' is not POSIX compatible, implement logic" efixme "Variable 'SECONDS' is not POSIX compatible, implement logic"
SECONDS=0 SECONDS=0
unset funcname unset funcname
exit 0 ;; return 0 ;;
result) result)
printf "$EBENCH_FORMAT_STRING_RESULT" "$2" || die invalid-format printf "$EBENCH_FORMAT_STRING_RESULT" "$2" || die invalid-format
unset funcname unset funcname
exit 0 ;; return 0 ;;
*) die 2 "Invalid argument '$2' has been parsed in $funcname" *) die 2 "Invalid argument '$2' has been parsed in $funcname"
esac esac
}; alias ebench='ebench "$LINENO"' }; alias ebench='ebench "${LINENO:-0}"'

@ -16,16 +16,16 @@ edebug() { funcname="edebug"
"$PRINTF" "$EDEBUG_FORMAT_STRING" "$2" || die invalid-format "$PRINTF" "$EDEBUG_FORMAT_STRING" "$2" || die invalid-format
"$PRINTF" "$EDEBUG_FORMAT_STRING_LOG" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$EDEBUG_FORMAT_STRING_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
elif [ "$DEBUG" = 1 ]; then elif [ "$DEBUG" = 1 ]; then
"$PRINTF" "$EDEBUG_FORMAT_STRING_DEBUG" "$2" || die invalid-format "$PRINTF" "$EDEBUG_FORMAT_STRING_DEBUG" "$2" || die invalid-format
"$PRINTF" "$EDEBUG_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$EDEBUG_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
else else
case "$LANG" in case "$LANG" in
# FIXME-TRANSLATE: Translate to more languages # FIXME-TRANSLATE: Translate to more languages
en-*|*) die 255 "processing variable DEBUG with value '$DEBUG' in $funcname" en-*|*) die 255 "processing variable DEBUG with value '$DEBUG' in $funcname"
esac esac
fi fi
}; alias die='die "$LINENO"' }; alias die='die "${LINENO:-0}"'

@ -15,16 +15,16 @@ eerror() { funcname="eerror"
"$PRINTF" "$EERROR_FORMAT_STRING" "$2" || die invalid-format "$PRINTF" "$EERROR_FORMAT_STRING" "$2" || die invalid-format
"$PRINTF" "$EERROR_FORMAT_STRING_LOG" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$EERROR_FORMAT_STRING_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
elif [ "$DEBUG" = 1 ]; then elif [ "$DEBUG" = 1 ]; then
"$PRINTF" "$EERROR_FORMAT_STRING_DEBUG" "$2" || die invalid-format "$PRINTF" "$EERROR_FORMAT_STRING_DEBUG" "$2" || die invalid-format
"$PRINTF" "$EERROR_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$EERROR_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
else else
case "$LANG" in case "$LANG" in
# FIXME-TRANSLATE: Translate to more languages # FIXME-TRANSLATE: Translate to more languages
en-*|*) die bug "processing variable DEBUG with value '$DEBUG' in $funcname" en-*|*) die bug "processing variable DEBUG with value '$DEBUG' in $funcname"
esac esac
fi fi
}; alias eerror='eerror "$LINENO"' }; alias eerror='eerror "${LINENO:-0}"'

@ -26,18 +26,18 @@ efixme() { funcname="efixme"
if [ "$IGNORE_FIXME" = 1 ]; then if [ "$IGNORE_FIXME" = 1 ]; then
# FIXME: Implement 'fixme' debug channel # FIXME: Implement 'fixme' debug channel
edebug fixme "Fixme message for '$2' disabled" edebug fixme "Fixme message for '$2' disabled"
exit 0 return 0
elif [ "$IGNORE_FIXME" = 0 ] || [ -z "$IGNORE_FIXME" ]; then elif [ "$IGNORE_FIXME" = 0 ] || [ -z "$IGNORE_FIXME" ]; then
if [ "$DEBUG" = 0 ] || [ -z "$DEBUG" ]; then if [ "$DEBUG" = 0 ] || [ -z "$DEBUG" ]; then
"$PRINTF" "$EFIXME_FORMAT_STRING" "$2" || die invalid-format "$PRINTF" "$EFIXME_FORMAT_STRING" "$2" || die invalid-format
"$PRINTF" "$EFIXME_FORMAT_STRING" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$EFIXME_FORMAT_STRING_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
elif [ "$DEBUG" = 1 ]; then elif [ "$DEBUG" = 1 ]; then
"$PRINTF" "$EFIXME_FORMAT_STRING_DEBUG" "$2" || die invalid-format "$PRINTF" "$EFIXME_FORMAT_STRING_DEBUG" "$2" || die invalid-format
"$PRINTF" "$EFIXME_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$EFIXME_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
else else
case "$LANG" in case "$LANG" in
# FIXME-TRANSLATE: Translate to more languages # FIXME-TRANSLATE: Translate to more languages
@ -50,4 +50,4 @@ efixme() { funcname="efixme"
en-*|*) die 255 "processing variable IGNORE_FIXME with value '$IGNORE_FIXME' in $0" en-*|*) die 255 "processing variable IGNORE_FIXME with value '$IGNORE_FIXME' in $0"
esac esac
fi fi
}; alias efixme='efixme "$LINENO"' }; alias efixme='efixme "${LINENO:-0}"'

@ -14,16 +14,16 @@ einfo() { funcname="einfo"
"$PRINTF" "$EINFO_FORMAT_STRING" "$1" || die invalid-format "$PRINTF" "$EINFO_FORMAT_STRING" "$1" || die invalid-format
"$PRINTF" "$EINFO_FORMAT_STRING_LOG" "$1" >> "$logPath" || die invalid-format "$PRINTF" "$EINFO_FORMAT_STRING_LOG" "$1" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
elif [ "$DEBUG" = 1 ]; then elif [ "$DEBUG" = 1 ]; then
"$PRINTF" "$EINFO_FORMAT_STRING_DEBUG" "$1" || die invalid-format "$PRINTF" "$EINFO_FORMAT_STRING_DEBUG" "$1" || die invalid-format
"$PRINTF" "$EINFO_FORMAT_STRING_DEBUG_LOG" "$1" >> "$logPath" || die invalid-format "$PRINTF" "$EINFO_FORMAT_STRING_DEBUG_LOG" "$1" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
else else
case "$LANG" in case "$LANG" in
# FIXME-TRANSLATE: Translate to more languages # FIXME-TRANSLATE: Translate to more languages
en-*|*) die bug "processing variable DEBUG with value '$DEBUG' in $funcname" en-*|*) die bug "processing variable DEBUG with value '$DEBUG' in $funcname"
esac esac
fi fi
}; alias einfo='einfo "$LINENO"' }; alias einfo='einfo "${LINENO:-0}"'

@ -14,11 +14,11 @@ elog() { funcname="elog"
"debug") "debug")
if [ "$DEBUG" = 0 ] || [ -z "$DEBUG" ]; then if [ "$DEBUG" = 0 ] || [ -z "$DEBUG" ]; then
unset funcname unset funcname
exit 0 return 0
elif [ "$DEBUG" = 1 ]; then elif [ "$DEBUG" = 1 ]; then
"$PRINTF" "$ELOG_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$ELOG_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
else else
case "$LANG" in case "$LANG" in
# FIXME-TRANSLATE: Translate to more languages # FIXME-TRANSLATE: Translate to more languages
@ -27,4 +27,4 @@ elog() { funcname="elog"
fi ;; fi ;;
*) die bug "Invalid argument '$2' has been parsed to $funcname" *) die bug "Invalid argument '$2' has been parsed to $funcname"
esac esac
}; alias einfo='einfo "$LINENO"' }; alias einfo='einfo "${LINENO:-0}"'

@ -14,16 +14,16 @@ ewarn() { funcname="ewarn"
"$PRINTF" "$EWARN_FORMAT_STRING" "$2" || die invalid-format "$PRINTF" "$EWARN_FORMAT_STRING" "$2" || die invalid-format
"$PRINTF" "$EWARN_FORMAT_STRING_LOG" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$EWARN_FORMAT_STRING_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
elif [ "$DEBUG" = 1 ]; then elif [ "$DEBUG" = 1 ]; then
"$PRINTF" "$EWARN_FORMAT_STRING_DEBUG" "$2" || die invalid-format "$PRINTF" "$EWARN_FORMAT_STRING_DEBUG" "$2" || die invalid-format
"$PRINTF" "$EWARN_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format "$PRINTF" "$EWARN_FORMAT_STRING_DEBUG_LOG" "$2" >> "$logPath" || die invalid-format
unset funcname unset funcname
exit 0 return 0
else else
case "$LANG" in case "$LANG" in
# FIXME-TRANSLATE: Translate to more languages # FIXME-TRANSLATE: Translate to more languages
en-*|*) die bug "processing variable DEBUG with value '$DEBUG' in $funcname" en-*|*) die bug "processing variable DEBUG with value '$DEBUG' in $funcname"
esac esac
fi fi
}; alias ewarn='ewarn "$LINENO"' }; alias ewarn='ewarn "${LINENO:-0}"'