[Distr-commits] r822 - branches/distr-2.4/pkg/utils

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Jun 9 04:49:22 CEST 2012


Author: ruckdeschel
Date: 2012-06-09 04:49:22 +0200 (Sat, 09 Jun 2012)
New Revision: 822

Added:
   branches/distr-2.4/pkg/utils/R.bat
   branches/distr-2.4/pkg/utils/RBuild.bat
   branches/distr-2.4/pkg/utils/RCheck.bat
   branches/distr-2.4/pkg/utils/RInstall.bat
   branches/distr-2.4/pkg/utils/RRversions.bat
   branches/distr-2.4/pkg/utils/RZip.bat
   branches/distr-2.4/pkg/utils/Rversions.bat
   branches/distr-2.4/pkg/utils/pmake
   branches/distr-2.4/pkg/utils/ppmake.bat
   branches/distr-2.4/pkg/utils/ppmakeDoc.bat
Modified:
   branches/distr-2.4/pkg/utils/README-batchfiles
   branches/distr-2.4/pkg/utils/finde.r
   branches/distr-2.4/pkg/utils/pmake.bat
   branches/distr-2.4/pkg/utils/pmakeDoc.bat
Log:
[utils]
+ finde: new examples
+ pmake, pmakeDoc (with ppmake, ppmakeDoc for elevation) 
    revised to work with 32/64bit
+ new shorties : RCheck, RBuild, RZip, RInstall 
        to provide shorthands for calls to R CMD xxx with many --..options
+ Rbat, RVersions (with RRversions for elevation) 
  enhanced versions from  Gabor Grothendieck's batchfiles.
+ README-batchfiles also updated.

