]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
zsh: remove unit property caching
authorRonan Pigott <ronan@rjp.ie>
Tue, 18 Jul 2023 23:52:18 +0000 (16:52 -0700)
committerRonan Pigott <ronan@rjp.ie>
Wed, 19 Jul 2023 21:27:45 +0000 (14:27 -0700)
The existing caching policy isn't very sensible for this cache. We could
write a different policy, but I don't think there is much value in
caching these values, as in my experience the command used to generate
them is quick.

shell-completion/zsh/_systemctl.in

index 8c004c3bb1b2f1d7d4968d4f872fa055eadaa0f5..85ea6d28f57fe826915357e69d1d15a084ece7ca 100644 (file)
@@ -451,13 +451,9 @@ done
 
 (( $+functions[_systemctl_unit_properties] )) ||
     _systemctl_unit_properties() {
-        if ( [[ ${+_sys_all_properties} -eq 0 ]] || _cache_invalid SYS_ALL_PROPERTIES$_sys_service_mgr ) ||
-               ! _retrieve_cache SYS_ALL_PROPERTIES$_sys_service_mgr;
-        then
-            _sys_all_properties=( ${${(M)${(f)"$({{ROOTLIBEXECDIR}}/systemd --dump-bus-properties)"}}} )
-            _store_cache SYS_ALL_PROPERTIES$_sys_service_mgr _sys_all_properties
-        fi
-        _values -s , "${_sys_all_properties[@]}"
+               local -a _sys_all_properties=( ${(f)"$({{ROOTLIBEXECDIR}}/systemd --no-pager --dump-bus-properties 2>/dev/null)"} )
+        _wanted systemd-unit-properties expl 'unit property' \
+                       _values -s , "${_sys_all_properties[@]}"
     }
 
 (( $+functions[_systemctl_job_modes] )) ||