[Distr-commits] r1324 - pkg/utils www

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 12 10:22:38 CET 2019


Author: ruckdeschel
Date: 2019-03-12 10:22:38 +0100 (Tue, 12 Mar 2019)
New Revision: 1324

Modified:
   pkg/utils/DESCRIPTIONutils.R
   pkg/utils/DESCRIPTIONutilsExamples.R
   pkg/utils/README-R-utils
   www/distrTeach.html
Log:
[utils] new utility to update HTML pages for the packages  

Modified: pkg/utils/DESCRIPTIONutils.R
===================================================================
--- pkg/utils/DESCRIPTIONutils.R	2019-03-12 08:19:37 UTC (rev 1323)
+++ pkg/utils/DESCRIPTIONutils.R	2019-03-12 09:22:38 UTC (rev 1324)
@@ -46,7 +46,7 @@
 
 
 replaceReqRversion <- function(text,version){
-     if(!is.na(version)) gsub("^R[ ]+\\([^\\)]+\\)",version,text)
+     if(!is.na(version)) gsub("^R[ ]*\\([^\\)]+\\)",version,text)
   }
 
 ## needs: getRevNr() in getRevNr.R in  utils/ e.g.
@@ -156,6 +156,37 @@
 
 ### Examples see DESCRIPTIONutilsExamples.R in same folder
 