Added: branches/distr-2.4/pkg/utils/R.bat
===================================================================
--- branches/distr-2.4/pkg/utils/R.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/R.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,242 @@
+
+ at echo off
+rem if /i "%1"==path (path %2) && goto:eof
+
+setlocal
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: Placing this file in your path will allow rcmd to be run anywhere
+:: without changing your path environment variable.  See comments
+:: below on how it finds where R is.  Your path can be listed by
+:: the Windows console command:  path
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+rem at one tine this script had only been tested on XP
+rem recent tests have only been on Vista
+rem ver | findstr XP >NUL
+rem if errorlevel 1 echo Warning: This script has only been tested on Windows XP.
+
+set scriptdir_=%~dp0
+set lookin=.;%userprofile%;%scriptdir_%
+if not defined R_BATCHFILES_RC (
+	for %%f in ("rbatchfilesrc.bat") do set "R_BATCHFILES_RC=%%~$lookin:f"
+)
+if defined R_BATCHFILES_RC (
+	if exist "%R_BATCHFILES_RC%" call %R_BATCHFILES_RC%
+)
+
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: use environment variable R_HOME if defined
+:: else current folder if bin\rcmd.exe exists 
+:: else most current R as determined by registry entry
+:: else error
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+if not defined R_HOME if exist bin\r.exe set R_HOME=%CD%
+if not defined R_HOME for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\R-core\R /v InstallPath 2^>NUL ^| findstr InstallPath'
+  ) do set R_HOME=%%~b
+if not defined R_HOME for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\wow6432Node\r-core\r /v InstallPath 2^>NUL ^| findstr InstallPath'
+  ) do set R_HOME=%%~b
+if not defined R_HOME echo "Error: R not found" & goto:eof
+
+call :process_arch %*
+
+:: add R_MIKTEX to PATH if defined.  Otherwise if its not 
+:: in the PATH already then check \Program Files\miktex* or \miktex* 
+:: and if found add that to PATH.
+
+:: if miktex found in PATH skip searching for it
+PATH | findstr /i miktex > nul
+if not errorlevel 1 goto:end_miktex
+
+:: check for presence of %ProgramFiles%\miktex* or \miktex*
+
+if not defined R_MIKTEX for /f "delims=" %%a in (
+    'dir /b /on "%ProgramFiles%"\miktex* 2^>NUL'
+) do set R_MIKTEX=%ProgramFiles%\%%a
+
+if not defined R_MIKTEX for /f "delims=" %%a in (
+    'dir /b /on %SystemDrive%:\miktex* 2^>NUL'
+) do set R_MIKTEX=%SystemDrive%:\miktex\%%a
+
+:end_miktex
+if defined R_MIKTEX PATH %R_MIKTEX%\miktex\bin;%PATH%
+
+if not defined MYSQL_HOME for /f "delims=" %%a in (
+    'dir /b /on "%ProgramFiles%"\MySQL\* 2^>NUL'
+) do set MYSQL_HOME=%ProgramFiles%\MySQL\%%a
+
+if not defined R_TOOLS for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\R-core\Rtools /v InstallPath 2^>NUL ^| findstr InstallPath'
+ ) do set R_TOOLS=%%~b
+if not defined R_TOOLS for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\wow6432Node\Rtools /v InstallPath 2^>NUL ^| findstr InstallPath'
+  ) do set R_TOOLS=%%~b
+
+set PATHQ=%PATH%
+:WHILE
+    if "%PATHQ%"=="" goto WEND
+    for /F "delims=;" %%i in ("%PATHQ%") do if exist "%%~sfi" set PATH2=%PATH2%;%%~sfi
+    for /F "delims=; tokens=1,*" %%i in ("%PATHQ%") do set PATHQ=%%j
+    goto WHILE 
+:WEND
+
+set path2=%path2:~1%
+
+if defined R_TOOLS (
+    set path2=%R_TOOLS%\bin;%R_TOOLS%\perl\bin;%R_TOOLS%\MinGW\bin;%PATH2%
+)
+
+path %path2%
+
+set here=%CD%
+set args=%*
+
+:: get name by which this command was called
+:: this allows same file to be used for Rgui, Rterm, etc. by just renaming it
+for %%i in (%0) do set cmd=%%~ni.exe
+
+if /i %cmd%==rtools.exe (endlocal & set path=%path2%) && goto:eof
+
+cd %R_HOME%\bin
+if /i not %cmd%==rguistart.exe goto:notRguiStart
+  set cmd=rgui.exe
+  set firstArgument=%1
+  if defined firstArgument (
+    dir %1 | findstr "<DIR>" > nul
+    if errorlevel 1 goto:notRguiStart
+    set here=%~1
+    set firstArgument=
+  )
+  set args=
+  shift
+  :startloop
+  set firstArgument=%1
+  if defined firstArgument (
+     set args=%args% "%~1" 
+     shift
+     goto:startloop
+  )
+:notRguiStart
+
+set st=
+if /i %cmd%==rgui.exe set st=start
+
+if /i not %cmd%==#Rscript.exe goto:not#Rscript
+set cmd=Rscript.exe
+if [%1]==[] goto:help#Rscript
+call :rsarg1 %*
+goto:not#Rscript
+:rsarg1
+set args=%*
+set arg1=%~1
+set arg1=%arg1:.bat.bat=.bat%
+set last4=%arg1:~-4%
+if /i not "%last4%"==".bat" set arg1=%arg1%.bat
+for %%a in ("%R_HOME%\bin\Rscript.exe") do set RSCRIPT=%%~sfa
+call set args=%%args:%1="%arg1%"%%
+rem call set args=%%args:%1=%%
+goto:eof
+:not#Rscript
+
+cd %here%
+
+:: Look in architecture specific subdirectory of bin. If not there look in bin.
+set cmdpath=%R_HOME%\bin\%R_ARCH0%\%cmd%
+if exist "%cmdpath%" goto:cmdpathfound
+set cmdpath=%R_HOME%\bin\%cmd%
+if exist "%cmdpath%" goto:cmdpathfound
+echo "Error: %cmd% not found" & goto:eof
+:cmdpathfound
+
+:: if called as jgr.bat locate the JGR package to find jgr.exe
+if /i not %cmd%==jgr.exe goto:notJGR
+  set st=start
+  set cmdpath=jgr.exe
+  if not defined JGR_LIBS set JGR_LIBS=%R_LIBS%
+  for %%a in ("%R_HOME%\bin\Rscript.exe") do set RSCRIPT=%%~sfa
+  if not defined JGR_LIBS for /f "usebackq delims=" %%a in (
+		`%RSCRIPT% -e "cat(.libPaths(),sep=';')"`
+  ) do set JGR_LIBS=%%~a
+  if not defined JGR_LIBS (
+	echo "Error: JGR package not found in R library" & goto:eof
+  )
+  for %%f in ("JGR") do set "jgrpkg=%%~$JGR_LIBS:f"
+  set JGR_LIB=%jgrpkg:~0,-4%
+  for %%a in ("%JGR_LIB%") do set JGR_LIB_SHORT=%%~sfa
+  for %%a in ("%R_HOME%") do set R_HOME_SHORT=%%~sfa
+  set args=--libpath=%JGR_LIB_SHORT% --rhome=%R_HOME_SHORT%
+
+:notJGR
+
+rem set R_ARCH
+rem set R_ARCH0
+rem set cmdpath
+rem if defined st set st
+rem set args
+
+set cygwin=nodosfilewarning
+if not defined args goto:noargs
+if defined st (start "" "%cmdpath%" %args%) else "%cmdpath%" %args%
+goto:eof
+:noargs
+if defined st (start "" "%cmdpath%") else "%cmdpath%"
+goto:eof
+
+:help#Rscript
+echo Usage: #Rscript %%0 %%*
+echo If the above is the first line in a file 
+echo containing only R code and the file is 
+echo given a .bat extension then it can be 
+echo run as a batch file.
+goto:eof
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: processing of --arch= where value can be 32, 64, i386, x64, /i386, /x64
+
+:: Call it like this: call :process_arch %*
+:: On return R_ARCH will be set from --arch or R_ARCH or default
+:: and R_ARCH0 will be R_ARCH without the / prefix
+:: It will look for the architecture in these places in this order:
+:: - first arg if its --arch
+:: - environment variable R_ARCH
+:: - check if R_HOME\bin\i386 exists
+:: - if R_HOME\bin\x64 exists
+:: - if none of the above then use R_ARCH=/i386
+:: Note that R_HOME should be defined before calling this routine
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+:process_arch
+	if defined R_ARCH goto:process_arch_defined
+	:: The loop searches for --arch and sets R_ARCH to the next argument
+    :process_arch_loop 
+    set arg=%~1
+    shift 
+    if not defined arg goto :process_arch_cont 
+	if "%arg%"=="--arch" ( 
+		set R_ARCH=%1
+        set	process_arg_arch=%1
+	)
+	if defined R_ARCH goto:process_arch_cont
+	goto:process_arch_loop	
+    :process_arch_cont
+	if defined process_arg_arch goto:process_arch_defined
+	if exist %R_HOME%\bin\i386 (set R_ARCH=/i386) & goto:process_arch_defined
+	if exist %R_HOME%\bin\x64 (set R_ARCH=/x64) & goto:process_arch_defined
+	(set R_ARCH=/i386)
+	:process_arch_defined
+	if "%R_ARCH%"=="32" (set R_ARCH=/i386)
+	if "%R_ARCH%"=="386" (set R_ARCH=/i386)
+	if "%R_ARCH%"=="i386" (set R_ARCH=/i386)
+	if "%R_ARCH%"=="64" (set R_ARCH=/x64)
+	if "%R_ARCH%"=="x64" (set R_ARCH=/x64)
+	:: if R_ARCH does not begin with a slash add one as a prefix
+	(set first_char=%R_ARCH:~0,1%)
+	if not "%first_char%" == "/" (set R_ARCH=/%R_ARCH%)
+	:: R_ARCH0 is like R_ARCH but without the beginning /
+	(set R_ARCH0=%R_ARCH:~1%)
+	goto:eof
+
+endlocal

