[systemd-commits] 8 commits - hwdb/70-pointingstick.hwdb Makefile.am shell-completion/zsh

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Mon May 18 02:32:04 PDT 2015


 Makefile.am                        |    1 
 hwdb/70-pointingstick.hwdb         |    2 +
 shell-completion/zsh/_systemctl.in |   74 +++++++++++++++++--------------------
 3 files changed, 38 insertions(+), 39 deletions(-)

New commits:
commit 06ee4910e4746f18de63d573ab392bc60918e1f0
Author: Mantas MikulÄ—nas <grawity at gmail.com>
Date:   Mon May 18 11:18:10 2015 +0300

    buildsys: actually install 70-pointingstick.hwdb

diff --git a/Makefile.am b/Makefile.am
index 4639b2f..5bcbfff 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -3913,6 +3913,7 @@ dist_udevhwdb_DATA = \
 	hwdb/60-evdev.hwdb \
 	hwdb/60-keyboard.hwdb \
 	hwdb/70-mouse.hwdb \
+	hwdb/70-pointingstick.hwdb \
 	hwdb/70-touchpad.hwdb
 
 EXTRA_DIST += \

commit e6e3d81e215ec9a7696fd87a9b34fc3e508af9ef
Author: Hans de Goede <hdegoede at redhat.com>
Date:   Mon May 18 09:54:00 2015 +0200

    hwdb: Add trackpoint sensitivity setting for Thinkpad X230 tablet
    
    This model needs the trackpoint sensitivity to be boosted to not be too slow
    to be usable, see: https://bugzilla.redhat.com/show_bug.cgi?id=1200717

diff --git a/hwdb/70-pointingstick.hwdb b/hwdb/70-pointingstick.hwdb
index 72c1a3b..a8c21a2 100644
--- a/hwdb/70-pointingstick.hwdb
+++ b/hwdb/70-pointingstick.hwdb
@@ -87,6 +87,8 @@ evdev:name:*DualPoint Stick:dmi:bvn*:bvr*:bd*:svnDellInc.:pnLatitudeE6400*:pvr*
 # Lenovo
 #########################################
 
+# Lenovo Thinkpad X230 tablet
+evdev:name:TPPS/2 IBM TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX230Tablet:*
 # Lenovo Thinkpad X240
 evdev:name:TPPS/2 IBM TrackPoint:dmi:bvn*:bvr*:bd*:svnLENOVO:pn*:pvrThinkPadX240:*
 # Lenovo Thinkpad T440s

commit bf8864c2c07f3bdab4ab4287bf2b5d3b5ce21f5c
Author: Eric Cook <llua at gmx.com>
Date:   Mon May 18 01:02:43 2015 -0400

    zsh-completion: make the arrays _sys_active_units, _sys_startable_units and _sys_restartable_units local to the completer.

diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index 0d409c6..1dc6406 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -208,7 +208,7 @@ done
 # Completion functions for STARTABLE_UNITS
 (( $+functions[_systemctl_start] )) || _systemctl_start()
 {
-   _systemctl_startable_units
+   local _sys_startable_units; _systemctl_startable_units
    compadd "$@" - ${_sys_startable_units[*]} $(_systemctl_get_template_names)
 }
 