+updateHTMLpages <- function(startDir = "C:/rtest/distr",
+                            pkgNames = c("distr", "distrEx","distrSim",
+							             "distrTEst", "distrEllipse",
+										 "distr-Familie", "distrTeach",
+										 "distrMod", "distrDoc", "RandVar"),
+                             pkgVersions = c(rep("2.8.0",9),"1.2.0")
+							 ){
+   if(is.null(names(pkgVersions))) names(pkgVersions) <- pkgNames
+   for(pkg in pkgNames){
+       File <- file.path(startDir, "www", paste(pkg,".html",sep=""))
+       xx <- suppressWarnings(readLines(con = File))
+	   if(length(xx)){
+	      xx <- gsub("Release Date: .+<br>", paste("Release Date:",
+		            format(Sys.time(), format="%Y-%m-%d"), "<br>"),xx)
+          xx <- gsub("> Version: .+<br>", paste("> Version:",
+		            pkgVersions[pkg], "<br>"),xx)
+          xx <- gsub("last updated on .+<br>", paste("last updated on ",
+		            format(Sys.time(), format="%Y-%m-%d"), ". <br>",
+					sep=""),xx)
+          writeLines(xx, con = File)
+       }
+    }
+    return(invisible())
+}
+
+if(FALSE){
+   updateHTMLpages()
+}
+
+
+
 getVersions <- function(startDir = "C:/rtest/robast/branches/robast-0.7",
                         pkgs){
 return(sapply(pkgs,function(x){

Modified: pkg/utils/DESCRIPTIONutilsExamples.R
===================================================================
--- pkg/utils/DESCRIPTIONutilsExamples.R	2019-03-12 08:19:37 UTC (rev 1323)
+++ pkg/utils/DESCRIPTIONutilsExamples.R	2019-03-12 09:22:38 UTC (rev 1324)
@@ -142,6 +142,7 @@
 Values["Version",1] <- "0.9.6"
 changeDescription(startDir = "C:/rtest/distr",names=Names,
                   pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
+updateHTMLpages(pkgVersions = c(rep("2.8.0",9),"1.2.0"))
 }
 
 if(FALSE){## Version 2.8 in branch
@@ -176,9 +177,9 @@
 Pkgs <- c("RandVar", "ROptEstOld", "RobAStBase", "RobAStRDA", "RobLox", "RobRex", "RobLoxBioC", "ROptEst", "RobExtremes", "ROptRegTS")
 Names <- c("Version")
 Values <- matrix(c("1.2.0"),1,length(Pkgs))
-ReqRVersion0 <- <- rep("R(>= 3.4)",length(Pkgs))
-colnames(Values) <- Pkgs
-rownames(Values) <- names(ReqRVersion0) <- Names
+ReqRVersion0 <- rep("R(>= 3.4)",length(Pkgs))
+colnames(Values) <- names(ReqRVersion0)<- Pkgs
+rownames(Values)  <- Names
 
 changeDescription(startDir = "C:/rtest/robast/",names=Names,pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
 }
@@ -187,9 +188,9 @@
 Pkgs <- c("RandVar", "ROptEstOld", "RobAStBase", "RobAStRDA", "RobLox", "RobRex", "RobLoxBioC", "ROptEst", "RobExtremes", "ROptRegTS")
 Names <- c("Version")
 Values <- matrix(c("1.2.0"),1,length(Pkgs))
-ReqRVersion0 <- <- rep("R(>= 3.4)",length(Pkgs))
-colnames(Values) <- Pkgs
-rownames(Values) <- names(ReqRVersion0) <- Names
+ReqRVersion0 <- rep("R(>= 3.4)",length(Pkgs))
+colnames(Values) <- names(ReqRVersion0)<- Pkgs
+rownames(Values)  <- Names
 changeDescription(startDir = "C:/rtest/robast/branches/robast-1.2",names=Names,pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
 }
 
@@ -197,8 +198,8 @@
 Pkgs <- c("RandVar", "ROptEstOld", "RobAStBase", "RobAStRDA", "RobLox", "RobRex", "RobLoxBioC", "ROptEst", "RobExtremes", "ROptRegTS")
 Names <- c("Version")
 Values <- matrix(c("1.3.0"),1,length(Pkgs))
-ReqRVersion0 <- <- rep("R(>= 3.4)",length(Pkgs))
-colnames(Values) <- Pkgs
-rownames(Values) <- names(ReqRVersion0) <- Names
+ReqRVersion0 <- rep("R(>= 3.4)",length(Pkgs))
+colnames(Values) <- names(ReqRVersion0)<- Pkgs
+rownames(Values)  <- Names
 changeDescription(startDir = "C:/rtest/robast/branches/robast-1.3",names=Names,pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
 }

Modified: pkg/utils/README-R-utils
===================================================================
--- pkg/utils/README-R-utils	2019-03-12 08:19:37 UTC (rev 1323)
+++ pkg/utils/README-R-utils	2019-03-12 09:22:38 UTC (rev 1324)
@@ -90,6 +90,19 @@
 ## for examples see DESCRIPTIONutilsExamples.R 
 
 
+## updateHTMLpages(startDir = "C:/rtest/distr",
+##                 pkgNames = c("distr", "distrEx", "distrSim", "distrTEst", 
+## 							    "distrEllipse", "distr-Familie", "distrTeach",
+## 							    "distrMod", "distrDoc", "RandVar"),
+##                 pkgVersions = c(rep("2.8.0",9),"1.2.0")
+## 				   )
+## args: startDir: folder with checkout to distr svn repo,
+##                  e.g. "C:/rtest/distr/"
+## pkgNames: character -- names of HTML files to be updated (without extension ".html")
+## pkgVersions: charchter vector of length(pkgNames); if unnamed in same order;
+##              otherwise names have to coincide with pkgNames
+## updates HTML pages (i.e., updates date information and version information)
+
 ### compare.R :
 #
 # compares (recursively over all slots / list elements)

Modified: www/distrTeach.html
===================================================================
--- www/distrTeach.html	2019-03-12 08:19:37 UTC (rev 1323)
+++ www/distrTeach.html	2019-03-12 09:22:38 UTC (rev 1324)
@@ -42,6 +42,7 @@
 <ul>
 
 
+  <li>>=3.4 for version 2.8.0</li>
   <li>>=2.14 for version 2.5.0</li>
   <li>>=2.2.0 for version 2.1,</li>
 



More information about the Distr-commits mailing list