Added: branches/distr-2.4/pkg/utils/RBuild.bat
===================================================================
--- branches/distr-2.4/pkg/utils/RBuild.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/RBuild.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,3 @@
+ at echo off
+call R CMD build --compact-vignettes --resave-data %1
+echo on
\ No newline at end of file

Added: branches/distr-2.4/pkg/utils/RCheck.bat
===================================================================
--- branches/distr-2.4/pkg/utils/RCheck.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/RCheck.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,7 @@
+ at echo off
+if not "%2"=="" (
+call R CMD check --multiarch --outdir=%2 --timings --install-args="--byte-compile --with-keep.source --compact-docs --resave-data --install-tests --example --html --latex --clean --preclean --compile-both" %1
+) else (
+call R CMD check --multiarch --timings --install-args="--byte-compile --with-keep.source --compact-docs --resave-data --install-tests --example --html --latex --clean --preclean --compile-both" %1
+)
+echo on

Modified: branches/distr-2.4/pkg/utils/README-batchfiles
===================================================================
--- branches/distr-2.4/pkg/utils/README-batchfiles	2012-06-07 23:36:25 UTC (rev 821)
+++ branches/distr-2.4/pkg/utils/README-batchfiles	2012-06-09 02:49:22 UTC (rev 822)
@@ -4,9 +4,15 @@
 
 to be done beforehand: 
    install   batch-utils   by Gabor Grothendiek (see CRAN)
+you also need el.js to elevate the priviledges on Win 7 / Vista.
 
 provided Utilities: (all to be called in devel dir)
 
