[rkward-cvs] SF.net SVN: rkward:[2827] trunk/rkward/rkward/rbackend/rpackages/rkward/R/ public.R

kapatp at users.sourceforge.net kapatp at users.sourceforge.net
Wed Apr 21 09:03:19 UTC 2010


Revision: 2827
          http://rkward.svn.sourceforge.net/rkward/?rev=2827&view=rev
Author:   kapatp
Date:     2010-04-21 09:03:19 +0000 (Wed, 21 Apr 2010)

Log Message:
-----------
More informative CRAN mirror menu

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

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R	2010-04-21 08:11:28 UTC (rev 2826)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/public.R	2010-04-21 09:03:19 UTC (rev 2827)
@@ -422,7 +422,16 @@
 	old_repos <- getOption("repos")
 	on.exit (options (repos=old_repos))
 
-	chooseCRANmirror()
+	if (!interactive())
+		stop("cannot choose a CRAN mirror non-interactively")
+	m <- getCRANmirrors(all = FALSE, local.only = FALSE)
+	res <- menu (paste(m[, 1L], m[, 5L], sep = " - "), getOption("menu.graphics"), "CRAN mirror")
+	if (res > 0L) {
+		URL <- m[res, "URL"]
+		repos <- getOption("repos")
+		repos["CRAN"] <- gsub("/$", "", URL[1L])
+		options(repos = repos)
+	}
 
 	return (as.character (getOption ("repos")["CRAN"]))
 }


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