[Distr-commits] r1219 - branches/distr-2.8/pkg/utils pkg/utils
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Jul 25 13:40:19 CEST 2018
Author: ruckdeschel
Date: 2018-07-25 13:40:19 +0200 (Wed, 25 Jul 2018)
New Revision: 1219
Modified:
branches/distr-2.8/pkg/utils/DESCRIPTIONutils.R
branches/distr-2.8/pkg/utils/DESCRIPTIONutilsExamples.R
pkg/utils/DESCRIPTIONutils.R
pkg/utils/DESCRIPTIONutilsExamples.R
pkg/utils/getRevNr.R
Log:
utils: enhanced DESCRIPTIONutils so that it can be loaded more easily
Modified: branches/distr-2.8/pkg/utils/DESCRIPTIONutils.R
===================================================================
--- branches/distr-2.8/pkg/utils/DESCRIPTIONutils.R 2018-07-25 11:32:49 UTC (rev 1218)
+++ branches/distr-2.8/pkg/utils/DESCRIPTIONutils.R 2018-07-25 11:40:19 UTC (rev 1219)
@@ -1,3 +1,24 @@
+if(FALSE) {
+ ## use this to source this file / have finde() and ersetze() available
+
+ ## change svncheckout suitably...
+ svncheckout <- file.path("C:/rtest/distr")
+ trunk <- FALSE
+ ## if the version from devel
+ branches <- dir(file.path(svncheckout,"branches"))
+ branches <- grep("distr-",branches,value=TRUE)
+ branches <- branches[!grepl("\\.[[:alpha:]]+",branches)]
+ thisbranch <- max(branches)
+ thisdir <- file.path(svncheckout,"branches", thisbranch)
+ print(thisdir)
+ ## or in trunk
+ if(trunk) thisdir <- ""
+ print(file.path(thisdir,"pkg/utils/DESCRIPTIONutils.R"))
+ source(file.path(thisdir,"pkg/utils/DESCRIPTIONutils.R"))
+ source(file.path(thisdir,"pkg/utils/getRevNr.R"))
+}
+#
+
### some utils for unified treatment of DESCRIPTION files from R
updatePackageHelp <- function(package){
@@ -148,7 +169,7 @@
file.copy(from=FN2, to =FN, over=TRUE)
})
}
-copyDescription(startDir = "C:/rtest/distr")
+if(FALSE) copyDescription(startDir = "C:/rtest/distr")
rmDescription2 <- function(startDir){
oldDir <- getwd()
@@ -165,4 +186,4 @@
})
}
-rmDescription2(startDir = "C:/rtest/distr")
+if(FALSE) rmDescription2(startDir = "C:/rtest/distr")
Modified: branches/distr-2.8/pkg/utils/DESCRIPTIONutilsExamples.R
===================================================================
--- branches/distr-2.8/pkg/utils/DESCRIPTIONutilsExamples.R 2018-07-25 11:32:49 UTC (rev 1218)
+++ branches/distr-2.8/pkg/utils/DESCRIPTIONutilsExamples.R 2018-07-25 11:40:19 UTC (rev 1219)
@@ -72,6 +72,13 @@
rownames(Values) <- Names
changeDescription(startDir = "C:/rtest/robast/",names=Names,pkgs=Pkgs, values=Values)
+
+Pkgs <- c("RandVar", "ROptEstOld", "RobAStBase", "RobAStRDA", "RobLox", "RobRex", "RobLoxBioC", "ROptEst", "RobExtremes", "ROptRegTS")
+Names <- c("Version")
+Values <- matrix(c("1.2.0"),1,length(Pkgs))
+colnames(Values) <- Pkgs
+rownames(Values) <- Names
+changeDescription(startDir = "C:/rtest/robast/branches/robast-1.2",names=Names,pkgs=Pkgs, values=Values)
}
if(FALSE){### Version 2.5
Modified: pkg/utils/DESCRIPTIONutils.R
===================================================================
--- pkg/utils/DESCRIPTIONutils.R 2018-07-25 11:32:49 UTC (rev 1218)
+++ pkg/utils/DESCRIPTIONutils.R 2018-07-25 11:40:19 UTC (rev 1219)
@@ -1,3 +1,24 @@
+if(FALSE) {
+ ## use this to source this file / have finde() and ersetze() available
+
+ ## change svncheckout suitably...
+ svncheckout <- file.path("C:/rtest/distr")
+ trunk <- FALSE
+ ## if the version from devel
+ branches <- dir(file.path(svncheckout,"branches"))
+ branches <- grep("distr-",branches,value=TRUE)
+ branches <- branches[!grepl("\\.[[:alpha:]]+",branches)]
+ thisbranch <- max(branches)
+ thisdir <- file.path(svncheckout,"branches", thisbranch)
+ print(thisdir)
+ ## or in trunk
+ if(trunk) thisdir <- ""
+ print(file.path(thisdir,"pkg/utils/DESCRIPTIONutils.R"))
+ source(file.path(thisdir,"pkg/utils/DESCRIPTIONutils.R"))
+ source(file.path(thisdir,"pkg/utils/getRevNr.R"))
+}
+#
+
### some utils for unified treatment of DESCRIPTION files from R
updatePackageHelp <- function(package){
@@ -14,7 +35,7 @@
df0 <- gsub(liS, reS,dfile)
return(df0)}
PFc <- PF
- s <- sapply(c("Package","Version","Date","Depends","License","SVNRevision"),
+ s <- sapply(c("Package","Version","Date","Depends","License","VCS/SVNRevision"),
function(x){ PFca <- replaceField(field=x,dfile=PFc)
PFc <<- PFca
return(NA)})
@@ -32,7 +53,7 @@
,values ### values of the DESCRIPTION tags to be updated
## (a matrix, columns = pkgs and row = tags see examples)
,pkgs = NULL ## pkgs to be updated; if NULL all pkgs in startfolder
- ,withSVNread = TRUE ### should SVNRevision be updated
+ ,withSVNread = TRUE ### should VCS/SVNRevision be updated
,withPackageHelpUpdate = TRUE ### should file <pkg>-package.Rd in man
## be updated
,pathRepo = NULL ### path to svn repo; if NULL deduced from startDir
@@ -57,14 +78,14 @@
PathToBash, PathToreadsvnlog.sh)
print(svnrev)
- if("SVNRevision" %in% names){
- values[which(names=="SVNRevision"),] <- c(svnrev[[1]])
+ if("VCS/SVNRevision" %in% names){
+ values[which(names=="VCS/SVNRevision"),] <- c(svnrev[[1]])
}else{
nr <- nrow(values)
- names <- c(names,"SVNRevision")
+ names <- c(names,"VCS/SVNRevision")
vlsvn <- rep(c(svnrev[[1]]),ncol(values))
values <- base::rbind(values,vlsvn)
- rownames(values)[nr+1] <- "SVNRevision"
+ rownames(values)[nr+1] <- "VCS/SVNRevision"
}
}
if(withDate){
@@ -148,7 +169,7 @@
file.copy(from=FN2, to =FN, over=TRUE)
})
}
-copyDescription(startDir = "C:/rtest/distr")
+if(FALSE) copyDescription(startDir = "C:/rtest/distr")
rmDescription2 <- function(startDir){
oldDir <- getwd()
@@ -165,4 +186,4 @@
})
}
-rmDescription2(startDir = "C:/rtest/distr")
+if(FALSE) rmDescription2(startDir = "C:/rtest/distr")
Modified: pkg/utils/DESCRIPTIONutilsExamples.R
===================================================================
--- pkg/utils/DESCRIPTIONutilsExamples.R 2018-07-25 11:32:49 UTC (rev 1218)
+++ pkg/utils/DESCRIPTIONutilsExamples.R 2018-07-25 11:40:19 UTC (rev 1219)
@@ -72,6 +72,13 @@
rownames(Values) <- Names
changeDescription(startDir = "C:/rtest/robast/",names=Names,pkgs=Pkgs, values=Values)
+
+Pkgs <- c("RandVar", "ROptEstOld", "RobAStBase", "RobAStRDA", "RobLox", "RobRex", "RobLoxBioC", "ROptEst", "RobExtremes", "ROptRegTS")
+Names <- c("Version")
+Values <- matrix(c("1.2.0"),1,length(Pkgs))
+colnames(Values) <- Pkgs
+rownames(Values) <- Names
+changeDescription(startDir = "C:/rtest/robast/branches/robast-1.2",names=Names,pkgs=Pkgs, values=Values)
}
if(FALSE){### Version 2.5
Modified: pkg/utils/getRevNr.R
===================================================================
--- pkg/utils/getRevNr.R 2018-07-25 11:32:49 UTC (rev 1218)
+++ pkg/utils/getRevNr.R 2018-07-25 11:40:19 UTC (rev 1219)
@@ -3,7 +3,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)
- PathToBash = "C:/cygwin/bin/bash", ## path to bash
+ PathToBash = "C:/cygwin64/bin/bash", ## path to bash
PathToUtils="C:/rtest/distr/branches/distr-2.4/pkg/utils",
### path to shell script readsvnlog.sh
tmpfile = "C:/rtest/tmp-svnlog5.txt", ### some tmpfile to which we write the
@@ -16,7 +16,6 @@
toRev <- "HEAD"
if(inRforge)
pathRepo <- paste("svn://svn.r-forge.r-project.org/svnroot/",pathRepo,sep="")
- print(pathRepo)
inQuotes <- function(x) paste("\"",x,"\"", sep="")
comd <- paste(inQuotes(PathToBash), ifelse(withlogin,"--login",""),
inQuotes(paste(PathToUtils, "readsvnlog.sh", sep="/")),
More information about the Distr-commits
mailing list