+
+## revised batch utils:
+## R.bat and Rversions.bat (to cover 32 and 64bit simultaneously)
+## and RRversions.bat (with elevation, otherwise as Rversions.bat)
+
 ################################################
 #   pmake.bat
 ################################################
@@ -26,7 +32,9 @@
 #                        (else just against R-ver2 if given or R-ver if given or preset R-version)
 #
 #   all args are positional, i.e. they only apply if all preceding args are given
+## with elevation: ppmake.bat (Syntax as above)
 
+
 ################################################
 #   pmakeDoc.bat
 ################################################
@@ -34,10 +42,11 @@
 # pmakeDoc makes package distrDoc ...
 #
 #  SYNTAX: pmakeDoc [R-ver] [Rver2] [+]
-#   * performs R CMD check, R CMD build, R CMD build --binary --no-vignette, R CMD INSTALL to distrDoc,
+#   * performs R CMD check, R CMD build, R CMD INSTALL --build, R CMD INSTALL to distrDoc,
 #
 #   args: as pmake 
 #   
+## with elevation: ppmakeDoc.bat (Syntax as above)
 
 ################################################
 #   rebuild.bat
@@ -50,3 +59,8 @@
 #
 #   args: as pmake 
 
+# I also provide shortcuts for R CMD xxx commands with default options
+# R CMD check           -> RCheck  [with 2 remaining args, 1 ^= package 1(optional)^= outdir]
+# R CMD build           -> RBuild
+# R CMD INSTALL --build -> RZip
+# R CMD INSTALL         -> RInstall

Added: branches/distr-2.4/pkg/utils/RInstall.bat
===================================================================
--- branches/distr-2.4/pkg/utils/RInstall.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/RInstall.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,3 @@
+ at echo off
+call R CMD INSTALL --byte-compile --with-keep.source --compact-docs --resave-data --install-tests --example --html --latex --clean --preclean --compile-both %1
+echo on
\ No newline at end of file

Added: branches/distr-2.4/pkg/utils/RRversions.bat
===================================================================
--- branches/distr-2.4/pkg/utils/RRversions.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/RRversions.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,7 @@
+ at echo off
+echo.
+if not "%1"=="" (
+   el cmd /c Rversions %1 %2
+) else (
+   Rversions  
+)

Added: branches/distr-2.4/pkg/utils/RZip.bat
===================================================================
--- branches/distr-2.4/pkg/utils/RZip.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/RZip.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,3 @@
+ at echo off
+call R CMD INSTALL --build --byte-compile --with-keep.source --compact-docs --resave-data --install-tests --example --html --latex --clean --preclean --compile-both %1
+echo on
\ No newline at end of file

