From 6503face194f1ec3592a0a99c72c4e3ca1049daf Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Mon, 30 Oct 2023 21:43:55 +0100 Subject: [PATCH] package/finit: bump to v4.5 Signed-off-by: Joachim Wiberg --- .../etc/bash_completion.d/initctl-complete.sh | 141 ------------------ package/finit/finit.hash | 2 +- package/finit/finit.mk | 8 +- 3 files changed, 8 insertions(+), 143 deletions(-) delete mode 100644 board/common/rootfs/etc/bash_completion.d/initctl-complete.sh diff --git a/board/common/rootfs/etc/bash_completion.d/initctl-complete.sh b/board/common/rootfs/etc/bash_completion.d/initctl-complete.sh deleted file mode 100644 index f1c538b7..00000000 --- a/board/common/rootfs/etc/bash_completion.d/initctl-complete.sh +++ /dev/null @@ -1,141 +0,0 @@ -_cond() -{ - initctl -pt cond dump | awk '{print $4}' | sed 's/<\(.*\)>/\1/' -} - -_ident() -{ - if [ -n "$1" ]; then - initctl ident | grep -q $1 - else - initctl ident - fi -} - -_svc() -{ - initctl ls -pt | grep $1 | sed "s/.*\/\(.*\)/\1/g" | sort -u -} - -_enabled() -{ - echo "$(_svc enabled)" -} - -_available() -{ - all=$(mktemp) - ena=$(mktemp) - echo "$(_svc available)" >$all - echo "$(_svc enabled)" >$ena - grep -v -f $ena $all - rm $all $ena -} - -# Determine first non-option word. Usually the command -_firstword() { - local firstword i - - firstword= - for ((i = 1; i < ${#COMP_WORDS[@]}; ++i)); do - if [[ ${COMP_WORDS[i]} != -* ]]; then - firstword=${COMP_WORDS[i]} - break - fi - done - - echo $firstword -} - -# Determine last non-option word. Uusally a sub-command -_lastword() { - local lastword i - - lastword= - for ((i = 1; i < ${#COMP_WORDS[@]}; ++i)); do - if [[ ${COMP_WORDS[i]} != -* ]] && [[ -n ${COMP_WORDS[i]} ]] && [[ ${COMP_WORDS[i]} != $cur ]]; then - lastword=${COMP_WORDS[i]} - fi - done - - echo $lastword -} - -_initctl() -{ - local cur command - - cur=${COMP_WORDS[COMP_CWORD]} - prev="${COMP_WORDS[COMP_CWORD-1]}" - firstword=$(_firstword) - lastword=$(_lastword) - - commands="status cond debug help kill ls log version list enable \ - disable touch show cat edit create delete reload start \ - stop restart signal cgroup ps top plugins runlevel reboot \ - halt poweroff suspend utmp" - cond_cmds="set get clear status dump" - cond_types="hook net pid service task usr" - signals="int term hup stop tstp cont usr1 usr2 pwr" - options="-b --batch \ - -c --create \ - -d --debug \ - -f --force \ - -h --help \ - -j --json \ - -n --noerr \ - -1 --once \ - -p --plain \ - -q --quiet \ - -t --no-heading \ - -v --verbose \ - -V --version" - - case "${firstword}" in - enable) - COMPREPLY=($(compgen -W "$(_available)" -- $cur)) - ;; - disable|touch) - COMPREPLY=($(compgen -W "$(_enabled)" -- $cur)) - ;; - show|cat|edit|delete) - COMPREPLY=($(compgen -W "$(_svc .)" -- $cur)) - ;; - start|stop|restart|log|status) - COMPREPLY=($(compgen -W "$(_ident)" -- $cur)) - ;; - signal|kill) - if $(_ident "${prev}"); then - COMPREPLY=($(compgen -W "$signals" -- $cur)) - else - COMPREPLY=($(compgen -W "$(_ident)" -- $cur)) - fi - ;; - cond) - case "${lastword}" in - set|clear) - compopt -o nospace - COMPREPLY=($(compgen -W "usr/" -- $cur)) - ;; - get) - COMPREPLY=($(compgen -W "$(_cond)" -- $cur)) - ;; - dump) - COMPREPLY=($(compgen -W "$cond_types" -- $cur)) - ;; - *) - COMPREPLY=($(compgen -W "$cond_cmds" -- $cur)) - ;; - esac - ;; - *) - COMPREPLY=($(compgen -W "$commands" -- $cur)) - ;; - esac - - if [[ $cur == -* ]]; then - COMPREPLY=($(compgen -W "$options" -- $cur)) - fi -} - -complete -F _initctl initctl diff --git a/package/finit/finit.hash b/package/finit/finit.hash index 0cfbe2cd..4319eb5d 100644 --- a/package/finit/finit.hash +++ b/package/finit/finit.hash @@ -1,5 +1,5 @@ # From https://github.com/troglobit/finit/releases/ -sha256 904af0b0d7b22bcbe7772ea5851a0496445bfb3cff5c9a65935fd74745dcba75 finit-4.5-rc5.tar.gz +sha256 ef73d9ba01aefef1a2171483f26339c7aefdf92dd25d7b322f15efa48e78d655 finit-4.5.tar.gz # Locally calculated sha256 3a2b964c1772d03ab17b73a389ecce9151e0b190a9247817a2c009b16d356422 LICENSE diff --git a/package/finit/finit.mk b/package/finit/finit.mk index 94b5ebaf..99c43886 100644 --- a/package/finit/finit.mk +++ b/package/finit/finit.mk @@ -4,7 +4,7 @@ # ################################################################################ -FINIT_VERSION = 4.5-rc5 +FINIT_VERSION = 4.5 FINIT_SITE = https://github.com/troglobit/finit/releases/download/$(FINIT_VERSION) FINIT_LICENSE = MIT FINIT_LICENSE_FILES = LICENSE @@ -119,6 +119,12 @@ else FINIT_CONF_OPTS += --disable-alsa-utils-plugin endif +ifeq ($(BR2_PACKAGE_BASH_COMPLETION),y) +FINIT_CONF_OPTS += --with-bash-completiond-dir +else +FINIT_CONF_OPTS += --without-bash-completiond-dir +endif + ifeq ($(BR2_PACKAGE_DBUS),y) FINIT_CONF_OPTS += --enable-dbus-plugin else