Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: _rpm caches installed rpms



I'm personally a fan of caching (sp?).  Others may not be; should it
be configurable?  In any case, the cache can easily be force-rebuilt.

Index: Completion/Linux/_rpm
===================================================================
RCS file: /usr/local/cvsroot/zsh/Completion/Linux/_rpm,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 _rpm
--- Completion/Linux/_rpm	1999/09/21 12:15:42	1.1.1.1
+++ Completion/Linux/_rpm	1999/09/29 18:35:40
@@ -188,7 +188,10 @@
     ;&
   package)
     _description expl 'RPM package'
-    compadd "$expl[@]" -M 'r:|-=* r:|=*' - $(rpm -qa) && ret=0
+    if (( ! $+installed_rpms )); then
+      installed_rpms=( $(rpm -qa) )
+    fi
+    compadd "$expl[@]" -M 'r:|-=* r:|=*' - $installed_rpms && ret=0
     ;;
   package_file)
     if compset -P ftp://; then



Messages sorted by: Reverse Date, Date, Thread, Author