Added: branches/distr-2.4/pkg/utils/Rversions.bat
===================================================================
--- branches/distr-2.4/pkg/utils/Rversions.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/Rversions.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,116 @@
+
+ at echo off
+
+:: Without args this lists the R_HOME directory for each version of R
+:: on the system.  If one of those directories is given as an argument
+:: then that version is set to the current version
+:: Note: Use Rfind.bat and look on R_HOME line to find current version of R.
+
+setlocal
+rem ver | findstr XP >NUL
+rem if errorlevel 1 echo Warning: This script has only been tested on Windows XP.
+
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: use environment variable R_HOME if defined
+:: else current folder if bin\rcmd.exe exists 
+:: else most current R as determined by registry entry
+:: else error
+:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+echo %R_HOME%
+if not defined R_HOME if exist bin\rcmd.exe set R_HOME=%CD%
+if not defined R_HOME for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\r-core\r /v InstallPath 2^>NUL ^| findstr InstallPath'
+  ) do set R_HOME=%%~b 
+   
+if not defined R_HOME for /f "tokens=2*" %%a in (
+ 'reg query hklm\software\wow6432Node\r-core\r /v InstallPath 2^>NUL ^| findstr InstallPath'
+  ) do set R_HOME=%%~b
+if not defined R_HOME echo "Error: R not found" & goto:eof
+
+:: look for architecture in these places in this order:
+:: - environment variable R_ARCH
+:: - first arg if its --arch
+:: - check if R_HOME\bin\i386 exists
+:: - if R_HOME\bin\x64 exists
+:: - if none of the above then use i386
+
+call :process_arch %*
+rem set R
+
+cd %R_HOME%
+cd ..
+
+if "%1"=="" (
+	for /d %%a in (*) do if exist %%a\bin\R.exe echo %%a
+	goto:eof
+)
+
+:: Look in architecture specific subdirectory of bin. If not there look in bin.
+set cmdpath=%1\bin\%R_ARCH0%\RSetReg.exe
+echo %cmdpath%
+rem set cmdpath
+if exist "%cmdpath%" goto:cmdpathfound
+set cmdpath=%1\bin\RSetReg.exe
+rem set cmdpath
+if exist "%cmdpath%" goto:cmdpathfound
+echo "Error: RSetReg.exe not found" & goto:eof
+goto:eof
+:cmdpathfound
+	reg delete hklm\software\r-core\r  /f /v "Current Version"
+    reg delete hklm\software\r-core\r /f /v InstallPath
+    reg delete hklm\software\wow6432Node\r-core\r /f /v "Current Version"
+    reg delete hklm\software\wow6432Node\r-core\r /f /v InstallPath
+	"%cmdpath%"
+
+goto:eof
+
+
+
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+:: processing of --arch= where value can be 32, 64, i386, x64, /i386, /x64
+
+:: Call it like this: call :process_arch %*
+:: On return R_ARCH will be set from --arch or R_ARCH or default
+:: and R_ARCH0 will be R_ARCH without the / prefix
+:: It will look for the architecture in these places in this order:
+:: - first arg if its --arch
+:: - environment variable R_ARCH
+:: - check if R_HOME\bin\i386 exists
+:: - if R_HOME\bin\x64 exists
+:: - if none of the above then use R_ARCH=/i386
+:: Note that R_HOME should be defined before calling this routine
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+:process_arch
+	if defined R_ARCH goto:process_arch_defined
+	:: The loop searches for --arch and sets R_ARCH to the next argument
+   :process_arch_loop 
+    set arg=%~1
+    shift 
+    if not defined arg goto :process_arch_cont 
+	if "%arg%"=="--arch" ( 
+		set R_ARCH=%1
+        set	process_arg_arch=%1
+	)
+	if defined R_ARCH goto:process_arch_cont
+	goto:process_arch_loop
+    :process_arch_cont
+	if defined process_arg_arch goto:process_arch_defined
+	if exist %R_HOME%\bin\i386 (set R_ARCH=/i386) & goto:process_arch_defined
+	if exist %R_HOME%\bin\x64 (set R_ARCH=/x64) & goto:process_arch_defined
+	(set R_ARCH=/i386)
+	:process_arch_defined
+	if "%R_ARCH%"=="32" (set R_ARCH=/i386)
+	if "%R_ARCH%"=="386" (set R_ARCH=/i386)
+	if "%R_ARCH%"=="i386" (set R_ARCH=/i386)
+	if "%R_ARCH%"=="64" (set R_ARCH=/x64)
+	if "%R_ARCH%"=="x64" (set R_ARCH=/x64)
+	:: if R_ARCH does not begin with a slash add one as a prefix
+	(set first_char=%R_ARCH:~0,1%)
+	if not "%first_char%" == "/" (set R_ARCH=/%R_ARCH%)
+	:: R_ARCH0 is like R_ARCH but without the beginning /
+	(set R_ARCH0=%R_ARCH:~1%)
+    echo %R_ARCH% %R_ARCH0%
+	goto:eof
+
+endlocal

Modified: branches/distr-2.4/pkg/utils/finde.r
===================================================================
--- branches/distr-2.4/pkg/utils/finde.r	2012-06-07 23:36:25 UTC (rev 821)
+++ branches/distr-2.4/pkg/utils/finde.r	2012-06-09 02:49:22 UTC (rev 822)
@@ -20,8 +20,12 @@
   }
 infind(dir)   
 }
+#finde(x="Wow6432Node", dir ="C:/R/devel/src/gnuwin32", rec=TRUE, ext="")
 
-
+#finde(x="getPos", dir ="C:/rtest/distr/branches/distr-2.4/pkg/distrMod/", rec=TRUE)
+finde(x="roptest\\(", dir ="C:/rtest/robast/branches/robast-0.9/pkg/ROptEst/", rec=TRUE)
+finde(x="getSlots\\(", dir ="C:/rtest/distr/branches/distr-2.4/pkg/distrMod/", rec=TRUE)
+finde(x="\"loc\"", dir ="C:/rtest/distr/branches/distr-2.4/pkg/distrEx/", rec=TRUE)
 finde(x=".makeQNew", dir ="C:/rtest/distr/pkg/distr/R")
 finde(x="http://distr\\.r-forge\\.r-project\\.org/distr\\.pdf", dir ="C:/rtest/distr/", rec=TRUE)
 

