1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-08 21:17:47 +03:00

Slightly improve performance of startable/restartable unit completion (#7839)

This commit is contained in:
dana 2018-01-28 06:29:58 -06:00 committed by Zbigniew Jędrzejewski-Szmek
parent 508058c9c5
commit 992f51ea42

View File

@ -140,20 +140,19 @@ _systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-uni
_systemctl_active_units() {_sys_active_units=( ${${(f)"$(__systemctl list-units "*$PREFIX*$SUFFIX*" )"}%% *} )} _systemctl_active_units() {_sys_active_units=( ${${(f)"$(__systemctl list-units "*$PREFIX*$SUFFIX*" )"}%% *} )}
_systemctl_startable_units(){ _systemctl_startable_units(){
_sys_startable_units=( $( _filter_units_by_property ActiveState inactive $( _sys_startable_units=( $( _filter_units_by_property ActiveState inactive $(
_filter_units_by_property CanStart yes $( _filter_units_by_property CanStart yes ${${${(f)"$(
__systemctl $mode list-unit-files --state enabled,disabled,static "*$PREFIX*$SUFFIX*" | \ __systemctl $mode list-unit-files --state enabled,disabled,static "*$PREFIX*$SUFFIX*"
{ while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; } __systemctl $mode list-units --state inactive,failed "*$PREFIX*$SUFFIX*"
__systemctl $mode list-units --state inactive,failed "*$PREFIX*$SUFFIX*" | \ )"}:#*@.*}%%[[:space:]]*}
{ while read -r a b; do echo -E - " $a"; done; } )) ) ) )) )
} }
_systemctl_restartable_units(){ _systemctl_restartable_units(){
_sys_restartable_units=( $(_filter_units_by_property CanStart yes $( _sys_restartable_units=( $( _filter_units_by_property CanStart yes ${${${(f)"$(
__systemctl $mode list-unit-files --state enabled,disabled,static "*$PREFIX*$SUFFIX*" | \ __systemctl $mode list-unit-files --state enabled,disabled,static "*$PREFIX*$SUFFIX*"
{ while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; } __systemctl $mode list-units "*$PREFIX*$SUFFIX*"
__systemctl $mode list-units "*$PREFIX*$SUFFIX*" | \ )"}:#*@.*}%%[[:space:]]*} ) )
{ while read -r a b; do echo -E - " $a"; done; } )) )
} }
_systemctl_failed_units() {_sys_failed_units=( ${${(f)"$(__systemctl list-units --state=failed "*$PREFIX*$SUFFIX*" )"}%% *} ) } _systemctl_failed_units() {_sys_failed_units=( ${${(f)"$(__systemctl list-units --state=failed "*$PREFIX*$SUFFIX*" )"}%% *} ) }