[Lme4-commits] r1703 - pkg/lme4/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Apr 8 22:36:32 CEST 2012


Author: mmaechler
Date: 2012-04-08 22:36:32 +0200 (Sun, 08 Apr 2012)
New Revision: 1703

Modified:
   pkg/lme4/man/Dyestuff.Rd
Log:
more failsafe  pkgI() utility  [needed for new CRAN anti-behavior]


Modified: pkg/lme4/man/Dyestuff.Rd
===================================================================
--- pkg/lme4/man/Dyestuff.Rd	2012-04-07 21:38:07 UTC (rev 1702)
+++ pkg/lme4/man/Dyestuff.Rd	2012-04-08 20:36:32 UTC (rev 1703)
@@ -66,10 +66,15 @@
  sessionInfo()
  searchpaths()
  pkgI <- function(pkgname) {
-   pd <- packageDescription(pkgname)
-   cat(sprintf("\%s -- built: \%s\\n\%*s -- dir  : \%s\\n",
-               pkgname, pd$Built, nchar(pkgname), "",
-               dirname(dirname(attr(pd, "file")))))
+   pd <- tryCatch(packageDescription(pkgname),
+                  error=function(e)e, warning=function(w)w)
+   if(inherits(pd, "error") || inherits(pd, "warning"))
+     cat(sprintf("packageDescription(\\"\%s\\") \%s: \%s\\n",
+                 pkgname, class(pd)[2], pd$message))
+   else
+     cat(sprintf("\%s -- built: \%s\\n\%*s -- dir  : \%s\\n",
+                 pkgname, pd$Built, nchar(pkgname), "",
+                 dirname(dirname(attr(pd, "file")))))
  }
  pkgI("Matrix")
  pkgI("Rcpp")



More information about the Lme4-commits mailing list