Added: branches/distr-2.4/pkg/utils/pmake
===================================================================
--- branches/distr-2.4/pkg/utils/pmake	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/pmake	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,33 @@
+#! /bin/sh
+#
+# ***pmake*** makes a package...
+#
+#  SYNTAX: pmake <packagename> 
+#   * performs R CMD check, R CMD build, R CMD INSTALL to package <packagename>,
+# 
+# 
+echo.
+echo ##########################################
+echo This is pmake --- making package %1
+echo ##########################################
+cd ..
+echo ----------------------------------------------------------------
+echo R CMD REMOVE
+echo ----------------------------------------------------------------
+R CMD REMOVE %1
+echo ----------------------------------------------------------------
+echo R CMD check
+echo ----------------------------------------------------------------
+R CMD check --timings --install-args="--byte-compile --with-keep.source --compact-docs --resave-data --install-tests --example --html --latex --clean --preclean" %1
+echo ----------------------------------------------------------------
+echo R CMD build
+echo ----------------------------------------------------------------
+R CMD build --compact-vignettes --resave-data %1
+echo ----------------------------------------------------------------
+echo R CMD INSTALL
+echo ----------------------------------------------------------------
+R CMD INSTALL --byte-compile --with-keep.source --compact-docs --resave-data --install-tests --example --html --latex --clean --preclean %1
+echo ----------------------------------------------------------------
+echo FERTIG!!!
+echo ----------------------------------------------------------------
+cd utils

Modified: branches/distr-2.4/pkg/utils/pmake.bat
===================================================================
--- branches/distr-2.4/pkg/utils/pmake.bat	2012-06-07 23:36:25 UTC (rev 821)
+++ branches/distr-2.4/pkg/utils/pmake.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -1,4 +1,4 @@
-echo off
+ at echo off
 REM
 REM ***pmake*** makes a package...
 REM
@@ -12,87 +12,116 @@
 REM                        (else just against R-ver2 if given or R-ver if given or preset R-version)
 REM           all args are positional, i.e. they only apply if all preceding args are given
 REM 
+REM To be able to switch between Rversions you need batch utils from G.Grothendieck (on CRAN)
+REM which should be on your path. In addition (as for June 8 2012), you need to modify 
+REM Rversions.bat from Gabor and add RRversions.bat (from me) to solve 
+REM  (a) some change in the policy on where to write registry entries with RSetReg [modified Rversions.bat]
+REM  (b) overcome the nasty elevated privileges [RRversions.bat]
+REM
+REM Second you should place RBuild.bat, RCheck.bat, RInstall.bat, RZip.bat to a place found in the PATH 
 REM 
+REM IF you want to use word completion, add location of this file to path & remove cd lines
 REM 
-REM ALSO add the utils folder to your path
-REM 
 echo.
+set R_ARCH=32
+set EL2=call RRversions %2 64
+set EL3=call RRversions %3 64
+echo %EL2%
+echo %EL3%
 echo ##########################################
 echo This is pmake --- making package %1
 echo ##########################################
 echo.
+cd ..
 echo.
-echo ----------------------------------------------------------------
-echo R CMD REMOVE
-echo ----------------------------------------------------------------
+if not "%2"=="" (
+   echo ----------------------------------------------------------------
+   echo R CMD REMOVE under %2
+   echo ----------------------------------------------------------------
+   %EL2%
+   PING 1.1.1.1 -n 1 -w 1000 >NUL
+)  else (
+   echo ----------------------------------------------------------------
+   echo R CMD REMOVE
+   echo ----------------------------------------------------------------
+)
 echo on
 call R CMD REMOVE %1
 echo off
 echo.
 echo ----------------------------------------------------------------
 if not "%3"=="" ( 
-echo R CMD check under %3
-) else (
-if not "%2"=="" (
-echo R CMD check under %2
-) else (
-echo R CMD check
-)
-)
+   echo R CMD check under %3
+)  else (
+   if not "%2"=="" (
+      echo R CMD check under %2
+   )  else (
+      echo R CMD check
+   )
+) 
 echo ----------------------------------------------------------------
-if not "%2"=="" call Rversions %2
-if not "%3"=="" call Rversions %3
+if not "%3"=="" (
+  %EL3%
+   PING 1.1.1.1 -n 1 -w 1000 >NUL
+) 
 echo on
-call R CMD check --force-multiarch --timings %1
+call Rcheck  %1
 echo off
