diff --git a/.cppcheck-suppressions b/.cppcheck-suppressions index d2df344bb3a..a02a60aa5aa 100644 --- a/.cppcheck-suppressions +++ b/.cppcheck-suppressions @@ -29,7 +29,7 @@ syntaxError:display/displaydrivers.html # dist.x86_64-pc-linux-gnu syntaxError:dist.x86_64-pc-linux-gnu/* -# doc +# doc syntaxError:doc/* # docker @@ -51,7 +51,7 @@ negativeIndex:imagery/i.atcorr/computations.cpp:1025 syntaxError:include/Makefile syntaxError:include/VERSION:1 -# text files +# text files syntaxError:INSTALL.md syntaxError:install-sh syntaxError:GPL.TXT @@ -131,7 +131,7 @@ syntaxError:mswindows/* invalidFunctionArg:raster/r.sim/simlib/random.c:36 invalidFunctionArg:raster/r.sim/simlib/random.c:57 -## Different rules under different ifdef. +## Different rules under different ifdef. ctuOneDefinitionRuleViolation:raster/r.in.pdal/grassrasterwriter.h:39 syntaxError:raster/rasterintro.html syntaxError:raster/Makefile:155 diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000000..6bf0e35a48d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,123 @@ +# EditorConfig: https://editorconfig.org +# Rules are read from top to bottom, the most recent rule found applies +# Some basic properties are supported by all editor plugins + +# top-most EditorConfig file +root = true + +# General settings +[*] +end_of_line = lf +insert_final_newline = true +charset = utf-8 +trim_trailing_whitespace = true + +[*.{htm,html,js,css,svg}] +indent_size = 2 + +[*.{xml,config}] +indent_size = 2 + +# Scripts +[{*.sh,mswindows/osgeo4w/*config}] +end_of_line = lf +indent_size = 4 + +# These are explicitly windows files and should use crlf +[*.{bat,cmd,ps1}{.tmpl,}] +end_of_line = crlf + +[*.{c,h,cpp,hpp}] +indent_size = 2 + +[{*.js,*.json,*.json5,*.mjs,*.cjs}] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true + +[*.js] +block_comment_start = /** +block_comment = * +block_comment_end = */ + +[*.ipynb] +end_of_line = lf + +[{*.py, *.pyi}] +charset = utf-8 +indent_style = space +# TODO: To enable when files are fixed: +# indent_size = 4 +# max_line_length = 88 + +[{Makefile,*.make,*.make.in}] +# TODO: To enable when files are fixed: +# indent_style = tab +indent_size = 4 + +[*.y{a,}ml] +indent_style = space +indent_size = 2 + +# Patch files +[*.patch] +trim_trailing_whitespace = false + +# TODO: To enable when files are fixed: +# # CSVs use CRLF as defined in RFC 4180 +# [*.csv] +# end_of_line = crlf + +[*.md] +# Two trailing whitespace in markdown means to create a line break +# https://www.markdownguide.org/basic-syntax/#line-breaks +# trim_trailing_whitespace = false +indent_style = space +# TODO: To enable when files are fixed: +# indent_size = 2 + +# TODO: Remove R batch files exclusions once fixed +[mswindows/external/rbatch/*] +trim_trailing_whitespace = unset +end_of_line = unset +charset = unset +insert_final_newline = unset + +# Exclude some files from rules +[*.{ascii,asc,ref,po,ps,svg}] +trim_trailing_whitespace = unset +end_of_line = unset +charset = unset +insert_final_newline = unset + +[{**/testsuite/data/**,mswindows/osgeo4w/envdiff.sed}] +trim_trailing_whitespace = unset +end_of_line = unset +charset = unset +insert_final_newline = unset + +[python/libgrass_interface_generator/ctypesgen/parser/parsetab.py] +trim_trailing_whitespace = false + +[mswindows/{generic.manifest,Installer-Files/*.url}] +end_of_line = crlf + +# Binary files +[**/PERMANENT/vector/*/{cidx,coor,sidx,topo}] +trim_trailing_whitespace = unset +end_of_line = unset +charset = unset +insert_final_newline = unset + +[*.{laz,raw,rgb}] +trim_trailing_whitespace = unset +end_of_line = unset +charset = unset +insert_final_newline = unset + +[{lib/vector/diglib/test*.ok,**/*.nib/keyedobjects.nib}] +trim_trailing_whitespace = unset +end_of_line = unset +charset = unset +insert_final_newline = unset diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000000..df0f3dafcc7 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,20 @@ +# TODO: Enable the following with a related change in .editorconfig: +# *.csv text eol=crlf + +# Scripts +*.bash text eol=lf +*.sh text eol=lf +# Windows scripts should be CRLF +*.bat text eol=crlf +*.cmd text eol=crlf +*.ps1 text eol=crlf + +# Jupyter notebooks +*.ipynb text eol=lf + +# Binary files +*.raw binary +*.laz binary +*/PERMANENT/vector/*/[cs]idx binary +*/PERMANENT/vector/*/coor binary +*/PERMANENT/vector/*/topo binary diff --git a/.github/actions/create-upload-suggestions/action.yml b/.github/actions/create-upload-suggestions/action.yml index b80c08c1b46..791df86541b 100644 --- a/.github/actions/create-upload-suggestions/action.yml +++ b/.github/actions/create-upload-suggestions/action.yml @@ -225,7 +225,7 @@ runs: env: FORMATTED_URL: >- [`formatted-${{ steps.tool-name-safe.outputs.tool-name }}`](${{ - steps.upload-changes.outputs.artifact-url }}) + steps.upload-changes.outputs.artifact-url }}) - name: Fail action if some files were changed if: >- ${{ (steps.files_changed.outputs.files_changed == 'true') && diff --git a/.github/workflows/.editorconfig b/.github/workflows/.editorconfig deleted file mode 100644 index 47ff004344a..00000000000 --- a/.github/workflows/.editorconfig +++ /dev/null @@ -1,3 +0,0 @@ -[*.sh] -indent_style = space -indent_size = 4 diff --git a/.github/workflows/additional_checks.yml b/.github/workflows/additional_checks.yml index 76554f24db3..b96099e1856 100644 --- a/.github/workflows/additional_checks.yml +++ b/.github/workflows/additional_checks.yml @@ -36,12 +36,6 @@ jobs: precommit: - '.pre-commit-config.yaml' - - name: Check for CRLF endings - uses: erclu/check-crlf@94acb86c2a41b0a46bd8087b63a06f0457dd0c6c # v1.2.0 - with: - # Ignore all test data, Windows-specific directories and scripts. - exclude: mswindows .*\.bat .*/testsuite/data/.* - - name: Set up Python uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index d966cc87dc9..821149c00b5 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -104,7 +104,7 @@ jobs: --min-success 100 --config .github/workflows/macos_gunittest.cfg env: SampleData: "https://grass.osgeo.org/sampledata/north_carolina/\ - nc_spm_full_v2alpha2.tar.gz" + nc_spm_full_v2alpha2.tar.gz" - name: Make HTML test report available if: ${{ !cancelled() }} uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3 diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index b8fe555a343..e0f28603a75 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -49,6 +49,7 @@ jobs: VALIDATE_BASH_EXEC: true # VALIDATE_CSS: true # VALIDATE_DOCKER: true + VALIDATE_EDITORCONFIG: true VALIDATE_JAVASCRIPT_ES: true # VALIDATE_JAVASCRIPT_STANDARD: true VALIDATE_JSON: true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 39d38f17008..b62559a5899 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -78,3 +78,9 @@ repos: rev: v1.35.1 hooks: - id: yamllint + # TODO: In a next release, the plain editorconfig-checker repo could be used + - repo: https://github.com/editorconfig-checker/editorconfig-checker.python + rev: 3.0.3 + hooks: + - id: editorconfig-checker + alias: ec diff --git a/db/drivers/mysql/Makefile b/db/drivers/mysql/Makefile index bbccbaf1588..117ff5a4f75 100644 --- a/db/drivers/mysql/Makefile +++ b/db/drivers/mysql/Makefile @@ -12,8 +12,8 @@ endif include $(MODULE_TOPDIR)/include/Make/DB.make -LIBES = $(DBMIDRIVERLIB) $(DBMIBASELIB) $(DBSTUBSLIB) \ - $(GISLIB) $(DATETIMELIB) +LIBES = $(DBMIDRIVERLIB) $(DBMIBASELIB) $(DBSTUBSLIB) \ + $(GISLIB) $(DATETIMELIB) EXTRA_CFLAGS = $(MYSQLINCPATH) EXTRA_LDFLAGS = $(MYSQLLIBPATH) diff --git a/include/Make/Install.make b/include/Make/Install.make index b9a5e45e0fc..99b3e40635c 100644 --- a/include/Make/Install.make +++ b/include/Make/Install.make @@ -123,9 +123,9 @@ $(DESTDIR)$(INST_DIR) $(DESTDIR)$(UNIX_BIN): $(STARTUP): $(ARCH_DISTDIR)/$(GRASS_NAME).tmp sed -e 's#'@GISBASE@'#'$(INST_DIR)'#g' \ - -e 's#'@LD_LIBRARY_PATH_VAR@'#'$(LD_LIBRARY_PATH_VAR)'#g' \ - -e 's#'@CONFIG_PROJSHARE@'#'$(PROJSHARE)'#g' \ - $< > $@ + -e 's#'@LD_LIBRARY_PATH_VAR@'#'$(LD_LIBRARY_PATH_VAR)'#g' \ + -e 's#'@CONFIG_PROJSHARE@'#'$(PROJSHARE)'#g' \ + $< > $@ -$(CHMOD) a+x $@ define fix_gisbase @@ -173,16 +173,16 @@ BINDISTNAME = grass-$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE) real-bindist: -tar cCBf $(ARCH_DISTDIR) - $(BIN_DIST_FILES) | gzip -fc > $(BINDISTNAME).tar.gz -size=`ls -l $(BINDISTNAME).tar.gz | awk '{print $$5}'`; \ - sed -e "s/BIN_DIST_VERSION/$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE)/" \ - -e "s/GRASSPRG_NAME/$(GRASS_NAME)/" \ - -e "s/SIZE_TAR_FILE/$$size/" -e "s#BIN_DIST_DIR#'$(INST_DIR)'#" \ - -e "s/ARCHITECTURE/$(ARCH)/" \ - -e "s/LD_LIBRARY_PATH_VAR/$(LD_LIBRARY_PATH_VAR)/" \ - -e "s/TEST_STR=/TEST_STR=executable/" \ - -e "s#IMPORTANT.*#Generated from the binaryInstall.src file using the command make bindist#" \ - -e "s/# executable shell.*//" -e "s/# make bindist.*//" \ - binaryInstall.src > $(BINDISTNAME)-install.sh ; \ - chmod a+x $(BINDISTNAME)-install.sh 2>/dev/null + sed -e "s/BIN_DIST_VERSION/$(GRASS_VERSION_NUMBER)-$(ARCH)-$(DATE)/" \ + -e "s/GRASSPRG_NAME/$(GRASS_NAME)/" \ + -e "s/SIZE_TAR_FILE/$$size/" -e "s#BIN_DIST_DIR#'$(INST_DIR)'#" \ + -e "s/ARCHITECTURE/$(ARCH)/" \ + -e "s/LD_LIBRARY_PATH_VAR/$(LD_LIBRARY_PATH_VAR)/" \ + -e "s/TEST_STR=/TEST_STR=executable/" \ + -e "s#IMPORTANT.*#Generated from the binaryInstall.src file using the command make bindist#" \ + -e "s/# executable shell.*//" -e "s/# make bindist.*//" \ + binaryInstall.src > $(BINDISTNAME)-install.sh ; \ + chmod a+x $(BINDISTNAME)-install.sh 2>/dev/null bindist-macosx: $(MAKE) -C macosx bindist-macosx diff --git a/lib/fonts/fonts/cyrilc.hmp b/lib/fonts/fonts/cyrilc.hmp index 12b63015753..c1d5c6f5086 100644 --- a/lib/fonts/fonts/cyrilc.hmp +++ b/lib/fonts/fonts/cyrilc.hmp @@ -19,4 +19,4 @@ 2801 2802 2823 2805 2806 2821 2804 2822 2809 2810 2811 2812 2813 2814 2815 2816 2832 2817 2818 2819 2820 2807 2803 2829 -2828 2808 2825 2830 2826 2824 2827 2832 +2828 2808 2825 2830 2826 2824 2827 2832 diff --git a/lib/fonts/fonts/fonts.table b/lib/fonts/fonts/fonts.table index d4d8486b5fa..f897f10384d 100644 --- a/lib/fonts/fonts/fonts.table +++ b/lib/fonts/fonts/fonts.table @@ -1,16 +1,16 @@ # # Descriptive Names for GRASS Stroke Fonts # -# This file maps a descriptive name to each font file, for use in the +# This file maps a descriptive name to each font file, for use in the # description field in the fontcap table (generated by g.mkfontcap). # # Format: Each line contains the filename followed by the vertical bar # character | and then the descriptive name. # -# Note that this file is used purely for the purpose of specifying +# Note that this file is used purely for the purpose of specifying # descriptive names for the Stroke fonts in this directory. # $GISBASE/etc/fontcap contains the list of fonts available to the GRASS -# display drivers, and any changes must be reflected there before they are +# display drivers, and any changes must be reflected there before they are # available for use - g.mkfontcap can do this automatically. # cyrilc.hmp|Cyrillic diff --git a/man/sphinx/Makefile b/man/sphinx/Makefile index 2de68502f88..27274e43f0b 100644 --- a/man/sphinx/Makefile +++ b/man/sphinx/Makefile @@ -69,17 +69,17 @@ json: htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/grass_gis.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/grass_gis.qhc" + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/grass_gis.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/grass_gis.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @@ -98,9 +98,9 @@ epub: latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @@ -121,9 +121,9 @@ man: texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @@ -144,10 +144,10 @@ changes: linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/mswindows/GRASS-Installer.nsi.tmpl b/mswindows/GRASS-Installer.nsi.tmpl index 2b2722a5083..ab01e133a51 100644 --- a/mswindows/GRASS-Installer.nsi.tmpl +++ b/mswindows/GRASS-Installer.nsi.tmpl @@ -4,7 +4,7 @@ ;Written by Marco Pasetti ;Updated for OSGeo4W by Colin Nielsen, Helmut Kudrnovsky, and Martin Landa ;Last Update: $Id$ -;Mail to: grass-dev@lists.osgeo.org +;Mail to: grass-dev@lists.osgeo.org ;---------------------------------------------------------------------------------------------------------------------------- @@ -102,7 +102,7 @@ ShowUnInstDetails hide ;StrReplace Function ;Replaces all occurrences of a given needle within a haystack with another string ;Written by dandaman32 - + Var STR_REPLACE_VAR_0 Var STR_REPLACE_VAR_1 Var STR_REPLACE_VAR_2 @@ -112,7 +112,7 @@ Var STR_REPLACE_VAR_5 Var STR_REPLACE_VAR_6 Var STR_REPLACE_VAR_7 Var STR_REPLACE_VAR_8 - + Function StrReplace Exch $STR_REPLACE_VAR_2 Exch 1 @@ -140,7 +140,7 @@ Function StrReplace Pop $STR_REPLACE_VAR_1 ; stack as it was before the function was called Exch $STR_REPLACE_VAR_0 FunctionEnd - + !macro _strReplaceConstructor OUT NEEDLE NEEDLE2 HAYSTACK Push "${HAYSTACK}" Push "${NEEDLE}" @@ -148,7 +148,7 @@ FunctionEnd Call StrReplace Pop "${OUT}" !macroend - + !define StrReplace '!insertmacro "_strReplaceConstructor"' ;---------------------------------------------------------------------------------------------------------------------------- @@ -184,35 +184,35 @@ Function .onInit Var /GLOBAL UNINSTALL_STRING Var /GLOBAL INSTALL_PATH - + Var /GLOBAL INSTALLED_VERSION_NUMBER Var /GLOBAL INSTALLED_GIT_REVISION Var /GLOBAL INSTALLED_BINARY_REVISION - + Var /GLOBAL INSTALLED_VERSION - + Var /GLOBAL DISPLAYED_INSTALLED_VERSION - + Var /GLOBAL MESSAGE_0_ Var /GLOBAL MESSAGE_1_ Var /GLOBAL MESSAGE_2_ Var /GLOBAL MESSAGE_3_ - + ReadRegStr $UNINSTALL_STRING HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "UninstallString" ReadRegStr $INSTALL_PATH HKLM "Software\${GRASS_BASE}" "InstallPath" ReadRegStr $INSTALLED_VERSION_NUMBER HKLM "Software\${GRASS_BASE}" "VersionNumber" ReadRegStr $INSTALLED_GIT_REVISION HKLM "Software\${GRASS_BASE}" "GitRevision" - + ${If} $INSTALLED_GIT_REVISION == "" ReadRegStr $INSTALLED_GIT_REVISION HKLM "Software\${GRASS_BASE}" "Revision" - ${EndIf} - + ${EndIf} + ReadRegStr $INSTALLED_BINARY_REVISION HKLM "Software\${GRASS_BASE}" "BinaryRevision" - + StrCpy $MESSAGE_0_ "${CHECK_INSTALL_NAME} is already installed on your system.$\r$\n" StrCpy $MESSAGE_0_ "$MESSAGE_0_$\r$\n" - - !if ${INSTALLER_TYPE} == "Release" + + !if ${INSTALLER_TYPE} == "Release" ${If} $INSTALLED_BINARY_REVISION == "" StrCpy $DISPLAYED_INSTALLED_VERSION "$INSTALLED_VERSION_NUMBER" ${Else} @@ -221,32 +221,32 @@ Function .onInit !else StrCpy $DISPLAYED_INSTALLED_VERSION "$INSTALLED_VERSION_NUMBER-$INSTALLED_GIT_REVISION-$INSTALLED_BINARY_REVISION" !endif - + StrCpy $MESSAGE_0_ "$MESSAGE_0_The installed release is $DISPLAYED_INSTALLED_VERSION$\r$\n" - + StrCpy $MESSAGE_1_ "$MESSAGE_0_$\r$\n" StrCpy $MESSAGE_1_ "$MESSAGE_1_You are going to install a newer release of ${CHECK_INSTALL_NAME}$\r$\n" StrCpy $MESSAGE_1_ "$MESSAGE_1_$\r$\n" StrCpy $MESSAGE_1_ "$MESSAGE_1_Press OK to uninstall GRASS $DISPLAYED_INSTALLED_VERSION" StrCpy $MESSAGE_1_ "$MESSAGE_1_ and install ${DISPLAYED_NAME} or Cancel to quit." - + StrCpy $MESSAGE_2_ "$MESSAGE_0_$\r$\n" StrCpy $MESSAGE_2_ "$MESSAGE_2_You are going to install an older release of ${CHECK_INSTALL_NAME}$\r$\n" StrCpy $MESSAGE_2_ "$MESSAGE_2_$\r$\n" StrCpy $MESSAGE_2_ "$MESSAGE_2_Press OK to uninstall GRASS $DISPLAYED_INSTALLED_VERSION" StrCpy $MESSAGE_2_ "$MESSAGE_2_ and install ${DISPLAYED_NAME} or Cancel to quit." - + StrCpy $MESSAGE_3_ "$MESSAGE_0_$\r$\n" StrCpy $MESSAGE_3_ "$MESSAGE_3_This is the latest release available.$\r$\n" StrCpy $MESSAGE_3_ "$MESSAGE_3_$\r$\n" StrCpy $MESSAGE_3_ "$MESSAGE_3_Press OK to reinstall ${DISPLAYED_NAME} or Cancel to quit." - + IntOp $INSTALLED_GIT_REVISION $INSTALLED_GIT_REVISION * 1 IntOp $INSTALLED_BINARY_REVISION $INSTALLED_BINARY_REVISION * 1 IntOp $INSTALLED_VERSION $INSTALLED_GIT_REVISION + $INSTALLED_BINARY_REVISION - + !define /math VERSION ${GIT_REVISION} + ${BINARY_REVISION} - + ${If} $INSTALLED_VERSION_NUMBER == "" ${Else} ${If} $INSTALLED_VERSION < ${VERSION} @@ -275,9 +275,9 @@ Function .onInit quit_reinstall: Abort continue_reinstall: - ${EndIf} + ${EndIf} ${EndIf} - + ${If} $INSTALLED_VERSION_NUMBER == "" ${Else} ${If} $0 = 0 @@ -295,10 +295,10 @@ FunctionEnd Function CheckUpdate - ${If} $ASK_FOR_PATH == "NO" + ${If} $ASK_FOR_PATH == "NO" Abort ${EndIf} - + FunctionEnd ;---------------------------------------------------------------------------------------------------------------------------- @@ -310,26 +310,26 @@ FunctionEnd ;Function CheckInstDir ; Var /GLOBAL INSTDIR_TEST -; Var /GLOBAL INSTDIR_LENGTH +; Var /GLOBAL INSTDIR_LENGTH ; Var /GLOBAL INSTDIR_TEST_LENGTH ; Var /GLOBAL MESSAGE_CHKINST_ -; +; ; StrCpy $MESSAGE_CHKINST_ "WARNING: you are about to install GRASS into a directory that has spaces$\r$\n" ; StrCpy $MESSAGE_CHKINST_ "$MESSAGE_CHKINST_in either its name or the path of directories leading up to it.$\r$\n" ; StrCpy $MESSAGE_CHKINST_ "$MESSAGE_CHKINST_Some functionalities of GRASS might be hampered by this. We would highly$\r$\n" ; StrCpy $MESSAGE_CHKINST_ "$MESSAGE_CHKINST_appreciate if you tried and reported any problems, so that we can fix them.$\r$\n" ; StrCpy $MESSAGE_CHKINST_ "$MESSAGE_CHKINST_However, if you want to avoid any such issues, we recommend that you$\r$\n" ; StrCpy $MESSAGE_CHKINST_ "$MESSAGE_CHKINST_choose a simple installation path without spaces, such as: C:\${GRASS_BASE}.$\r$\n" -; +; ; ${StrReplace} "$INSTDIR_TEST" " " "" "$INSTDIR" -; +; ; StrLen $INSTDIR_LENGTH "$INSTDIR" ; StrLen $INSTDIR_TEST_LENGTH "$INSTDIR_TEST" -; -; ${If} $INSTDIR_TEST_LENGTH < $INSTDIR_LENGTH +; +; ${If} $INSTDIR_TEST_LENGTH < $INSTDIR_LENGTH ; MessageBox MB_OK|MB_ICONEXCLAMATION "$MESSAGE_CHKINST_" ; ${EndIf} -; +; ;FunctionEnd ;---------------------------------------------------------------------------------------------------------------------------- @@ -351,39 +351,39 @@ Function ReplaceLineStr Push $R7 ; input string length Push $R8 ; line string length Push $R9 ; global - + StrLen $R7 $R1 - + GetTempFileName $R4 - + FileOpen $R5 $R4 w FileOpen $R3 $R2 r - + ReadLoop: ClearErrors FileRead $R3 $R6 IfErrors Done - + StrLen $R8 $R6 StrCpy $R9 $R6 $R7 -$R8 StrCmp $R9 $R1 0 +3 - + FileWrite $R5 "$R0$\r$\n" Goto ReadLoop - + FileWrite $R5 $R6 Goto ReadLoop - + Done: - + FileClose $R3 FileClose $R5 - + SetDetailsPrint none Delete $R2 Rename $R4 $R2 SetDetailsPrint both - + Pop $R9 Pop $R8 Pop $R7 @@ -491,24 +491,24 @@ Var /GLOBAL DOWNLOAD_MESSAGE_ Section "GRASS" SecGRASS SectionIn RO - + ;Set the INSTALL_DIR variable Var /GLOBAL INSTALL_DIR - - ${If} $ASK_FOR_PATH == "NO" + + ${If} $ASK_FOR_PATH == "NO" StrCpy $INSTALL_DIR "$INSTALL_PATH" ${Else} StrCpy $INSTALL_DIR "$INSTDIR" ${EndIf} - + ;Set to try to overwrite existing files - SetOverwrite try - + SetOverwrite try + ;Set the GIS_DATABASE directory SetShellVarContext current - Var /GLOBAL GIS_DATABASE + Var /GLOBAL GIS_DATABASE StrCpy $GIS_DATABASE "$DOCUMENTS\grassdata" - + ;Create the GIS_DATABASE directory CreateDirectory "$GIS_DATABASE" @@ -516,7 +516,7 @@ Section "GRASS" SecGRASS SetOutPath "$INSTALL_DIR" File .\Installer-Files\GRASS-WebSite.url File .\Installer-Files\WinGRASS-README.url - + ;add GRASS files SetOutPath "$INSTALL_DIR" File /r ${PACKAGE_FOLDER}\*.* @@ -524,12 +524,12 @@ Section "GRASS" SecGRASS ;grant $INSTDIR\etc read write accessible and show if succeeded: error if it failed AccessControl::GrantOnFile "$INSTDIR\etc" "(S-1-5-32-545)" "FullAccess" Pop $R0 - DetailPrint $R0 - ;grant modifying/overwriting fontcap file and show if succeeded: error if it failed + DetailPrint $R0 + ;grant modifying/overwriting fontcap file and show if succeeded: error if it failed AccessControl::GrantOnFile "$INSTDIR\etc\fontcap" "(S-1-5-32-545)" "FullAccess" Pop $R0 - DetailPrint $R0 - + DetailPrint $R0 + ;create run_gmkfontcap.bat ClearErrors FileOpen $0 $INSTALL_DIR\etc\run_gmkfontcap.bat w @@ -567,12 +567,12 @@ Section "GRASS" SecGRASS FileOpen $0 $INSTALL_DIR\etc\run_gmkfontcap.bat.manifest w IfErrors done_create_run_gmkfontcap.bat.manifest FileWrite $0 ' $\r$\n' - FileWrite $0 '$\r$\n' + FileWrite $0 '$\r$\n' FileWrite $0 ' $\r$\n' - FileWrite $0 ' GRASS help script:run_gmkfontcap$\r$\n' + FileWrite $0 ' type="win32"/>$\r$\n' + FileWrite $0 ' GRASS help script:run_gmkfontcap$\r$\n' FileWrite $0 ' $\r$\n' FileWrite $0 ' $\r$\n' FileWrite $0 ' $\r$\n' @@ -586,13 +586,13 @@ Section "GRASS" SecGRASS FileWrite $0 '$\r$\n' FileClose $0 done_create_run_gmkfontcap.bat.manifest: - + ;Run g.mkfontcap outside a grass session during installation to catch all fonts ExecWait '"$INSTALL_DIR\etc\run_gmkfontcap.bat"' ;set $INSTDIR\etc back to read accessible - AccessControl::SetOnFile "$INSTDIR\etc" "(S-1-5-32-545)" "GenericRead + GenericExecute" - + AccessControl::SetOnFile "$INSTDIR\etc" "(S-1-5-32-545)" "GenericRead + GenericExecute" + ;Install demolocation into the GIS_DATABASE directory SetOutPath "$GIS_DATABASE\demolocation" File /r ${DEMOLOCATION_PATH}\*.* @@ -605,9 +605,9 @@ Section "GRASS" SecGRASS ;Create the Uninstaller WriteUninstaller "$INSTALL_DIR\Uninstall-GRASS.exe" - + ;Registry Key Entries - + ;HKEY_LOCAL_MACHINE Install entries ;Set the Name, Version and Revision of GRASS + PublisherInfo + InstallPath WriteRegStr HKLM "Software\${GRASS_BASE}" "Name" "${GRASS_BASE}" @@ -617,11 +617,11 @@ Section "GRASS" SecGRASS WriteRegStr HKLM "Software\${GRASS_BASE}" "Publisher" "${PUBLISHER}" WriteRegStr HKLM "Software\${GRASS_BASE}" "WebSite" "${WEB_SITE}" WriteRegStr HKLM "Software\${GRASS_BASE}" "InstallPath" "$INSTALL_DIR" - + ;HKEY_LOCAL_MACHINE Uninstall entries WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "DisplayName" "GRASS GIS @GRASS_VERSION_MAJOR@.@GRASS_VERSION_MINOR@" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "UninstallString" "$INSTALL_DIR\Uninstall-GRASS.exe" - + !if ${INSTALLER_TYPE} == "Release" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}"\ "DisplayVersion" "${VERSION_NUMBER}-${BINARY_REVISION}" @@ -629,31 +629,31 @@ Section "GRASS" SecGRASS WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}"\ "DisplayVersion" "${VERSION_NUMBER}-${GIT_REVISION}-${BINARY_REVISION}" !endif - + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "DisplayIcon" "$INSTALL_DIR\gui\icons\grass.ico" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "EstimatedSize" 1 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "HelpLink" "${WIKI_PAGE}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "URLInfoAbout" "${WEB_SITE}" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" "Publisher" "${PUBLISHER}" - + ;Create the Desktop Shortcut SetShellVarContext current - + CreateShortCut "$DESKTOP\${GRASS_BASE}.lnk" "$INSTALL_DIR\${GRASS_COMMAND}.bat" "--gui"\ "$INSTALL_DIR\gui\icons\grass.ico" "" SW_SHOWNORMAL "" "Launch GRASS GIS ${VERSION_NUMBER}" - + ;Create the Windows Start Menu Shortcuts SetShellVarContext all - + CreateDirectory "$SMPROGRAMS\${GRASS_BASE}" - + CreateShortCut "$SMPROGRAMS\${GRASS_BASE}\${GRASS_BASE}.lnk" "$INSTALL_DIR\${GRASS_COMMAND}.bat" "--gui"\ "$INSTALL_DIR\gui\icons\grass.ico" "" SW_SHOWNORMAL "" "Launch GRASS GIS ${VERSION_NUMBER}" - + CreateShortCut "$SMPROGRAMS\${GRASS_BASE}\Uninstall ${GRASS_BASE}.lnk" "$INSTALL_DIR\Uninstall-GRASS.exe" ""\ "$INSTALL_DIR\Uninstall-GRASS.exe" "" SW_SHOWNORMAL "" "Uninstall GRASS GIS ${VERSION_NUMBER}" - + ;Create the grass_command.bat ClearErrors FileOpen $0 $INSTALL_DIR\${GRASS_COMMAND}.bat w @@ -680,20 +680,20 @@ Section "GRASS" SecGRASS FileWrite $0 'if %ERRORLEVEL% GEQ 1 pause' FileClose $0 done_create_grass_command.bat: - + ;Set the UNIX_LIKE GRASS Path Var /GLOBAL UNIX_LIKE_DRIVE Var /GLOBAL UNIX_LIKE_GRASS_PATH - + StrCpy $UNIX_LIKE_DRIVE "$INSTALL_DIR" 3 StrCpy $UNIX_LIKE_GRASS_PATH "$INSTALL_DIR" "" 3 - + ;replace "\" with "/" in $UNIX_LIKE_DRIVE ${StrReplace} "$UNIX_LIKE_DRIVE" "\" "/" "$UNIX_LIKE_DRIVE" - + ;replace ":" with "" in $UNIX_LIKE_DRIVE ${StrReplace} "$UNIX_LIKE_DRIVE" ":" "" "$UNIX_LIKE_DRIVE" - + ;replace "\" with "/" in $UNIX_LIKE_GRASS_PATH ${StrReplace} "$UNIX_LIKE_GRASS_PATH" "\" "/" "$UNIX_LIKE_GRASS_PATH" @@ -709,28 +709,28 @@ Section "GRASS" SecGRASS ;It first read the $PROFILE variable, to scan the OS version: ;If equal to "drive:\Users\UserName", the OS is Vista, and the $USERNAME variable set to $PROFILE - "drive:\Users\" ;If not, the OS is XP or previous, and the $USERNAME variable set to $PROFILE - "drive:\Documents and Settings\" - + ${If} $USERNAME == "" StrCpy $PROFILE_DRIVE "$PROFILE" 2 StrCpy $PROFILE_ROOT "$PROFILE" 5 -3 - ${If} $USERNAME = "Users" + ${If} $USERNAME = "Users" ${StrReplace} "$USERNAME" "$PROFILE_DRIVE\Users\" "" "$PROFILE" ${Else} ${StrReplace} "$USERNAME" "$PROFILE_DRIVE\Documents and Settings\" "" "$PROFILE" ${EndIf} ${EndIf} - + ;Get the short form of the install path (to allow for paths with spaces) VAR /GLOBAL INST_DIR_SHORT GetFullPathName /SHORT $INST_DIR_SHORT $INSTALL_DIR ;Set the Unix-Like GIS_DATABASE Path ;Var /GLOBAL UNIX_LIKE_GIS_DATABASE_PATH - + ;replace \ with / in $GIS_DATABASE ;${StrReplace} "$UNIX_LIKE_GIS_DATABASE_PATH" "\" "/" "$GIS_DATABASE" - SetShellVarContext current + SetShellVarContext current ${If} ${FileExists} "$APPDATA\GRASS@GRASS_VERSION_MAJOR@\rc" DetailPrint "File $APPDATA\GRASS@GRASS_VERSION_MAJOR@\rc already exists. Skipping." ${Else} @@ -742,7 +742,7 @@ Section "GRASS" SecGRASS FileWrite $0 'GISDBASE: $GIS_DATABASE$\r$\n' FileWrite $0 'LOCATION_NAME: demolocation$\r$\n' FileWrite $0 'MAPSET: PERMANENT$\r$\n' - FileClose $0 + FileClose $0 done_create_grass_rc: ${EndIf} @@ -751,7 +751,7 @@ Section "GRASS" SecGRASS Push 'gisbase = "/c/OSGeo4W/apps/grass/grass-@GRASS_VERSION_MAJOR@.@GRASS_VERSION_MINOR@.@GRASS_VERSION_RELEASE@"' ; string that a line must begin with *WS Sensitive* Push 'gisbase = "$INSTDIR"' ; string to replace whole line with Call ReplaceLineStr - + ;replace config_projshare Push "$INSTDIR\etc\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@.py" ; file to modify Push 'config_projshare = "/c/OSGeo4W/share/proj"' ; string that a line must begin with *WS Sensitive* @@ -759,7 +759,7 @@ Section "GRASS" SecGRASS Call ReplaceLineStr ;replace BU with numeric group name for local users. Users S-1-5-32-545 does not work for Windows Enterprise. Try Authenticated Users S-1-5-11 - AccessControl::SetOnFile "$INSTDIR\etc\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@.py" "(S-1-5-11)" "GenericRead + GenericExecute" + AccessControl::SetOnFile "$INSTDIR\etc\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@.py" "(S-1-5-11)" "GenericRead + GenericExecute" SectionEnd ;-------------------------------------------------------------------------- @@ -789,30 +789,30 @@ Function DownloadInstallMSRuntime StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_ installation without the $EXTENDED_ARCHIVE_NAME.$\r$\n" MessageBox MB_OKCANCEL "$DOWNLOAD_MESSAGE_" IDOK download IDCANCEL cancel_download - - download: - SetShellVarContext current + + download: + SetShellVarContext current InitPluginsDir NSISdl::download "$HTTP_PATH/$ARCHIVE_NAME" "$TEMP\$ARCHIVE_NAME" Pop $0 StrCmp $0 "success" download_ok download_failed - - download_ok: + + download_ok: InitPluginsDir untgz::extract -d "$TEMP\$ORIGINAL_UNTAR_FOLDER" -zbz2 "$TEMP\$ARCHIVE_NAME" Pop $0 StrCmp $0 "success" untar_ok untar_failed - + download_failed: DetailPrint "$0" ;print error message to log MessageBox MB_OK "Download Failed.$\r$\nGRASS will be installed without the $EXTENDED_ARCHIVE_NAME." Goto end - + cancel_download: MessageBox MB_OK "Download Cancelled.$\r$\nGRASS will be installed without the $EXTENDED_ARCHIVE_NAME." Goto end - + untar_failed: DetailPrint "$0" ;print error message to log @@ -822,7 +822,7 @@ Function DownloadInstallMSRuntime CopyFiles "$TEMP\$ORIGINAL_UNTAR_FOLDER\bin\*.dll" "$INSTALL_DIR\extrabin" DetailPrint "MS runtime files installed." Goto end - + end: FunctionEnd @@ -831,15 +831,15 @@ Section "Important Microsoft Runtime DLLs" SecMSRuntime ;Set the size (in KB) of the archive file StrCpy $ARCHIVE_SIZE_KB 833 - + ;Set the size (in KB) of the unpacked archive file AddSize 13500 - + StrCpy $HTTP_PATH "http://download.osgeo.org/osgeo4w/v2/${PLATFORM}/release/msvcrt2019/" StrCpy $ARCHIVE_NAME "msvcrt2019-14.2-1.tar.bz2" StrCpy $EXTENDED_ARCHIVE_NAME "Microsoft Visual C++ Redistributable Packages" StrCpy $ORIGINAL_UNTAR_FOLDER "install_msruntime" - + Call DownloadInstallMSRuntime SectionEnd @@ -847,7 +847,7 @@ SectionEnd Function DownloadDataSet ; IntOp $ARCHIVE_SIZE_MB $ARCHIVE_SIZE_KB / 1024 - + StrCpy $DOWNLOAD_MESSAGE_ "The installer will download the $EXTENDED_ARCHIVE_NAME sample data set.$\r$\n" StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_$\r$\n" ; StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_The archive is about $ARCHIVE_SIZE_MB MB and may take" @@ -859,40 +859,40 @@ Function DownloadDataSet StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_$\r$\n" StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_Press OK to continue or Cancel to skip the download and complete the GRASS" StrCpy $DOWNLOAD_MESSAGE_ "$DOWNLOAD_MESSAGE_ installation without the $EXTENDED_ARCHIVE_NAME data set.$\r$\n" - + MessageBox MB_OKCANCEL "$DOWNLOAD_MESSAGE_" IDOK download IDCANCEL cancel_download - - download: - SetShellVarContext current + + download: + SetShellVarContext current InitPluginsDir NSISdl::download "$HTTP_PATH/$ARCHIVE_NAME" "$TEMP\$ARCHIVE_NAME" Pop $0 StrCmp $0 "success" download_ok download_failed - - download_ok: + + download_ok: InitPluginsDir untgz::extract -d "$GIS_DATABASE" "$TEMP\$ARCHIVE_NAME" Pop $0 StrCmp $0 "success" untar_ok untar_failed - - untar_ok: + + untar_ok: Rename "$GIS_DATABASE\$ORIGINAL_UNTAR_FOLDER" "$GIS_DATABASE\$CUSTOM_UNTAR_FOLDER" Delete "$TEMP\$ARCHIVE_NAME" Goto end - + download_failed: DetailPrint "$0" ;print error message to log MessageBox MB_OK "Download Failed.$\r$\nGRASS will be installed without the $EXTENDED_ARCHIVE_NAME sample data set." Goto end - + cancel_download: MessageBox MB_OK "Download Cancelled.$\r$\nGRASS will be installed without the $EXTENDED_ARCHIVE_NAME sample data set." Goto end - + untar_failed: DetailPrint "$0" ;print error message to log - + end: FunctionEnd @@ -901,34 +901,34 @@ Section /O "North Carolina (Wake County) Data Set" SecNorthCarolinaSDB ;Set the size (in KB) of the archive file StrCpy $ARCHIVE_SIZE_KB 144213 - + ;Set the size (in KB) of the unpacked archive file AddSize 254521 - + StrCpy $HTTP_PATH "https://grass.osgeo.org/sampledata/north_carolina/" StrCpy $ARCHIVE_NAME "nc_spm_08_grass7.tar.gz" StrCpy $EXTENDED_ARCHIVE_NAME "North Carolina (Wake County)" StrCpy $ORIGINAL_UNTAR_FOLDER "nc_spm_08_grass7" StrCpy $CUSTOM_UNTAR_FOLDER "North_Carolina" - - Call DownloadDataSet - + + Call DownloadDataSet + SectionEnd Section /O "South Dakota (Spearfish County) Data Set" SecSpearfishSDB ;Set the size (in KB) of the archive file StrCpy $ARCHIVE_SIZE_KB 20803 - + ;Set the size (in KB) of the unpacked archive file AddSize 42171 - + StrCpy $HTTP_PATH "https://grass.osgeo.org/sampledata" StrCpy $ARCHIVE_NAME "spearfish_grass70data-0.3.tar.gz" StrCpy $EXTENDED_ARCHIVE_NAME "South Dakota (Spearfish County)" StrCpy $ORIGINAL_UNTAR_FOLDER "spearfish60_grass7" StrCpy $CUSTOM_UNTAR_FOLDER "Spearfish60_grass7" - + Call DownloadDataSet SectionEnd @@ -940,7 +940,7 @@ Function .onInstSuccess ${If} ${SectionIsSelected} ${SecMSRuntime} Delete "$TEMP\$ARCHIVE_NAME" RMDir /r "$TEMP\$ORIGINAL_UNTAR_FOLDER" - RMDir "$TEMP\$ORIGINAL_UNTAR_FOLDER" + RMDir "$TEMP\$ORIGINAL_UNTAR_FOLDER" ${EndIf} FunctionEnd @@ -951,23 +951,23 @@ FunctionEnd Section "Uninstall" ;remove files & folders RMDir /r "$INSTDIR" - + ;remove the Desktop ShortCut SetShellVarContext current Delete "$DESKTOP\${GRASS_BASE}.lnk" - + ;remove the Programs Start ShortCuts SetShellVarContext all RMDir /r "$SMPROGRAMS\${GRASS_BASE}" - + ;remove the $APPDATA\GRASS@GRASS_VERSION_MAJOR@ folder ;disabled, don't remove user settings ; SetShellVarContext current - ;RMDir /r "$APPDATA\GRASS@GRASS_VERSION_MAJOR@" + ;RMDir /r "$APPDATA\GRASS@GRASS_VERSION_MAJOR@" ;${If} ${FileExists} "$APPDATA\GRASS@GRASS_VERSION_MAJOR@\addons\*.*" ; RMDir /r "$APPDATA\GRASS@GRASS_VERSION_MAJOR@\addons" ;${EndIf} - + ;remove the Registry Entries DeleteRegKey HKLM "Software\${GRASS_BASE}" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${GRASS_BASE}" diff --git a/mswindows/GRASS-Packager.bat.tmpl b/mswindows/GRASS-Packager.bat.tmpl index ca050728949..d689825c4ee 100644 --- a/mswindows/GRASS-Packager.bat.tmpl +++ b/mswindows/GRASS-Packager.bat.tmpl @@ -1,108 +1,108 @@ -rem ----------------------------------------------------------------------------------------------------------------------- -rem Self Contained GRASS Automated Packager -rem ----------------------------------------------------------------------------------------------------------------------- -rem Edited by: Marco Pasetti -rem Revised for OSGeo4W by: Colin Nielsen, Helmut Kudrnovsky, and Martin Landa -rem Last Update: $Id$ -rem ----------------------------------------------------------------------------------------------------------------------- - -@echo off - -rem -------------------------------------------------------------------------------------------------------------------------- -rem Set the script variables -rem -------------------------------------------------------------------------------------------------------------------------- - -set PACKAGE_DIR=.\GRASS-@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@-Package - -set OSGEO4W_BLD_DIR=C:\OSGeo4W -if exist C:\OSGeo4W_grass@GRASS_VERSION_MAJOR@ ( -set OSGEO4W_PKG_DIR=C:\OSGeo4W_grass@GRASS_VERSION_MAJOR@ -) else ( -set OSGEO4W_PKG_DIR=C:\OSGeo4W -) - -set MSYS_BLD_DIR=C:\msys64\mingw64 - -set GRASS_PREFIX=%OSGEO4W_BLD_DIR%\apps\grass\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@ - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Remove the previous package and create a new PACKAGE_DIR -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. - -if exist %PACKAGE_DIR% rmdir /S/Q %PACKAGE_DIR% -mkdir %PACKAGE_DIR% - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Copy %GRASS_PREFIX% content to PACKAGE_DIR -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. - -xcopy %GRASS_PREFIX% %PACKAGE_DIR% /S/V/F/I - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Copy extrabins to PACKAGE_DIR\extrabin -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. - -mkdir %PACKAGE_DIR%\extrabin -mkdir %PACKAGE_DIR%\extrabin\gdalplugins - -copy %OSGEO4W_PKG_DIR%\bin\* %PACKAGE_DIR%\extrabin -xcopy %OSGEO4W_PKG_DIR%\bin\gdalplugins\* %PACKAGE_DIR%\extrabin\gdalplugins /S/V/F/I -rem msvcrt2019 -del %PACKAGE_DIR%\extrabin\*140*.dll - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Copy 'Windows batchfiles for use with R' (GRASS-R-integration) from source to PACKAGE_DIR\extrabin -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. - -copy .\external\rbatch\* %PACKAGE_DIR%\extrabin - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Copy shared PROJ.4 files to PACKAGE_DIR\proj -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. - -if not exist "%PACKAGE_DIR%\share" mkdir %PACKAGE_DIR%\share -mkdir %PACKAGE_DIR%\share\proj -xcopy %OSGEO4W_PKG_DIR%\share\proj %PACKAGE_DIR%\share\proj /S/V/F/I - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Copy shared GDAL files to PACKAGE_DIR\share\gdal -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. - -mkdir %PACKAGE_DIR%\share\gdal -xcopy %OSGEO4W_PKG_DIR%\share\gdal %PACKAGE_DIR%\share\gdal /S/V/F/I - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Copy Python content to PACKAGE_DIR\Python3 -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. - -mkdir %PACKAGE_DIR%\Python312 - -xcopy %OSGEO4W_PKG_DIR%\apps\Python312\* %PACKAGE_DIR%\Python312 /S/V/F/I - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Copy env.bat -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. - -copy env.bat %PACKAGE_DIR%\etc - -@echo. -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo Packaging Completed -@echo ----------------------------------------------------------------------------------------------------------------------- -@echo. +rem ----------------------------------------------------------------------------------------------------------------------- +rem Self Contained GRASS Automated Packager +rem ----------------------------------------------------------------------------------------------------------------------- +rem Edited by: Marco Pasetti +rem Revised for OSGeo4W by: Colin Nielsen, Helmut Kudrnovsky, and Martin Landa +rem Last Update: $Id$ +rem ----------------------------------------------------------------------------------------------------------------------- + +@echo off + +rem -------------------------------------------------------------------------------------------------------------------------- +rem Set the script variables +rem -------------------------------------------------------------------------------------------------------------------------- + +set PACKAGE_DIR=.\GRASS-@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@-Package + +set OSGEO4W_BLD_DIR=C:\OSGeo4W +if exist C:\OSGeo4W_grass@GRASS_VERSION_MAJOR@ ( +set OSGEO4W_PKG_DIR=C:\OSGeo4W_grass@GRASS_VERSION_MAJOR@ +) else ( +set OSGEO4W_PKG_DIR=C:\OSGeo4W +) + +set MSYS_BLD_DIR=C:\msys64\mingw64 + +set GRASS_PREFIX=%OSGEO4W_BLD_DIR%\apps\grass\grass@GRASS_VERSION_MAJOR@@GRASS_VERSION_MINOR@ + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Remove the previous package and create a new PACKAGE_DIR +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. + +if exist %PACKAGE_DIR% rmdir /S/Q %PACKAGE_DIR% +mkdir %PACKAGE_DIR% + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Copy %GRASS_PREFIX% content to PACKAGE_DIR +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. + +xcopy %GRASS_PREFIX% %PACKAGE_DIR% /S/V/F/I + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Copy extrabins to PACKAGE_DIR\extrabin +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. + +mkdir %PACKAGE_DIR%\extrabin +mkdir %PACKAGE_DIR%\extrabin\gdalplugins + +copy %OSGEO4W_PKG_DIR%\bin\* %PACKAGE_DIR%\extrabin +xcopy %OSGEO4W_PKG_DIR%\bin\gdalplugins\* %PACKAGE_DIR%\extrabin\gdalplugins /S/V/F/I +rem msvcrt2019 +del %PACKAGE_DIR%\extrabin\*140*.dll + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Copy 'Windows batchfiles for use with R' (GRASS-R-integration) from source to PACKAGE_DIR\extrabin +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. + +copy .\external\rbatch\* %PACKAGE_DIR%\extrabin + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Copy shared PROJ.4 files to PACKAGE_DIR\proj +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. + +if not exist "%PACKAGE_DIR%\share" mkdir %PACKAGE_DIR%\share +mkdir %PACKAGE_DIR%\share\proj +xcopy %OSGEO4W_PKG_DIR%\share\proj %PACKAGE_DIR%\share\proj /S/V/F/I + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Copy shared GDAL files to PACKAGE_DIR\share\gdal +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. + +mkdir %PACKAGE_DIR%\share\gdal +xcopy %OSGEO4W_PKG_DIR%\share\gdal %PACKAGE_DIR%\share\gdal /S/V/F/I + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Copy Python content to PACKAGE_DIR\Python3 +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. + +mkdir %PACKAGE_DIR%\Python312 + +xcopy %OSGEO4W_PKG_DIR%\apps\Python312\* %PACKAGE_DIR%\Python312 /S/V/F/I + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Copy env.bat +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. + +copy env.bat %PACKAGE_DIR%\etc + +@echo. +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo Packaging Completed +@echo ----------------------------------------------------------------------------------------------------------------------- +@echo. diff --git a/mswindows/Makefile b/mswindows/Makefile index 3a33ac70b74..de2a4c6463c 100644 --- a/mswindows/Makefile +++ b/mswindows/Makefile @@ -11,7 +11,7 @@ ifneq ($(MINGW),) default: GRASS-Packager.bat GRASS-Installer.nsi parsubdirs else default: -endif +endif GRASS-Packager.bat: GRASS-Packager.bat.tmpl sed \ diff --git a/mswindows/external/README.license b/mswindows/external/README.license index 2423c610f5f..f9345809a9d 100644 --- a/mswindows/external/README.license +++ b/mswindows/external/README.license @@ -1,21 +1,21 @@ - - -In the following directories you will find code which was not -written by The GRASS Development Team. - -Parts of GRASS are not copyright by The GRASS Development Team. -The original authors hold the copyrights and you have to abide -to their licensing terms where noted. -(Keep in mind that code linking into GRASS can only be distributed -if compatible with the GPL.) - -Specifically the source code below this directory is not necessarily -licensed under the GPL. Check the READMEs and source code header -comments carefully. - - - - * Windows batchfiles for use with R / (GNU GPL v2) - http://code.google.com/p/batchfiles/ - https://github.com/ggrothendieck/batchfiles (new code repository) - + + +In the following directories you will find code which was not +written by The GRASS Development Team. + +Parts of GRASS are not copyright by The GRASS Development Team. +The original authors hold the copyrights and you have to abide +to their licensing terms where noted. +(Keep in mind that code linking into GRASS can only be distributed +if compatible with the GPL.) + +Specifically the source code below this directory is not necessarily +licensed under the GPL. Check the READMEs and source code header +comments carefully. + + + + * Windows batchfiles for use with R / (GNU GPL v2) + http://code.google.com/p/batchfiles/ + https://github.com/ggrothendieck/batchfiles (new code repository) + diff --git a/mswindows/external/rbatch/ANNOUNCE b/mswindows/external/rbatch/ANNOUNCE index 98618afec5f..a033c16b2d1 100644 --- a/mswindows/external/rbatch/ANNOUNCE +++ b/mswindows/external/rbatch/ANNOUNCE @@ -1,21 +1,21 @@ -A new version of the Windows batchfiles is available. +A new version of the Windows batchfiles is available. CHANGES -The key change is the new R.bat utility. R.bat has a new interface and +The key change is the new R.bat utility. R.bat has a new interface and extended functionality covering many of the other prior utilities. (These older utilities are no longer needed and have been removed.) Unlike R.bat which requires no configuration the new Rpathset.bat utility is configured by manually changing the Windows batch SET statements in it. The -main advantage is just that it is very simple internally which may be +main advantage is just that it is very simple internally which may be advantageous in some situations involving customization. A new pdf document accompanies the utilities providing more detail. OVERVIEW -These are self contained independent no-install Windows batch, javascript and +These are self contained independent no-install Windows batch, javascript and .hta files. Just place any that you wish to use on your Windows PATH. R.bat @@ -28,7 +28,7 @@ line do this: R gui R.bat locates R, MiKTeX and Rtools using the registry or heuristics and then -runs the subcommand indicated by the first argument. +runs the subcommand indicated by the first argument. In addition to the gui subcommand, the following subcommands are available: cd, cmd, dir, gui, help, ls, path, R, script, show, SetReg, tools, touch. @@ -48,7 +48,7 @@ R show -- show R_ variable values used (R_ROOT, R_HOME, R_VER, R_ARCH, etc.) R path -- temporarily add R, MiKTeX and Rtools to the Windows path R tools -- similar but only add MiKTeX and Rtools to the Windows path -Except for R touch (which updates the date on your R_HOME directory) and +Except for R touch (which updates the date on your R_HOME directory) and R SetReg (which calls RSetReg.exe to update the registry with your R version), R.bat makes no permanent changes to your system. @@ -56,16 +56,16 @@ Rpathset.bat Rpathset.bat temporarily sets the Windows path to R, Rtools and MiKTeX based on SET statements that the user can configure manually. It is an -alternative to R.bat that lacks R.bat's "no configuration" nature but may be +alternative to R.bat that lacks R.bat's "no configuration" nature but may be preferred in some situations due to its internal simplicity. -Also Rpathset.bat is more likely to work on systems that have not been -tested given its simplicity. (The utilities were tested on 32 bit Windows +Also Rpathset.bat is more likely to work on systems that have not been +tested given its simplicity. (The utilities were tested on 32 bit Windows Vista and 64 bit Windows 8 systems.) Other -Other commands which continue to be available are copydir.bat, movedir.bat, +Other commands which continue to be available are copydir.bat, movedir.bat, el.js, clip2r.js and find-miktex.hta . These copy and move R libraries, run a command in elevated mode (i.e. as Administrator), copy the clipboard to a running R instance and find MiKTeX. diff --git a/mswindows/external/rbatch/NEWS b/mswindows/external/rbatch/NEWS index ed028a3d445..2b53b78602a 100644 --- a/mswindows/external/rbatch/NEWS +++ b/mswindows/external/rbatch/NEWS @@ -10,7 +10,7 @@ Changes in version 0.7-1 Changes in version 0.7-0 - o R.bat reworked. It now has a with different interface and many prior + o R.bat reworked. It now has a with different interface and many prior batch files have been incorporated into it and removed o new Rpathset.bat @@ -33,7 +33,7 @@ Changes in version 0.6-5 %ProgramFiles%\MySQL\* - This allows one to install and run RMySQL without setting any environment + This allows one to install and run RMySQL without setting any environment variables. (Note that MySQL should be installed from the mysql site. xampp and wamp do not include the header files needed by RMySQL.) @@ -71,7 +71,7 @@ Changes in version 0.5-0 or higher. o new command find-miktex.hta can be run without arguments from the - Windows command line or double clicked from Windows Explorer + Windows command line or double clicked from Windows Explorer to show path to the MiKTeX bin directory. o Rversions.hta now also changes the .RData association and has @@ -90,14 +90,14 @@ Changes in version 0.5-0 Changes in version 0.4-3 - o Sweave.bat and Stangle.bat were not automatically finding MiKTeX. + o Sweave.bat and Stangle.bat were not automatically finding MiKTeX. Fixed. Changes in version 0.4-2 o can optionally work off initialization files in place of registry. - Place rbatchfilesrc.bat in current directory or %userprofile% (so - different directories can work off different versions of R, say) + Place rbatchfilesrc.bat in current directory or %userprofile% (so + different directories can work off different versions of R, say) or same directory as the other batchfiles and it will run it first. Typically rbatchfiles.bat would constain these two lines or similar: set R_HOME=C:\Program Files\R\R-2.7.0 @@ -110,13 +110,13 @@ Changes in version 0.4-1 o it is no longer necessary to set any paths to build R packages provided Rtools 2.7 or later is used. Rcmd.bat and the other scripts automatically find Rtools from the registry (including perl) - and if MikTeX is at %ProgramFiles%\MiKTeX* or %SystemDrive%:\MiKTex - then it will find MiKTeX too. New optional environment variables + and if MikTeX is at %ProgramFiles%\MiKTeX* or %SystemDrive%:\MiKTex + then it will find MiKTeX too. New optional environment variables R_TOOLS and R_MIKTEX are available to force specified paths to be used. o new Rtools.bat command that sets the path for the current cmd instance to the one that R*.bat files use internally. That is, rtools/bin, - rtools/perl/bin, rtools/MinGW/bin and MiKTeX .../miktex/bin are added + rtools/perl/bin, rtools/MinGW/bin and MiKTeX .../miktex/bin are added to the path. This is not needed to run or install R programs but only if you want to access the rtools for other purposes. @@ -162,7 +162,7 @@ Changes in version 0.4-0 by Dieter Menne. Changes in version 0.3-2 - + o sweave.bat now uses Rterm.bat rather than Rcmd.bat which makes it usable with a basic R installation (i.e. sh.exe not needed). Previously it required Rcmd.bat but now it requires Rterm.bat instead. @@ -173,7 +173,7 @@ Changes in Version 0.3-1 o new find-miktex.bat which lists the mixktex folders from the registry - o new Rscript.bat which allows one to use the Rscript facility in + o new Rscript.bat which allows one to use the Rscript facility in R 2.5.0 and later without changing pathnames. Just place Rscript.bat in any existing path and it will automatically find the current version of R from the registry and run the Rscript.exe that @@ -182,24 +182,24 @@ Changes in Version 0.3-1 o runR.bat. If you have an R script such as myfile.R then you can create a batch script for it by copying runR.bat to myfile.bat. Then when you issue the command myfile or myfile.bat it will run the R script in - myfile.R . Just place myfile.bat and myfile.R anywhere in your path. + myfile.R . Just place myfile.bat and myfile.R anywhere in your path. This uses Rscript.bat . o #Rscript. If you have an Rscript called myfile.R, say, then if you - copy the script to myfile.bat and place - #Rscript %0 %* + copy the script to myfile.bat and place + #Rscript %0 %* as the first line with the remainder being the R commands then issuing the command myfile or myfile.bat will run the R script. The advantage over the runR.bat method is that there is only one file, myfile.bat. - You don't need myfile.R anymore. The disadvantage is that it will - echo the #Rscript line to stdout. This will be fixed if and when - Rscript ever gets the perl/python/ruby -x flag. (The runR approach will - not echo additional lines but does require two files.) + You don't need myfile.R anymore. The disadvantage is that it will + echo the #Rscript line to stdout. This will be fixed if and when + Rscript ever gets the perl/python/ruby -x flag. (The runR approach will + not echo additional lines but does require two files.) o new Rtidy.bat is a sample Rscript that uses the #Rscript facility based on George Georgalis' UNIX code - o withgs.bat now checks for latest ghostscript version. (Previously + o withgs.bat now checks for latest ghostscript version. (Previously version was hard coded and it only worked for that version.) Changes in Version 0.3-0 @@ -211,13 +211,13 @@ Changes in Version 0.3-0 o new --tex, --pdf, --nobck.pdf switches are available on sweave. Also expanded help when entering sweave without args. - + Changes in Version 0.2-9 o updated README and other documentation files and inline documentation o added sweave.bat - + o new google code home page and svn repository http://code.google.com/p/batchfiles/ @@ -244,7 +244,7 @@ Changes in Version 0.2-6 o Rrefresh.bat has been removed (after having been deprecated in in previous versions of batchfiles). - o tested movedir.bat by using it to upgrade R-2.2.0pat to R-2.2.1. + o tested movedir.bat by using it to upgrade R-2.2.0pat to R-2.2.1. See instructions in README. Changes in Version 0.2-5 @@ -261,27 +261,27 @@ Changes in Version 0.2-3 R to another. (This is a temporary solution until R provides facilities for upgrading the libraries, expected in R 2.3.0 .) See README for usage. - + o eliminated all code associated with reading and manipulation of R_ENVIRON, R_PROFILE and R_LIBS simplifying the batch files. Use copydir.bat instead. - o Rversions.hta is a javascript GUI version of Rversions.bat + o Rversions.hta is a javascript GUI version of Rversions.bat Changes in Version 0.2-2 o added jgr.bat which starts up the JGR GUI. - o added Rversions.bat which can list the directories of all R versions + o added Rversions.bat which can list the directories of all R versions available and can set one to become the current R version. - o all batch scripts which used the environment variable name Rrw now + o all batch scripts which used the environment variable name Rrw now use the environment variable name R_HOME instead. - o Rcmd.bat, Rgui.bat, R.bat, jgr.bat files will now read R_ENVIRON, + o Rcmd.bat, Rgui.bat, R.bat, jgr.bat files will now read R_ENVIRON, if present, and set the R_LIBS definition in it, if present (unless R_LIBS is already defined as an environment variable). All R_ENVIRON - file syntax accepted by R is supported including comments (#), + file syntax accepted by R is supported including comments (#), var=value, var=${foo-bar} and recursions, var=${A-${B-C}}. o makepkg.bat internals were simplified due to previous point. @@ -290,7 +290,7 @@ Changes in Version 0.2-2 o updated THANKS. - o updated README. More introductory information. Also instructions + o updated README. More introductory information. Also instructions for Rgui shortcut will disable screen flash on startup. Corrections. Changes in Version 0.2-1 @@ -300,18 +300,18 @@ Changes in Version 0.2-1 Changes in Version 0.2-0 o can now support configurations without *.site files (as well as - configurations with *.site files) thereby reducing the minimum - configuration even further. + configurations with *.site files) thereby reducing the minimum + configuration even further. o Rcmd.bat, Rgui.bat and R.bat now temporarily set R_ENVIRON, - R_PROFILE and R_LIBS as needed so that it is no longer necessary to + R_PROFILE and R_LIBS as needed so that it is no longer necessary to copy the *.site files into the etc directory eliminating all reconfiguration when upgrading to a new version of R (except for refreshing MiKTeX). o new command miktex-refresh.bat is used to refresh MiKTeX after a new version of R is installed. Previously this was done in - Rrefresh.bat which is now deprecated. Rrefresh.bat is no longer + Rrefresh.bat which is now deprecated. Rrefresh.bat is no longer needed (unless you want each R version to have its own *.site files). o new NEWS, WISHLIST and RESOURCES files. diff --git a/mswindows/external/rbatch/R.bat b/mswindows/external/rbatch/R.bat index fd28421d126..684cc912a85 100644 --- a/mswindows/external/rbatch/R.bat +++ b/mswindows/external/rbatch/R.bat @@ -1,589 +1,589 @@ -@Echo OFF - -:: Software and documentation is (c) 2013 GKX Associates Inc. and -:: licensed under [GPL 2.0](https://www.gnu.org/licenses/gpl-2.0.html). - -:: Help is at bottom of script or just run script with single argument: help - -:: can optionally uncomment and change these to force certain values. This -:: is normally unnecessary. Rather one can usually rely on the heuristics to -:: set them. -:: set R_CMD=R -:: set R_HOME=%ProgramFiles%\R\R-2.14.0 -:: set R_ARCH=64 -:: set R_MIKTEX_PATH=%ProgramFiles%\MiKTeX 2.9\miktex\bin -:: set R_TOOLS=C:\Rtools -:: set MYSQL_HOME=%ProgramFiles%\MySQL\MysQL Server 5.1 - -:: 1 means read registry and 0 means ignore registry -if not defined R_REGISTRY set R_REGISTRY=1 -set CYGWIN=nodosfilewarning - -SetLocal EnableExtensions EnableDelayedExpansion - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: R_CMD -:: 1. if 1st arg is CMD then set R_CMD to R -:: 2. else if 1st arg is Rshow, Rpath, Rgui, Rcmd, R or Rscript set R_CMD to it -:: and remove it from args -:: 3. else use R_CMD if set -:: 4. else use %0 -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -set args=%* -set cmd= -if /i "%~1"=="registry" goto:Rregistry -if /i "%~1"=="cd" set cmd=Rcd -if /i "%~1"=="CMD" set cmd=Rcmd -if /i "%~1"=="dir" set cmd=Rdir -if /i "%~1"=="ls" set cmd=Rdir -if /i "%~1"=="gui" set cmd=Rgui -if /i "%~1"=="help" goto:Rhelp -if /i "%~1"=="path" set cmd=Rpath -if /i "%~1"=="R" set cmd=R -if /i "%~1"=="script" set cmd=Rscript -if /i "%~1"=="show" set cmd=RShow -if /i "%~1"=="SetReg" set cmd=RSetReg -if /i "%~1"=="tools" set cmd=Rtools -if /i "%~1"=="touch" set cmd=Rtouch - -if "%cmd%"=="" goto:R_CMD_cont -if "%2"=="" (set args=) && goto:R_CMD_cont -set args=xxx%* -call set args=%%args:xxx%1=%% -:R_CMD_cont -if defined cmd set R_CMD=%cmd% -if not defined R_CMD set R_CMD=%0 -:: set "R_CMD=%R_CMD:.bat=%" -for %%i in ("%R_CMD%") do set R_CMD=%%~ni -if /i "%R_CMD%"=="#Rscript" set R_CMD=Rscript -rem echo R_CMD:%R_CMD% args=[%args%] - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: 1. If .\Rgui.exe exist use implied R_PATH and skip remaining points. -:: 2. If .\{x64,i386}\Rgui.exe or .\bin\{x64,i386}\Rgui.exe exists use implied R_HOME. -:: 3. if R_HOME defined then derive any of R_ROOT and R_VER that -:: are not already defined. -:: 4. if R_PATH defined then derive any of R_ROOT, R_HOME, R_VER and R_ARCH that -:: are not already defined. -:: 4a. If R_REGISTRY=1 and R found in registry derive any of R_HOME, R_ROOT and -:: R_VER that are not already defined. -:: 5. If R_ROOT not defined try %ProgramFiles%\R\*, %ProgramFiles(x86)%\R\* -:: and then %SystemRoot%\R else error -:: 6. If R_VER not defined use last directory in cd %R_ROOT% & dir /od -:: 7. if R_ARCH not defined try %R_ROOT%\%R_VER%\bin\x64\Rgui.exe and then -:: %R_ROOT%\%R_VER%\bin\i386\Rgui.exe -:: 8. If R_ROOT, R_VER and R_ARCH defined skip remaining points. -:: 9. If Rgui.exe found on PATH use implied R_PATH. -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: 1 -if exist Rgui.exe ( - pushd ..\.. - set R_HOME=!CD! - popd - goto:R_exe_end -) - -:: 2 -if exist x64\Rgui.exe ( - pushd .. - set R_PATH=!CD!\bin\x64 - popd - goto:R_exe_end -) -if exist i386\Rgui.exe ( - pushd .. - set R_PATH=!CD!\bin\i386 - popd - goto:R_exe_end -) -if exist bin\x64\Rgui.exe set R_PATH=%CD%\bin\x64 & goto:R_exe_end -if exist bin\i386\Rgui.exe set R_PATH=%CD%\bin\i386 -:R_exe_end - -:: 3 - -if defined R_HOME ( - pushd - cd %R_HOME% - if not defined R_VER for /f "delims=" %%a in ("!CD!") do set R_VER=%%~na - cd .. - if not defined R_ROOT set R_ROOT=!CD! - popd -) - -:: 4 -if defined R_PATH ( - pushd - cd %R_PATH% - if not defined R_ARCH for /f "delims=" %%a in ("!CD!") do set R_ARCH=%%~na - cd ..\.. - if not defined R_HOME set R_HOME=!CD! - if not defined R_VER for /f "delims=" %%a in ("!CD!") do set R_VER=%%~na - cd .. - if not defined R_ROOT set R_ROOT=!CD! - popd -) - - -:: 4a - -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 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 defined R_HOME ( - if not defined R_ROOT ( - pushd %R_HOME% - cd .. - set R_ROOT=!CD! - popd - ) - if not defined R_VER ( - for /f "delims=" %%a in ("%R_HOME%") do set R_VER=%%~nxa - ) -) - - -:: 5 - -if defined R_ROOT goto:R_ROOT_end -if exist "%ProgramFiles%\R" set R_ROOT=%ProgramFiles%\R -if defined R_ROOT goto:R_ROOT_end -if exist %SystemDrive%\R set R_ROOT=%SystemDrive%\R -:R_ROOT_end - -:: 6 -if defined R_VER goto:R_VER_end -for /f "delims=" %%a in ( - 'dir /b /od /ad "%R_ROOT%" 2^>NUL' -) do set R_VER=%%a -:R_VER_end - -:: do we need this? -if defined R_ROOT if defined R_VER set R_HOME=%R_ROOT%\%R_VER% - -:: 7 -if defined R_ARCH goto:R_ARCH_cont -set R_ARCH=i386 -if exist "%R_HOME%\bin\x64" set R_ARCH=x64 -if exist "%R_ROOT%\%R_VER%\bin\x64" set R_ARCH=x64 -:R_ARCH_cont -if "%R_ARCH%"=="64" set R_ARCH=x64 -if "%R_ARCH%"=="32" set R_ARCH=i386 -if "%R_ARCH%"=="386" set R_ARCH=i386 - -:: 8 -if not defined R_ROOT goto:where -if not defined R_VER goto:where -if not defined R_ARCH goto:where -set R_PATH=%R_ROOT%\%R_VER%\bin\%R_ARCH% -goto:path_end - -echo "R not found" & exit /b 1 - -:: 9 -:where -where Rgui.exe 1>NUL 2>NUL -if not errorlevel 1 for /f "delims=" %%a in ('where Rgui.exe') do set R_PATH=%%~pa - -:path_end - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: R_TOOLS -:: 1. use R_TOOLS if defined. If not -:: 2. check if ls.exe, rsync.exe and gcc.exe are on PATH. If not -:: 3. check if Rtools found in registry. If not -:: 4. check if C:\Rtools exists. If not -:: 5. R_TOOLS not found. -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -if defined R_TOOLS goto:RtoolsEnd - -where ls.exe 1> NUL 2> NUL -if errorlevel 1 goto:RtoolsNotOnPATH - -where rsync.exe 1> NUL 2> NUL -if errorlevel 1 goto:RtoolsNotOnPATH - -where gcc.exe 1> NUL 2> NUL -if errorlevel 1 goto:RtoolsNotOnPATH - -for /f "delims=" %%a in ('where rsync.exe') do set R_TOOLS=%%~pa -pushd %R_TOOLS% -cd .. -set R_TOOLS=%CD% -popd -goto:RtoolsEnd - -:RtoolsNotOnPATH - -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 - -if exist "C:\Rtools" set R_TOOLS=C:\Rtools - -:RToolsEnd - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: R_TOOLS_PATH -:: Extract path from: %R_TOOLS%\unins000.dat -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -if defined R_TOOLS call :extract_string {app} %R_TOOLS%\unins000.dat -call set R_TOOLS_PATH=%%final:{app}=%R_TOOLS%%% -call :trimPath:R_TOOLS_PATH - -if defined R_TOOLS for /f "tokens=3" %%a in (%R_TOOLS%\Version.txt) do set R_TOOLS_VERSION=%%a - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: R_MIKTEX -:: If R_MIKTEX defined use that -:: else if pdflatex.exe on PATH use that else -:: check %ProgramFiles%\miktex* else -:: check %ProgramFiles(x86)%\miktex* else -:: check %SystemDrive%\miktex* -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -if defined R_MIKTEX_PATH goto:miktex_end - -:: if pdflatex.exe found in PATH use implied path -where pdflatex.exe 1>NUL 2>NUL -if errorlevel 1 goto:miktex_continue -set MIKTEX_ALREADY_ON_PATH=1 -for /f "delims=" %%a in ('where pdflatex.exe') do set R_MIKTEX_PATH=%%~pa -:: remove trailing \, if any -IF "%R_MIKTEX_PATH:~-1%"=="\" SET R_MIKTEX_PATH=%R_MIKTEX_PATH:~0,-1% - -goto:miktex_end - -:miktex_continue -if not defined R_MIKTEX_PATH for /f "delims=" %%a in ( - 'dir /b /on "%ProgramFiles%"\miktex* 2^>NUL' -) do set R_MIKTEX_PATH=%ProgramFiles%\%%a\miktex\bin - -if not defined R_MIKTEX_PATH for /f "delims=" %%a in ( - 'dir /b /on "%ProgramFiles(x86)%"\miktex* 2^>NUL' -) do set R_MIKTEX_PATH=%ProgramFiles%\%%a\miktex\bin - -if not defined R_MIKTEX_PATH for /f "delims=" %%a in ( - 'dir /b /on %SystemDrive%:\miktex* 2^>NUL' -) do set R_MIKTEX_PATH=%SystemDrive%:\%%a\mixtex\bin - -:miktex_end - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: MySQL -:: If MYSQL_HOME defined use that else -:: check %ProgramFiles%\MySQL\* else -:: check %SystemDrive%:\MySQL\* -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:: 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 MYSQL_HOME for /f "delims=" %%a in ( -:: 'dir /b /on %SystemDrive%:\MySQL* 2^>NUL' -:: ) do set R_MIKTEX=%SystemDrive%:\MySQL\%%a - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: get name by which program was called - $0 -:: or use R_CMD environment variable if that was defined (mainly for testing) -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -if not defined R_CMD (set R_CMD=%0) -for %%i in ("%R_CMD%") do set R_CMD=%%~ni -if /i "%R_CMD%"=="dir" goto:Rdir -if /i "%R_CMD%"=="cd" goto:Rcd -if /i "%R_CMD%"=="touch" goto:Rtouch -if /i "%R_CMD%"=="Rversions" goto:RSetReg - -:: add MiKTeX to PATH if not already on it -if not defined R_MIKTEX_PATH goto :miktex_add_path_end -echo %PATH% | findstr /i miktex 1>NUL 2>NUL -if errorlevel 1 path %R_MIKTEX_PATH%;%PATH% -:miktex_add_path_end - -:: add Rtools paths to PATH if not already on it -if not defined R_TOOLS_PATH goto :Rtools_add_path_end -echo %PATH% | findstr /i Rtools 1>NUL 2>NUL -if errorlevel 1 path %R_TOOLS_PATH%;%PATH% -:Rtools_add_path_end - -if /i "%R_CMD%"=="Rpath" goto:Rpath -if /i "%R_CMD%"=="Rtools" goto:Rtools -if /i "%R_CMD%"=="Rcd" goto:Rcd -if /i "%R_CMD%"=="Rdir" goto:Rdir -if /i "%R_CMD%"=="Rshow" goto:Rshow -if /i "%R_CMD%"=="Rtouch" goto:Rtouch -if /i "%R_CMD%"=="RSetReg" goto:RSetReg - - -if /i not "%R_CMD%"=="Rgui" goto:notRgui -start "Rgui.exe" "%R_PATH%\Rgui.exe" %args% -goto:eof - -:notRgui -"%R_PATH%\%R_CMD%.exe" %args% - -goto:eof - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: output the set statements -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:Rshow - -if defined R_PATH ( - set old=%CD% - cd %R_PATH% - for /f "delims=" %%a in ("!CD!") do set R_ARCH=%%~nxa - cd ..\.. - set R_HOME=!CD! - for /f "delims=" %%a in ("!CD!") do set R_VER=%%~nxa - cd .. - set R_ROOT=!CD! - cd !old! -) - -:: echo set R_PATH=%R_PATH% -:: echo set R_HOME=%R_HOME% -:: echo set R_ROOT=%R_ROOT% -:; echo set R_VER=%R_VER% -:: echo set R_ARCH=%R_ARCH% -:: echo set R_TOOLS=%R_TOOLS% -:: echo set R_TOOLS_PATH=%R_TOOLS_PATH% -:: :: echo set MYSQL_HOME=%MYSQL_HOME% -::echo set R_MIKTEX_PATH=%R_MIKTEX_PATH% -set R -goto:eof - -:Rcd -endlocal & cd %R_ROOT% -goto:eof - -:Rdir -dir/od "%R_ROOT%" -goto:eof - -:RSetReg -cd %R_PATH% -RSetReg %args% -goto:eof - -:: if not XP then check if running with Admin privs. If not give msg and exit. -:Rtouch -ver | findstr XP >NUL -if not errorlevel 1 goto:Rtouch_next -if not exist "%ProgramFiles%\R" goto:Rtouch_next -reg query "HKU\S-1-5-19" >NUL 2>&1 && ( goto Rtouch_next ) || ( - echo Please run this as Administator. - goto :eof -) -:Rtouch_next - -if not defined R_HOME set R_HOME=%R_ROOT%\%R_VER% -pushd %R_HOME% -echo > dummy.txt -del dummy.txt -popd -goto:eof - - - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: set path -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:Rpath -endlocal & PATH %PATH%;%R_PATH% -goto:eof - -:Rtools -endlocal & PATH %PATH% -goto:eof - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: list R versions -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:Rversions -if defined args goto:Rversions_cont -pushd %R_HOME% -cd .. -echo R packages found. Most recent (last listed) is default: -for /f "delims=" %%a in ('dir/b /od') do echo %%~fa -popd -goto:eof -:Rversions_cont -set args=###%args% -set args=%args:### =% -set args=%args:###=% -pushd %R_HOME% -cd .. -(for /f "delims=" %%a in ('dir /b /od') do echo %%~fa) | findstr /L /C:"%args%" 1>NUL 2>NUL -if errorlevel 1 echo %args% not found & goto:eof -echo Run the following command (may need an elevated cmd window): -for /f "delims=" %%a in ('dir /b /on ^| findstr /L /C:"%args%"') do @echo echo ^> "%%~fa\dummy.txt" /Y -popd -goto:eof - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: list registry entries -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:Rregistry -reg query hklm\software\R-core\R /v InstallPath 2>NUL | findstr InstallPath -reg query hklm\software\wow6432Node\r-core\r /v InstallPath 2>NUL | findstr InstallPath - -goto:eof - -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: -:: -:: Extract text from file: -:: %1 = input string that starts text -:: %2 = input file -:: final = output variable holding text from and including %1 until -:: binary data encountered -:: -:: Needs: SetLocal EnableExtensions EnableDelayedExpansion -:: -:: Example: -:: call :extract_string {app} C:\Rtools\unins000.dat -:: echo %final% -:: where {app} is the string that starts extraction and -:: C:\Rtoolsiunins000.dat is the file -:: -:: Based on code by Frank Westlake, https://github.com/FrankWestlake -:: -::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - - :extract_string - - SetLocal EnableExtensions EnableDelayedExpansion - - Set "string=%1" - Set "file=%2" - - For /F "delims=" %%a in ( - 'findstr /C:"%string%" "%file%"^|MORE' - ) Do ( - Set "$=%%~a" - If /I "!$:~0,5!" EQU "%string%" ( - Set $=!$:;=" "! - For %%b in ("!$!") Do ( - Set "#=%%~b" - If "!#:~0,5!" EQU "%string%" ( - CALL :work "!#!" - ) - ) - ) - ) - endlocal & set final=%final% - Goto :EOF - :work - set final=%final%!#!; - Goto :EOF - - :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - :trimPath: [segment to add] - :: Eliminates redundant path segments from the variable and - :: optionally adds new segmants. - :: Example: CALL :trimPath:PATH - :: Example: CALL :trimPath:PATH "C:\A & B" C:\a\b\c - :: - :: Note that only a colon separates the subroutine name and - :: the name of the variable to be edited. - :: - Frank Westlake, https://github.com/FrankWestlake - SetLocal EnableExtensions EnableDelayedExpansion - For /F "tokens=2 delims=:" %%a in ("%0") Do ( - For %%a in (%* !%%a!) Do ( - Set "#=%%~a" - For %%b in (!new!) Do If /I "!#!" EQU "%%~b" Set "#=" - If DEFINED # ( - If DEFINED new (Set "new=!new!;!#!") Else ( Set "new=!#!") - ) - ) - ) - EndLocal & For /F "tokens=2 delims=:" %%a in ("%0") Do Set "%%a=%new%" - Goto :EOF - -:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: - -:Rhelp - -echo (c) 2013 G. Grothendieck -echo License: GPL 2.0 ( https://www.gnu.org/licenses/gpl-2.0.html ) -echo Launch script for R and associated functions. -echo Usage: R.bat [subcommand] [arguments] -echo Subcommands where (0) means takes no arguments; (A) means may need Admin priv -echo cd - cd to R_ROOT, typically to C:\Program Files\R (0) -echo cmd - Run Rcmd.exe -echo dir - List contents of R_ROOT in chronological order showing R versions (0) -echo gui - Run Rgui.exe -echo help - Help info (0) -echo path - Add R_TOOLS, R_MIKTEX ^& R_PATH to path for this cmd line session (0) -echo R - Run R.exe (0) -echo script - Run Rscript.exe -echo show - Show R_ variable values used. R_PATH, etc. (0) -echo SetReg - Run RSetReg; see 2.17 in R FAQ for Windows (A) -echo tools - Add R_TOOLS and R_MIKTEX to path for this cmd line session (0) -echo touch - Change date on R_HOME to now (0) (A) -echo Examples -echo R -- invoke R.exe R gui -- invoke Rgui.exe -echo R dir -- show R versions R show -- show R_ variables -echo R CMD build mypkg -- builds mypkg -echo cmd /c set R_VER=R-2.14.0 ^& R gui -- run indicated Rgui version -echo cmd /c set R_ARCH=32 ^^^& R gui -- run 32 bit Rgui -echo cmd /c R_VER=R-2.14.0 ^^^& R setreg - make 2.14.0 current in registry -echo cmd /c R_VER=R-2.14.0 ^^^& R.bat touch - change date on R-2.14.0 dir to now -goto:eof -echo. -echo Run Rgui using a different version of R. R_HOME only affects R session -echo but not cmd line session. -echo cmd /c set R_HOME=%ProgramFiles%\R\R-2.14.0 ^& R gui -echo -echo Launch a new cmd line window in which R_HOME is as set and launch R: -echo start set R_HOME=%ProgramFiles%\R\R-2.14.0 ^& R gui -echo -echo ==Customization by renaming== -echo. -echo If the optional first argument is missing then it uses the value of -echo the environment variable R_CMD or if that is not set it uses the name of -echo the script file as the default first argument. The idea is one could have -echo multiple versions of the script called R.bat, Rgui.bat, etc. which invoke -echo the corresponding functionality without having to specify first argument. -echo. -echo ==Customization by setting environment variables at top of script== -echo. -echo It can be customized by setting any of R_CMD, R_HOME, R_ARCH, -echo R_MIKTEX_PATH, R_TOOLS after the @echo off command at the top of the -echo script. R_CMD will be used as the default first argument (instead of the -echo script name). -echo. -echo e.g. use the following after @echo off to force 32-bit -echo set R_ARCH=32 -echo. -echo e.g. use the following after @echo off to force a particular version of -echo R to be used -echo set R_HOME=%ProgramFiles%\R\R-2.14.0 -echo. -echo e.g. use the following after @echo off to change the default command to -echo Rgui even if the script is called myRgui.bat, say: -echo set R_CMD=Rgui -echo. -echo ==Installation== -echo. -echo The script is self contained so just place it anywhere on your Windows -echo PATH. (From the Windows cmd line the command PATH shows your current -echo Windows path.) You may optionally make copies of this script with names -echo like R.bat, Rscript.bat, Rcmd.bat so that each has a different default. -echo. - +@Echo OFF + +:: Software and documentation is (c) 2013 GKX Associates Inc. and +:: licensed under [GPL 2.0](https://www.gnu.org/licenses/gpl-2.0.html). + +:: Help is at bottom of script or just run script with single argument: help + +:: can optionally uncomment and change these to force certain values. This +:: is normally unnecessary. Rather one can usually rely on the heuristics to +:: set them. +:: set R_CMD=R +:: set R_HOME=%ProgramFiles%\R\R-2.14.0 +:: set R_ARCH=64 +:: set R_MIKTEX_PATH=%ProgramFiles%\MiKTeX 2.9\miktex\bin +:: set R_TOOLS=C:\Rtools +:: set MYSQL_HOME=%ProgramFiles%\MySQL\MysQL Server 5.1 + +:: 1 means read registry and 0 means ignore registry +if not defined R_REGISTRY set R_REGISTRY=1 +set CYGWIN=nodosfilewarning + +SetLocal EnableExtensions EnableDelayedExpansion + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: R_CMD +:: 1. if 1st arg is CMD then set R_CMD to R +:: 2. else if 1st arg is Rshow, Rpath, Rgui, Rcmd, R or Rscript set R_CMD to it +:: and remove it from args +:: 3. else use R_CMD if set +:: 4. else use %0 +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +set args=%* +set cmd= +if /i "%~1"=="registry" goto:Rregistry +if /i "%~1"=="cd" set cmd=Rcd +if /i "%~1"=="CMD" set cmd=Rcmd +if /i "%~1"=="dir" set cmd=Rdir +if /i "%~1"=="ls" set cmd=Rdir +if /i "%~1"=="gui" set cmd=Rgui +if /i "%~1"=="help" goto:Rhelp +if /i "%~1"=="path" set cmd=Rpath +if /i "%~1"=="R" set cmd=R +if /i "%~1"=="script" set cmd=Rscript +if /i "%~1"=="show" set cmd=RShow +if /i "%~1"=="SetReg" set cmd=RSetReg +if /i "%~1"=="tools" set cmd=Rtools +if /i "%~1"=="touch" set cmd=Rtouch + +if "%cmd%"=="" goto:R_CMD_cont +if "%2"=="" (set args=) && goto:R_CMD_cont +set args=xxx%* +call set args=%%args:xxx%1=%% +:R_CMD_cont +if defined cmd set R_CMD=%cmd% +if not defined R_CMD set R_CMD=%0 +:: set "R_CMD=%R_CMD:.bat=%" +for %%i in ("%R_CMD%") do set R_CMD=%%~ni +if /i "%R_CMD%"=="#Rscript" set R_CMD=Rscript +rem echo R_CMD:%R_CMD% args=[%args%] + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: 1. If .\Rgui.exe exist use implied R_PATH and skip remaining points. +:: 2. If .\{x64,i386}\Rgui.exe or .\bin\{x64,i386}\Rgui.exe exists use implied R_HOME. +:: 3. if R_HOME defined then derive any of R_ROOT and R_VER that +:: are not already defined. +:: 4. if R_PATH defined then derive any of R_ROOT, R_HOME, R_VER and R_ARCH that +:: are not already defined. +:: 4a. If R_REGISTRY=1 and R found in registry derive any of R_HOME, R_ROOT and +:: R_VER that are not already defined. +:: 5. If R_ROOT not defined try %ProgramFiles%\R\*, %ProgramFiles(x86)%\R\* +:: and then %SystemRoot%\R else error +:: 6. If R_VER not defined use last directory in cd %R_ROOT% & dir /od +:: 7. if R_ARCH not defined try %R_ROOT%\%R_VER%\bin\x64\Rgui.exe and then +:: %R_ROOT%\%R_VER%\bin\i386\Rgui.exe +:: 8. If R_ROOT, R_VER and R_ARCH defined skip remaining points. +:: 9. If Rgui.exe found on PATH use implied R_PATH. +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +:: 1 +if exist Rgui.exe ( + pushd ..\.. + set R_HOME=!CD! + popd + goto:R_exe_end +) + +:: 2 +if exist x64\Rgui.exe ( + pushd .. + set R_PATH=!CD!\bin\x64 + popd + goto:R_exe_end +) +if exist i386\Rgui.exe ( + pushd .. + set R_PATH=!CD!\bin\i386 + popd + goto:R_exe_end +) +if exist bin\x64\Rgui.exe set R_PATH=%CD%\bin\x64 & goto:R_exe_end +if exist bin\i386\Rgui.exe set R_PATH=%CD%\bin\i386 +:R_exe_end + +:: 3 + +if defined R_HOME ( + pushd + cd %R_HOME% + if not defined R_VER for /f "delims=" %%a in ("!CD!") do set R_VER=%%~na + cd .. + if not defined R_ROOT set R_ROOT=!CD! + popd +) + +:: 4 +if defined R_PATH ( + pushd + cd %R_PATH% + if not defined R_ARCH for /f "delims=" %%a in ("!CD!") do set R_ARCH=%%~na + cd ..\.. + if not defined R_HOME set R_HOME=!CD! + if not defined R_VER for /f "delims=" %%a in ("!CD!") do set R_VER=%%~na + cd .. + if not defined R_ROOT set R_ROOT=!CD! + popd +) + + +:: 4a + +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 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 defined R_HOME ( + if not defined R_ROOT ( + pushd %R_HOME% + cd .. + set R_ROOT=!CD! + popd + ) + if not defined R_VER ( + for /f "delims=" %%a in ("%R_HOME%") do set R_VER=%%~nxa + ) +) + + +:: 5 + +if defined R_ROOT goto:R_ROOT_end +if exist "%ProgramFiles%\R" set R_ROOT=%ProgramFiles%\R +if defined R_ROOT goto:R_ROOT_end +if exist %SystemDrive%\R set R_ROOT=%SystemDrive%\R +:R_ROOT_end + +:: 6 +if defined R_VER goto:R_VER_end +for /f "delims=" %%a in ( + 'dir /b /od /ad "%R_ROOT%" 2^>NUL' +) do set R_VER=%%a +:R_VER_end + +:: do we need this? +if defined R_ROOT if defined R_VER set R_HOME=%R_ROOT%\%R_VER% + +:: 7 +if defined R_ARCH goto:R_ARCH_cont +set R_ARCH=i386 +if exist "%R_HOME%\bin\x64" set R_ARCH=x64 +if exist "%R_ROOT%\%R_VER%\bin\x64" set R_ARCH=x64 +:R_ARCH_cont +if "%R_ARCH%"=="64" set R_ARCH=x64 +if "%R_ARCH%"=="32" set R_ARCH=i386 +if "%R_ARCH%"=="386" set R_ARCH=i386 + +:: 8 +if not defined R_ROOT goto:where +if not defined R_VER goto:where +if not defined R_ARCH goto:where +set R_PATH=%R_ROOT%\%R_VER%\bin\%R_ARCH% +goto:path_end + +echo "R not found" & exit /b 1 + +:: 9 +:where +where Rgui.exe 1>NUL 2>NUL +if not errorlevel 1 for /f "delims=" %%a in ('where Rgui.exe') do set R_PATH=%%~pa + +:path_end + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: R_TOOLS +:: 1. use R_TOOLS if defined. If not +:: 2. check if ls.exe, rsync.exe and gcc.exe are on PATH. If not +:: 3. check if Rtools found in registry. If not +:: 4. check if C:\Rtools exists. If not +:: 5. R_TOOLS not found. +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +if defined R_TOOLS goto:RtoolsEnd + +where ls.exe 1> NUL 2> NUL +if errorlevel 1 goto:RtoolsNotOnPATH + +where rsync.exe 1> NUL 2> NUL +if errorlevel 1 goto:RtoolsNotOnPATH + +where gcc.exe 1> NUL 2> NUL +if errorlevel 1 goto:RtoolsNotOnPATH + +for /f "delims=" %%a in ('where rsync.exe') do set R_TOOLS=%%~pa +pushd %R_TOOLS% +cd .. +set R_TOOLS=%CD% +popd +goto:RtoolsEnd + +:RtoolsNotOnPATH + +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 + +if exist "C:\Rtools" set R_TOOLS=C:\Rtools + +:RToolsEnd + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: R_TOOLS_PATH +:: Extract path from: %R_TOOLS%\unins000.dat +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +if defined R_TOOLS call :extract_string {app} %R_TOOLS%\unins000.dat +call set R_TOOLS_PATH=%%final:{app}=%R_TOOLS%%% +call :trimPath:R_TOOLS_PATH + +if defined R_TOOLS for /f "tokens=3" %%a in (%R_TOOLS%\Version.txt) do set R_TOOLS_VERSION=%%a + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: R_MIKTEX +:: If R_MIKTEX defined use that +:: else if pdflatex.exe on PATH use that else +:: check %ProgramFiles%\miktex* else +:: check %ProgramFiles(x86)%\miktex* else +:: check %SystemDrive%\miktex* +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +if defined R_MIKTEX_PATH goto:miktex_end + +:: if pdflatex.exe found in PATH use implied path +where pdflatex.exe 1>NUL 2>NUL +if errorlevel 1 goto:miktex_continue +set MIKTEX_ALREADY_ON_PATH=1 +for /f "delims=" %%a in ('where pdflatex.exe') do set R_MIKTEX_PATH=%%~pa +:: remove trailing \, if any +IF "%R_MIKTEX_PATH:~-1%"=="\" SET R_MIKTEX_PATH=%R_MIKTEX_PATH:~0,-1% + +goto:miktex_end + +:miktex_continue +if not defined R_MIKTEX_PATH for /f "delims=" %%a in ( + 'dir /b /on "%ProgramFiles%"\miktex* 2^>NUL' +) do set R_MIKTEX_PATH=%ProgramFiles%\%%a\miktex\bin + +if not defined R_MIKTEX_PATH for /f "delims=" %%a in ( + 'dir /b /on "%ProgramFiles(x86)%"\miktex* 2^>NUL' +) do set R_MIKTEX_PATH=%ProgramFiles%\%%a\miktex\bin + +if not defined R_MIKTEX_PATH for /f "delims=" %%a in ( + 'dir /b /on %SystemDrive%:\miktex* 2^>NUL' +) do set R_MIKTEX_PATH=%SystemDrive%:\%%a\mixtex\bin + +:miktex_end + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: MySQL +:: If MYSQL_HOME defined use that else +:: check %ProgramFiles%\MySQL\* else +:: check %SystemDrive%:\MySQL\* +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +:: 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 MYSQL_HOME for /f "delims=" %%a in ( +:: 'dir /b /on %SystemDrive%:\MySQL* 2^>NUL' +:: ) do set R_MIKTEX=%SystemDrive%:\MySQL\%%a + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: get name by which program was called - $0 +:: or use R_CMD environment variable if that was defined (mainly for testing) +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +if not defined R_CMD (set R_CMD=%0) +for %%i in ("%R_CMD%") do set R_CMD=%%~ni +if /i "%R_CMD%"=="dir" goto:Rdir +if /i "%R_CMD%"=="cd" goto:Rcd +if /i "%R_CMD%"=="touch" goto:Rtouch +if /i "%R_CMD%"=="Rversions" goto:RSetReg + +:: add MiKTeX to PATH if not already on it +if not defined R_MIKTEX_PATH goto :miktex_add_path_end +echo %PATH% | findstr /i miktex 1>NUL 2>NUL +if errorlevel 1 path %R_MIKTEX_PATH%;%PATH% +:miktex_add_path_end + +:: add Rtools paths to PATH if not already on it +if not defined R_TOOLS_PATH goto :Rtools_add_path_end +echo %PATH% | findstr /i Rtools 1>NUL 2>NUL +if errorlevel 1 path %R_TOOLS_PATH%;%PATH% +:Rtools_add_path_end + +if /i "%R_CMD%"=="Rpath" goto:Rpath +if /i "%R_CMD%"=="Rtools" goto:Rtools +if /i "%R_CMD%"=="Rcd" goto:Rcd +if /i "%R_CMD%"=="Rdir" goto:Rdir +if /i "%R_CMD%"=="Rshow" goto:Rshow +if /i "%R_CMD%"=="Rtouch" goto:Rtouch +if /i "%R_CMD%"=="RSetReg" goto:RSetReg + + +if /i not "%R_CMD%"=="Rgui" goto:notRgui +start "Rgui.exe" "%R_PATH%\Rgui.exe" %args% +goto:eof + +:notRgui +"%R_PATH%\%R_CMD%.exe" %args% + +goto:eof + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: output the set statements +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:Rshow + +if defined R_PATH ( + set old=%CD% + cd %R_PATH% + for /f "delims=" %%a in ("!CD!") do set R_ARCH=%%~nxa + cd ..\.. + set R_HOME=!CD! + for /f "delims=" %%a in ("!CD!") do set R_VER=%%~nxa + cd .. + set R_ROOT=!CD! + cd !old! +) + +:: echo set R_PATH=%R_PATH% +:: echo set R_HOME=%R_HOME% +:: echo set R_ROOT=%R_ROOT% +:; echo set R_VER=%R_VER% +:: echo set R_ARCH=%R_ARCH% +:: echo set R_TOOLS=%R_TOOLS% +:: echo set R_TOOLS_PATH=%R_TOOLS_PATH% +:: :: echo set MYSQL_HOME=%MYSQL_HOME% +::echo set R_MIKTEX_PATH=%R_MIKTEX_PATH% +set R +goto:eof + +:Rcd +endlocal & cd %R_ROOT% +goto:eof + +:Rdir +dir/od "%R_ROOT%" +goto:eof + +:RSetReg +cd %R_PATH% +RSetReg %args% +goto:eof + +:: if not XP then check if running with Admin privs. If not give msg and exit. +:Rtouch +ver | findstr XP >NUL +if not errorlevel 1 goto:Rtouch_next +if not exist "%ProgramFiles%\R" goto:Rtouch_next +reg query "HKU\S-1-5-19" >NUL 2>&1 && ( goto Rtouch_next ) || ( + echo Please run this as Administator. + goto :eof +) +:Rtouch_next + +if not defined R_HOME set R_HOME=%R_ROOT%\%R_VER% +pushd %R_HOME% +echo > dummy.txt +del dummy.txt +popd +goto:eof + + + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: set path +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:Rpath +endlocal & PATH %PATH%;%R_PATH% +goto:eof + +:Rtools +endlocal & PATH %PATH% +goto:eof + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: list R versions +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:Rversions +if defined args goto:Rversions_cont +pushd %R_HOME% +cd .. +echo R packages found. Most recent (last listed) is default: +for /f "delims=" %%a in ('dir/b /od') do echo %%~fa +popd +goto:eof +:Rversions_cont +set args=###%args% +set args=%args:### =% +set args=%args:###=% +pushd %R_HOME% +cd .. +(for /f "delims=" %%a in ('dir /b /od') do echo %%~fa) | findstr /L /C:"%args%" 1>NUL 2>NUL +if errorlevel 1 echo %args% not found & goto:eof +echo Run the following command (may need an elevated cmd window): +for /f "delims=" %%a in ('dir /b /on ^| findstr /L /C:"%args%"') do @echo echo ^> "%%~fa\dummy.txt" /Y +popd +goto:eof + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: list registry entries +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +:Rregistry +reg query hklm\software\R-core\R /v InstallPath 2>NUL | findstr InstallPath +reg query hklm\software\wow6432Node\r-core\r /v InstallPath 2>NUL | findstr InstallPath + +goto:eof + +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Extract text from file: +:: %1 = input string that starts text +:: %2 = input file +:: final = output variable holding text from and including %1 until +:: binary data encountered +:: +:: Needs: SetLocal EnableExtensions EnableDelayedExpansion +:: +:: Example: +:: call :extract_string {app} C:\Rtools\unins000.dat +:: echo %final% +:: where {app} is the string that starts extraction and +:: C:\Rtoolsiunins000.dat is the file +:: +:: Based on code by Frank Westlake, https://github.com/FrankWestlake +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + + :extract_string + + SetLocal EnableExtensions EnableDelayedExpansion + + Set "string=%1" + Set "file=%2" + + For /F "delims=" %%a in ( + 'findstr /C:"%string%" "%file%"^|MORE' + ) Do ( + Set "$=%%~a" + If /I "!$:~0,5!" EQU "%string%" ( + Set $=!$:;=" "! + For %%b in ("!$!") Do ( + Set "#=%%~b" + If "!#:~0,5!" EQU "%string%" ( + CALL :work "!#!" + ) + ) + ) + ) + endlocal & set final=%final% + Goto :EOF + :work + set final=%final%!#!; + Goto :EOF + + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + :trimPath: [segment to add] + :: Eliminates redundant path segments from the variable and + :: optionally adds new segmants. + :: Example: CALL :trimPath:PATH + :: Example: CALL :trimPath:PATH "C:\A & B" C:\a\b\c + :: + :: Note that only a colon separates the subroutine name and + :: the name of the variable to be edited. + :: - Frank Westlake, https://github.com/FrankWestlake + SetLocal EnableExtensions EnableDelayedExpansion + For /F "tokens=2 delims=:" %%a in ("%0") Do ( + For %%a in (%* !%%a!) Do ( + Set "#=%%~a" + For %%b in (!new!) Do If /I "!#!" EQU "%%~b" Set "#=" + If DEFINED # ( + If DEFINED new (Set "new=!new!;!#!") Else ( Set "new=!#!") + ) + ) + ) + EndLocal & For /F "tokens=2 delims=:" %%a in ("%0") Do Set "%%a=%new%" + Goto :EOF + +:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +:Rhelp + +echo (c) 2013 G. Grothendieck +echo License: GPL 2.0 ( https://www.gnu.org/licenses/gpl-2.0.html ) +echo Launch script for R and associated functions. +echo Usage: R.bat [subcommand] [arguments] +echo Subcommands where (0) means takes no arguments; (A) means may need Admin priv +echo cd - cd to R_ROOT, typically to C:\Program Files\R (0) +echo cmd - Run Rcmd.exe +echo dir - List contents of R_ROOT in chronological order showing R versions (0) +echo gui - Run Rgui.exe +echo help - Help info (0) +echo path - Add R_TOOLS, R_MIKTEX ^& R_PATH to path for this cmd line session (0) +echo R - Run R.exe (0) +echo script - Run Rscript.exe +echo show - Show R_ variable values used. R_PATH, etc. (0) +echo SetReg - Run RSetReg; see 2.17 in R FAQ for Windows (A) +echo tools - Add R_TOOLS and R_MIKTEX to path for this cmd line session (0) +echo touch - Change date on R_HOME to now (0) (A) +echo Examples +echo R -- invoke R.exe R gui -- invoke Rgui.exe +echo R dir -- show R versions R show -- show R_ variables +echo R CMD build mypkg -- builds mypkg +echo cmd /c set R_VER=R-2.14.0 ^& R gui -- run indicated Rgui version +echo cmd /c set R_ARCH=32 ^^^& R gui -- run 32 bit Rgui +echo cmd /c R_VER=R-2.14.0 ^^^& R setreg - make 2.14.0 current in registry +echo cmd /c R_VER=R-2.14.0 ^^^& R.bat touch - change date on R-2.14.0 dir to now +goto:eof +echo. +echo Run Rgui using a different version of R. R_HOME only affects R session +echo but not cmd line session. +echo cmd /c set R_HOME=%ProgramFiles%\R\R-2.14.0 ^& R gui +echo +echo Launch a new cmd line window in which R_HOME is as set and launch R: +echo start set R_HOME=%ProgramFiles%\R\R-2.14.0 ^& R gui +echo +echo ==Customization by renaming== +echo. +echo If the optional first argument is missing then it uses the value of +echo the environment variable R_CMD or if that is not set it uses the name of +echo the script file as the default first argument. The idea is one could have +echo multiple versions of the script called R.bat, Rgui.bat, etc. which invoke +echo the corresponding functionality without having to specify first argument. +echo. +echo ==Customization by setting environment variables at top of script== +echo. +echo It can be customized by setting any of R_CMD, R_HOME, R_ARCH, +echo R_MIKTEX_PATH, R_TOOLS after the @echo off command at the top of the +echo script. R_CMD will be used as the default first argument (instead of the +echo script name). +echo. +echo e.g. use the following after @echo off to force 32-bit +echo set R_ARCH=32 +echo. +echo e.g. use the following after @echo off to force a particular version of +echo R to be used +echo set R_HOME=%ProgramFiles%\R\R-2.14.0 +echo. +echo e.g. use the following after @echo off to change the default command to +echo Rgui even if the script is called myRgui.bat, say: +echo set R_CMD=Rgui +echo. +echo ==Installation== +echo. +echo The script is self contained so just place it anywhere on your Windows +echo PATH. (From the Windows cmd line the command PATH shows your current +echo Windows path.) You may optionally make copies of this script with names +echo like R.bat, Rscript.bat, Rcmd.bat so that each has a different default. +echo. + diff --git a/mswindows/external/rbatch/README.grass b/mswindows/external/rbatch/README.grass index 40bc7a307a7..5566aba14d6 100644 --- a/mswindows/external/rbatch/README.grass +++ b/mswindows/external/rbatch/README.grass @@ -1,11 +1,11 @@ README.grass - written by Helmut Kudrnovsky - alectoria gmx.at -This directory contains windows batch files for installing and maintaining R, for +This directory contains windows batch files for installing and maintaining R, for an improved coupling of GRASS GIS and R (www.r-project.org) in a windows environment. -- -Files integrated from +Files integrated from svn checkout http://batchfiles.googlecode.com/svn/trunk/ diff --git a/mswindows/external/rbatch/RESOURCES b/mswindows/external/rbatch/RESOURCES index 39471b824e4..d5ac89da8af 100644 --- a/mswindows/external/rbatch/RESOURCES +++ b/mswindows/external/rbatch/RESOURCES @@ -1,7 +1,7 @@ GENERAL RESOURCES ON WINDOWS BATCH FILE PROGRAMMMING ---------------------------------------------------- -The Windows command line commands will bring up help information +The Windows command line commands will bring up help information that is particularly useful: help set @@ -18,7 +18,7 @@ Here are some links on Windows batch file programmming. http://groups-beta.google.com/group/alt.msdos.batch.nt/msg/5a9587e871c27a75 - cmd bugs - http://groups-beta.google.com/group/alt.msdos.batch/msg/7b1d22945c89af75 - cmd help resources + http://groups-beta.google.com/group/alt.msdos.batch/msg/7b1d22945c89af75 - cmd help resources http://msdn.microsoft.com/downloads/list/webdev.asp - Windows script downloads @@ -28,9 +28,9 @@ Here are some links on Windows batch file programmming. http://www.commandline.co.uk - Ritchie Lawrence cmd line utilities - http://www.cybermesa.com/~bstewart/ - Bill Stewart’s scripting tools + http://www.cybermesa.com/~bstewart/ - Bill Stewart�s scripting tools - http://www.fpschultze.de - FP Shcultze’s batch tricks + http://www.fpschultze.de - FP Shcultze�s batch tricks http://www.microsoft.com/technet/community/columns/scripts - MS TechNet scripting diff --git a/mswindows/external/rbatch/Rpathset.bat b/mswindows/external/rbatch/Rpathset.bat index 590e9a58980..64738dc49ac 100644 --- a/mswindows/external/rbatch/Rpathset.bat +++ b/mswindows/external/rbatch/Rpathset.bat @@ -1,92 +1,92 @@ -:: Software and documentation is (c) 2013 GKX Associates Inc. and -:: licensed under [GPL 2.0](https://www.gnu.org/licenses/gpl-2.0.html). - -:: Purpose: setup path to use R, Rtools and other utilities from cmd line. -:: -:: Makes no permanent system changes. Does not read or write registry. -:: Temporarily prepends to PATH and sets environment variables for current -:: Windows cmd line session only. -:: -:: Use: Run this each time you launch cmd.exe and want to use R or Rtools. -:: Can also use it like this: Rpathset Rgui -:: where Rgui may be replaced with R, Rscript, etc. -:: -:: Install: Modify set statements appropriately for your installation. -:: and then place this batch script anywhre on your existing path. -:: (The Windows commandline command PATH shows the current PATH.) -:: -:: In many cases no changes are needed at all in this file. -:: R_HOME and R_ARCH are the most likely that may need to be changed. -:: -:: Report bugs to: -:: ggrothendieck at gmail.com -:: -:: License: GPL 2.0 - -:: Go into R and issue this command: normalizePath(R.home()) -:: and use its output as the value here. If you upgrade R to another -:: version R_HOME will change. -:: R is available from: http://www.r-project.org -set R_HOME=C:\Program Files\R\R-3.1.0 - -:: 32 or 64 bit version of R. -:: (If you wish to use both versions of R make two versions of this file.) -:: set R_ARCH=i386 -set R_ARCH=x64 - -:: If in future R changes where it puts its executables then change accordingly -set R_PATH=%R_HOME%\bin\%R_ARCH% - -:: directory path where Rtools was installed. Usually best to use default -:: which is the one shown below. Note that different versions of R may -:: require different versions of Rtools. -:: Rtools is available from: http://cran.r-project.org/bin/windows/Rtools/ -set R_TOOLS=C:\Rtools - -:: If in future Rtools changes the required paths then modify accordingly. -:: To check, run the following findstr command which lists the R_TOOLS_PATH -:: (plus some garbage): -:: findstr {app} %R_TOOLS%\unins000.dat -set R_TOOLS_PATH=%R_TOOLS%\bin;%R_TOOLS%\gcc-4.6.3\bin - -:: From within R, the R_USER directory path can be viewed like this: -:: cat(normalizePath('~')) -:: It contains your personal .Rprofile, if any, and unless set otherwise -:: %R_USER%\R\win-library contains your personal R library of packages -:: (from CRAN and elsewhere). -set R_USER=%userprofile%\Documents - -:: This reduces the verbosity of certain Cygwin tools -:: (Unfortunately, it seems to have no effect on some Windows systems.) -set CYGWIN=nodosfilewarning - -:: Displays Rtools version in use -type %R_TOOLS%\version.txt - -:: MiKTeX path. Used to build R packages from source. -:: This is the directory containing pdflatex.exe -:: MiKTeX is available from http://miktex.org -set R_MIKTEX_PATH=C:\Program Files (x86)\MiKTeX 2.9\miktex\bin - -:: This is only needed when building RMySQL package from source -:: It is not needed to run RMySQL once its built. -:: set MYSQL_HOME=C:\Program Files\MySQL\MySQL Server 5.1 - -:: This is only needed to run JGR and Deducer. -:: R_LIBS is the system library. -:: If you have installed at least one package (at which point R will ask to -:: set up a personal library -- which you should allow) then R_LIBS_USER -:: is similar to output of .libPaths() with first comnponent being your -:: personal library and second component being library holding packages that -:: come with R. -:: Be sure NOT to store the packages that you downloaded from CRAN -:: in the %R_HOME%\library directory. -:: set R_LIBS=%R_USER%\R\win-library\2.15 -:: set R_LIBS_USER=%R_LIBS%;%R_HOME%\library - -:: adds directory to path for the remainder of current cmd line session -path %R_TOOLS_PATH%;%R_MIKTEX_PATH%;%PATH%;%R_PATH% - -:: if there are no arguments we are done; else run the argument -if "%1"=="" goto:eof -%* +:: Software and documentation is (c) 2013 GKX Associates Inc. and +:: licensed under [GPL 2.0](https://www.gnu.org/licenses/gpl-2.0.html). + +:: Purpose: setup path to use R, Rtools and other utilities from cmd line. +:: +:: Makes no permanent system changes. Does not read or write registry. +:: Temporarily prepends to PATH and sets environment variables for current +:: Windows cmd line session only. +:: +:: Use: Run this each time you launch cmd.exe and want to use R or Rtools. +:: Can also use it like this: Rpathset Rgui +:: where Rgui may be replaced with R, Rscript, etc. +:: +:: Install: Modify set statements appropriately for your installation. +:: and then place this batch script anywhre on your existing path. +:: (The Windows commandline command PATH shows the current PATH.) +:: +:: In many cases no changes are needed at all in this file. +:: R_HOME and R_ARCH are the most likely that may need to be changed. +:: +:: Report bugs to: +:: ggrothendieck at gmail.com +:: +:: License: GPL 2.0 + +:: Go into R and issue this command: normalizePath(R.home()) +:: and use its output as the value here. If you upgrade R to another +:: version R_HOME will change. +:: R is available from: http://www.r-project.org +set R_HOME=C:\Program Files\R\R-3.1.0 + +:: 32 or 64 bit version of R. +:: (If you wish to use both versions of R make two versions of this file.) +:: set R_ARCH=i386 +set R_ARCH=x64 + +:: If in future R changes where it puts its executables then change accordingly +set R_PATH=%R_HOME%\bin\%R_ARCH% + +:: directory path where Rtools was installed. Usually best to use default +:: which is the one shown below. Note that different versions of R may +:: require different versions of Rtools. +:: Rtools is available from: http://cran.r-project.org/bin/windows/Rtools/ +set R_TOOLS=C:\Rtools + +:: If in future Rtools changes the required paths then modify accordingly. +:: To check, run the following findstr command which lists the R_TOOLS_PATH +:: (plus some garbage): +:: findstr {app} %R_TOOLS%\unins000.dat +set R_TOOLS_PATH=%R_TOOLS%\bin;%R_TOOLS%\gcc-4.6.3\bin + +:: From within R, the R_USER directory path can be viewed like this: +:: cat(normalizePath('~')) +:: It contains your personal .Rprofile, if any, and unless set otherwise +:: %R_USER%\R\win-library contains your personal R library of packages +:: (from CRAN and elsewhere). +set R_USER=%userprofile%\Documents + +:: This reduces the verbosity of certain Cygwin tools +:: (Unfortunately, it seems to have no effect on some Windows systems.) +set CYGWIN=nodosfilewarning + +:: Displays Rtools version in use +type %R_TOOLS%\version.txt + +:: MiKTeX path. Used to build R packages from source. +:: This is the directory containing pdflatex.exe +:: MiKTeX is available from http://miktex.org +set R_MIKTEX_PATH=C:\Program Files (x86)\MiKTeX 2.9\miktex\bin + +:: This is only needed when building RMySQL package from source +:: It is not needed to run RMySQL once its built. +:: set MYSQL_HOME=C:\Program Files\MySQL\MySQL Server 5.1 + +:: This is only needed to run JGR and Deducer. +:: R_LIBS is the system library. +:: If you have installed at least one package (at which point R will ask to +:: set up a personal library -- which you should allow) then R_LIBS_USER +:: is similar to output of .libPaths() with first comnponent being your +:: personal library and second component being library holding packages that +:: come with R. +:: Be sure NOT to store the packages that you downloaded from CRAN +:: in the %R_HOME%\library directory. +:: set R_LIBS=%R_USER%\R\win-library\2.15 +:: set R_LIBS_USER=%R_LIBS%;%R_HOME%\library + +:: adds directory to path for the remainder of current cmd line session +path %R_TOOLS_PATH%;%R_MIKTEX_PATH%;%PATH%;%R_PATH% + +:: if there are no arguments we are done; else run the argument +if "%1"=="" goto:eof +%* diff --git a/mswindows/external/rbatch/batchfiles.tex b/mswindows/external/rbatch/batchfiles.tex index acfa8c6e634..87653c10b0d 100644 --- a/mswindows/external/rbatch/batchfiles.tex +++ b/mswindows/external/rbatch/batchfiles.tex @@ -275,7 +275,7 @@ \subsection{Rpathset.bat} An alternative to \begin{verbatim} -R.bat path +R.bat path \end{verbatim} is the \texttt{Rpathset.bat}. Unlike \texttt{R.bat}, @@ -300,7 +300,7 @@ \subsection{movedir.bat and copydir.bat} \begin{verbatim} cd %userprofile%\\Documents\\win-library copydir 2.15\\library 3.0\\library -R.bat gui +R.bat gui ... now enter update.packages() into R... \end{verbatim} diff --git a/mswindows/external/rbatch/copydir.bat b/mswindows/external/rbatch/copydir.bat index 9ab646e6e0c..78e7af33ebc 100644 --- a/mswindows/external/rbatch/copydir.bat +++ b/mswindows/external/rbatch/copydir.bat @@ -1,19 +1,19 @@ -@echo off -:: Software and documentation is (c) 2013 GKX Associates Inc. and -:: licensed under [GPL 2.0](https://www.gnu.org/licenses/gpl-2.0.html). -setlocal -if not "%2"=="" goto:run -echo Usage: copydir fromdir todir -echo All files/directories in fromdir that do not also exist in todir are -echo recursively copied. -echo e.g. -echo cd "%userprofile%\Documents\R\win-library" -echo copydir 2.14 2.15 -echo Now start up R 2.15.x and issue update.packages() -goto:eof -:run -:: Notes on code: -:: on xcopy command /e copies subdir/files incl empty ones -:: on xcopy command /i causes target to be created -for /D %%a in ("%~1\*") do if not exist %2\%%~na xcopy /e/i "%%a" "%~2\%%~nxa" -endlocal +@echo off +:: Software and documentation is (c) 2013 GKX Associates Inc. and +:: licensed under [GPL 2.0](https://www.gnu.org/licenses/gpl-2.0.html). +setlocal +if not "%2"=="" goto:run +echo Usage: copydir fromdir todir +echo All files/directories in fromdir that do not also exist in todir are +echo recursively copied. +echo e.g. +echo cd "%userprofile%\Documents\R\win-library" +echo copydir 2.14 2.15 +echo Now start up R 2.15.x and issue update.packages() +goto:eof +:run +:: Notes on code: +:: on xcopy command /e copies subdir/files incl empty ones +:: on xcopy command /i causes target to be created +for /D %%a in ("%~1\*") do if not exist %2\%%~na xcopy /e/i "%%a" "%~2\%%~nxa" +endlocal diff --git a/mswindows/external/rbatch/find-miktex.hta b/mswindows/external/rbatch/find-miktex.hta index 43a994fa5d9..8b7603723a2 100644 --- a/mswindows/external/rbatch/find-miktex.hta +++ b/mswindows/external/rbatch/find-miktex.hta @@ -5,7 +5,7 @@ .highlight {background:#ff00ff} .text {color:#ff00ff} .both {color:white;background:black} - + find-miktex @@ -25,7 +25,7 @@ while (true) { i++; } catch(e) {break}; } - + diff --git a/mswindows/external/rbatch/make-batchfiles-pdf.bat b/mswindows/external/rbatch/make-batchfiles-pdf.bat index 5e133489ff0..9a099d9b63d 100644 --- a/mswindows/external/rbatch/make-batchfiles-pdf.bat +++ b/mswindows/external/rbatch/make-batchfiles-pdf.bat @@ -1,6 +1,5 @@ - -:: make pdf documentation. To run: -:: 1. install pandoc from http://code.google.com/p/pandoc/downloads/list -:: 2. run this file - -pandoc batchfiles.md -o batchfiles.pdf +:: make pdf documentation. To run: +:: 1. install pandoc from http://code.google.com/p/pandoc/downloads/list +:: 2. run this file + +pandoc batchfiles.md -o batchfiles.pdf diff --git a/mswindows/external/rbatch/movedir.bat b/mswindows/external/rbatch/movedir.bat index 57fb0a7a498..64155246a17 100644 --- a/mswindows/external/rbatch/movedir.bat +++ b/mswindows/external/rbatch/movedir.bat @@ -1,16 +1,16 @@ -@echo off -:: Software and documentation is (c) 2013 GKX Associates Inc. and -:: licensed under [GPL 2.0](https://www.gnu.org/licenses/gpl-2.0.html). -setlocal -if not "%2"=="" goto:run -echo Usage: copydir fromdir todir -echo All files/directories in fromdir that do not also exist in todir are -echo recursively copied. -echo e.g. -echo cd "%userprofile%\Documents\R\win-library" -echo movedir 2.14 2.15 -echo Now start up R 2.15.x and issue update.packages() -goto:eof -:run -for /D %%a in ("%~1\*") do if not exist %2\%%~na move "%%a" "%~2\%%~nxa" -endlocal +@echo off +:: Software and documentation is (c) 2013 GKX Associates Inc. and +:: licensed under [GPL 2.0](https://www.gnu.org/licenses/gpl-2.0.html). +setlocal +if not "%2"=="" goto:run +echo Usage: copydir fromdir todir +echo All files/directories in fromdir that do not also exist in todir are +echo recursively copied. +echo e.g. +echo cd "%userprofile%\Documents\R\win-library" +echo movedir 2.14 2.15 +echo Now start up R 2.15.x and issue update.packages() +goto:eof +:run +for /D %%a in ("%~1\*") do if not exist %2\%%~na move "%%a" "%~2\%%~nxa" +endlocal diff --git a/mswindows/generic.manifest b/mswindows/generic.manifest index 0855fe9cba5..bd0ea40eea3 100644 --- a/mswindows/generic.manifest +++ b/mswindows/generic.manifest @@ -1,10 +1,10 @@ - + - GRASS modules + type="win32"/> + GRASS modules diff --git a/mswindows/osgeo4w/gdal-config b/mswindows/osgeo4w/gdal-config index 1917531b73e..9ad585f47b5 100755 --- a/mswindows/osgeo4w/gdal-config +++ b/mswindows/osgeo4w/gdal-config @@ -25,7 +25,7 @@ if test $# -eq 0; then usage 1 1>&2 fi -case $1 in +case $1 in --libs) echo $CONFIG_LIBS ;; diff --git a/mswindows/osgeo4w/geos-config b/mswindows/osgeo4w/geos-config index 6b52971ee80..523059726ee 100755 --- a/mswindows/osgeo4w/geos-config +++ b/mswindows/osgeo4w/geos-config @@ -32,7 +32,7 @@ case $1 in echo $OSGEO4W_ROOT_MSYS/lib/geos_c.lib ;; --ldflags) - echo + echo ;; --includes) echo $OSGEO4W_ROOT_MSYS/include diff --git a/mswindows/osgeo4w/liblas-config b/mswindows/osgeo4w/liblas-config index 0fbef69b696..05212ae94fc 100755 --- a/mswindows/osgeo4w/liblas-config +++ b/mswindows/osgeo4w/liblas-config @@ -7,57 +7,57 @@ INCLUDES="-I${prefix}/include " LIBS="-L$libdir -llas -llas_c" GDAL_INCLUDE="" -if test -n "$GDAL_INCLUDE" ; then +if test -n "$GDAL_INCLUDE" ; then INCLUDES="$INCLUDES -I$GDAL_INCLUDE" fi GDAL_LIBRARY="" -if test -n "$GDAL_LIBRARY" ; then +if test -n "$GDAL_LIBRARY" ; then LIBS="$LIBS $GDAL_LIBRARY" fi GEOTIFF_INCLUDE="" -if test -n "$GEOTIFF_INCLUDE" ; then +if test -n "$GEOTIFF_INCLUDE" ; then INCLUDES="$INCLUDES -I$GEOTIFF_INCLUDE" fi GEOTIFF_LIBRARY="" -if test -n "$GEOTIFF_LIBRARY" ; then +if test -n "$GEOTIFF_LIBRARY" ; then LIBS="$LIBS $GEOTIFF_LIBRARY" fi ORACLE_INCLUDE="" -if test -n "$ORACLE_INCLUDE" ; then +if test -n "$ORACLE_INCLUDE" ; then INCLUDES="$INCLUDES -I$ORACLE_INCLUDE" fi ORACLE_OCI_LIBRARY="" -if test -n "$ORACLE_OCI_LIBRARY" ; then +if test -n "$ORACLE_OCI_LIBRARY" ; then LIBS="$LIBS $ORACLE_OCI_LIBRARY " fi TIFF_INCLUDE="" -if test -n "$TIFF_INCLUDE" ; then +if test -n "$TIFF_INCLUDE" ; then INCLUDES="$INCLUDES -I$TIFF_INCLUDE" fi TIFF_LIBRARY="" -if test -n "$TIFF_LIBRARY" ; then +if test -n "$TIFF_LIBRARY" ; then LIBS="$LIBS $TIFF_LIBRARY" fi LIBXML2_INCLUDE_DIR="" -if test -n "$LIBXML2_INCLUDE_DIR" ; then +if test -n "$LIBXML2_INCLUDE_DIR" ; then INCLUDES="$INCLUDES -I$LIBXML2_INCLUDE_DIR" fi LIBXML2_LIBRARIES="" -if test -n "$LIBXML2_LIBRARIES" ; then +if test -n "$LIBXML2_LIBRARIES" ; then LIBS="$LIBS $LIBXML2_LIBRARIES" fi LASZIP_INCLUDE_DIR="" -if test -n "$LASZIP_INCLUDE_DIR" ; then +if test -n "$LASZIP_INCLUDE_DIR" ; then INCLUDES="$INCLUDES -I$LASZIP_INCLUDE_DIR" fi LASZIP_LIBRARY="" -if test -n "$LASZIP_LIBRARY" ; then +if test -n "$LASZIP_LIBRARY" ; then LIBS="$LIBS $LASZIP_LIBRARY" fi @@ -80,8 +80,8 @@ if test $# -eq 0; then usage 1 1>&2 fi -case $1 in - --libs) +case $1 in + --libs) echo $OSGEO4W_ROOT_MSYS/lib/liblas_c.lib ;; @@ -94,7 +94,7 @@ case $1 in ;; --defines) - echo + echo ;; --includes) @@ -102,13 +102,13 @@ case $1 in ;; --cflags) - echo + echo ;; --cxxflags) echo -pedantic -ansi -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wfloat-equal -Wredundant-decls -Wno-long-long -std=c++98 ;; - + *) usage 1 1>&2 ;; diff --git a/mswindows/osgeo4w/mysql_config b/mswindows/osgeo4w/mysql_config index 11204eb9c72..d6b96ed2f13 100755 --- a/mswindows/osgeo4w/mysql_config +++ b/mswindows/osgeo4w/mysql_config @@ -1,15 +1,15 @@ #!/bin/sh # Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. -# +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; version 2 of the License. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA @@ -109,7 +109,7 @@ else port=3306 fi -# Create options +# Create options # We intentionally add a space to the beginning and end of lib strings, simplifies replace later libs=" $ldflags -L$pkglibdir -lmysqlclient -lpthread -lz -lm -ldl " libs="$libs " @@ -131,19 +131,19 @@ for remove in DDBUG_OFF DSAFE_MUTEX DFORCE_INIT_OF_VARS \ do # The first option we might strip will always have a space before it because # we set -I$pkgincludedir as the first option - cflags=`echo "$cflags"|sed -e "s/ -$remove */ /g"` - cxxflags=`echo "$cxxflags"|sed -e "s/ -$remove */ /g"` + cflags=`echo "$cflags"|sed -e "s/ -$remove */ /g"` + cxxflags=`echo "$cxxflags"|sed -e "s/ -$remove */ /g"` done -cflags=`echo "$cflags"|sed -e 's/ *\$//'` -cxxflags=`echo "$cxxflags"|sed -e 's/ *\$//'` +cflags=`echo "$cflags"|sed -e 's/ *\$//'` +cxxflags=`echo "$cxxflags"|sed -e 's/ *\$//'` # Same for --libs(_r) for remove in lmtmalloc static-libcxa i-static static-intel do # We know the strings starts with a space - libs=`echo "$libs"|sed -e "s/ -$remove */ /g"` - libs_r=`echo "$libs_r"|sed -e "s/ -$remove */ /g"` - embedded_libs=`echo "$embedded_libs"|sed -e "s/ -$remove */ /g"` + libs=`echo "$libs"|sed -e "s/ -$remove */ /g"` + libs_r=`echo "$libs_r"|sed -e "s/ -$remove */ /g"` + embedded_libs=`echo "$embedded_libs"|sed -e "s/ -$remove */ /g"` done # Strip trailing and ending space if any, and '+' (FIXME why?) diff --git a/mswindows/osgeo4w/postinstall.bat b/mswindows/osgeo4w/postinstall.bat index 61d2d98b7d4..10e8f727673 100644 --- a/mswindows/osgeo4w/postinstall.bat +++ b/mswindows/osgeo4w/postinstall.bat @@ -5,8 +5,8 @@ textreplace -std -t "%OSGEO4W_ROOT%\apps\grass\grass@POSTFIX@\etc\fontcap" for /F "tokens=* USEBACKQ" %%F IN (`getspecialfolder Documents`) do set DOCUMENTS=%%F -if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@.lnk" "%BATCH%" "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%" -if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\GRASS GIS @VERSION@.lnk" "%BATCH%" "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%" +if not %OSGEO4W_MENU_LINKS%==0 xxmklink "%OSGEO4W_STARTMENU%\GRASS GIS @VERSION@.lnk" "%BATCH%" "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%" +if not %OSGEO4W_DESKTOP_LINKS%==0 xxmklink "%OSGEO4W_DESKTOP%\GRASS GIS @VERSION@.lnk" "%BATCH%" "--gui" "%DOCUMENTS%" "Launch GRASS GIS @VERSION@" 1 "%ICON%" rem run g.mkfontcap outside a GRASS session during rem an OSGeo4W installation for updating paths to fonts diff --git a/python/grass/docs/Makefile b/python/grass/docs/Makefile index 7f0aee7396a..1ef20e4d444 100644 --- a/python/grass/docs/Makefile +++ b/python/grass/docs/Makefile @@ -100,8 +100,8 @@ libpythonlatex: $(call run_grass,$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex) @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." libpythonlatexpdf: @echo "SPHINXBUILD: Using <$(SPHINXBUILD)>" @@ -119,5 +119,5 @@ libpythonman: libpythondoctest: @echo "SPHINXBUILD: Using <$(SPHINXBUILD)>" $(call run_grass,$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest) - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." diff --git a/raster3d/r3.showdspf/Makefile b/raster3d/r3.showdspf/Makefile index 591880f59ee..f20726aee86 100644 --- a/raster3d/r3.showdspf/Makefile +++ b/raster3d/r3.showdspf/Makefile @@ -2,8 +2,8 @@ MODULE_TOPDIR = ../.. PGM=r3.showdspf -OGLLIB = $(XMLIBPATH) $(XLIBPATH) $(OPENGLWM) $(OPENGLULIB) $(OPENGLLIB) \ - $(XMLIB) $(XTLIB) $(XLIB) $(XEXTRALIBS) +OGLLIB = $(XMLIBPATH) $(XLIBPATH) $(OPENGLWM) $(OPENGLULIB) $(OPENGLLIB) \ + $(XMLIB) $(XTLIB) $(XLIB) $(XEXTRALIBS) LDIR = $(MODULE_TOPDIR)/lib/dspf EXTRA_CFLAGS = -I$(LDIR) -I. $(OPENGLINC) $(OPENGLWINC) $(XCFLAGS) $(XMINC) diff --git a/vector/v.buffer/v.buffer.html b/vector/v.buffer/v.buffer.html index bdb6d1f231e..8870cd335c5 100644 --- a/vector/v.buffer/v.buffer.html +++ b/vector/v.buffer/v.buffer.html @@ -66,7 +66,7 @@

