[rkward-cvs] SF.net SVN: rkward:[3715] trunk/rkward/rkward/rbackend/rpackages/rkward/R/ internal.R

m-eik at users.sourceforge.net m-eik at users.sourceforge.net
Tue Aug 9 13:43:36 UTC 2011


Revision: 3715
          http://rkward.svn.sourceforge.net/rkward/?rev=3715&view=rev
Author:   m-eik
Date:     2011-08-09 13:43:35 +0000 (Tue, 09 Aug 2011)

Log Message:
-----------
changed .rk.get.installed.packages to scan for pluginmaps in packages

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R	2011-08-09 07:56:07 UTC (rev 3714)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal.R	2011-08-09 13:43:35 UTC (rev 3715)
@@ -78,10 +78,15 @@
 # package information formats may - according to the help - be subject to change. Hence this function to cope with "missing" values
 # also it concatenates everything to a single vector, so we can easily get the whole structure with a single call
 ".rk.get.installed.packages" <- function () {
-	x <- as.data.frame (installed.packages ())
-	try (titles <- as.data.frame (library ()$results)$Title)
-	if (length (titles) != dim (x)[1]) titles <- rep ("", dim (x)[1])
-	return (list (as.character (x$Package), as.character (titles), as.character (x$Version), as.character (x$LibPath)))
+	x <- as.data.frame(installed.packages(fields="Title"))
+	# does a package enhance RKWard, i.e. provide plugins?
+	enhance.rk <- grepl("rkward", x$Enhances)
+	# enhance.rk is just a logical vector. indenpendent of that, check if a main .pluginmap file is provided
+	checkForPluginmaps <- file.path(x$LibPath, x$Package, "rkward", paste(x$Package, ".pluginmap", sep=""))
+	pluginmaps <- ifelse(file_test("-f", checkForPluginmaps), checkForPluginmaps, "")
+	return(list(Package=as.character(x$Package), Title=as.character(x$Title), 
+		Version=as.character(x$Version), LibPath=as.character(x$LibPath),
+		EnhanceRK=as.logical(enhance.rk), Plugins=as.character(pluginmaps)))
 }
 
 ".rk.available.packages.cache" <- NULL


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list