-if not "%2"=="" call Rversions %2
+if not "%3"=="" (
+   %EL2%
+   PING 1.1.1.1 -n 1 -w 1000 >NUL
+)
 echo.
 echo ----------------------------------------------------------------
 if "%4"=="+" (
-echo R CMD check --force-multiarch --timings under %2
-echo ----------------------------------------------------------------
-echo on
-call R CMD check --force-multiarch --timings --outdir=%2 %1
-echo off
-echo.
-echo ----------------------------------------------------------------
+   echo R CMD check under %2
+   echo ----------------------------------------------------------------
+   echo on
+   call RCheck %1 %2
+   echo off
+   echo.
+   echo ----------------------------------------------------------------
 )
 if not "%2"=="" (
-echo R CMD build under %2
-) else echo R CMD build
+   echo R CMD build under %2
+)  else echo R CMD build 
 echo ----------------------------------------------------------------
 echo on
-call R CMD build --compact-vignettes %1
+call RBuild %1
 echo off
 echo.
 echo ----------------------------------------------------------------
 if not "%2"=="" (
-echo R CMD INSTALL --build under %2
-) else echo R CMD INSTALL --build 
+   echo R CMD INSTALL --build under %2
+)  else echo R CMD INSTALL --build 
 echo ----------------------------------------------------------------
 echo on
-call R CMD INSTALL --force-biarch --byte-compile --with-keep.source --compact-docs --resave-data -- example --html --latex --clean --preclean --build %1
+call RZip %1
 echo off
 echo.
-echo ----------------------------------------------------------------
-if not "%2"=="" (
-echo R CMD INSTALL under %2
-) else echo R CMD INSTALL
-echo ----------------------------------------------------------------
-echo on
-call R CMD INSTALL --force-biarch --byte-compile --with-keep.source --compact-docs --resave-data -- example --html --latex --clean --preclean %1
-echo off
-echo ----------------------------------------------------------------
 if not "%3"=="" (
-echo R CMD INSTALL under %3
+   echo R CMD INSTALL under %3
+   echo ----------------------------------------------------------------
+   %EL3%
+   PING 1.1.1.1 -n 1 -w 1000 >NUL
+   echo on
+   call RInstall %1
+   echo off
+   %EL2%
+   PING 1.1.1.1 -n 1 -w 1000 >NUL
+   echo ----------------------------------------------------------------
+)  else (
+   echo ----------------------------------------------------------------
+   if not "%2"=="" (
+      echo R CMD INSTALL under %2
+   ) else echo R CMD INSTALL
+   echo ----------------------------------------------------------------
+   echo on
+   call RInstall %1
+   echo off
+)
 echo ----------------------------------------------------------------
-call Rversions %3
-echo on
-call R CMD INSTALL --force-biarch --byte-compile --with-keep.source --compact-docs --resave-data -- example --html --latex --clean --preclean %1
-echo off
-call Rversions %2
-echo ----------------------------------------------------------------
-)
 echo FERTIG!!!
 echo ----------------------------------------------------------------
+cd utils
 echo on

Modified: branches/distr-2.4/pkg/utils/pmakeDoc.bat
===================================================================
--- branches/distr-2.4/pkg/utils/pmakeDoc.bat	2012-06-07 23:36:25 UTC (rev 821)
+++ branches/distr-2.4/pkg/utils/pmakeDoc.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -1,4 +1,4 @@
-echo off
+ at echo off
 REM
 REM ***pmakeDoc*** makes package distrDoc...
 REM
@@ -12,85 +12,113 @@
 REM                        (else just against R-ver2 if given or R-ver if given or preset R-version)
 REM           all args are positional, i.e. they only apply if all preceding args are given
 REM 
-cd .. 
+REM To be able to switch between Rversions you need batch utils from G.Grothendieck (on CRAN)
+REM which should be on your path.
+REM  (a) some change in the policy on where to write registry entries with RSetReg [modified Rversions.bat]
+REM  (b) overcome the nasty elevated privileges [RRversions.bat]
+REM
+REM Second you should place RBuild.bat, RCheck.bat, RInstall.bat, RZip.bat to a place found in the PATH 
 REM 
+REM IF you want to use word completion, add location of this file to path & remove cd lines
+REM 
 echo.
+set R_ARCH=32
+set EL1=call RRversions %1 64
+set EL2=call RRversions %2 64
+echo %EL1%
+echo %EL2%
 echo ##########################################
 echo This is pmakeDoc --- making package distrDoc
 echo ##########################################
 echo.
+cd ..
 echo.