Corner settings

-With a point vector map as input data, square buffers are created instead +With a point vector map as input data, square buffers are created instead of round buffers by using the -s flag.
diff --git a/vector/v.class/v.class.html b/vector/v.class/v.class.html index d833975173e..a530ca39e8e 100644 --- a/vector/v.class/v.class.html +++ b/vector/v.class/v.class.html @@ -44,10 +44,10 @@

NOTES

this new polyline is then chosen as a new node to create break up one of the two preceding segments, and so forth. -

The problem of the difference in terms of units between the two axes -is solved by rescaling both amplitudes to an interval between 0 and 1. -In the original algorithm, the process is stopped when the difference between -the slopes of the two new segments is no longer significant (alpha = 0.05). As +

The problem of the difference in terms of units between the two axes +is solved by rescaling both amplitudes to an interval between 0 and 1. +In the original algorithm, the process is stopped when the difference between +the slopes of the two new segments is no longer significant (alpha = 0.05). As the slope is the ratio between the frequency and the amplitude of the corresponding interval, i.e. its density, this effectively tests whether the frequencies of the two newly proposed classes are different from those obtained by diff --git a/vector/v.surf.bspline/v.surf.bspline.html b/vector/v.surf.bspline/v.surf.bspline.html index b2ed87a9573..ea101c9beb7 100644 --- a/vector/v.surf.bspline/v.surf.bspline.html +++ b/vector/v.surf.bspline/v.surf.bspline.html @@ -40,7 +40,7 @@

