zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: _rpm caches installed rpms
@ 1999-09-29 18:59 Adam Spiers
  1999-09-30  9:51 ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Adam Spiers @ 1999-09-29 18:59 UTC (permalink / raw)
  To: zsh workers mailing list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: _rpm caches installed rpms
  1999-09-29 18:59 PATCH: _rpm caches installed rpms Adam Spiers
@ 1999-09-30  9:51 ` Zefram
  1999-09-30 18:32   ` Adam Spiers
  0 siblings, 1 reply; 3+ messages in thread
From: Zefram @ 1999-09-30  9:51 UTC (permalink / raw)
  To: adam; +Cc: zsh-workers

Adam Spiers wrote:
>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.

I think caching is dangerous in this case.  If the rpm command is being
used, then the data you are caching -- the list of installed packages
-- is almost certainly changing.  The list can also be generated (with
rpm -qa) quite quickly.  In both of these aspects, rpm is unlike, for
exxample, man, where caching is useful.

-zefram


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: PATCH: _rpm caches installed rpms
  1999-09-30  9:51 ` Zefram
@ 1999-09-30 18:32   ` Adam Spiers
  0 siblings, 0 replies; 3+ messages in thread
From: Adam Spiers @ 1999-09-30 18:32 UTC (permalink / raw)
  To: zsh-workers

Zefram (zefram@fysh.org) wrote:
> Adam Spiers wrote:
> >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.
> 
> I think caching is dangerous in this case.  If the rpm command is being
> used, then the data you are caching -- the list of installed packages
> -- is almost certainly changing.

Oops, good point.  Peter, probably best to leave that patch out.

> The list can also be generated (with
> rpm -qa) quite quickly.

Not on my machine :-(  664 installed rpms ...

> In both of these aspects, rpm is unlike, for
> exxample, man, where caching is useful.

True.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-09-30 18:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-29 18:59 PATCH: _rpm caches installed rpms Adam Spiers
1999-09-30  9:51 ` Zefram
1999-09-30 18:32   ` Adam Spiers

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).