-echo ----------------------------------------------------------------
-echo R CMD REMOVE
-echo ----------------------------------------------------------------
+if not "%1"=="" (
+   echo ----------------------------------------------------------------
+   echo R CMD REMOVE under %1
+   echo ----------------------------------------------------------------
+   %EL1%
+   PING 1.1.1.1 -n 1 -w 1000 >NUL
+)  else (
+   echo ----------------------------------------------------------------
+   echo R CMD REMOVE
+   echo ----------------------------------------------------------------
+)
 echo on
 call R CMD REMOVE distrDoc
 echo off
 echo.
 echo ----------------------------------------------------------------
 if not "%2"=="" ( 
-echo R CMD check under %2
-) else (
-if not "%1"=="" (
-echo R CMD check under %1
-) else (
-echo R CMD check
+   echo R CMD check under %2
+)  else (
+   if not "%1"=="" (
+      echo R CMD check under %1
+   ) else (
+   echo R CMD check
+   )
 )
+echo ----------------------------------------------------------------
+if not "%2"=="" (
+   %EL2% 
 )
-echo ----------------------------------------------------------------
-if not "%1"=="" call Rversions %1
-if not "%2"=="" call Rversions %2
 echo on
-call R CMD check distrDoc
+call RCheck distrDoc
 echo off
-if not "%1"=="" call Rversions %1
+if not "%2"=="" (
+  %EL1%
+  PING 1.1.1.1 -n 1 -w 1000 >NUL
+)
 echo.
 echo ----------------------------------------------------------------
 if "%3"=="+" (
-echo R CMD check under %1
-echo ----------------------------------------------------------------
-echo on
-call R CMD check --outdir=%1 distrDoc
-echo off
-echo.
-echo ----------------------------------------------------------------
+   echo R CMD check under %1
+   echo ----------------------------------------------------------------
+   echo on
+   call RCheck distrDoc %1
+   echo off
+   echo.
+   echo ----------------------------------------------------------------
 )
 if not "%1"=="" (
-echo R CMD build under %1
-) else echo R CMD build
+   echo R CMD build under %1
+)  else echo R CMD build
 echo ----------------------------------------------------------------
 echo on
-call R CMD build distrDoc
+call RBuild distrDoc
 echo off
 echo.
 echo ----------------------------------------------------------------
 if not "%1"=="" (
-echo R CMD build --binary under %1
-) else echo R CMD build --binary 
+   echo R CMD INSTALL --build under %1
+)  else echo R CMD INSTALL --build
 echo ----------------------------------------------------------------
 echo on
-call R CMD build --binary --no-vignettes distrDoc
+call RZip distrDoc
 echo off
 echo.
-echo ----------------------------------------------------------------
-if not "%1"=="" (
-echo R CMD INSTALL under %1
-) else echo R CMD INSTALL
-echo ----------------------------------------------------------------
-echo on
-call R CMD INSTALL distrDoc
-echo off
-echo ----------------------------------------------------------------
 if not "%2"=="" (
-echo R CMD INSTALL under %2
+   echo ----------------------------------------------------------------
+   echo R CMD INSTALL under %2
+   echo ----------------------------------------------------------------
+   %EL2%
+   PING 1.1.1.1 -n 1 -w 1000 >NUL
+   echo on
+   call RInstall distrDoc
+   call echo off
+   %EL1%
+   PING 1.1.1.1 -n 1 -w 1000 >NUL
+)  else (
+   echo ----------------------------------------------------------------
+   if not "%1"=="" (
+      echo R CMD INSTALL under %1
+   )  else echo R CMD INSTALL
+   echo ----------------------------------------------------------------
+   echo on
+   call RInstall distrDoc
+   echo off
+)
 echo ----------------------------------------------------------------
-call Rversions %2
-echo on
-call R CMD INSTALL distrDoc
-echo off
-call Rversions %1
-echo ----------------------------------------------------------------
-)
 echo FERTIG!!!
 echo ----------------------------------------------------------------
 REM

Added: branches/distr-2.4/pkg/utils/ppmake.bat
===================================================================
--- branches/distr-2.4/pkg/utils/ppmake.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/ppmake.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,4 @@
+ at echo off
+echo.
+el cmd /c pmake %1 %2 %3 %4
+echo on

Added: branches/distr-2.4/pkg/utils/ppmakeDoc.bat
===================================================================
--- branches/distr-2.4/pkg/utils/ppmakeDoc.bat	                        (rev 0)
+++ branches/distr-2.4/pkg/utils/ppmakeDoc.bat	2012-06-09 02:49:22 UTC (rev 822)
@@ -0,0 +1,4 @@
+ at echo off
+echo.
+el cmd /c pmakeDoc %1 %2 %3 
+echo on



More information about the Distr-commits mailing list