@@ -216,7 +216,7 @@ done
 for fun in stop kill try-restart condrestart ; do
   (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
   {
-    _systemctl_active_units
+    local _sys_active_units; _systemctl_active_units
     compadd "$@" - $( _filter_units_by_property CanStop yes \
       ${_sys_active_units[*]} )
   }
@@ -234,7 +234,7 @@ done
 for fun in reload reload-or-try-restart force-reload ; do
   (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
   {
-    _systemctl_active_units
+    local _sys_active_units; _systemctl_active_units
     compadd "$@" - $( _filter_units_by_property CanReload yes \
       ${_sys_active_units[*]} )
   }
@@ -244,7 +244,7 @@ done
 for fun in restart reload-or-restart ; do
   (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()
   {
-    _systemctl_restartable_units
+    local _sys_restartable_units; _systemctl_restartable_units
     compadd "$@" - ${_sys_restartable_units[*]} $(_systemctl_get_template_names)
   }
 done

commit 2103d29d89f32546f95b9ec019be0ea06714c8c2
Author: Eric Cook <llua at gmx.com>
Date:   Mon May 18 03:19:59 2015 -0400

    zsh-completion: removing more pointless forks
    
    I seem to have forgot about _systemctl_active_units().

diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index a032ea2..0d409c6 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -105,7 +105,7 @@ _systemctl_all_units()
   if ( [[ ${+_sys_all_units} -eq 0 ]] || _cache_invalid SYS_ALL_UNITS ) &&
     ! _retrieve_cache SYS_ALL_UNITS;
   then
-    _sys_all_units=( $(__systemctl list-units --all | { while read -r a b; do echo -E - " $a"; done; }) )
+    _sys_all_units=( ${${(f)"$(__systemctl list-units --all)"}%% *} )
     _store_cache SYS_ALL_UNITS _sys_all_units
   fi
 }
@@ -118,7 +118,7 @@ _systemctl_really_all_units()
   if ( [[ ${+_sys_really_all_units} -eq 0 ]] || _cache_invalid SYS_REALLY_ALL_UNITS ) &&
     ! _retrieve_cache SYS_REALLY_ALL_UNITS;
   then
-    all_unit_files=( $(__systemctl list-unit-files | { while read -r a b; do echo -E - " $a"; done; }) )
+    all_unit_files=( ${${(f)"$(__systemctl list-unit-files)"}%% *} )
     _systemctl_all_units
     really_all_units=($_sys_all_units $all_unit_files)
     _sys_really_all_units=(${(u)really_all_units})
@@ -146,7 +146,7 @@ _filter_units_by_property() {
 _systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files)"}##*@.[^[:space:]]##}%%@.*}\@ }
 
 
-_systemctl_active_units()  {_sys_active_units=(  $(__systemctl list-units          | { while read -r a b; do echo -E - " $a"; done; }) )}
+_systemctl_active_units()  {_sys_active_units=(  ${${(f)"$(__systemctl list-units)"}%% *} )}
 
 _systemctl_startable_units(){
     _sys_startable_units=( $( _filter_units_by_property ActiveState inactive $(
@@ -259,22 +259,22 @@ done
 # Completion functions for JOBS
 (( $+functions[_systemctl_cancel] )) || _systemctl_cancel()
 {
-  compadd "$@" - $(__systemctl list-jobs \
-    | cut -d' ' -f1  2>/dev/null ) || _message "no jobs found"
+  compadd "$@" - ${${(f)"$(__systemctl list-jobs)"}%% *} ||
+    _message "no jobs found"
 }
 
 # Completion functions for SNAPSHOTS
 (( $+functions[_systemctl_delete] )) || _systemctl_delete()
 {
-  compadd "$@" - $(__systemctl list-units --type snapshot --all \
-    | cut -d' ' -f1  2>/dev/null ) || _message "no snapshots found"
+  compadd "$@" - ${${(f)"$(__systemctl list-units --type snapshot --all)"}%% *} ||
+    _message "no snapshots found"
 }
 
 # Completion functions for TARGETS
 (( $+functions[_systemctl_set-default] )) || _systemctl_set-default()
 {
-  compadd "$@" - $(__systemctl list-unit-files --type target --all \
-    | cut -d' ' -f1  2>/dev/null ) || _message "no targets found"
+  compadd "$@" - ${${(f)"$(__systemctl list-unit-files --type target --all)"}%% *} ||
+    _message "no targets found"
 }
 
 # Completion functions for ENVS
@@ -287,8 +287,7 @@ for fun in set-environment unset-environment ; do
       suf='-S='
     fi
 
-    compadd "$@" ${suf} - $(systemctl show-environment \
-      | while read line; do echo " ${line%%\=}";done )
+    compadd "$@" ${suf} - ${${(f)"$(systemctl show-environment)"}%%=*}
   }
 done
 
@@ -315,7 +314,7 @@ _systemctl_caching_policy()
   oldcache=( "$1"(mh+1) )
   (( $#oldcache )) && return 0
 
-  _sysunits=($(__systemctl --all | cut -d' ' -f1))
+  _sysunits=(${${(f)"$(__systemctl --all)"}%% *})
 
   if (( $#_sysunits )); then
     for unit in $_sysunits; do
@@ -342,10 +341,9 @@ _unit_properties() {
   if ( [[ ${+_sys_all_properties} -eq 0 ]] || _cache_invalid SYS_ALL_PROPERTIES ) &&
     ! _retrieve_cache SYS_ALL_PROPERTIES;
   then
-    _sys_all_properties=( $( {__systemctl show --all;
-       @rootlibexecdir@/systemd --dump-configuration-items; } | {
-       while IFS='=' read -r a b; do [ -n "$b" ] && echo "$a"; done
-    }) )
+    _sys_all_properties=( ${${(M)${(f)"$(__systemctl show --all;
+    @rootlibexecdir@/systemd --dump-configuration-items)"}##[[:alnum:]]##=*}%%=*}
+    )
     _store_cache SYS_ALL_PROPRTIES _sys_all_properties
   fi
   _values -s , "${_sys_all_properties[@]}"

commit 463985a9f489c54b89ee7ce6ffd67501035420b4
Author: Eric Cook <llua at gmx.com>
Date:   Mon May 18 01:02:41 2015 -0400

    zsh-completion: less forking in _systemctl_failed_units() and make the array `_sys_failed_units' local to the completer.

diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index 304fec4..a032ea2 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -165,7 +165,7 @@ _systemctl_restartable_units(){
                                { while read -r a b; do echo -E - " $a"; done; } )) )
 }
 
-_systemctl_failed_units()  {_sys_failed_units=(  $(__systemctl list-units --failed | { while read -r a b; do echo -E - " $a"; done; }) )}
+_systemctl_failed_units()  {_sys_failed_units=( ${${(f)"$(__systemctl list-units --failed)"}%% *} ) }
 _systemctl_unit_state() { typeset -gA _sys_unit_state; _sys_unit_state=( $(__systemctl list-unit-files) ) }
 
 local fun
@@ -201,7 +201,7 @@ done
 # Completion functions for FAILED_UNITS
 (( $+functions[_systemctl_reset-failed] )) || _systemctl_reset-failed()
 {
-  _systemctl_failed_units
+  local _sys_failed_units; _systemctl_failed_units
   compadd "$@" -a - _sys_failed_units || _message "no failed unit found"
 }
 

commit e4e868f3aeedccfe04c6b6c3be026c7f8873370a
Author: Eric Cook <llua at gmx.com>
Date:   Mon May 18 01:02:40 2015 -0400

    zsh-completion: less forking in _systemctl_get_template_names()

diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index fc9fc2e..304fec4 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -143,7 +143,7 @@ _filter_units_by_property() {
   done
 }
 
-_systemctl_get_template_names() { __systemctl list-unit-files | { while read -r a b; do  [[ $a =~ @\. ]] && echo -E - " ${a%%@.*}@"; done; } }
+_systemctl_get_template_names() { echo -E - ${^${(M)${(f)"$(__systemctl list-unit-files)"}##*@.[^[:space:]]##}%%@.*}\@ }
 
 
 _systemctl_active_units()  {_sys_active_units=(  $(__systemctl list-units          | { while read -r a b; do echo -E - " $a"; done; }) )}

commit fb869ca1d20e503708ae813c3d3ebcf5a5173c25
Author: Eric Cook <llua at gmx.com>
Date:   Mon May 18 01:02:39 2015 -0400

    zsh-completion: actually complete template names for subcommands enable, reenable and disable.
    
    compadd's -a option treats non-option arguments as arrays. So
    $(_systemctl_get_template_names) expands to some words that aren't
    legal array names. Even if there were, they would be empty; thus adding
    nothing.
    
    deduplicated a few functions too.

diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index 678e81e..fc9fc2e 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -166,9 +166,7 @@ _systemctl_restartable_units(){
 }
 
 _systemctl_failed_units()  {_sys_failed_units=(  $(__systemctl list-units --failed | { while read -r a b; do echo -E - " $a"; done; }) )}
-_systemctl_enabled_units() {_sys_enabled_units=( $(__systemctl list-unit-files     | { while read -r a b; do [[ $b == "enabled" ]] && echo -E - " $a"; done; }) )}
-_systemctl_disabled_units(){_sys_disabled_units=($(__systemctl list-unit-files     | { while read -r a b; do [[ $b == "disabled" ]] && echo -E - " $a"; done; }) )}
-_systemctl_masked_units()  {_sys_masked_units=(  $(__systemctl list-unit-files     | { while read -r a b; do [[ $b == "masked" ]] && echo -E - " $a"; done; }) )}
+_systemctl_unit_state() { typeset -gA _sys_unit_state; _sys_unit_state=( $(__systemctl list-unit-files) ) }
 
 local fun
 # Completion functions for ALL_UNITS
@@ -183,22 +181,21 @@ done
 # Completion functions for ENABLED_UNITS
 (( $+functions[_systemctl_disable] )) || _systemctl_disable()
 {
-    _systemctl_enabled_units
-    compadd "$@" -a - _sys_enabled_units
+    local _sys_unit_state; _systemctl_unit_state
+    compadd "$@" - ${(k)_sys_unit_state[(R)enabled]}
 }
 
 (( $+functions[_systemctl_reenable] )) || _systemctl_reenable()
 {
-    _systemctl_enabled_units
-    _systemctl_disabled_units
-    compadd "$@" -a - _sys_enabled_units _sys_disabled_units $(_systemctl_get_template_names)
+    local _sys_unit_state; _systemctl_unit_state
+    compadd "$@" - ${(k)_sys_unit_state[(R)(enabled|disabled)]} $(_systemctl_get_template_names)
 }
 
 # Completion functions for DISABLED_UNITS
 (( $+functions[_systemctl_enable] )) || _systemctl_enable()
 {
-  _systemctl_disabled_units
-  compadd "$@" -a - _sys_disabled_units $(_systemctl_get_template_names)
+  local _sys_unit_state; _systemctl_unit_state
+  compadd "$@" - ${(k)_sys_unit_state[(R)disabled]} $(_systemctl_get_template_names)
 }
 
 # Completion functions for FAILED_UNITS
@@ -255,8 +252,8 @@ done
 # Completion functions for MASKED_UNITS
 (( $+functions[_systemctl_unmask] )) || _systemctl_unmask()
 {
-  _systemctl_masked_units
-  compadd "$@" -a - _sys_masked_units || _message "no masked units found"
+  local _sys_unit_state; _systemctl_unit_state
+  compadd "$@" - ${(k)_sys_unit_state[(R)masked]} || _message "no masked units found"
 }
 
 # Completion functions for JOBS

commit 67afa93148ca51eb1d37717ad3c3cac980be1c7a
Author: Eric Cook <llua at gmx.com>
Date:   Mon May 18 01:02:38 2015 -0400

    zsh-completion: actually run _filter_units_by_property when creating the arrays _sys_(re|)startable_units

diff --git a/shell-completion/zsh/_systemctl.in b/shell-completion/zsh/_systemctl.in
index e123d31..678e81e 100644
--- a/shell-completion/zsh/_systemctl.in
+++ b/shell-completion/zsh/_systemctl.in
@@ -149,20 +149,20 @@ _systemctl_get_template_names() { __systemctl list-unit-files | { while read -r
 _systemctl_active_units()  {_sys_active_units=(  $(__systemctl list-units          | { while read -r a b; do echo -E - " $a"; done; }) )}
 
 _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 $(
                           __systemctl $mode list-unit-files --state enabled,disabled,static | \
                                { while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; }
                           __systemctl $mode list-units --state inactive,failed | \
-                               { while read -r a b; do echo -E - " $a"; done; } )))
+                               { while read -r a b; do echo -E - " $a"; done; } )) ) )
 }
 
 _systemctl_restartable_units(){
-    _sys_restartable_units=(_filter_units_by_property CanStart yes $(
+    _sys_restartable_units=( $(_filter_units_by_property CanStart yes $(
                           __systemctl $mode list-unit-files --state enabled,disabled,static | \
                                { while read -r a b; do [[ $a =~ @\. ]] || echo -E - " $a"; done; }
                           __systemctl $mode list-units | \
-                               { while read -r a b; do echo -E - " $a"; done; } ))
+                               { while read -r a b; do echo -E - " $a"; done; } )) )
 }
 
 _systemctl_failed_units()  {_sys_failed_units=(  $(__systemctl list-units --failed | { while read -r a b; do echo -E - " $a"; done; }) )}
@@ -170,6 +170,7 @@ _systemctl_enabled_units() {_sys_enabled_units=( $(__systemctl list-unit-files
 _systemctl_disabled_units(){_sys_disabled_units=($(__systemctl list-unit-files     | { while read -r a b; do [[ $b == "disabled" ]] && echo -E - " $a"; done; }) )}
 _systemctl_masked_units()  {_sys_masked_units=(  $(__systemctl list-unit-files     | { while read -r a b; do [[ $b == "masked" ]] && echo -E - " $a"; done; }) )}
 
+local fun
 # Completion functions for ALL_UNITS
 for fun in is-active is-failed is-enabled status show cat mask preset help list-dependencies edit ; do
   (( $+functions[_systemctl_$fun] )) || _systemctl_$fun()



More information about the systemd-commits mailing list