NOTES

and north-south spline step length arguments allows the user to account for some degree of anisotropy in the distribution of observation points. Short spline step lengths, especially spline step -lengths that are less than the distance between observation points, +lengths that are less than the distance between observation points, can greatly increase the processing time.

The maximum number of splines for each direction at each @@ -64,15 +64,15 @@

NOTES

v.surf.bspline can produce raster (raster_output) OR vector output but NOT simultaneously. Note that topology is not -built for output point vector layer. If required, the topology can be built +built for output point vector layer. If required, the topology can be built using v.build. -

If output is a point vector layer and sparse is not specified, +

If output is a point vector layer and sparse is not specified, the output vector layer will contain points at the same locations as observation points in the input layer but the values -of the output points will be interpolated values. If a sparse -point vector layer is specified, the output vector layer will contain points -at the same locations as the sparse vector layer points. The values will be +of the output points will be interpolated values. If a sparse +point vector layer is specified, the output vector layer will contain points +at the same locations as the sparse vector layer points. The values will be those of the interpolated raster surface at those points.

A cross validation "leave-one-out" analysis is available to help to @@ -146,7 +146,7 @@

KNOWN ISSUES

In order to avoid RAM memory problems, an auxiliary table is needed for recording some intermediate calculations. This requires -the GROUP BY SQL function is used. This function is not +the GROUP BY SQL function is used. This function is not supported by the DBF driver. For this reason, vector output (output) is not permitted with the DBF driver. There are no problems with the raster map output from the DBF driver. diff --git a/vector/v.voronoi/Makefile b/vector/v.voronoi/Makefile index a0ce43637aa..c145d346580 100644 --- a/vector/v.voronoi/Makefile +++ b/vector/v.voronoi/Makefile @@ -3,8 +3,8 @@ MODULE_TOPDIR = ../.. PGM = v.voronoi -SWEEP_OBJS = sw_edgelist.o sw_geometry.o sw_heap.o sw_main.o sw_memory.o sw_output.o \ - sw_voronoi.o +SWEEP_OBJS = sw_edgelist.o sw_geometry.o sw_heap.o sw_main.o sw_memory.o sw_output.o \ + sw_voronoi.o v_voronoi_OBJS = vo_main.o vo_extend.o vo_write.o $(SWEEP_OBJS)