[Distr-commits] r1320 - pkg/utils

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Mar 12 08:39:24 CET 2019


Author: ruckdeschel
Date: 2019-03-12 08:39:23 +0100 (Tue, 12 Mar 2019)
New Revision: 1320

Modified:
   pkg/utils/DESCRIPTIONutils.R
   pkg/utils/DESCRIPTIONutilsExamples.R
Log:
[DESCRIPTIONutils] changeDescription now can also change required R versions

Modified: pkg/utils/DESCRIPTIONutils.R
===================================================================
--- pkg/utils/DESCRIPTIONutils.R	2019-03-12 07:35:55 UTC (rev 1319)
+++ pkg/utils/DESCRIPTIONutils.R	2019-03-12 07:39:23 UTC (rev 1320)
@@ -44,6 +44,11 @@
   }}
 }
 
+
+replaceReqRversion <- function(text,version){
+     if(!is.na(version)) gsub("^R\\([^\\)]+\\)",version,text)
+  }
+
 ## needs: getRevNr() in getRevNr.R in  utils/ e.g.
 ## source("C:/rtest/distr/branches/distr-2.7/pkg/utils/getRevNr.R")
 
@@ -62,6 +67,7 @@
     inRforge = TRUE,    ### shall we use r-forge as repository
                         ## (otherwise need full URL as arg pathRepo
     withlogin = TRUE,   ### do we need option --login (yes in cygwin, don't know in Linux)
+    ReqRVersion = NA, ## do we change required R-versions?
     PathToBash = "C:/cygwin64/bin/bash",  ## path to bash
     PathToreadsvnlog.sh="C:/rtest/distr/branches/distr-2.4/pkg/utils",
                     ### path to shell script readsvnlog.sh
@@ -134,7 +140,11 @@
           print(xx[,names])
          }
          xx[,names] <- values[names,x]
+         if(!is.na(ReqRVersion[x])){
+            xx[,"Depends"] <- replaceReqRversion(xx[,"Depends"],ReqRVersion[x])
+         }
          print(xx[,names])
+
          write.dcf(xx, file=FN,width=1.2*getOption("width"))
          if(withPackageHelpUpdate)
             updatePackageHelp(package=file.path("pkg",x))
@@ -142,6 +152,8 @@
     }
     return(invisible())
   }
+
+
 ### Examples see DESCRIPTIONutilsExamples.R in same folder
 
 getVersions <- function(startDir = "C:/rtest/robast/branches/robast-0.7",

Modified: pkg/utils/DESCRIPTIONutilsExamples.R
===================================================================
--- pkg/utils/DESCRIPTIONutilsExamples.R	2019-03-12 07:35:55 UTC (rev 1319)
+++ pkg/utils/DESCRIPTIONutilsExamples.R	2019-03-12 07:39:23 UTC (rev 1320)
@@ -134,42 +134,71 @@
 Pkgs <- c("startupmsg",
           "distr", "distrEx", "distrDoc", "distrEllipse", "distrRmetrics",
           "distrMod", "distrTeach", "distrSim", "distrTEst")
-Names <- c("Version", "License")
-Values <- matrix(c("2.8.0","LGPL-3"),2,length(Pkgs))
-colnames(Values) <- Pkgs
+Names <- c("Version")
+Values <- matrix(c("2.8.0"),1,length(Pkgs))
+ReqRVersion0 <- c(NA,rep("R(>= 3.4)",length(Pkgs)-1))
+colnames(Values) <- names(ReqRVersion0) <- Pkgs
 rownames(Values) <- Names
 Values["Version",1] <- "0.9.6"
 changeDescription(startDir = "C:/rtest/distr",names=Names,
-                  pkgs=Pkgs, values=Values)
+                  pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
 }
 
+if(FALSE){## Version 2.8 in branch
+Pkgs <- c("startupmsg",
+          "distr", "distrEx", "distrDoc", "distrEllipse", "distrRmetrics",
+          "distrMod", "distrTeach", "distrSim", "distrTEst")
+Names <- c("Version")
+Values <- matrix(c("2.8.0"),1,length(Pkgs))
+ReqRVersion0 <- c(NA,rep("R(>= 3.4)",length(Pkgs)-1))
+colnames(Values) <- Pkgs
+rownames(Values) <- names(ReqRVersion0) <- Names
+Values["Version",1] <- "0.9.6"
+changeDescription(startDir = "C:/rtest/distr/branches/distr-2.8",names=Names,
+                  pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
+}
+
 if(FALSE){## Version 2.9 in branch
 Pkgs <- c("startupmsg",
           "distr", "distrEx", "distrDoc", "distrEllipse", "distrRmetrics",
           "distrMod", "distrTeach", "distrSim", "distrTEst")
-Names <- c("Version", "License")
-Values <- matrix(c("2.9.0","LGPL-3"),2,length(Pkgs))
+Names <- c("Version")
+Values <- matrix(c("2.9.0"),1,length(Pkgs))
+ReqRVersion0 <- c(NA,rep("R(>= 3.4)",length(Pkgs)-1))
 colnames(Values) <- Pkgs
-rownames(Values) <- Names
+rownames(Values) <- names(ReqRVersion0) <- Names
 Values["Version",1] <- "0.9.7"
 changeDescription(startDir = "C:/rtest/distr/branches/distr-2.9",names=Names,
-                  pkgs=Pkgs, values=Values)
+                  pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
 }
 
 if(FALSE){## Version 1.2 in trunk
 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
-changeDescription(startDir = "C:/rtest/robast/",names=Names,pkgs=Pkgs, values=Values)
+rownames(Values) <- names(ReqRVersion0) <- Names
+
+changeDescription(startDir = "C:/rtest/robast/",names=Names,pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
 }
 
+if(FALSE){## Version 1.2 in branch
+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
+changeDescription(startDir = "C:/rtest/robast/branches/robast-1.2",names=Names,pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
+}
+
 if(FALSE){## Version 1.3 in branch
 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
-changeDescription(startDir = "C:/rtest/robast/branches/robast-1.3",names=Names,pkgs=Pkgs, values=Values)
+rownames(Values) <- names(ReqRVersion0) <- Names
+changeDescription(startDir = "C:/rtest/robast/branches/robast-1.3",names=Names,pkgs=Pkgs, values=Values,ReqRVersion =ReqRVersion0)
 }



More information about the Distr-commits mailing list