[rkward-devel] a new approach to external plugins
Thomas Friedrichsmeier
thomas.friedrichsmeier at ruhr-uni-bochum.de
Tue Aug 9 17:36:52 UTC 2011
Hi,
On Tuesday 09 August 2011, meik michalke wrote:
> i just committed a small change to .rk.get.installed.packages() in svn. it
> adds two new elements to the list, one is a logical vector (whether
> "Enhances" in DESCRIPTION lists "rkward"), and the last one lists the
> found pluginmaps with full path.
nice! Note that this caused a (harmless) assert failure in
rkloadlibsdialog.cpp (i.e. the package management dialog), since that expects
.rk.get.installed.packages() to return four fields, only. Fixed.
> both entries are independent of the
> other, that is, the function does scan for a pluginmap even if there's no
> "Enhances: rkward" defined.
Why not limit the search to those packages with Enhances: rkward?
> the whole scanning doesn't slow down the function notably.
In fact the scanning is faster than I had expected, though. But still, it
seems to make up ~10% of the time spend in .rk.get.installed.packages(), and
so perhaps that can be enhanced a bit.
(Timing is a bit difficult, since the metric of interest is time spent with cold
disk cache. When the disk cache is hot, .rk.get.installed.packages() is pretty
fast, anyway).
While at it, I'd also suggest splitting the check for pluginmaps into an
entirely separate function, since this would also have to be called for newly
installed / updated packages. At startup, internally, we would call
.rk.find.package.pluginmaps (x$LibPath[x$EnhanceRK], x$Package[x$EnhanceRK])
to get a list of installed pluginmaps. One further potential advantage is that
in this approach, packages could provide more than just one .pluginmap.
> i did two other small changes to it: i named the returned list elements (as
> seen above, which shouldn't hurt) and replaced
>
> library()$Title
>
> and its checks with
>
> installed.packages(fields="Title")
>
> which should give the same results in one go.
Much better solution, indeed!
Regards
Thomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/rkward-devel/attachments/20110809/cba0a2ef/attachment.sig>
More information about the Rkward-devel
mailing list