systemd/0004-bash-completion-use-list-unit-files-to-get-all-units.patch
Stephan Kulow 20ad5f583e Accepting request 242699 from Base:System
- Add patch shut-up-rpmlint-on-var-log-journal.patch to avoid
  rpmlink warning
- Add upstream patches
  0001-bus-proxyd-fix-incorrect-comparison.patch
  0002-shell-completion-prevent-mangling-unit-names.patch
  0003-Always-check-asprintf-return-code.patch
  0004-bash-completion-use-list-unit-files-to-get-all-units.patch
  0005-core-only-set-the-kernel-s-timezone-when-the-RTC-run.patch
  0006-parse_boolean-require-exact-matches.patch
  0007-drop_duplicates-copy-full-BindMount-struct.patch
  0008-shell-completion-prevent-mangling-unit-names-bash.patch
  0009-journald-always-add-syslog-facility-for-messages-com.patch

- Add patch shut-up-rpmlint-on-var-log-journal.patch to avoid
  rpmlink warning
- Add upstream patches
  0001-bus-proxyd-fix-incorrect-comparison.patch
  0002-shell-completion-prevent-mangling-unit-names.patch
  0003-Always-check-asprintf-return-code.patch
  0004-bash-completion-use-list-unit-files-to-get-all-units.patch
  0005-core-only-set-the-kernel-s-timezone-when-the-RTC-run.patch
  0006-parse_boolean-require-exact-matches.patch
  0007-drop_duplicates-copy-full-BindMount-struct.patch
  0008-shell-completion-prevent-mangling-unit-names-bash.patch
  0009-journald-always-add-syslog-facility-for-messages-com.patch

OBS-URL: https://build.opensuse.org/request/show/242699
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd?expand=0&rev=196
2014-07-29 19:21:37 +00:00

40 lines
1.8 KiB
Diff

Based on c6a373a26348544d944b08bf0c5dea4f72f6980b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
Date: Sat, 26 Jul 2014 20:11:58 -0400
Subject: [PATCH] bash-completion: use list-unit-files to get "all" units
I think that it is better to return good results slightly more slowly,
than partial quickly. Also reading from disk seems fast enough. Even
the delay on first try with completely cold cache is acceptable.
This is just for bash, 'cause zsh was already doing this.
https://bugzilla.redhat.com/show_bug.cgi?id=790768
---
shell-completion/bash/systemctl.in | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git shell-completion/bash/systemctl.in shell-completion/bash/systemctl.in
index c5950cc..69ef04b 100644
--- shell-completion/bash/systemctl
+++ shell-completion/bash/systemctl
@@ -51,11 +51,13 @@ __filter_units_by_property () {
done
}
-__get_all_units () { __systemctl $1 list-units --all \
+__get_all_units () { { __systemctl $1 list-unit-files; __systemctl $1 list-units --all; } \
| { while read -r a b; do echo " $a"; done; }; }
__get_active_units () { __systemctl $1 list-units \
| { while read -r a b; do echo " $a"; done; }; }
-__get_startable_units () { __systemctl $1 list-units --all -t service,timer,socket,mount,automount,path,snapshot,swap \
+__get_startable_units () { {
+ __systemctl $1 list-units --all -t service,timer,socket,mount,automount,path,snapshot,swap
+ __systemctl $1 list-unit-files -t service,timer,socket,mount,automount,path,snapshot,swap; } \
| { while read -r a b c d; do [[ $c == "inactive" || $c == "failed" ]] && echo " $a"; done; }; }
__get_failed_units () { __systemctl $1 list-units \
| { while read -r a b c d; do [[ $c == "failed" ]] && echo " $a"; done; }; }
--
1.7.9.2