[Distr-commits] r360 - branches/distr-2.1/pkg/utils pkg/utils
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Fri Nov 28 17:06:29 CET 2008
Author: ruckdeschel
Date: 2008-11-28 17:06:29 +0100 (Fri, 28 Nov 2008)
New Revision: 360
Added:
branches/distr-2.1/pkg/utils/copyToBranch.R
pkg/utils/copyToBranch.R
pkg/utils/updateTo203.R
Log:
some new utils
Added: branches/distr-2.1/pkg/utils/copyToBranch.R
===================================================================
--- branches/distr-2.1/pkg/utils/copyToBranch.R (rev 0)
+++ branches/distr-2.1/pkg/utils/copyToBranch.R 2008-11-28 16:06:29 UTC (rev 360)
@@ -0,0 +1,27 @@
+copyToBranch <- function(FILE, fromDir, toDir, fileInfo=NULL, recursive = FALSE, overwrite=TRUE){
+ oldDir <- getwd()
+ on.exit(setwd(oldDir))
+ ### toCopyList
+ toDo <- NULL
+ if (file.exists(fromDir)){
+ setwd(fromDir)
+ toDo <- dir(recursive=recursive)
+ if(!is.null(FILE))
+ toDo <- toDo[grep(FILE,toDo)]
+ if(!is.null(fileInfo)){
+ fI <- sapply(toDo, file.info)
+ toDo <- fileInfo(fI)
+ }
+ }
+ cat("Files to copy:\n")
+ print(toDo)
+ if(!is.null(toDo)&&!is.null(toDir)) if(length(toDo))
+ return(file.copy(toDo, file.path(toDir,toDo), overwrite= overwrite))
+ else return(NULL)
+}
+
+copyToBranch(FILE="^pkg/[^/]*/inst/NEWS",fromDir="C:/rtest/distr",
+ toDir="C:/rtest/distr/branches/distr-2.1",rec=TRUE)
+
+copyToBranch(FILE="^pkg/utils/c.*",fromDir="C:/rtest/distr",
+ toDir="C:/rtest/distr/branches/distr-2.1",rec=TRUE)
Added: pkg/utils/copyToBranch.R
===================================================================
--- pkg/utils/copyToBranch.R (rev 0)
+++ pkg/utils/copyToBranch.R 2008-11-28 16:06:29 UTC (rev 360)
@@ -0,0 +1,27 @@
+copyToBranch <- function(FILE, fromDir, toDir, fileInfo=NULL, recursive = FALSE, overwrite=TRUE){
+ oldDir <- getwd()
+ on.exit(setwd(oldDir))
+ ### toCopyList
+ toDo <- NULL
+ if (file.exists(fromDir)){
+ setwd(fromDir)
+ toDo <- dir(recursive=recursive)
+ if(!is.null(FILE))
+ toDo <- toDo[grep(FILE,toDo)]
+ if(!is.null(fileInfo)){
+ fI <- sapply(toDo, file.info)
+ toDo <- fileInfo(fI)
+ }
+ }
+ cat("Files to copy:\n")
+ print(toDo)
+ if(!is.null(toDo)&&!is.null(toDir)) if(length(toDo))
+ return(file.copy(toDo, file.path(toDir,toDo), overwrite= overwrite))
+ else return(NULL)
+}
+
+copyToBranch(FILE="^pkg/[^/]*/inst/NEWS",fromDir="C:/rtest/distr",
+ toDir="C:/rtest/distr/branches/distr-2.1",rec=TRUE)
+
+copyToBranch(FILE="^pkg/utils/c.*",fromDir="C:/rtest/distr",
+ toDir="C:/rtest/distr/branches/distr-2.1",rec=TRUE)
Added: pkg/utils/updateTo203.R
===================================================================
--- pkg/utils/updateTo203.R (rev 0)
+++ pkg/utils/updateTo203.R 2008-11-28 16:06:29 UTC (rev 360)
@@ -0,0 +1,63 @@
+dev.dir = "C:/rtest/"
+setNewversion(dev.dir = dev.dir,
+ packs = c("startupmsg",
+ "SweaveListingUtils",
+ "distr",
+ "distrEx",
+ "distrDoc",
+ "distrSim",
+ "distrTEst",
+ "distrTeach",
+ "distrMod",
+ "RobAStBase",
+ "RandVar",
+ "ROptEst",
+ "RobLox",
+ "RobRex",
+ "ROptRegTS"),
+ packs.dir = paste(dev.dir, c(rep("distr/pkg",9),
+ rep("RobASt/pkg",6)), sep=""),
+ packs.ver = c("0.5.3", "0.1.1", rep("2.0.3",7),
+ "0.1.3","0.6.6","0.6.2",
+ "0.6.1", "0.6.1", "0.6.1"),
+ packs.gtR = c("1.8.0", "2.0.0", "2.2.0", "2.6.0", "2.6.0",
+ "2.6.0", "2.6.0", "2.2.0", "2.6.0", "2.7.0",
+ "2.7.0", "2.7.0", "2.7.0", "2.4.0", "2.4.0"),
+ withHTML = FALSE,
+ packs.HTML.dir = c("", "", paste(dev.dir,
+ c(rep("distr/www",7)),sep=""),
+ rep("",6)),
+ rkurs = FALSE,
+ rkursDir = "D:/My Documents/altArbeit/R-Kurs/"
+ )
+setNewversion(dev.dir = dev.dir,
+ packs = c("startupmsg",
+ "SweaveListingUtils",
+ "distr",
+ "distrEx",
+ "distrDoc",
+ "distrSim",
+ "distrTEst",
+ "distrTeach",
+ "distrMod",
+ "RobAStBase",
+ "RandVar",
+ "ROptEst",
+ "RobLox",
+ "RobRex",
+ "ROptRegTS"),
+ packs.dir = paste(dev.dir, c(rep("distr/branches/distr-2.1/pkg",9),
+ rep("RobASt/branches/robast-0.7/pkg",6)), sep=""),
+ packs.ver = c("0.6", "0.2", rep("2.1",7),
+ "0.2",rep("0.7",5)),
+ packs.gtR = c("1.8.0", "2.0.0", "2.2.0", "2.6.0", "2.6.0",
+ "2.6.0", "2.6.0", "2.2.0", "2.6.0", "2.7.0",
+ "2.7.0", "2.7.0", "2.7.0", "2.4.0", "2.4.0"),
+ withHTML = FALSE,
+ packs.HTML.dir = c("", "", paste(dev.dir,
+ c(rep("distr/www",7)),sep=""),
+ rep("",6)),
+ rkurs = FALSE,
+ rkursDir = "D:/My Documents/altArbeit/R-Kurs/"
+ )
+
More information about the Distr-commits
mailing list