work 2

work 2

--- .appveyor/install.bat
+++ .appveyor/install.bat
@@ -18,9 +18,9 @@
 appveyor DownloadFile %LUAROCKS_URL%/luarocks-%LUAROCKS_VER%-win32.zip
 7z x luarocks-%LUAROCKS_VER%-win32.zip
 cd luarocks-%LUAROCKS_VER%-win32
-install.bat /LUA c:\lua%LUA_VER% /Q /LV %LUA_SHORTV%
+call install.bat /LUA c:\lua%LUA_VER% /Q /LV %LUA_SHORTV%
 set PATH="%PATH%;%ProgramFiles(x86)%\LuaRocks\%LUAROCKS_SHORTV%"
-echo %PATH%
+echo PATH: %PATH%
 set LUA_PATH="C:\Program Files (x86)\LuaRocks\%LUAROCKS_SHORTV%\lua\?.lua;C:\Program Files (x86)\LuaRocks\%LUAROCKS_SHORTV%\lua\?\init.lua;C:\Program Files (x86)\LuaRocks\systree\share\lua\%LUA_SHORTV%\?.lua;C:\Program Files (x86)\LuaRocks\systree\share\lua\%LUA_SHORTV%\?\init.lua"
 set LUA_CPATH="C:\Program Files (x86)\LuaRocks\systree\lib\lua\%LUA_SHORTV%\?.dll"
 luarocks --version


commit on 08/06/2018 at 22:24:51

commit on 08/06/2018 at 22:24:51


[FIX] Fixed some grammar mistakes.

[FIX] Fixed some grammar mistakes.

--- dev/build_release_package.bat
+++ dev/build_release_package.bat
@@ -21,13 +21,13 @@
 goto :success

 :sample_build_error
-echo Failed to build sample project.
+echo "Failed to build sample project."
 exit /b %errorlevel%

 :nuget_package_error
-echo Failed to create nuget package.
+echo "Failed to create nuget package."
 exit /b %errorlevel%

 :success
-echo "Successfully build project."
+echo "Successfully built project."


Added some default placeholders for cm_options to script/cmtool.bat that hand off the cm_options to the cm's installer. However, the semantics of these can change depending on the cmtool, since not all support or need options.

--- script/cmtool.bat
+++ script/cmtool.bat
@@ -88,6 +88,7 @@
 ::::::::::::
 :chef
 ::::::::::::
+if not defined CHEF_OPTIONS set CHEF_OPTIONS=%CM_OPTIONS%

 for %%i in ("%CHEF_URL%") do set CHEF_MSI=%%~nxi
 set CHEF_DIR=%TEMP%\chef
@@ -116,6 +117,7 @@
 ::::::::::::
 :puppet
 ::::::::::::
+if not defined PUPPET_OPTIONS set PUPPET_OPTIONS=%CM_OPTIONS%

 :: if "%CM_VERSION%" == "latest" set CM_VERSION=3.8.7

@@ -157,6 +159,7 @@
 ::::::::::::
 :salt
 ::::::::::::
+if not defined SALT_OPTIONS set SALT_OPTIONS=%CM_OPTIONS%

 if "%CM_VERSION%" == "latest" set CM_VERSION=2015.8.8-2


Fix to script

Fix to script

git-svn-id: 9dd7b0dce703189cfc704e2284e84470f37cac3d@16118 bf327186-88b3-11dd-a302-d386e5130c1c

--- src/main/resources/executeworkflow.bat
+++ src/main/resources/executeworkflow.bat
@@ -17,6 +17,6 @@
 set ARGS=%ARGS% -Djava.awt.headless=true
 set ARGS=%ARGS% "-Dtaverna.startup=%TAVERNA_HOME%."

-java %ARGS% -jar "%TAVERNA_HOME%lib\prelauncher-2.4-SNAPSHOT.jar" %*
+java %ARGS% -jar "%TAVERNA_HOME%lib\prelauncher-2.5-SNAPSHOT.jar" %*


tests

tests

error: pathspec 'script/runtests.bat' did not match any file(s) known to git

--- script/runtests.bat
+++ script/runtests.bat
@@ -0,0 +1,3 @@
+dotnet test -c Debug test/Leto.ProtocolFacts/Leto.ProtocolFacts.csproj
+dotnet test -c Debug test/Leto.WindowsFacts/Leto.WindowsFacts.csproj
+dotnet test -c Debug test/Leto.OpenSslFacts/Leto.OpenSslFacts.csproj


ram disk for windows

ram disk for windows

Signed-off-by: Kenneth Reitz <b1c1d8736f20db3fb6c1c66bb1455ed43909f0d8@kennethreitz.org>

--- run-tests.bat
+++ run-tests.bat
@@ -1,8 +1,8 @@
-imdisk -a -s 2104515b -m R: -f C:\my_disk.ima -p "/FS:NTFS /C /Y"
-set RAM_DISK="R:\"
+rem imdisk -a -s 2104515b -m R: -f C:\my_disk.ima -p "/FS:NTFS /C /Y"
+set RAM_DISK="R:"

 virtualenv R:\.venv
 R:\.venv\Scripts\pip install -e . --upgrade --upgrade-strategy=only-if-needed
 R:\.venv\Scripts\pipenv install --dev

-SET RAM_DISK="R:\" && SET PYPI_VENDOR_DIR=".\tests\pypi\" && R:\.venv\Scripts\pipenv run pytest -n auto -v tests --tap-stream
+SET RAM_DISK="R:" && SET PYPI_VENDOR_DIR=".\tests\pypi\" && R:\.venv\Scripts\pipenv run pytest -n auto -v tests --tap-stream


remove unnecessary parts of cleanSolution batch file

--- cleanSolution.bat
+++ cleanSolution.bat
@@ -1,7 +1,4 @@
 @echo off
-echo Backing up ITestPlugins
-md .temp
-copy .\Tests\TestLibrary\PluginManager\ITestPluginDLLs\*.dll .\.temp\*.safe
 echo Cleaning Solution...
 cd Applications
 del /S /Q *.pidb *.dll *.exe *.mdb *.pdb *.FilesWrittenAbsolute.txt
@@ -17,8 +14,4 @@
 del /S /Q *.pidb *.dll *.exe *.mdb *.pdb *.FilesWrittenAbsolute.txt
 cd ..\Plugins
 del /S /Q *.pidb *.dll *.exe *.mdb *.pdb *.FilesWrittenAbsolute.txt
-cd ..
-echo Restoring ITestPlugins
-copy .\.temp\*.safe .\Tests\TestLibrary\PluginManager\ITestPluginDLLs\*.dll
-del .\.temp\*.safe
-rd .temp+cd ..


Install markdownlint-cli.

Install markdownlint-cli.

--- scripts/install.cmd
+++ scripts/install.cmd
@@ -12,6 +12,7 @@
 pushd "%SCRIPTSDIR%" && pushd ..

 pip install -r requirements.txt
+npm install -g markdownlint-cli

 popd && popd
 endlocal


Added commands to clean up the sniffer directory

--- src/clean.bat
+++ src/clean.bat
@@ -24,6 +24,8 @@
 del jade\tools\DummyAgent\*~
 del jade\tools\rma\*.class
 del jade\tools\rma\*~
+del jade\tools\sniffer\*.class
+del jade\tools\sniffer\*~

 del jade\lang\acl\ACLParser.java
 del jade\lang\acl\ACLParserConstants.java


Quieter alltests.cmd

Quieter alltests.cmd

--- alltests.cmd
+++ alltests.cmd
@@ -1,20 +1,20 @@
 call \ned\bin\switchpy 23
-python setup.py develop
+python setup.py -q develop
 nosetests
 del coverage\tracer.pyd
 nosetests
 call \ned\bin\switchpy 24
-python setup.py develop
+python setup.py -q develop
 nosetests
 del coverage\tracer.pyd
 nosetests
 call \ned\bin\switchpy 25
-python setup.py develop
+python setup.py -q develop
 nosetests
 del coverage\tracer.pyd
 nosetests
 call \ned\bin\switchpy 26
-python setup.py develop
+python setup.py -q develop
 nosetests
 del coverage\tracer.pyd
 nosetests


Updated build.cmd for the Dialogic SIP components.

--- nuget/Base/build.cmd
+++ nuget/Base/build.cmd
@@ -12,5 +12,8 @@
 copy ..\..\ivrToolkit.Core\bin\debug\ivrToolkit.core.* lib\net40\
 copy ..\..\ivrToolkit.DialogicPlugin\bin\debug\ivrToolkit.dialogicPlugin.* lib\net40\
 copy ..\..\ivrToolkit.SimulatorPlugin\bin\debug\ivrToolkit.SimulatorPlugin.* lib\net40\
+copy ..\..\ivrToolkit.DialogicSipPluginSync\bin\x86\Debug\ivrToolkit.DialogicSipPluginSync.* lib\net40\
+copy ..\..\Debug\ivrToolkit.DialogicSipLibrary.* lib\net40\
+copy ..\..\Debug\ivrToolkit.DialogicSipWrapperSync.* lib\net40\

 nuget pack


Build script should overwrite images automatically

--- make_script.bat
+++ make_script.bat
@@ -24,7 +24,7 @@
 copy "%build_dir%\hehu_mf.pbo" "%target_dir%\@hehu_mf\addons"
 copy "%source_dir%\mod.cpp" "%target_dir%\@hehu_mf"
 copy "%source_dir%\README.md" "%target_dir%\@hehu_mf\readme.txt"
-xcopy /E "%source_dir%\images" "%target_dir%\@hehu_mf\images"
+xcopy /E /Y "%source_dir%\images" "%target_dir%\@hehu_mf\images"

 exit 0


ProcessGoldenImages.bat: fixed passed/failed test counter

--- Tests/ProcessGoldenImages.bat
+++ Tests/ProcessGoldenImages.bat
@@ -93,14 +93,8 @@
 set TESTS_PASSED=0
 set OVERAL_STATUS=

-
 for %%X in (%TestApps%) do (
     call :gen_golden_img %%X
-    if "!ERRORLEVEL!" == "0" (
-        set /a TESTS_PASSED=!TESTS_PASSED!+1
-    ) else (
-        set /a TESTS_FAILED=!TESTS_FAILED!+1
-    )
 )

 cd Tests
@@ -111,14 +105,14 @@

 echo.
 if "%TESTS_PASSED%" NEQ "0" (
-    echo %FONT_GREEN%%TESTS_PASSED% tests PASSED%FONT_DEFAULT%
+    echo %FONT_GREEN%!TESTS_PASSED! tests PASSED%FONT_DEFAULT%
 )

 if "%TESTS_FAILED%" NEQ "0" (
-    echo %FONT_RED%%TESTS_FAILED% tests FAILED%FONT_DEFAULT%
-)
-
-EXIT /B %TESTS_FAILED%
+    echo %FONT_RED%!TESTS_FAILED! tests FAILED%FONT_DEFAULT%
+)
+
+EXIT /B !TESTS_FAILED!

 :: For some reason, colored font does not work after the line that starts the sample app
 :print_colored
@@ -187,7 +181,12 @@
         echo !app_path! !cmd_args!
         !app_path! !cmd_args!

-        if !ERRORLEVEL! NEQ 0 (set EXIT_CODE=1)
+        if !ERRORLEVEL! NEQ 0 (
+            set EXIT_CODE=1
+            set /a TESTS_FAILED=!TESTS_FAILED!+1
+        ) else (
+            set /a TESTS_PASSED=!TESTS_PASSED!+1
+        )

         if "%golden_img_mode%" == "compare" (
             if !ERRORLEVEL! EQU 0 (set STATUS=%FONT_GREEN%Golden image validation PASSED for %app_name% [!test_mode!].%FONT_DEFAULT%)
@@ -216,7 +215,7 @@

     cd ../../../

-    EXIT /B %EXIT_CODE%
+    EXIT /B !EXIT_CODE!


no message

no message

--- sage/deploy.cmd
+++ sage/deploy.cmd
@@ -26,8 +26,9 @@
   SET DEPLOYMENT_SOURCE=%~dp0%.
 )

-SET DEPLOYMENT_TARGET=/site/wwwroot
-
+IF NOT DEFINED DEPLOYMENT_TARGET (
+  SET DEPLOYMENT_TARGET=%ARTIFACTS%\wwwroot
+)

 IF NOT DEFINED NEXT_MANIFEST_PATH (
   SET NEXT_MANIFEST_PATH=%ARTIFACTS%\manifest
@@ -114,20 +115,24 @@
   echo Found compatible virtual environment.
 )

+:: 4. Install packages
+echo Pip install requirements.
+env\scripts\pip install django
+IF !ERRORLEVEL! NEQ 0 goto error
+
+REM Add additional package installation here
+REM -- Example --
+REM env\scripts\easy_install pytz
+REM IF !ERRORLEVEL! NEQ 0 goto error
+
 :: 5. Copy web.config
 IF EXIST "%DEPLOYMENT_SOURCE%\web.%PYTHON_VER%.config" (
   echo Overwriting web.config with web.%PYTHON_VER%.config
   copy /y "%DEPLOYMENT_SOURCE%\web.%PYTHON_VER%.config" "%DEPLOYMENT_TARGET%\web.config"
 )

-echo pip installing django
-\site\wwwroot\env\scripts\pip install django
-
 :: 6. Django collectstatic
-IF EXIST "\site\wwwroot\manage.py" (
-    \site\wwwroot\env\scripts\python \site\wwwroot\manage.py runserver 0.0.0.0:8000
-  )
-)
+env\scripts\python manage.py runserver 0.0.0.0:8000

 popd


Прогресс бар 3

Прогресс бар 3

error: pathspec 'progress_bar2.1.bat' did not match any file(s) known to git

--- progress_bar2.1.bat
+++ progress_bar2.1.bat
@@ -0,0 +1,79 @@
+@ECHO OFF
+setlocal enabledelayedexpansion
+
+rem ⢮ 権
+Set "cnt=120"
+::ᨬ ࠧ ப
+set "ilen=20"
+::થ ᨬ
+set "imark=0"
+::
+set "imarklen=3"
+:: ᪮쪮 権 ᤢ થ
+set "imarkskip=2"
+:: ⥫ (䮭)
+set "iblank=9"
+::  થ
+set "imarkpos=0"
+::砫   ᨬ ࠭
+set "boxb=["
+set "boxe=]"
+
+set /a "imu=%imarklen%"
+
+::樠
+set "istrbs="
+for /l %%i in (1,1,%ilen%) do set "istrbs=!istrbs!"
+set "istrblank="
+for /l %%i in (1,1,%ilen%) do set "istrblank=!istrblank!%iblank%"
+set "imarkbs="
+for /l %%i in (1,1,%imarklen%) do set "imarkbs=!imarkbs!"
+set "imarkstr="
+for /l %%i in (1,1,%imarklen%) do set "imarkstr=!imarkstr!%imark%"
+
+0<nul set /p "=%boxb%%istrblank%%boxe%%istrbs%"
+::᭮ 横
+for /l %%i in (1,1,%cnt%) do (
+	Call:Bar %%i
+	1>nul 2>&1 ping -n 1 -w 1 127.255.255.255
+)
+
+
+::ࠥ  ᮡ
+::set "istrblank="
+::0>nul set /p "=!istrbs!"
+::for /l %%i in (1,1,%ilen%) do set "istrblank=!istrblank! "
+::0>nul set /p "=%boxb%%istrblank% "
+::0>nul set /p "=%istrbs% "
+
+>nul pause & goto:eof
+
+:Bar
+if %imu% gtr 0 (
+	if %imarkpos% lss %imarklen% (
+		0<nul set /p "=%imark%"
+	) else if %imarkpos% gtr %ilen% (
+		for /l %%j in (1,1,%imu%) do 0<nul set /p "="
+		0<nul set /p "=%iblank%"
+		for /l %%j in (2,1,%imu%) do 0<nul set /p "=%imark%"
+		set /a "imu-=1"
+		if !imu! equ 1 set "imu=-%imarklen%"
+		set /a "imarkpos-=1"
+	) else 0<nul set /p "=%imarkbs%%iblank%%imarkstr%"
+	set /a "imarkpos+=1"
+)
+::if %imarkpos% gtr %imarklen%
+::echo.%imarkpos%
+
+::0<nul set /p "=%imark%"
+
+exit /b
+
+if %imarkpos% equ 0 (
+	set "imarkpos=1"
+	0<nul set /p "=%iblank%%istrbs%%imark%"
+) else (
+	0<Nul Set /p "=%iblank%%imark%"
+	set /a "imarkpos=(imarkpos+1)%%ilen"
+)
+exit /b


trigger checks

trigger checks

--- recipes/soxr/bld.bat
+++ recipes/soxr/bld.bat
@@ -2,7 +2,7 @@
 cd build

 cmake ^
-    -G "Ninja" ^
+    -G "NMake Makefiles" ^
     -DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
     -DCMAKE_BUILD_TYPE=Release ^
     -DBUILD_TESTING=ON ^


turn off ipv6 in vcpkg build of libwebsockets

--- contrib/cmake/build3rdparty.cmd
+++ contrib/cmake/build3rdparty.cmd
@@ -47,14 +47,11 @@
 REM     HEAD_REF v2.4-stable
 REM also find libwebsocket's CMakeLists.txt file and modify the libuv find_library, adding 'libuv' as that's what the libuv vcpkg produces:
 REM     find_library(LIBUV_LIBRARIES NAMES uv libuv)
-REM and add thse lines in the vcpkg_configure_cmake in its portfile:
+REM and add these lines in the vcpkg_configure_cmake in its portfile (LWS_IPV6 replaces an existing line):
+REM     -DLWS_IPV6=OFF
 REM     -DLWS_WITH_LIBUV=ON
 REM     -DLIBUV_LIBRARIES=${CURRENT_PACKAGES_DIR}/lib
 REM     -DLIBUV_INCLUDE_DIR=${CURRENT_PACKAGES_DIR}/include
-REM possibly add libuv dependency (might not be necessary?)
-REM     Feature: libuv
-REM     Build-Depends: libuv
-REM     Description: turns on LWS_WITH_LIBUV
 REM then use remove and install again, building build libwebsockets[libuv].


clarify pdfium code fetching instructions slightly

--- contrib/cmake/build3rdparty.cmd
+++ contrib/cmake/build3rdparty.cmd
@@ -60,7 +60,7 @@
 REM ------ building pdifum - this one needs some manual steps - these can be done before calling the script ---------------
 REM - Set up your Depot Tools (this can be one time, reuse it for other builds etc)
 REM      Follow these instructions to get the depot_tools (download .zip, extract all, set variable, run gclient): https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#install
-REM - Then in your 3rdParty/vcpkg folder, and run these commands in it to get the pdfium source:
+REM - Then in your 3rdParty/vcpkg folder (make sure it is not a long path, or subst V: to it), and run these commands in it to get the pdfium source:
 REM      set DEPOT_TOOLS=<<<<your depot_tools path>>>>
 REM      set PATH=%DEPOT_TOOLS%;%PATH%
 REM      set DEPOT_TOOLS_WIN_TOOLCHAIN=0
@@ -69,8 +69,11 @@
 REM      gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
 REM      gclient sync
 REM      REM branch 3710 is compatibile with the VS 2015 compiler and v140 toolset  (or if you want to use the latest, see below)
+REM      cd pdfium
 REM      git checkout chromium/3710
-REM      gclient sync
+REM      cd ..
+REM      gclient sync --force
+REM - If using VS2015 compiler, find span.h and remove 'constexpr' from all the forwarding constructors.
 REM - If using the latest Pdfium, use at least VS2017 and skip the branch checkout above, and substitute the pdfium-masterbranch-CMakeLists.txt in vcpkg/ports/pdfium and make this one small patch (other changes may be needed if the master branch has changed):
 REM      in pdfium\core\fxcrt\fx_memory_wrappers.h(26)   comment out the static_assert (uint8_t counts as an arithmentic type)


build: separate build of ARM64 config

build: separate build of ARM64 config

Added a pedal (VIRTIO_WIN_NO_ARM env var) that disables ARM64 build,
sometimes it's handy.

Signed-off-by: Ilya Rudakov <8300843b273e1d997b2d119060a4420345621b2e@virtuozzo.com>

--- buildAll.bat
+++ buildAll.bat
@@ -1,5 +1,5 @@
 @echo off
-call tools\build.bat virtio-win.sln Win10 ARM64
+if "%VIRTIO_WIN_NO_ARM%"=="" call tools\build.bat virtio-win.sln Win10 ARM64
 if errorlevel 1 goto :fail
 if "%VIRTIO_WIN_NO_LEGACY%"=="" call tools\build.bat virtio-win.sln "Wxp Wnet Wlh Win7" %*
 if errorlevel 1 goto :fail


Add the rexster-console.bat file. #138

Add the rexster-console.bat file. #138

error: pathspec 'rexster-console.bat' did not match any file(s) known to git

--- rexster-console.bat
+++ rexster-console.bat
@@ -0,0 +1,15 @@
+:: Windows launcher script for Rexster Console
+@echo off
+
+cd %CD%\target\
+
+set TARGET=
+
+for /f "tokens=*" %%a in ('dir /b /ad') do (
+if exist "%%a\bin\rexster-console.bat" set TARGET=%%a
+)
+
+cd %TARGET%\bin\
+call rexster-console.bat localhost 8185 gremlin %*
+
+target/rexster-*-standalone/bin/rexster-console.bat localhost 8185 gremlin $@


cmd install for ethernet and optical path managers

Preq: make mvn clean install in generic,
ethernet and optical path managers.

--- code/odl.cmd
+++ code/odl.cmd
@@ -32,6 +32,16 @@

      karafcmd "feature:repo-add mvn:org.opendaylight.mwtn/genericpathmanager-features/0.4.0-SNAPSHOT/xml/features"
      karafcmd "feature:install odl-mwt-genericpathmanager"
+
+     sleep 20
+
+     karafcmd "feature:repo-add mvn:org.opendaylight.mwtn/ethernetpathmanager-features/0.4.0-SNAPSHOT/xml/features"
+     karafcmd "feature:install odl-mwt-ethernetpathmanager"
+
+     sleep 20
+
+     karafcmd "feature:repo-add mvn:org.opendaylight.mwtn/opticalpathmanager-features/0.4.0-SNAPSHOT/xml/features"
+     karafcmd "feature:install odl-mwt-opticalpathmanager"

      sleep 20


added open_c/autogen.cmd

added open_c/autogen.cmd

darcs-hash:20070430115512-1b897-446185f7d5416b98fd339772c42957c8f837d080.gz

error: pathspec 'open_c/autogen.cmd' did not match any file(s) known to git

--- open_c/autogen.cmd
+++ open_c/autogen.cmd
@@ -0,0 +1,33 @@
+::
+:: Prepare pristine Sofia SIP source tree for Visual C
+::
+:: NOTE: this script requires gawk - see http://unxutils.sourceforge.net
+::
+:: This file is part of the Sofia-SIP package
+::
+:: Copyright (C) 2007 Nokia Corporation.
+::
+:: Contact: Martti Mela <martti.mela@nokia.com>
+::
+:: This library is free software; you can redistribute it and/or
+:: modify it under the terms of the GNU Lesser General Public License
+:: as published by the Free Software Foundation; either version 2.1 of
+:: the License, or (at your option) any later version.
+::
+:: This library 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
+:: Lesser General Public License for more details.
+::
+:: You should have received a copy of the GNU Lesser General Public
+:: License along with this library; if not, write to the Free Software
+:: Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+:: 02110-1301 USA
+::
+
+@setlocal
+@if x%AWK%==x set AWK=mawk
+
+@call version_files.cmd
+
+@call build_sources.cmd


Fixed starting script (regarding spaces in installation root directory)

--- dist/src/main/bin/midpoint.bat
+++ dist/src/main/bin/midpoint.bat
@@ -62,7 +62,7 @@

 :execStart
 echo "%cd%\lib\midpoint.war"
-start /b javaw -jar -Xms2048M -Xmx2048M -Dpython.cachedir=%MIDPOINT_HOME%\tmp -Djavax.net.ssl.trustStore=%MIDPOINT_HOME%\keystore.jceks -Djavax.net.ssl.trustStoreType=jceks -Dmidpoint.home=%MIDPOINT_HOME% %cd%\lib\midpoint.war > %BOOT_OUT% 2>&1 &
+start /b javaw -jar -Xms2048M -Xmx2048M -Dpython.cachedir="%MIDPOINT_HOME%\tmp" -Djavax.net.ssl.trustStore="%MIDPOINT_HOME%\keystore.jceks" -Djavax.net.ssl.trustStoreType=jceks -Dmidpoint.home="%MIDPOINT_HOME%" "%cd%\lib\midpoint.war" > "%BOOT_OUT%" 2>&1 &

 :execStop
 echo "%cd%\lib\midpoint.war"


set package stuff to release.

set package stuff to release.


Changed MYPATH to actual PATH variable

Changed MYPATH to actual PATH variable

--- scripts/install.bat
+++ scripts/install.bat
@@ -1,4 +1,4 @@
 ECHO on
 FOR /f %%i IN ('dir /ad /b "C:\" ^|findstr /I "mongo"') DO set dest=%%i
 MOVE C:\%dest% C:\mongodb
-setx MYPATH "%PATH%;C:\mongodb\bin"
+SETX PATH "%PATH%;C:\mongodb\bin"


Make.cmd: create TARGDIR if necessary

Make.cmd: create TARGDIR if necessary

Fixes #1771.

R=adg, rsc1
CC=golang-dev
https://golang.org/cl/4437089

--- src/Make.cmd
+++ src/Make.cmd
@@ -25,7 +25,7 @@
 install: $(TARGDIR)/$(TARG)

 $(TARGDIR)/$(TARG): $(TARG)
-	cp -f $(TARG) $(TARGDIR)
+	mkdir -p $(TARGDIR) && cp -f $(TARG) $(TARGDIR)

 CLEANFILES+=$(TARG) _test _testmain.go


make.bat: Fix for old files

make.bat: Fix for old files

Same fix as applied here: http://codereview.appspot.com/5761044

Fixes issue 3222.

R=golang-dev, alex.brainman, rsc
CC=golang-dev
http://codereview.appspot.com/5838043

Committer: Alex Brainman <54ba58c8441b5eff861de6b4e5ee46baf086b142@gmail.com>

--- src/make.bat
+++ src/make.bat
@@ -27,6 +27,9 @@
 cd src
 if "x%GOROOT_FINAL%"=="x" set GOROOT_FINAL=%GOROOT%
 set DEFGOROOT=-DGOROOT_FINAL="\"%GOROOT_FINAL:\=\\%\""
+
+:: Clean old generated file that will cause problems in the build.
+del /F ".\pkg\runtime\runtime_defs.go"

 echo # Building C bootstrap tool.
 echo cmd/dist


add alias `be` for `bundle exec`

add alias `be` for `bundle exec`

--- files/set-env.bat
+++ files/set-env.bat
@@ -72,5 +72,6 @@

 :: command aliases
 @doskey vi=sublime_text $*
+@doskey be=bundle exec $*

 set PATH=%VAGRANTDIR%\bin;%RUBYDIR%\bin;%GITDIR%\cmd;%KDIFF3DIR%;%CYGWINRSYNCDIR%;%CYGWINSSHDIR%;%CONSOLE2DIR%;%SUBLIMEDIR%;%PUTTYDIR%;%VBOX_INSTALL_PATH%;%PATH%


SCHEDULING-1251

SCHEDULING-1251

git-svn-id: 27916816d6cfa57849e9a885196bf7392b80e1ac@19930 28e8926c-6b08-0410-baaa-805c5e19b8d6

--- bin/windows/pa-dataserver-gui.bat
+++ bin/windows/pa-dataserver-gui.bat
@@ -3,7 +3,7 @@

 rem I did not use init.bat because it does not work, and I have no idea why

-set PROACTIVE=%~dp0\..
+set PROACTIVE=%~dp0\..\..

 if NOT DEFINED JAVA_HOME goto javahome
 if "%JAVA_HOME%" == "" goto javahome
@@ -15,7 +15,8 @@
 )

 SET CLASSPATH=%CLASSPATH%;%PROACTIVE%\dist\lib\ProActive.jar;%PROACTIVE%\dist\lib\ProActive_examples.jar;%PROACTIVE%\dist\lib\ProActive_utils.jar
-set JAVA_CMD="%JAVA_HOME%\bin\java.exe" -Dproactive.home="%PROACTIVE%"  -Djava.security.manager -Djava.security.policy="%PROACTIVE%\examples\proactive.java.policy"
+
+set JAVA_CMD="%JAVA_HOME%\bin\java.exe" -Dproactive.home="%PROACTIVE%"  -Djava.security.manager -Djava.security.policy="%PROACTIVE%\config\security.java.policy-client"
 %JAVA_CMD% org.objectweb.proactive.extensions.vfsprovider.gui.ServerBrowser

 goto end


csv2anki.bat

error: pathspec 'csv2anki.bat' did not match any file(s) known to git

--- csv2anki.bat
+++ csv2anki.bat
@@ -0,0 +1 @@
+npm run-script csv2anki


don't dump env for task build

don't dump env for task build

--- phpsdk-starter.bat
+++ phpsdk-starter.bat
@@ -41,9 +41,9 @@
 		set TASK_ARGS=%TASK_ARGS:"=%

 		if exist "%IMHERE%phpsdk-local.bat" (
-			cmd /c "!PHP_SDK_VC_SHELL_CMD! && %IMHERE%\bin\phpsdk_setvars.bat && %IMHERE%\bin\phpsdk_dumpenv.bat && %IMHERE%\phpsdk-local.bat && %TASK% !TASK_ARGS!"
+			cmd /c "!PHP_SDK_VC_SHELL_CMD! && %IMHERE%\bin\phpsdk_setvars.bat && %IMHERE%\phpsdk-local.bat && %TASK% !TASK_ARGS!"
 		) else (
-			cmd /c "!PHP_SDK_VC_SHELL_CMD! && %IMHERE%\bin\phpsdk_setvars.bat && %IMHERE%\bin\phpsdk_dumpenv.bat && %TASK% !TASK_ARGS!"
+			cmd /c "!PHP_SDK_VC_SHELL_CMD! && %IMHERE%\bin\phpsdk_setvars.bat && %TASK% !TASK_ARGS!"
 		)
 		exit /b
 	) else (


Update options.bat

Update options.bat

--- tools/options.bat
+++ tools/options.bat
@@ -1,8 +1,8 @@
 @echo off

-set MSVCVER=2017
-set QTVER=5.13.2
+set MSVCVER=2019
+set QTVER=5.14.1
 set SSLVER=1.1.1d
 set PREFIX=C:\Qt
 set EXTRABUILDOPTIONS=-qt-sqlite


-NoCache for restoring Nuget packages

-NoCache for restoring Nuget packages

--- dotnet/Vernacular/Semantics/dev/PPWCode.Vernacular.Semantics.II/src/CreateNuGetPackages.cmd
+++ dotnet/Vernacular/Semantics/dev/PPWCode.Vernacular.Semantics.II/src/CreateNuGetPackages.cmd
@@ -9,7 +9,7 @@
 	if [%1]==[Release] set package_project=1
 	if defined package_project (
 		echo Packiging %project% ...
-		nuget restore
+		nuget restore -NoCache
 		nuget pack .\II\%project%.csproj -Build -Properties "Configuration=%1"
 	)


Fixes to collide.bat - Handles spaces in current directory path - Replace 'rm' for 'del'

--- scripts/collide.bat
+++ scripts/collide.bat
@@ -20,9 +20,9 @@
 echo %CONFIG% > %TMP_FILE%

 rem TODO: Make the ant build generate this string.
-set COLLIDE_CLASSPATH=%BASE%;%BASE%lib\gwt-user.jar;%BASE%lib\collide-server.jar;%BASE%lib\guava-12.0.jar;%BASE%lib\gson-2.2.1.jar;%BASE%lib\jsr305.jar;%BASE%lib\org.eclipse.jgit-1.3.0.201202151440-r.jar;%BASE%lib\waveinabox-import-0.3.jar
+set "COLLIDE_CLASSPATH=%BASE%;%BASE%lib\gwt-user.jar;%BASE%lib\collide-server.jar;%BASE%lib\guava-12.0.jar;%BASE%lib\gson-2.2.1.jar;%BASE%lib\jsr305.jar;%BASE%lib\org.eclipse.jgit-1.3.0.201202151440-r.jar;%BASE%lib\waveinabox-import-0.3.jar"

 rem Launch the server, setting up the appropriate classpath and config files.
-call %BASE%lib\vertx\bin\vertx.bat run bootstrap.js -conf "%TMP_FILE%" -cp "%COLLIDE_CLASSPATH%" %*
+call "%BASE%lib\vertx\bin\vertx.bat" run bootstrap.js -conf "%TMP_FILE%" -cp "%COLLIDE_CLASSPATH%" %*

-rm %TMP_FILE%
+del %TMP_FILE%


Windows: Invoke MSBuild through CMake.

Windows: Invoke MSBuild through CMake.

--- tools/build.bat
+++ tools/build.bat
@@ -9,4 +9,4 @@
 DEL /S /Q *.vcxproj *.vcxproj.filters *.vcxproj.user CMakeCache.txt cmake_install.cmake Rainbow.sdf Rainbow.sln 1> NUL 2>&1
 RD /S /Q box2d.dir CMakeFiles Debug freetype.dir GLee.dir ipch lib lua.dir png.dir rainbow.dir Release Win32 1> NUL 2>&1
 cmake %* -G %MSVC_VER% %SOURCE_DIR%
-MSBuild Rainbow.sln /property:Configuration=Debug /maxcpucount
+cmake --build . --config Debug -- /maxcpucount


[Scripts] Fix ESO script.

[Scripts] Fix ESO script.

--- scripts/x86/eso.bat
+++ scripts/x86/eso.bat
@@ -1 +1 @@
-inject.exe --run "C:\Program Files (x86)\Zenimax Online\The Elder Scrolls Online\game\client\eso.exe" --inject --export Load --add-path --path-resolution --module cerberus.dll+inject.exe --run "E:\Games\Zenimax Online\The Elder Scrolls Online\game\client\eso.exe" --inject --export Load --add-path --path-resolution --module cerberus.dll


added server start script

added server start script

error: pathspec 'local-server.bat' did not match any file(s) known to git

--- local-server.bat
+++ local-server.bat
@@ -0,0 +1,4 @@
+SET PHP_EXE=C:\php7\php.exe
+SET PORT=80
+start %PHP_EXE% -S localhost:%PORT% -t %~dp0public
+exit


Update filters for OpenCover-rc

Update filters for OpenCover-rc

--- test-coverage.bat
+++ test-coverage.bat
@@ -56,10 +56,10 @@
 @Rem Local Build?
 @if not "%appveyor%" == "True" if exist "C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" ("C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe" DBCL.sln)

-@call :run-single-test "Extensions"  "+[DBCL]DD.Extends*"
-@call :run-single-test "ICodeSet"    "+[DBCL]DD.Collections.ICodeSet* +[DBCL]DD.Text*"
-@call :run-single-test "BitSetArray" "+[DBCL]DD.Collections.BitSetArray*"
-@call :run-single-test "Diagnostics" "+[DBCL]DD.Diagnostics*"
+@call :run-single-test "Extensions"  "+[DBCL]*"
+@call :run-single-test "ICodeSet"    "+[DBCL]*"
+@call :run-single-test "BitSetArray" "+[DBCL]*"
+@call :run-single-test "Diagnostics" "+[DBCL]*"
 @exit /b

 :run-single-test


Update redeemSteamKey.bat

Update redeemSteamKey.bat

Little cleanup of unneeded vars

--- redeemSteamKey.bat
+++ redeemSteamKey.bat
@@ -20,10 +20,7 @@
 set "$sessionid="

 set "$ContentType=Content-Type: application/x-www-form-urlencoded; charset=UTF-8"
-set "$Accept=accept: application/json"
-set "$Origin=Origin: https://store.steampowered.com"
 set "Cache=Cache-Control: no-cache"
-set "$ContentLength=Content-Length: 64"
 set "$Url=https://store.steampowered.com/account/ajaxregisterkey/"

 :: Activating on Steam


Update redeemSteamKey.bat

Update redeemSteamKey.bat

Regex fix and better notifications to discord

--- redeemSteamKey.bat
+++ redeemSteamKey.bat
@@ -1,34 +1,49 @@
+:: https://github.com/yotamHak/Steam-Related/wiki/redeemSteamKey.bat
+
 @echo off

+:: Getting key from clipboard
 @powershell -sta "add-type -as System.Windows.Forms; [windows.forms.clipboard]::GetText()" > key.txt
 set /p $Key= < key.txt

-echo %$Key% | findstr /r "[a-zA-z0-9][a-zA-z0-9][a-zA-z0-9][a-zA-z0-9][a-zA-z0-9]-[a-zA-z0-9][a-zA-z0-9][a-zA-z0-9][a-zA-z0-9][a-zA-z0-9]-[a-zA-z0-9][a-zA-z0-9][a-zA-z0-9][a-zA-z0-9][a-zA-z0-9]" > nul
+echo %$Key% | findstr /r "[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]-[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]-[a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9][a-zA-Z0-9]" > nul
 if %errorlevel%==1 (
 	echo Clipboard doesn't contain a Steam Key.
-	Pause
+	pause
 	exit
 )
+
+:: Set Discord hook to this variable
+set "$DiscordWebHookUrl="
+
+:: Set session id from steam to this variable
+set "$sessionid="

 set "$ContentType=Content-Type: application/x-www-form-urlencoded; charset=UTF-8"
 set "$Accept=accept: application/json"
 set "$Origin=Origin: https://store.steampowered.com"
-set "$DNT=DNT: 1"
 set "Cache=Cache-Control: no-cache"
 set "$ContentLength=Content-Length: 64"
 set "$Url=https://store.steampowered.com/account/ajaxregisterkey/"
-set "$sessionid=859e41f7f39da804c05088ba"
-set "$DiscordWebHookUrl=" ::Fill with Discord webhook

 :: Activating on Steam
-curl -X POST -b cookies.txt -H "%$Cache%" -H "%$DNT%" -H "%$ContentType%" -d "sessionid=%$sessionid%" -d "product_key=%$Key%" %$Url% > res.json
+curl -X POST -b cookies.txt -H "%$Cache%" -H "%$ContentType%" -d "sessionid=%$sessionid%" -d "product_key=%$Key%" %$Url% > res.json

 :: Cleaning up the response
 @powershell -sta "(Get-Content -Path 'res.json').replace('`','') | Set-Content cleanResponse.json;"
 @powershell -sta "(Get-Content -Path 'cleanResponse.json').replace('""','') | Set-Content cleanResponse.json;"
+:: Getting app name
+@powershell -sta "select-string -Path 'cleanResponse.json' -Pattern 'line_item_description:([^}]+)' -AllMatches | foreach-object { $_.Matches } | foreach-object { $_.Value }" > appname.txt
+@powershell -sta "(Get-Content -Path 'appname.txt').replace('line_item_description:','') | Set-Content appname.txt;"
+:: Getting app id
+@powershell -sta "select-string -Path 'cleanResponse.json' -Pattern '{packageid:([^,]+)' -AllMatches | foreach-object { $_.Matches } | foreach-object { $_.Value }" > appid.txt
+@powershell -sta "(Get-Content -Path 'appid.txt').replace('{packageid:','') | Set-Content appid.txt;"

 :: Saving into Variables
 set /p $cleanResponse= < cleanResponse.json
+set /p $appName= < appname.txt
+set /p $appId= < appid.txt
+set "appSubUrl=\"url\":\"https://store.steampowered.com/sub/%$appId%/\""

 :: Checking activation response
 type "cleanResponse.json" | find "purchase_result_details:0" > nul
@@ -36,68 +51,70 @@
 	set "color=\"color\":65280"
 	set "title=\"title\":\"Activated\""
 	set "description=\"description\":\"Key activated successfuly!\""
-	set "result=%$Key%: Key activated successfuly!"
+	set "result=%$appName% - %$Key%: Key activated successfuly!"
 )
 type "cleanResponse.json" | find "purchase_result_details:9" > nul
 if %errorlevel%==0 (
 	set "color=\"color\":12845619"
 	set "title=\"title\":\"Fail - Already Owns\""
 	set "description=\"description\":\"This Steam account already owns the product contained in this offer. To access them, visit your library in the Steam client.\""
-	set "result=%$Key%: Already Owns"
+	set "result=%$appName% - %$Key%: Already Owns"
 )
 type "cleanResponse.json" | find "purchase_result_details:13" > nul
 if %errorlevel%==0 (
 	set "color=\"color\":12845619"
 	set "title=\"title\":\"Fail - Unavailable\""
 	set "description=\"description\":\"Sorry, but this product is not available for purchase in this country. Your product key has not been redeemed.\""
-	set "result=%$Key%: Unavailable"
+	set "result=%$appName% - %$Key%: Unavailable"
 )
 type "cleanResponse.json" | find "purchase_result_details:14" > nul
 if %errorlevel%==0 (
 	set "color=\"color\":12845619"
 	set "title=\"title\":\"Fail - Invalid\""
 	set "description=\"description\":\"The product code you have entered is not valid. Please double check to see if you have mistyped your key. I, L, and 1 can look alike, as can V and Y, and 0 and O.\""
-	set "result=%$Key%: Invalid"
+	set "result=%$appName% - %$Key%: Invalid"
 )
 type "cleanResponse.json" | find "purchase_result_details:15" > nul
 if %errorlevel%==0 (
 	set "color=\"color\":12845619"
 	set "title=\"title\":\"Fail - Duplicate\""
 	set "description=\"description\":\"The product code you have entered has already been activated by a different Steam account. This code cannot be used again. Please contact the retailer or online seller where the code was purchased for assistance.\""
-	set "result=%$Key%: Duplicate"
+	set "result=%$appName% - %$Key%: Duplicate"
 )
 type "cleanResponse.json" | find "purchase_result_details:24" > nul
 if %errorlevel%==0 (
 	set "color=\"color\":12845619"
 	set "title=\"title\":\"Fail - Missing Base Game\""
 	set "description=\"description\":\"The product code you have entered requires ownership of another product before activation. If you are trying to activate an expansion pack or downloadable content, please first activate the original game, then activate this additional content.\""
-	set "result=%$Key%: Missing Base Game"
+	set "result=%$appName% - %$Key%: Missing Base Game"
 )
 type "cleanResponse.json" | find "purchase_result_details:50" > nul
 if %errorlevel%==0 (
 	set "color=\"color\":12845619"
 	set "title=\"title\":\"Fail - Wallet Code\""
 	set "description=\"description\":\"The code you have entered is from a Steam Gift Card or Steam Wallet Code.\""
-	set "result=%$Key%: Wallet Code"
+	set "result=%$appName% - %$Key%: Wallet Code"
 )
 type "cleanResponse.json" | find "purchase_result_details:53" > nul
 if %errorlevel%==0 (
 	set "color=\"color\":12845619"
 	set "title=\"title\":\"Fail - Too Many Activations\""
 	set "description=\"description\":\"There have been too many recent activation attempts from this account or Internet address. Please wait and try your product code again later.\""
-	set "result=%$Key%: Too Many Activations"
+	set "result=%$appName% - %$Key%: Too Many Activations"
 )

 cls

 :: Sending result to Discord
-curl -H "Content-Type: application/json" -X POST -d "{ \"content\": \"%$cleanResponse%\", \"embeds\":[{%title%,%description%,%color%,\"author\": {\"name\": \"%$Key%\"}}]}" %$DiscordWebHookUrl%
+curl -H "Content-Type: application/json" -X POST -d "{ \"username\": \"%$appName%: %$Key%\",\"content\": \"%$cleanResponse%\", \"embeds\":[{%appSubUrl%,%title%,%description%,%color%,\"author\": {\"name\": \"%$appName%: %$Key%\"}}]}" %$DiscordWebHookUrl%

 :: Cleaning up files
 del res.json
 del cleanResponse.json
 del key.txt
+del appname.txt
+del appid.txt

-ECHO %result%
-PAUSE
-EXIT
+echo %result%
+pause
+exit


new nuget version

new nuget version

--- createpackages.cmd
+++ createpackages.cmd
@@ -10,5 +10,5 @@
 msbuild /property:Configuration=release BotBuilderChannelConnectorOwin\BotBuilderChannelConnectorOwin.csproj
 for /f %%v in ('powershell -noprofile "(Get-Command .\BotBuilderChannelConnector\bin\release\Microsoft.Bot.Builder.dll).FileVersionInfo.FileVersion"') do set builder=%%v
 rem .\.paket\paket.exe pack output nugets version %builder%
-.\.paket\paket.exe pack output nugets version 3.5.5.5
+.\.paket\paket.exe pack output nugets version 3.5.5.6
 echo *** Finished building Bot.Builder.ChannelConnector


Updated the build template to use the new kvm

--- build-template/build.cmd
+++ build-template/build.cmd
@@ -20,9 +20,9 @@
 .nuget\NuGet.exe install Sake -version 0.2 -o packages -ExcludeVersion

 IF "%SKIP_KRE_INSTALL%"=="1" goto run
-CALL packages\KoreBuild\build\kvm upgrade -svr50 -x86
-CALL packages\KoreBuild\build\kvm install default -svrc50 -x86
+CALL packages\KoreBuild\build\kvm upgrade -runtime CLR -x86
+CALL packages\KoreBuild\build\kvm install default -runtime CoreCLR -x86

 :run
-CALL packages\KoreBuild\build\kvm use default -svr50 -x86
+CALL packages\KoreBuild\build\kvm use default -runtime CLR -x86
 packages\Sake\tools\Sake.exe -I packages\KoreBuild\build -f makefile.shade %*


Update RunBrowser.bat

Update RunBrowser.bat

--- bin/RunBrowser.bat
+++ bin/RunBrowser.bat
@@ -1,8 +1,24 @@
 :: Batch Script to Detect Google Chrome or Mozilla Firefox installation on machine
 :: Execute detected browser or default browser if no browser detected

-:: Author: Adnan Umer <u.adnan@outlook.com>
-:: Dated: 24 Janvary, 2015
+:: Copyright (c) Adnan Umer <u.adnan@outlook.com>.
+:: All rights reserved. Follow me @MrAdnanUmer
+
+:: Permission is hereby granted, free of charge, to any person obtaining a copy of this
+:: software and associated documentation files (the "Software"), to deal in the Software
+:: without restriction, including without limitation the rights to use, copy, modify, merge,
+:: publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons
+:: to whom the Software is furnished to do so, subject to the following conditions:
+::
+:: The above copyright notice and this permission notice shall be included in all copies or
+:: substantial portions of the Software.
+::
+:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
+:: INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
+:: PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
+:: FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+:: OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+:: DEALINGS IN THE SOFTWARE.

 @echo off
 setlocal EnableDelayedExpansion
@@ -49,4 +65,4 @@
 start "HTML" %1 %2 %3 %4 %5 %6 %7 %8 %9

 :end
-endlocal+endlocal


update a batch to run testem.

update a batch to run testem.

--- utils/watch.bat
+++ utils/watch.bat
@@ -1 +1,2 @@
+start testem
 grunt.cmd watch


add LANG support

add LANG support

--- vendor/init.bat
+++ vendor/init.bat
@@ -203,9 +203,12 @@

     :: define SVN_SSH so we can use git svn with ssh svn repositories
     if not defined SVN_SSH set "SVN_SSH=%GIT_INSTALL_ROOT:\=\\%\\bin\\ssh.exe"
-)
-
-endlocal & set "PATH=%PATH%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
+    for /F "delims=" %%F in ('env /usr/bin/locale -uU 2^>nul') do (
+        set "LANG=%%F"
+    )
+)
+
+endlocal & set "PATH=%PATH%" & set "LANG=%LANG%" & set "SVN_SSH=%SVN_SSH%" & set "GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
 %lib_console% debug-output init.bat "Env Var - GIT_INSTALL_ROOT=%GIT_INSTALL_ROOT%"
 %lib_console% debug-output init.bat "Found Git in: '%GIT_INSTALL_ROOT%'"
 goto :PATH_ENHANCE


Master changes

Master changes

--- run.bat
+++ run.bat
@@ -1 +1,3 @@
 Test changes.
+
+Master changes.


Updated the batch library framework. Any goal that begins with "list_" and that contains no . or \ is assumed to be a pseudo-target not to be logged. Added option -q to force running nmake without capturing its output. (Default for pseudo-targets like clean) Added option -Q to force capturing nmake output into TARGET.log. (Default for real targets)

--- C/include/make.bat
+++ C/include/make.bat
@@ -14,7 +14,14 @@
 :#		    Builds the 16-bits MS-DOS version if Visual C++ 1.52 is   *
 :#		    installed in its default location in C:\MSVC.	      *
 :#		    							      *
-:#		    Invokes configure.bat to generate config.bat, if absent.  *
+:#		    When building real targets, logs all output, including    *
+:#		    that on stderr, into a TARGET.log file. This file is      *
+:#		    automatically loaded in Notepad in case of error.	      *
+:#		    							      *
+:#		    When building pseudo-targets, like clean or list_dirs,    *
+:#		    no logging is done, and all output goes to stdout/stderr. *
+:#		    							      *
+:#		    Invokes configure.bat if config.HOSTNAME.bat is absent.   *
 :#		    See configure.bat header for a description of its action, *
 :#		    and of that of the optional configure.XXX.bat files.      *
 :#		    							      *
@@ -85,90 +92,283 @@
 :#                  Avoid getting the PID if we have it already.              *
 :#   2016-11-07 JFL Updated the 10/19 errorlevel fix to work for DO and EXEC. *
 :#   2016-11-08 JFL Change back to using variable MAKE, required by nmake<=7.1*
+:#   2016-12-13 JFL Any goal that begins with "list_" and that contains no .  *
+:#		    or \ is assumed to be a pseudo-target not to be logged.   *
+:#		    Added options -q and -Q to set the output capture manually.
+:#   2016-12-16 JFL Updated the batch library framework.		      *
 :#                                                                            *
 :#          Copyright 2016 Hewlett Packard Enterprise Development LP         *
 :# Licensed under the Apache 2.0 license  www.apache.org/licenses/LICENSE-2.0 *
 :#*****************************************************************************

 setlocal EnableExtensions EnableDelayedExpansion
-set "VERSION=2016-11-08"
-set "SCRIPT=%~nx0"
-set "SPATH=%~dp0" & set "SPATH=!SPATH:~0,-1!"
-set "ARG0=%~f0"
-set  ARGS=%*
-
-:# FOREACHLINE macro. (Change the delimiter to none to catch the whole lines.)
+set "VERSION=2016-12-16"
+set "SCRIPT=%~nx0"				&:# Script name
+set "SPATH=%~dp0" & set "SPATH=!SPATH:~0,-1!"	&:# Script path, without the trailing \
+set  "ARG0=%~f0"				&:# Script full pathname
+set ^"ARGS=%*^"					&:# Argument line
+
+:# Initialize the most commonly used library components.
+call :Library.Init
+
+:# Go process command-line arguments
+goto Main
+
+:#----------------------------------------------------------------------------#
+:#                                                                            #
+:#  Function	    Library.Init					      #
+:#                                                                            #
+:#  Description     Initialize the most commonly used library components      #
+:#                                                                            #
+:#----------------------------------------------------------------------------#
+
+:Library.Init
+:# Initialize this library modules definitions.
+:# Each one depends on the preceding ones, so if you need one, you need all the preceding ones as well.
+call :Call.Init			&:# Function calls and argument extraction
+call :Macro.Init		&:# Inline macros generation
+call :Debug.Init		&:# Debug routines
+call :Exec.Init			&:# Conditional execution routines
+
+:# FOREACHLINE macro. (Changes the delimiter to none to catch the whole lines.)
 set FOREACHLINE=for /f "delims="

-set "POPARG=call :PopArg"
-call :Macro.Init
-call :Debug.Init
-call :Exec.Init
-goto Main
+:# HOME variable. For analogy with Unix systems.
+if not defined HOME set "HOME=%HOMEDRIVE%%HOMEPATH%"
+
+goto :eof

 :#----------------------------------------------------------------------------#
 :#                                                                            #
-:#  Function        PopArg                                                    #
-:#                                                                            #
-:#  Description     Pop the first arguments from %ARGS% into %ARG%            #
-:#                                                                            #
-:#  Arguments       %ARGS%	    Command line arguments                    #
-:#                                                                            #
-:#  Returns         %ARG%           The unquoted argument                     #
+:#  Module	    Call						      #
+:#                                                                            #
+:#  Description     Manage function calls and argument extraction             #
+:#                                                                            #
+:#  Functions	    PopArg          Pop the first argument from %ARGS% into   #
+:#				     %ARG% and %"ARG"%			      #
+:#		    PopSimpleArg    Simpler and faster version, incompatible  #
+:#                                   with ! or ^ characters in ARG values.    #
+:#		    Prep2ExpandVars Prepare variables to return from the      #
+:#		 		    local scope (with expansion on or off)    #
+:#				    to a parent scope with expansion on.      #
+:#		    PrepArgVars     Prepare variables containing pathnames    #
+:#				    that will be passed as arguments.	      #
+:#                                                                            #
+:#  Macros	    %POPARG%        Pop one argument using :PopArg            #
+:#                  %POPSARG%       Pop one argument using :PopSimpleArg      #
+:#                  %LCALL%         Call a routine in this library, either    #
+:#                                   locally, or from an outside script.      #
+:#                  %XCALL%         Call an outside script routine, from      #
+:#                                   another instance of that outside script. #
+:#                  %XCALL@%        Idem, but with all args stored in one var.#
+:#                                                                            #
+:#  Variables	    %ARG%           The unquoted argument                     #
 :#                  %"ARG"%         The actual argument, possibly quoted      #
-:#                                                                            #
-:#  Notes 	    Works around the defect of the shift command, which       #
-:#                  pops the first argument from the %* list, but does not    #
-:#                  remove it from %*.                                        #
-:#                                                                            #
-:#                  Use an inner call to make sure the argument parsing is    #
+:#                  %ARGS%	    Remaining command line arguments          #
+:#                                                                            #
+:#                  %CR%            An ASCII Carrier Return character '\x0D'  #
+:#                  %LF%            An ASCII Line Feed character '\x0A'       #
+:#                  %BS%            An ASCII Back Space character '\x08'      #
+:#                  %FF%            An ASCII Form Feed character '\x0C'       #
+:#                                                                            #
+:#  Notes 	    PopArg works around the defect of the shift command,      #
+:#                  which pops the first argument from the %* list, but does  #
+:#                  not remove it from %*.                                    #
+:#                  Also works around another defect with tricky characters   #
+:#                  like ! or ^ being lost when variable expansion is on.     #
+:#                                                                            #
+:#                  Important: The performance of this routine is much better #
+:#                  when invoked with variable expansion disabled. This is    #
+:#                  due to the complex processing done to avoid issues with   #
+:#                  tricky characters like ! or ^ when expansion is enabled.  #
+:#                  If you're sure that NONE of the arguments contain such    #
+:#                  tricky characters, then call :PopSimpleArg.               #
+:#                                                                            #
+:#                  Uses an inner call to make sure the argument parsing is   #
 :#                  done by the actual cmd.exe parser. This guaranties that   #
 :#                  arguments are split exactly as shift would have done.     #
 :#                                                                            #
 :#                  But call itself has a quirk, which requires a convoluted  #
 :#                  workaround to process the /? argument.                    #
+:#                                                                            #
+:#                  Known limitation: After using :PopArg, all consecutive    #
+:#                  argument separators in %ARGS% are replaced by one space.  #
+:#                  For example: "A==B" becomes "A B"                         #
+:#                  This does not change the result of subsequent calls to    #
+:#                  :PopArg, but this prevents from using the tail itself as  #
+:#                  an argument. => Do not use :PopArg to get :Exec args!     #
 :#                                                                            #
 :#                  To do: Detect if the last arg has mismatched quotes, and  #
 :#                  if it does, append one.                                   #
 :#                  Right now such mismatched quotes will cause an error here.#
-:#                  It is easily feasible to work around this, but this is    #
-:#                  useless as passing back an invalid argument like this     #
-:#                  will only cause more errors further down.                 #
+:#                  Do not work around this error to only pass back the bad   #
+:#                  argument, as this will only cause more errors further down#
 :#                                                                            #
 :#  History                                                                   #
 :#   2015-04-03 JFL Bug fix: Quoted args with an & inside failed to be poped. #
 :#   2015-07-06 JFL Bug fix: Call quirk prevented inner call from popping /?. #
+:#   2016-11-18 JFL Fixed popping arguments containing % characters.          #
+:#   2016-11-21 JFL Fixed popping quoted arguments containing &|<> characters.#
+:#   2016-11-22 JFL Fixed popping arguments containing ^ characters.          #
+:#   2016-11-24 JFL Updated %POPARG% to work with trick characters ! and ^ in #
+:#                  delayed expansion mode. The old and faster version is now #
+:#		    called %POPSARG%.                                         #
+:#		    Added routine :Prep2ExpandVars allowing to pass any       #
+:#		    tricky string across call or endlocal barriers.           #
+:#   2016-12-01 JFL Added a %FF% Form Feed character variable.                #
 :#                                                                            #
 :#----------------------------------------------------------------------------#

+call :Call.Init
+goto Call.end
+
+:Call.Init
+if not defined LCALL set "LCALL=call"	&:# Macro to call functions in this library
+set "POPARG=%LCALL% :PopArg"
+set "POPSARG=%LCALL% :PopSimpleArg"
+
+:# Mechanism for calling subroutines in a second external instance of the top script.
+set ^"XCALL=call "!ARG0!" -call^"	&:# This is the top script's (or this lib's if called directly) ARG0
+set ^"XCALL@=!XCALL! :CallVar^"		&:# Indirect call, with the label and arguments in a variable
+
+:# Define a LF variable containing a Line Feed ('\x0A')
+set LF=^
+%# The two blank lines here are necessary. #%
+%# The two blank lines here are necessary. #%
+
+:# Define a CR variable containing a Carriage Return ('\x0D')
+for /f %%a in ('copy /Z %COMSPEC% nul') do set "CR=%%a"
+
+:# Define a BS variable containing a BackSpace ('\x08')
+:# Use prompt to store a  backspace+space+backspace into a DEL variable.
+for /F "tokens=1 delims=#" %%a in ('"prompt #$H# & echo on & for %%b in (1) do rem"') do set "DEL=%%a"
+:# Then extract the first backspace
+set "BS=%DEL:~0,1%"
+
+:# Define a FF variable containing a Form Feed ('\x0C')
+for /f %%A in ('cls') do set "FF=%%A"
+
+:# Define variables for problematic characters, that cause parsing issues.
+:# Use the ASCII control character name, or the html entity name.
+:# Warning: The excl and hat characters need different quoting depending on context.
+set  "DEBUG.percnt=%%"	&:# One percent sign
+set  "DEBUG.excl=^!"	&:# One exclamation mark
+set  "DEBUG.hat=^"	&:# One caret, aka. circumflex accent, or hat sign
+set ^"DEBUG.quot=""	&:# One double quote
+set  "DEBUG.apos='"	&:# One apostrophe
+set  "DEBUG.amp=&"	&:# One ampersand
+set  "DEBUG.vert=|"	&:# One vertical bar
+set  "DEBUG.gt=>"	&:# One greater than sign
+set  "DEBUG.lt=<"	&:# One less than sign
+set  "DEBUG.lpar=("	&:# One left parenthesis
+set  "DEBUG.rpar=)"	&:# One right parenthesis
+set  "DEBUG.lbrack=["	&:# One left bracket
+set  "DEBUG.rbrack=]"	&:# One right bracket
+set  "DEBUG.sp= "	&:# One space
+set  "DEBUG.tab=	"	&:# One tabulation
+set  "DEBUG.quest=?"	&:# One question mark
+set  "DEBUG.ast=*"	&:# One asterisk
+set  "DEBUG.cr=!CR!"	&:# One carrier return
+set  "DEBUG.lf=!LF!"	&:# One line feed
+set  "DEBUG.bs=!BS!"	&:# One backspace
+set  "DEBUG.ff=!FF!"	&:# One form feed
+goto :eof
+
 :PopArg
+if "!!"=="" goto :PopArg.Eon
+:PopArg.Eoff
+:PopSimpleArg :# Will corrupt result if expansion is on and ARG contains ^ or ! characters.
 :# Gotcha: The call parser first scans its command line for an unquoted /?.
 :# If it finds one anywhere on the command line, then it ignores the target label and displays call help.
 :# To work around that, we initialize %ARG% and %"ARG"% with an impossible combination of values.
 set "ARG=Yes"
 set ""ARG"=No"
-call :PopArg.Helper %ARGS% >NUL 2>NUL &:# Output redirections ensure the call help is not actually output.
+set "PopArg.ARGS="
+if defined ARGS (
+  setlocal EnableDelayedExpansion
+  for /f "delims=" %%a in ("!ARGS:%%=%%%%!") do endlocal & set ^"PopArg.ARGS=%%a^"
+)
+call :PopArg.Helper %PopArg.ARGS% >NUL 2>NUL &:# Output redirections ensure the call help is not actually output.
 :# Finding that impossible combination now is proof that the call was not executed.
 :# In this case, try again with the /? quoted, to prevent the call parser from processing it.
 :# Note that we can not systematically do this /? enquoting, else it's "/?" that would break the call.
-if "%ARG%"=="Yes" if [%"ARG"%]==[No] call :PopArg.Helper %ARGS:/?="/?"%
+if "%ARG%"=="Yes" if [%"ARG"%]==[No] call :PopArg.Helper %PopArg.ARGS:/?="/?"%
+set "PopArg.ARGS="
 goto :eof
 :PopArg.Helper
-set "ARG=%~1"	&:# Remove quotes from the argument
-set ""ARG"=%1"	&:# The same with quotes, if any, should we need them
+set "ARG=%~1"		&:# Remove quotes from the argument
+set ^""ARG"=%1^"	&:# The same with quotes, if any, should we need them
+if defined ARG set "ARG=%ARG:^^=^%"
+if defined "ARG" set ^""ARG"=%"ARG":^^=^%^"
 :# Rebuild the tail of the argument line, as shift does not do it
 :# Never quote the set ARGS command, else some complex quoted strings break
 set ARGS=%2
 :PopArg.GetNext
 shift
+if defined ARGS set ^"ARGS=%ARGS:^^=^%^"
 if [%2]==[] goto :eof
 :# Leave quotes in the tail of the argument line
 set ARGS=%ARGS% %2
 goto :PopArg.GetNext

+:PopArg.Eon
+setlocal DisableDelayedExpansion
+call :PopArg
+call :Prep2ExpandVars ARG ^""ARG"^" ARGS
+setlocal EnableDelayedExpansion
+for /f %%a in ("-!ARG!") do for /f %%b in ("-!"ARG"!") do for /f %%c in ("-!ARGS!") do (
+  endlocal
+  endlocal
+  set "ARG=%%a"
+  set "ARG=!ARG:~1!"
+  set ^""ARG"=%%b^"
+  set ^""ARG"=!"ARG":~1!^"
+  set ^"ARGS=%%c^"
+  set "ARGS=!ARGS:~1!"
+)
+goto :eof
+
+:# Prepare variables to return from the local scope (with expansion on or off) to a parent scope with expansion on
+:Prep2ExpandVars VAR [VAR ...]
+if "!!"=="" goto :Prep2ExpandVars.Eon
+:Prep2ExpandVars.Eoff	:# The local scope has expansion off
+setlocal EnableDelayedExpansion
+set "VALUE=!%~1!"
+call :Prep2ExpandVars.Eon VALUE
+endlocal & set "%~1=%VALUE%"
+if not [%2]==[] shift & goto :Prep2ExpandVars.Eoff
+goto :eof
+
+:# Prepare variables, assuming the local scope itself has expansion on
+:Prep2ExpandVars.Eon VAR [VAR ...]
+if defined %1 (
+  for %%e in (sp tab cr lf quot amp vert lt gt hat percnt) do ( :# Encode named character entities
+    for %%c in ("!DEBUG.%%e!") do (
+      set "%~1=!%~1:%%~c= DEBUG.%%e !"
+    )
+  )
+  call set "%~1=%%%~1:^!= DEBUG.excl %%" 	& rem :# Encode exclamation points
+  call set "%~1=%%%~1: =^!%%"			& rem :# Encode final expandable entities
+)
+if not [%2]==[] shift & goto :Prep2ExpandVars.Eon
+goto :eof
+
+:# Prepare variables containing pathnames that will be passed as "arguments"
+:PrepArgVars
+set "%~1=!%~1:%%=%%%%!"				&:# Escape percent signs
+if not [%2]==[] shift & goto :PrepArgVars
+goto :eof
+
+:# Indirect call, with the label and arguments in a variable
+:CallVar CMDVAR
+call !%1:%%=%%%%!
+exit /b
+
+:Call.end
+
 :#----------------------------------------------------------------------------#
 :#                                                                            #
-:#  Function        Inline macro functions                                    #
+:#  Module          Macro						      #
 :#                                                                            #
 :#  Description     Tools for defining inline functions,                      #
 :#                  also known as macros by analogy with Unix shells macros   #
@@ -176,7 +376,7 @@
 :#  Macros          %MACRO%         Define the prolog code of a macro         #
 :#                  %/MACRO%        Define the epilog code of a macro         #
 :#                                                                            #
-:#  Variables       %LF%            A Line Feed ASCII character '\x0A'        #
+:#  Variables       %LF1%           A Line Feed ASCII character '\x0A'        #
 :#                  %LF2%           Generates a LF when expanded twice        #
 :#                  %LF3%           Generates a LF when expanded 3 times      #
 :#                                  Etc...                                    #
@@ -239,13 +439,6 @@
 goto :Macro.End

 :Macro.Init
-:# Define a LF variable containing a Line Feed ('\x0A')
-:# The two blank lines below are necessary.
-set LF=^
-
-
-:# End of define Line Feed. The two blank lines above are necessary.
-
 :# LF generator variables, that become an LF after N expansions
 :# %LF1% == %LF% ; %LF2% == To expand twice ; %LF3% == To expand 3 times ; Etc
 :# Starting with LF2, the right # of ^ doubles on every line,
@@ -261,17 +454,19 @@
 set "^!=^^^^^^^!"	&:# Define a %!%DelayedExpansion%!% variable
 set "'^!=^^^!"		&:# Idem, but inside a quoted string
 set ">=^^^>"		&:# Insert a redirection character
+set "<=^^^<"		&:# Insert a redirection character
 set "&=^^^&"		&:# Insert a command separator in a macro
 :# Idem, to be expanded twice, for use in macros within macros
 set "^!2=^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^!"
 set "'^!2=^^^^^^^!"
 set "&2=^^^^^^^^^^^^^^^&"

-set "MACRO=for %%$ in (1 2) do if %%$==2"			&:# Prolog code of a macro
+set "MACRO=for %%$ in (1 2) do if %%$==2"				&:# Prolog code of a macro
 set "/MACRO=else setlocal enableDelayedExpansion %&% set MACRO.ARGS="	&:# Epilog code of a macro
+set "ENDMACRO=endlocal"	&:# Ends the macro local scope started in /MACRO. Necessary before macro exit.

 set "ON_MACRO_EXIT=for /f "delims=" %%r in ('echo"	&:# Begin the return variables definitions
-set "/ON_MACRO_EXIT=') do endlocal %&% %%r"		&:# End the return variables definitions
+set "/ON_MACRO_EXIT=') do %ENDMACRO% %&% %%r"		&:# End the return variables definitions

 :# Primitive macro debugging definitions
 :# Macros, usable anywhere, including within other macros, for conditionally displaying debug information
@@ -287,22 +482,12 @@
 set "XDLEVEL=0" &:# 0=No macro debug; 1=medium debug; 2=full debug; 3=Even more debug
 set "IF_XDLEVEL=for /f %%' in ('call echo.%%XDLEVEL%%') do if %%' GEQ"

-:# While at it, and although this is unrelated to macros, define other useful ASCII control codes
-:# Define a CR variable containing a Carriage Return ('\x0D')
-for /f %%a in ('copy /Z %COMSPEC% nul') do set "CR=%%a"
-
-:# Define a BS variable containing a BackSpace ('\x08')
-:# Use prompt to store a  backspace+space+backspace into a DEL variable.
-for /F "tokens=1 delims=#" %%a in ('"prompt #$H# & echo on & for %%b in (1) do rem"') do set "DEL=%%a"
-:# Then extract the first backspace
-set "BS=%DEL:~0,1%"
-
 goto :eof
 :Macro.end

 :#----------------------------------------------------------------------------#
 :#                                                                            #
-:#  Function        Debug routines					      #
+:#  Module	    Debug						      #
 :#                                                                            #
 :#  Description     A collection of debug routines                            #
 :#                                                                            #
@@ -417,6 +602,8 @@
 :#   2016-09-01 JFL Bug fix: %RETURN% incorrectly returned empty variables.   #
 :#   2016-11-02 JFL Bug fix: Avoid log file redirection failures in recursive #
 :#                  scripts.                                                  #
+:#   2016-11-13 JFL Bug fix: Correctly return special characters & | < > ? *  #
+:#   2016-11-24 JFL Fixed tracing %FUNCTION% arguments with ^ and % chars.    #
 :#                                                                            #
 :#----------------------------------------------------------------------------#

@@ -428,29 +615,8 @@
 if exist echo >&2 echo WARNING: The file "echo" in the current directory will cause problems. Please delete it and retry.
 :# Inherited variables from the caller: DEBUG, VERBOSE, INDENT, >DEBUGOUT
 :# Initialize other debug variables
-set "ECHO=call :Echo"
-set "ECHOVARS=call :EchoVars"
-:# Define variables for problematic characters, that cause parsing issues
-:# Use the ASCII control character name, or the html entity name.
-:# Warning: The excl and hat characters need different quoting depending on context.
-set "DEBUG.percnt=%%"	&:# One percent sign
-set "DEBUG.excl=^!"	&:# One exclamation mark
-set "DEBUG.hat=^"	&:# One caret, aka. circumflex accent, or hat sign
-set ^"DEBUG.quot=""	&:# One double quote
-set "DEBUG.apos='"	&:# One apostrophe
-set "DEBUG.amp=&"	&:# One ampersand
-set "DEBUG.vert=|"	&:# One vertical bar
-set "DEBUG.gt=>"	&:# One greater than sign
-set "DEBUG.lt=<"	&:# One less than sign
-set "DEBUG.lpar=("	&:# One left parenthesis
-set "DEBUG.rpar=)"	&:# One right parenthesis
-set "DEBUG.lbrack=["	&:# One left bracket
-set "DEBUG.rbrack=]"	&:# One right bracket
-set "DEBUG.sp= "	&:# One space
-set "DEBUG.tab=	"	&:# One tabulation
-set "DEBUG.cr=!CR!"	&:# One carrier return
-set "DEBUG.lf=!LF!"	&:# One line feed
-set "DEBUG.bs=!BS!"	&:# One backspace
+set "ECHO=%LCALL% :Echo"
+set "ECHOVARS=%LCALL% :EchoVars"
 :# The FUNCTION, UPVAR, and RETURN macros should work with delayed expansion on or off
 set MACRO.GETEXP=(if "%'!2%%'!2%"=="" (set MACRO.EXP=EnableDelayedExpansion) else set MACRO.EXP=DisableDelayedExpansion)
 set UPVAR=call set DEBUG.RETVARS=%%DEBUG.RETVARS%%
@@ -458,66 +624,69 @@
   set DEBUG.EXITCODE=%!%MACRO.ARGS%!%%\n%
   if defined DEBUG.EXITCODE set DEBUG.EXITCODE=%!%DEBUG.EXITCODE: =%!%%\n%
   if not defined DEBUG.EXITCODE set DEBUG.EXITCODE=%!%DEBUG.ERRORLEVEL%!%%\n%
-  set "DEBUG.SETARGS=" %\n%
-  for %%v in (%!%DEBUG.RETVARS%!%) do ( %\n%
-    set "DEBUG.VALUE=%'!%%%v%'!%" %# We must remove problematic characters in that value #% %\n%
-    if defined DEBUG.VALUE ( %# Else the following lines will generate phantom characters #% %\n%
-      set "DEBUG.VALUE=%'!%DEBUG.VALUE:%%=%%DEBUG.percnt%%%'!%"	%# Encode percent #% %\n%
-      for %%e in (sp tab cr lf quot) do for %%c in ("%'!%DEBUG.%%e%'!%") do ( %# Encode named character entities #% %\n%
-	set "DEBUG.VALUE=%'!%DEBUG.VALUE:%%~c=%%DEBUG.%%e%%%'!%" %\n%
+  for %%l in ("%'!%LF%'!%") do ( %# Make it easy to insert line-feeds in any mode #% %\n%
+    set "DEBUG.SETARGS=""" %# The initial "" makes sure that for loops below never get an empty arg list #% %\n%
+    for %%v in (%!%DEBUG.RETVARS%!%) do ( %\n%
+      set "DEBUG.VALUE=%'!%%%v%'!%" %# We must remove problematic characters in that value #% %\n%
+      if defined DEBUG.VALUE ( %# Else the following lines will generate phantom characters #% %\n%
+	set "DEBUG.VALUE=%'!%DEBUG.VALUE:%%=%%DEBUG.percnt%%%'!%"	%# Encode percent #% %\n%
+	for %%e in (sp tab cr lf quot amp vert lt gt) do for %%c in ("%'!%DEBUG.%%e%'!%") do ( %# Encode named character entities #% %\n%
+	  set "DEBUG.VALUE=%'!%DEBUG.VALUE:%%~c=%%DEBUG.%%e%%%'!%" %\n%
+	) %\n%
+	set "DEBUG.VALUE=%'!%DEBUG.VALUE:^^=%%DEBUG.hat%%%'!%"	%# Encode carets #% %\n%
+	call set "DEBUG.VALUE=%%DEBUG.VALUE:%!%=^^^^%%" 		%# Encode exclamation points #% %\n%
+	set "DEBUG.VALUE=%'!%DEBUG.VALUE:^^^^=%%DEBUG.excl%%%'!%"	%# Encode exclamation points #% %\n%
       ) %\n%
-      set "DEBUG.VALUE=%'!%DEBUG.VALUE:^^=%%DEBUG.hat%%%'!%"	%# Encode carets #% %\n%
-      call set "DEBUG.VALUE=%%DEBUG.VALUE:%!%=^^^^%%" 		%# Encode exclamation points #% %\n%
-      set "DEBUG.VALUE=%'!%DEBUG.VALUE:^^^^=%%DEBUG.excl%%%'!%"	%# Encode exclamation points #% %\n%
+      set DEBUG.SETARGS=%!%DEBUG.SETARGS%!% "%%v=%'!%DEBUG.VALUE%'!%"%\n%
     ) %\n%
-    set DEBUG.SETARGS=%!%DEBUG.SETARGS%!% "%%v=%'!%DEBUG.VALUE%'!%" %\n%
-  ) %\n%
-  if %!%DEBUG%!%==1 ( %# Build the debug message and display it #% %\n%
-    set "DEBUG.MSG=return %'!%DEBUG.EXITCODE%'!%" %\n%
-    for %%v in (%!%DEBUG.SETARGS%!%) do ( %\n%
-      set "DEBUG.MSG=%'!%DEBUG.MSG%'!% %%DEBUG.amp%% set %%v" %!% %\n%
+    if %!%DEBUG%!%==1 ( %# Build the debug message and display it #% %\n%
+      set "DEBUG.MSG=return %'!%DEBUG.EXITCODE%'!%" %\n%
+      for /f "delims=" %%v in ("%'!%DEBUG.SETARGS: =%%~l%'!%") do if not %%v=="" ( %# for /f avoids issues with ? and * #% %\n%
+	set "DEBUG.MSG=%'!%DEBUG.MSG%'!% %%DEBUG.amp%% set %%v" %!% %\n%
+      ) %\n%
+      call set "DEBUG.MSG=%'!%DEBUG.MSG:%%=%%DEBUG.excl%%%'!%" %# Change all percent to ! #%  %\n%
+      if defined ^^%>%DEBUGOUT ( %# If we use a debugging stream distinct from stdout #% %\n%
+	%!%LCALL%!% :Echo.Eval2DebugOut DEBUG.MSG %# Use a helper routine, as delayed redirection does not work #% %\n%
+      ) else ( %# Output directly here, which is faster #% %\n%
+	for /f "delims=" %%c in ("%'!%INDENT%'!%%'!%DEBUG.MSG%'!%") do echo %%c%# Use a for loop to do a double !variable! expansion #%%\n%
+      ) %\n%
+      if defined LOGFILE ( %# If we have to send a copy to a log file #% %\n%
+	%!%LCALL%!% :Echo.Eval2LogFile DEBUG.MSG %# Use a helper routine, as delayed redirection does not work #% %\n%
+      ) %\n%
     ) %\n%
-    call set "DEBUG.MSG=%'!%DEBUG.MSG:%%=%%DEBUG.excl%%%'!%" %# Change all percent to ! #%  %\n%
-    if defined ^^%>%DEBUGOUT ( %# If we use a debugging stream distinct from stdout #% %\n%
-      call :Echo.Eval2DebugOut %!%DEBUG.MSG%!%%# Use a helper routine, as delayed redirection does not work #%%\n%
-    ) else ( %# Output directly here, which is faster #% %\n%
-      for /f "delims=" %%c in ("%'!%INDENT%'!%%'!%DEBUG.MSG%'!%") do echo %%c%# Use a for loop to do a double !variable! expansion #% %\n%
-    ) %\n%
-    if defined LOGFILE ( %# If we have to send a copy to a log file #% %\n%
-      call :Echo.Eval2LogFile %!%DEBUG.MSG%!%%# Use a helper routine, as delayed redirection does not work #%%\n%
-    ) %\n%
-  ) %\n%
-  for %%r in (%!%DEBUG.EXITCODE%!%) do ( %# Carry the return values through the endlocal barriers #% %\n%
-    for /f "delims=" %%a in (""" %'!%DEBUG.SETARGS%'!%") do ( %# The initial "" makes sure the body runs even if the arg list is empty #% %\n%
-      endlocal %&% endlocal %&% endlocal %# Exit the RETURN and FUNCTION local scopes #% %\n%
-      if "%'!%%'!%"=="" ( %# Delayed expansion is ON #% %\n%
+    for %%r in (%!%DEBUG.EXITCODE%!%) do ( %# Carry the return values through the endlocal barriers #% %\n%
+      for /f "delims=" %%a in ("%'!%DEBUG.SETARGS%'!%") do ( %\n%
+	endlocal %&% endlocal %&% endlocal %# Exit the RETURN and FUNCTION local scopes #% %\n%
 	set "DEBUG.SETARGS=%%a" %\n%
-	call set "DEBUG.SETARGS=%'!%DEBUG.SETARGS:%%=%%DEBUG.excl%%%'!%" %# Change all percent to ! #%  %\n%
-	for %%v in (%!%DEBUG.SETARGS:~3%!%) do ( %\n%
-	  set %%v %# Set each upvar variable in the caller's scope #% %\n%
+	if "%'!%%'!%"=="" ( %# Delayed expansion is ON #% %\n%
+	  call set "DEBUG.SETARGS=%'!%DEBUG.SETARGS:%%=%%DEBUG.excl%%%'!%" %# Change all percent to ! #%  %\n%
+	  for /f "delims=" %%v in ("%'!%DEBUG.SETARGS: =%%~l%'!%") do if not %%v=="" ( %# for /f avoids issues with ? and * #% %\n%
+	    set %%v %# Set each upvar variable in the caller's scope #% %\n%
+	  ) %\n%
+	) else ( %# Delayed expansion is OFF #% %\n%
+	  setlocal EnableDelayedExpansion %\n%
+	  for /f "delims=" %%v in ("%'!%DEBUG.SETARGS: =%%~l%'!%") do if %%v=="" ( %# for /f avoids issues with ? and * #% %\n%
+	    endlocal %\n%
+	  ) else ( %\n%
+	    call set %%v %# Set each upvar variable in the caller's scope #% %\n%
+	  ) %\n%
 	) %\n%
 	set "DEBUG.SETARGS=" %\n%
-      ) else ( %# Delayed expansion is OFF #% %\n%
-	set "DEBUG.hat=^^^^" %# Carets need to be doubled to be set right below #% %\n%
-	for %%v in (%%a) do if not %%v=="" ( %\n%
-	  call set %%v %# Set each upvar variable in the caller's scope #% %\n%
-	) %\n%
-	set "DEBUG.hat=^^" %# Restore the normal value with a single caret #% %\n%
+	exit /b %%r %# Return to the caller #% %\n%
       ) %\n%
-      exit /b %%r %# Return to the caller #% %\n%
     ) %\n%
   ) %\n%
 ) %/MACRO%
 :Debug.Init.2
-set "LOG=call :Echo.Log"
+set "LOG=%LCALL% :Echo.Log"
 set ">>LOGFILE=>>%LOGFILE%"
 if not defined LOGFILE set "LOG=rem" & set ">>LOGFILE=rem"
 if .%LOGFILE%.==.NUL. set "LOG=rem" & set ">>LOGFILE=rem"
 if .%NOREDIR%.==.1. set "LOG=rem" & set ">>LOGFILE=rem" &:# A parent script is already redirecting output. Trying to do it again here would fail.
-set "ECHO.V=call :Echo.Verbose"
-set "ECHO.D=call :Echo.Debug"
-set "ECHOVARS.V=call :EchoVars.Verbose"
-set "ECHOVARS.D=call :EchoVars.Debug"
+set "ECHO.V=%LCALL% :Echo.Verbose"
+set "ECHO.D=%LCALL% :Echo.Debug"
+set "ECHOVARS.V=%LCALL% :EchoVars.Verbose"
+set "ECHOVARS.D=%LCALL% :EchoVars.Debug"
 :# Variables inherited from the caller...
 :# Preserve INDENT if it contains just spaces, else clear it.
 for /f %%s in ('echo.%INDENT%') do set "INDENT="
@@ -542,7 +711,8 @@
 set "FUNCTION0=rem"
 set FUNCTION=%MACRO.GETEXP% %&% %MACRO% ( %\n%
   call set "FUNCTION.NAME=%%0" %\n%
-  call set "ARGS=%%*"%\n%
+  call set ARGS=%%*%# Do not quote this, to keep string/non string aternance #%%\n%
+  if defined ARGS set ARGS=%!%ARGS:^^^^^^^^^^^^^^^^=^^^^^^^^%!%%# ^carets are doubled in quoted strings, halved outside. => Quadruple them if using unquoted ones #%%\n%
   set "DEBUG.RETVARS=" %\n%
   if not defined MACRO.ARGS set "MACRO.ARGS=%'!%MACRO.EXP%'!%" %\n%
   setlocal %!%MACRO.ARGS%!% %\n%
@@ -564,18 +734,20 @@
 set "DEBUG=1"
 set "DEBUG.ENTRY=:Debug.Entry"
 set "IF_DEBUG=if .%DEBUG%.==.1."
-set "FUNCTION0=call call :Debug.Entry0 %%0 %%*"
+set "FUNCTION0=call %LCALL% :Debug.Entry0 %%0 %%*"
 set FUNCTION=%MACRO.GETEXP% %&% %MACRO% ( %\n%
   call set "FUNCTION.NAME=%%0" %\n%
-  call set "ARGS=%%*"%\n%
+  call set ARGS=%%*%# Do not quote this, to keep string/non string aternance #%%\n%
+  if defined ARGS set ARGS=%!%ARGS:^^^^^^^^^^^^^^^^=^^^^^^^^%!%%# ^carets are doubled in quoted strings, halved outside. => Quadruple them if using unquoted ones #%%\n%
   if %!%DEBUG%!%==1 ( %# Build the debug message and display it #% %\n%
+    set DEBUG.MSG=call %!%FUNCTION.NAME%!% %!%ARGS%!%%\n%
     if defined ^^%>%DEBUGOUT ( %# If we use a debugging stream distinct from stdout #% %\n%
-      call :Echo.2DebugOut call %!%FUNCTION.NAME%!% %!%ARGS%!%%# Use a helper routine, as delayed redirection does not work #%%\n%
+      %!%LCALL%!% :Echo.2DebugOut DEBUG.MSG %# Use a helper routine, as delayed redirection does not work #% %\n%
     ) else ( %# Output directly here, which is faster #% %\n%
-      echo%!%INDENT%!% call %!%FUNCTION.NAME%!% %!%ARGS%!%%\n%
+      echo%!%INDENT%!% %!%DEBUG.MSG%!%%\n%
     ) %\n%
     if defined LOGFILE ( %# If we have to send a copy to a log file #% %\n%
-      call :Echo.2LogFile call %!%FUNCTION.NAME%!% %!%ARGS%!%%# Use a helper routine, as delayed redirection does not work #%%\n%
+      %!%LCALL%!% :Echo.2LogFile DEBUG.MSG %# Use a helper routine, as delayed redirection does not work #% %\n%
     ) %\n%
     call set "INDENT=%'!%INDENT%'!%  " %\n%
   ) %\n%
@@ -583,19 +755,18 @@
   if not defined MACRO.ARGS set "MACRO.ARGS=%'!%MACRO.EXP%'!%" %\n%
   setlocal %!%MACRO.ARGS%!% %\n%
 ) %/MACRO%
-set "RETURN0=call :Debug.Return0 & exit /b"
+set "RETURN0=call %LCALL% :Debug.Return0 %%ERRORLEVEL%% & exit /b"
 :# Macro for displaying comments on the return log line
-set RETURN#=set "RETURN#ERR=%'!%ERRORLEVEL%'!%" %&% %MACRO% ( %\n%
-  set RETVAL=%!%MACRO.ARGS:~1%!%%\n%
-  call :Debug.Return0 %!%RETURN#ERR%!% %\n%
-  %ON_MACRO_EXIT% set "INDENT=%'!%INDENT%'!%" %/ON_MACRO_EXIT% %&% set "RETURN#ERR=" %&% exit /b %\n%
+set RETURN#=call set "RETURN.ERR=%%ERRORLEVEL%%" %&% %MACRO% ( %\n%
+  %LCALL% :Debug.Return# %# Redirections can't work in macro. Do it in a function. #% %\n%
+  for %%r in (%!%RETURN.ERR%!%) do %ENDMACRO% %&% set "RETURN.ERR=" %&% call set "INDENT=%%INDENT:~2%%" %&% exit /b %%r %\n%
 ) %/MACRO%
 set "EXEC.ARGS= %EXEC.ARGS%"
 set "EXEC.ARGS=%EXEC.ARGS: -d=% -d"
 set "EXEC.ARGS=%EXEC.ARGS:~1%"
 :# Reverse the above optimization
-set "ECHO.D=call :Echo.Debug"
-set "ECHOVARS.D=call :EchoVars.Debug"
+set "ECHO.D=%LCALL% :Echo.Debug"
+set "ECHOVARS.D=%LCALL% :EchoVars.Debug"
 goto :eof

 :Debug.Entry0
@@ -614,11 +785,18 @@
 set "INDENT=%INDENT%  "
 goto :eof

-:Debug.Return0 %1=Optional exit code
-%>DEBUGOUT% echo %INDENT%return !RETVAL!
-if defined LOGFILE %>>LOGFILE% echo %INDENT%return !RETVAL!
+:Debug.Return0 %1=Exit code
+%>DEBUGOUT% echo %INDENT%return %1
+if defined LOGFILE %>>LOGFILE% echo %INDENT%return %1
 set "INDENT=%INDENT:~0,-2%"
 exit /b %1
+
+:Debug.Return# :# %RETURN.ERR% %MACRO.ARGS%
+setlocal DisableDelayedExpansion
+%>DEBUGOUT% echo %INDENT%return %RETURN.ERR% ^&:#%MACRO.ARGS%
+if defined LOGFILE %>>LOGFILE% echo %INDENT%return %RETURN.ERR% ^&:#%MACRO.ARGS%
+endlocal
+goto :eof &:# %RETURN.ERR% will be processed in the %DEBUG#% macro.

 :# Routine to set the VERBOSE mode, in response to the -v argument.
 :Verbose.Off
@@ -643,8 +821,8 @@
 set "EXEC.ARGS=%EXEC.ARGS: -v=% -v"
 set "EXEC.ARGS=%EXEC.ARGS:~1%"
 :# Reverse the above optimization
-set "ECHO.V=call :Echo.Verbose"
-set "ECHOVARS.V=call :EchoVars.Verbose"
+set "ECHO.V=%LCALL% :Echo.Verbose"
+set "ECHOVARS.V=%LCALL% :EchoVars.Verbose"
 goto :eof

 :# Echo and log a string, indented at the same level as the debug output.
@@ -655,23 +833,35 @@
 goto :eof

 :Echo.Verbose
+:Echo.V
 %IF_VERBOSE% goto :Echo
 goto :Echo.Log

 :Echo.Debug
-%IF_DEBUG% goto :Echo
+:Echo.D
+%IF_DEBUG% %>DEBUGOUT% echo.%INDENT%%*
 goto :Echo.Log

-:Echo.Eval2DebugOut %*=String with variables that need to be evaluated first
-:# Must be called with delayed expansion on, so that !variables! within %* get expanded
-:Echo.2DebugOut	%*=String to output to the DEBUGOUT stream
-%>DEBUGOUT% echo.%INDENT%%*
-goto :eof
-
-:Echo.Eval2LogFile %*=String with variables that need to be evaluated first
-:# Must be called with delayed expansion on, so that !variables! within %* get expanded
-:Echo.2LogFile %*=String to output to the LOGFILE
-%>>LOGFILE% echo.%INDENT%%*
+:Echo.Eval2DebugOut %1=Name of string, with !variables! that need to be evaluated first
+setlocal EnableDelayedExpansion &:# Make sure that !variables! get expanded
+set "STRING=!%1!" &:# !variables! not yet expanded; They will be on next line
+%>DEBUGOUT% echo.%INDENT%%STRING%
+goto :eof
+
+:Echo.2DebugOut	%1=Name of string to output to the DEBUGOUT stream
+setlocal EnableDelayedExpansion &:# Make sure that !variables! get expanded
+%>DEBUGOUT% echo.%INDENT%!%1!
+goto :eof
+
+:Echo.Eval2LogFile %1=Name of string, with variables that need to be evaluated first
+setlocal EnableDelayedExpansion &:# Make sure that !variables! get expanded
+set "STRING=!%1!" &:# !variables! not yet expanded; They will be on next line
+%>>LOGFILE% echo.%INDENT%%STRING%
+goto :eof
+
+:Echo.2LogFile %1=Name of string to output to the LOGFILE
+setlocal EnableDelayedExpansion &:# Make sure that !variables! get expanded
+%>>LOGFILE% echo.%INDENT%!%1!
 goto :eof

 :# Echo and log variable values, indented at the same level as the debug output.
@@ -715,36 +905,50 @@

 :#----------------------------------------------------------------------------#
 :#                                                                            #
-:#  Function        Exec                                                      #
+:#  Module	    Exec                                                      #
 :#                                                                            #
 :#  Description     Run a command, logging its output to the log file.        #
 :#                                                                            #
 :#                  In VERBOSE mode, display the command line first.          #
 :#                  In DEBUG mode, display the command line and the exit code.#
 :#                  In NOEXEC mode, display the command line, but don't run it.
-:#                                                                            #
-:#  Arguments       -t          Tee all output to the log file if there's a   #
-:#                              usable tee.exe. Default: Redirect all >> log. #
-:#                              Known limitation: The exit code is always 0.  #
-:#                  %*          The command and its arguments                 #
-:#                              Quote redirection operators. Ex:              #
-:#                              %EXEC% find /I "error" "<"logfile.txt ">"NUL  #
 :#                                                                            #
 :#  Functions       Exec.Init	Initialize Exec routines. Call once at 1st    #
 :#                  Exec.Off	Disable execution of commands		      #
 :#                  Exec.On	Enable execution of commands		      #
 :#                  Do          Always execute a command, logging its output  #
 :#                  Exec	Conditionally execute a command, logging it.  #
+:#                  Exec.SetErrorLevel	Change the current ERRORLEVEL	      #
+:#                                                                            #
+:#  Exec Arguments  -l          Log the output to the log file.               #
+:#                  -L          Do not send the output to the log file. (Dflt)#
+:#                  -t          Tee all output to the log file if there's a   #
+:#                              usable tee.exe.                               #
+:#                              Known limitation: The exit code is always 0.  #
+:#                  -e          Always echo the command.		      #
+:#                  -v          Trace the command in verbose mode. (Default)  #
+:#                  -V          Do not trace the command in verbose mode.     #
+:#                  %*          The command and its arguments                 #
+:#                              Quote redirection operators. Ex:              #
+:#                              %EXEC% find /I "error" "<"logfile.txt ">"NUL  #
+:#                              Note: Quote redirections, NOT file numbers.   #
+:#                              Ex: 2">&"1 will work; "2>&1" will NOT work.   #
 :#                                                                            #
 :#  Macros          %DO%        Always execute a command, logging its output  #
 :#                  %EXEC%      Conditionally execute a command, logging it.  #
-:#                  %ECHO.X%    Echo and log a string, indented, in -X mode.  #
-:#                  %ECHO.XVD%  Echo a string, indented, in -X or -V or -D    #
-:#                              modes; Log it always.                         #
+:#                  %ECHO.X%    Echo a string indented in -X mode, and log it.#
+:#                  %ECHO.XD%   Idem in -X or -D modes.                       #
+:#                  %ECHO.XVD%  Idem in -X or -V or -D modes.                 #
 :#                              Useful to display commands in cases where     #
 :#                              %EXEC% can't be used, like in for ('cmd') ... #
 :#                  %IF_EXEC%   Execute a command if _not_ in NOEXEC mode     #
 :#                  %IF_NOEXEC% Execute a command in NOEXEC mode only         #
+:#                  %_DO%       Echo and run a command. No opts. No logging.  #
+:#                  %_DO.D%     Idem, echoing it in debug mode only.          #
+:#                  %_DO.XVD%   Idem, echoing it in -X or -V or -D modes only.#
+:#                  %XEXEC%     Call :Exec from an external scriptlet, such   #
+:#                               one in a (for /f in ('commands')) block.     #
+:#                  %XEXEC@%    Idem, but with all args stored in one var.    #
 :#                                                                            #
 :#  Variables       %NOEXEC%	Exec mode. 0=Execute commands; 1=Don't. Use   #
 :#                              functions Exec.Off and Exec.On to change it.  #
@@ -756,9 +960,14 @@
 :#                  %EXEC.ARGS%	Arguments to recursively pass to subcommands  #
 :#                              with the same execution options conventions.  #
 :#                                                                            #
-:#  Notes           This framework can't be used from inside () blocks.       #
-:#                  This is because these blocks are executed separately      #
-:#                  in a child shell.                                         #
+:#  Notes           %EXEC% can't be used from inside ('command') blocks.      #
+:#                  This is because these blocks are executed separately in   #
+:#                  a child shell. Use %XEXEC% or %XEXEC@% instead.	      #
+:#		    These macros rely on the %XCALL% mechanism for calling    #
+:#		    subroutines in a second instance of a script. They depend #
+:#		    on the following line being present after the ARGS	      #
+:#		    variable definition at the top of your script:	      #
+:#		    if '%1'=='-call' !ARGS:~1!& exit /b			      #
 :#                                                                            #
 :#  History                                                                   #
 :#   2010-05-19 JFL Created this routine.                                     #
@@ -780,8 +989,19 @@
 :#                  scripts.                                                  #
 :#   2016-11-05 JFL Fixed :Exec bug in XP/64.				      #
 :#                  Indent sub-scripts output in debug mode.                  #
-:#   2016-11-07 JFL Updated the 10/19 errorlevel fix to work for DO and EXEC. #
-:#                                                                            #
+:#   2016-11-06 JFL Updated the 10/19 errorlevel fix to work for DO and EXEC. #
+:#   2016-11-17 JFL Fixed tracing the exit code when caller has exp. disabled.#
+:#		    Added option -V to disable tracing exec in verbose mode.  #
+:#		    Added macro %ECHO.XD%.                                    #
+:#		    Faster and more exact method for separating the %EXEC%    #
+:#		    optional arguments from the command line to run. (The old #
+:#		    method lost non-white batch argument separators = , ; in  #
+:#		    some cases.)                                              #
+:#   2016-11-24 JFL Fixed executing commands containing a ^ character.        #
+:#		    Added routine :_Do.                                       #
+:#   2016-12-13 JFL Rewrote _DO as a pure macro.                              #
+:#   2016-12-15 JFL Changed the default to NOT redirecting the output to log. #
+:#		                                                              #
 :#----------------------------------------------------------------------------#

 call :Exec.Init
@@ -789,15 +1009,25 @@

 :# Global variables initialization, to be called first in the main routine
 :Exec.Init
-set "DO=call :Do"
-set "EXEC=call :Exec"
-set "ECHO.X=call :Echo.NoExec"
-set "ECHO.XVD=call :Echo.XVD"
+set "DO=%LCALL% :Do"
+set "EXEC=%LCALL% :Exec"
+set "ECHO.X=%LCALL% :Echo.X"
+set "ECHO.XD=%LCALL% :Echo.XD"
+set "ECHO.XVD=%LCALL% :Echo.XVD"
 if not .%NOEXEC%.==.1. set "NOEXEC=0"
+:# Quick and simple DO macros, supporting a single command, no redirections, no tricky chars!
+set _DO=%MACRO%     ( %LCALL% :Echo     %!%MACRO.ARGS%!% %&% %ON_MACRO_EXIT%%!%MACRO.ARGS%!%%/ON_MACRO_EXIT% ) %/MACRO%
+set _DO.D=%MACRO%   ( %LCALL% :Echo.D   %!%MACRO.ARGS%!% %&% %ON_MACRO_EXIT%%!%MACRO.ARGS%!%%/ON_MACRO_EXIT% ) %/MACRO%
+set _DO.XD=%MACRO%  ( %LCALL% :Echo.XD  %!%MACRO.ARGS%!% %&% %ON_MACRO_EXIT%%!%MACRO.ARGS%!%%/ON_MACRO_EXIT% ) %/MACRO%
+set _DO.XVD=%MACRO% ( %LCALL% :Echo.XVD %!%MACRO.ARGS%!% %&% %ON_MACRO_EXIT%%!%MACRO.ARGS%!%%/ON_MACRO_EXIT% ) %/MACRO%
+:# Execute commands from another instance of the main script
+set "XEXEC=%XCALL% :Exec"
+set "XEXEC@=%XCALL% :Exec.ExecVar"
 :# Check if there's a tee.exe program available
-set "Exec.HaveTee=0"
-tee.exe --help >NUL 2>NUL
-if not errorlevel 1 set "Exec.HaveTee=1"
+:# set "Exec.HaveTee=0"
+:# tee.exe --help >NUL 2>NUL
+:# if not errorlevel 1 set "Exec.HaveTee=1"
+for %%t in (tee.exe) do set "Exec.tee=%%~$PATH:t"
 :# Initialize ERRORLEVEL with known values
 set "TRUE.EXE=(call,)"	&:# Macro to silently set ERRORLEVEL to 0
 set "FALSE.EXE=(call)"	&:# Macro to silently set ERRORLEVEL to 1
@@ -824,14 +1054,12 @@
 set "EXEC.ARGS=%EXEC.ARGS:~1%"
 goto :eof

-:Echo.NoExec
+:Echo.XVD
+%IF_VERBOSE% goto :Echo
+:Echo.XD
+%IF_DEBUG% goto :Echo
+:Echo.X
 %IF_NOEXEC% goto :Echo
-goto :eof
-
-:Echo.XVD
-%IF_NOEXEC% goto :Echo
-%IF_VERBOSE% goto :Echo
-%IF_DEBUG% goto :Echo
 goto :Echo.Log

 :Exec.SetErrorLevel %1
@@ -840,46 +1068,49 @@
 :# Execute a command, logging its output.
 :# Use for informative commands that should always be run, even in NOEXEC mode.
 :Do
-set "Exec.RestoreErr=call :Exec.SetErrorLevel %ERRORLEVEL%" &:# Save the initial errorlevel: Build a command for restoring it later
-setlocal EnableExtensions DisableDelayedExpansion
-set NOEXEC=0
-set "IF_NOEXEC=if .%NOEXEC%.==.1."
+set "Exec.ErrorLevel=%ERRORLEVEL%" &:# Save the initial errorlevel
+setlocal EnableExtensions DisableDelayedExpansion &:# Clears the errorlevel
+%IF_NOEXEC% call :Exec.On
 goto :Exec.Start

 :# Execute critical operations that should not be run in NOEXEC mode.
 :# Version supporting input and output redirections, and pipes.
-:# Redirection operators MUST be surrounded by quotes. Ex: "<" or ">" or "2>>"
+:# Redirection operators MUST be surrounded by quotes. Ex: "<" or ">" or ">>"
 :Exec
-set "Exec.RestoreErr=call :Exec.SetErrorLevel %ERRORLEVEL%" &:# Save the initial errorlevel: Build a command for restoring it later
-setlocal EnableExtensions DisableDelayedExpansion
+set "Exec.ErrorLevel=%ERRORLEVEL%" &:# Save the initial errorlevel
+setlocal EnableExtensions DisableDelayedExpansion &:# Clears the errorlevel
 :Exec.Start
-set "NOREDIR0=%NOREDIR%"
-set "Exec.Redir=>>%LOGFILE%,2>&1"
-if .%NOREDIR%.==.1. set "Exec.Redir="
-if not defined LOGFILE set "Exec.Redir="
-if /i .%LOGFILE%.==.NUL. set "Exec.Redir="
+set "Exec.NOREDIR=%NOREDIR%"
+set "Exec.Redir="				&:# The selected redirection. Default: none
+set "Exec.2Redir=>>%LOGFILE%,2>&1"		&:# What to change it to, to enable redirection
+if .%NOREDIR%.==.1. set "Exec.2Redir="		&:# Several cases forbid redirection
+if not defined LOGFILE set "Exec.2Redir="
+if /i .%LOGFILE%.==.NUL. set "Exec.2Redir="
+set "Exec.IF_VERBOSE=%IF_VERBOSE%"		&:# Echo the command in verbose mode
+:# Record the command-line to execute.
+:# Never comment (set Exec.cmd) lines themselves, to avoid appending extra spaces.
+:# Use %*, but not %1 ... %9, because %N miss non-white argument separators like = , ;
+set ^"Exec.Cmd=%*^" &:# Doubles ^carets within "quoted" strings, and halves those outside
+set ^"Exec.Cmd=%Exec.Cmd:^^=^%^" &:# Fix the # of ^carets within "quoted" strings
 :# Process optional arguments
-set "Exec.GotCmd=Exec.GotCmd"   &:# By default, the command line is %* for :Exec
 goto :Exec.GetArgs
 :Exec.NextArg
-set "Exec.GotCmd=Exec.BuildCmd" &:# An :Exec argument was found, we'll have to rebuild the command line
+:# Remove the %EXEC% argument and following spaces from the head of the command line
+setlocal EnableDelayedExpansion &:# The next line works because no :exec own argument may contain an '=' or a '!'
+for /f "tokens=1* delims= " %%a in ("-!Exec.Cmd:*%1=!") do endlocal & set Exec.Cmd=%%b
 shift
 :Exec.GetArgs
+if "%~1"=="-l" set "Exec.Redir=%Exec.2Redir%" & goto :Exec.NextArg :# Do send the output to the log file
 if "%~1"=="-L" set "Exec.Redir=" & goto :Exec.NextArg :# Do not send the output to the log file
-if "%~1"=="-t" if defined LOGFILE ( :# Tee the output to the log file
+if "%~1"=="-t" if defined Exec.2Redir ( :# Tee the output to the log file
   :# Warning: This prevents from getting the command exit code!
-  if .%Exec.HaveTee%.==.1. if not .%NOREDIR%.==.1. set "Exec.Redir= 2>&1 | tee.exe -a %LOGFILE%"
+  if defined Exec.tee set "Exec.Redir= 2>&1 | %Exec.tee% -a %LOGFILE%"
   goto :Exec.NextArg
 )
-set Exec.Cmd=%*
-goto :%Exec.GotCmd%
-:Exec.BuildCmd
-:# Build the command list. Cannot use %*, which still contains the :Exec switches processed above.
-set Exec.Cmd=%1
-:Exec.GetCmdLoop
-shift
-if not .%1.==.. set Exec.Cmd=%Exec.Cmd% %1& goto :Exec.GetCmdLoop
-:Exec.GotCmd
+if "%~1"=="-e" set "Exec.IF_VERBOSE=if 1==1" & goto :Exec.NextArg :# Always echo the command
+if "%~1"=="-v" set "Exec.IF_VERBOSE=%IF_VERBOSE%" & goto :Exec.NextArg :# Echo the command in verbose mode
+if "%~1"=="-V" set "Exec.IF_VERBOSE=if 0==1" & goto :Exec.NextArg :# Do not echo the command in verbose mode
+:# Anything else is part of the command. Prepare to display it and run it.
 :# First stage: Split multi-char ops ">>" "2>" "2>>". Make sure to keep ">" signs quoted every time.
 :# Do NOT use surrounding quotes for these set commands, else quoted arguments will break.
 set Exec.Cmd=%Exec.Cmd:">>"=">"">"%
@@ -888,9 +1119,9 @@
 :# If there are output redirections, then cancel any attempt at redirecting output to the log file.
 set "Exec.Cmd1=%Exec.Cmd:"=%" &:# Remove quotes in the command string, to allow quoting the whole string.
 if not "%Exec.Cmd1:>=%"=="%Exec.Cmd1%" set "Exec.Redir="
-if defined Exec.Redir set "NOREDIR=1" &:# make sure child scripts do not try to redirect output again
+if defined Exec.Redir set "Exec.NOREDIR=1" &:# make sure child scripts do not try to redirect output again
 :# Second stage: Convert quoted redirection operators (Ex: ">") to a usable (Ex: >) and a displayable (Ex: ^>) value.
-:# Must be once for each of the four < > | & operators.
+:# Must be done once for each of the four < > | & operators.
 :# Since each operation removes half of ^ escape characters, then insert
 :# enough ^ to still protect the previous characters during the subsequent operations.
 set Exec.toEcho=%Exec.Cmd:"|"=^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^|%
@@ -902,7 +1133,7 @@
 set "Exec.Echo=rem"
 %IF_NOEXEC% set "Exec.Echo=echo"
 %IF_DEBUG% set "Exec.Echo=echo"
-%IF_VERBOSE% set "Exec.Echo=echo"
+%Exec.IF_VERBOSE% set "Exec.Echo=echo"
 %>DEBUGOUT% %Exec.Echo%.%INDENT%%Exec.toEcho%
 if defined LOGFILE %>>LOGFILE% echo.%INDENT%%Exec.toEcho%
 :# Constraints at this stage:
@@ -911,23 +1142,28 @@
 :# But the new variables created by the command must make it through.
 :# This should work whether :Exec is called with delayed expansion on or off.
 endlocal & if not .%NOEXEC%.==.1. (
-  set "NOREDIR=%NOREDIR%"
+  set "NOREDIR=%Exec.NOREDIR%"
   %IF_DEBUG% set "INDENT=%INDENT%  "
-  %Exec.RestoreErr% &:# Restore the errorlevel we had on :Exec entrance
+  call :Exec.SetErrorLevel %Exec.ErrorLevel% &:# Restore the errorlevel we had on :Exec entrance
   %Exec.Cmd%%Exec.Redir%
-  set "Exec.ErrorLevel=!ERRORLEVEL!"
-  set "NOREDIR=%NOREDIR0%" &:# Sets ERRORLEVEL=1 in Windows XP/64
+  call set "Exec.ErrorLevel=%%ERRORLEVEL%%"  &:# Save the new errorlevel set by the command executed
+  set "NOREDIR=%NOREDIR%" &:# Sets ERRORLEVEL=1 in Windows XP/64
   %IF_DEBUG% set "INDENT=%INDENT%"
-  call :Exec.ShowExitCode !Exec.ErrorLevel!
-)
-goto :eof
-
-:Exec.ShowExitCode %1
-set "Exec.ErrorLevel="
-set "Exec.RestoreErr="
-%IF_DEBUG% %>DEBUGOUT% echo.%INDENT%  exit %1
-if defined LOGFILE %>>LOGFILE% echo.%INDENT%  exit %1
-exit /b %1
+  call :Exec.TraceExit
+)
+exit /b
+
+:Exec.TraceExit
+for %%e in (%Exec.ErrorLevel%) do (
+  set "Exec.ErrorLevel="
+  %IF_DEBUG% %>DEBUGOUT% echo.%INDENT%  exit %%e
+  if defined LOGFILE %>>LOGFILE% echo.%INDENT%  exit %%e
+  exit /b %%e
+)
+
+:Exec.ExecVar CMDVAR
+call :Exec !%1:%%=%%%%!
+exit /b

 :Exec.End

@@ -1040,6 +1276,8 @@
 echo   -l LOGFILE    Log output into a file. Default: Don't
 echo   -L            Disable logging. Default: Use the parent script log file, if any
 echo   -O OS         Use nmake for OS. Default: Use that for %MAKEORIGIN%
+echo   -q            Run nmake without output capture. (Default for pseudo-targets)
+echo   -Q            Capture nmake output into TARGET.log. (Default for real targets)
 echo   -u DIRECTORY  Upgrade configure.bat and make.bat scripts in this dir.
 echo   -v            Enable verbose output
 echo   -V            Display %SCRIPT% version
@@ -1075,19 +1313,20 @@

 :# Run nmake without logging anything, for simple goals like help, clean, etc.
 :nmake [nmake.exe options]
+%FUNCTION%
 if not defined MAKEFILE call :GetDefaultMakeFile
 call :GetConfig >NUL 2>NUL :# Get Development tools location. Also defines OUTDIR.
-if errorlevel 1 exit /b
-%ECHOVARS.D% CD MESSAGES OUTDIR
+if errorlevel 1 %RETURN%
 :# Update the PATH for running Visual Studio tools, from definitions set in %CONFIG.BAT%
 set PATH=!%MAKEORIGIN%_PATH!
 if not defined MAKE set "MAKE=!%MAKEORIGIN%_CC:CL.EXE=nmake.exe!" &:# Includes enclosing quotes
+%ECHOVARS.D% CD MESSAGES OUTDIR MAKEORIGIN PATH %MAKEORIGIN%_CC
 set "NMAKEFLAGS=/NOLOGO /c /s"
 %IF_VERBOSE% set "NMAKEFLAGS=/NOLOGO"
 :# Clear a few multi-line variables that pollute the (nmake /P) logs
-for %%v in (LF1 LF2 LF3 LF4 LF5 MACRO /MACRO ON_MACRO_EXIT FUNCTION RETURN) do set "%%v="
-%EXEC% %MAKE% %NMAKEFLAGS% /F %MAKEFILE% %*
-exit /b
+for %%v in (LF1 LF2 LF3 LF4 LF5 MACRO /MACRO ON_MACRO_EXIT) do set "%%v="
+%EXEC% -L %MAKE% %NMAKEFLAGS% /F %MAKEFILE% %*
+%RETURN%

 :#-----------------------------------------------------------------------------

@@ -1216,6 +1455,9 @@
 set "MAKEDEFS="
 set "MAKEGOALS="
 set "MAKEORIGIN=WIN32"
+set "LIGHTMAKE="	&:# 1=Simply run nmake and exit. 0=Capture and process its output. Default: Use heuristic to choose
+set "DOLOG=1"		&:# By default, do create a log file
+set ">DEBUGOUT=>&2"	&:# Send debug output to stderr, so that it does not interfere with subroutines output capture

 if not defined STINCLUDE ( :# Try getting the copy in the master environment
   for /f "tokens=3" %%v in ('reg query "HKCU\Environment" /v STINCLUDE 2^>NUL') do set "STINCLUDE=%%v"
@@ -1236,21 +1478,28 @@
 if "!ARG!"=="-h" goto help
 if "!ARG!"=="-H" goto mstool_help
 if "!ARG!"=="-l" %POPARG% & call :Debug.SetLog !"ARG"! & goto next_arg
-if "!ARG!"=="-L" call :Debug.SetLog & goto next_arg
+if "!ARG!"=="-L" call :Debug.SetLog & set "DOLOG=0" & goto next_arg
 if "!ARG!"=="-O" %POPARG% & set "MAKEORIGIN=!ARG!" & goto next_arg
+if "!ARG!"=="-q" set "LIGHTMAKE=1" & goto next_arg
+if "!ARG!"=="-Q" set "LIGHTMAKE=0" & goto next_arg
 if "!ARG!"=="-u" %POPARG% & call :update_scripts "!ARG!" & goto :eof
 if "!ARG!"=="-v" call :Verbose.On & goto next_arg
 if "!ARG!"=="-V" (echo %VERSION%) & goto :eof
 if "!ARG!"=="-X" call :Exec.Off & goto next_arg
 :# Special targets that need special handling
 if "!ARG!"=="cleanenv" goto :CleanBuildEnvironment &:# This routine exits directly
-for %%t in (help clean mostlyclean distclean goal_name list_programs) do (
-  if "!ARG!"=="%%t" call :nmake !ARG! & exit /b
+if not "LIGHTMAKE"=="0" (
+  for %%t in (help clean mostlyclean distclean goal_name) do (
+    if "!ARG!"=="%%t" call :nmake !ARG! & exit /b
+  )
+  :# Any goal that begins with "list_" and that contains no . or \
+  if not "!ARG:list_=!"=="!ARG!" if "!ARG:.=!"=="!ARG!" if "!ARG:\=!"=="!ARG!" call :nmake !ARG! & exit /b
 )
 :# Anything else is an nmake argument. Fall through
 goto go

 :go
+if "%LIGHTMAKE%"=="1" call :nmake !ARG! !ARGS! & exit /b

 call :GetConfig :# Get Development tools location. Also defines OUTDIR.
 if errorlevel 1 exit /b
@@ -1262,7 +1511,7 @@
 )

 :# Select a log file
-if not defined LOGFILE ( :# Create one, in OUTDIR if defined
+if "%DOLOG%"=="1" if not defined LOGFILE ( :# Create one, in OUTDIR if defined
   set "LOGFILE=make.log"
   if not "%OUTDIR%"=="" set "LOGFILE=%OUTDIR%\!LOGFILE!"
   if exist "!LOGFILE!" del "!LOGFILE!"
@@ -1364,8 +1613,10 @@
 :# set CMD=%MAKE% /f %MAKEFILE% /x - %NMAKEFLAGS% %MAKEDEFS% %MAKEGOALS%
 set CMD=%MAKE% %NMAKEFLAGS% MESSAGES=1 %MAKEARGS%
 setlocal &:# Clear a few multi-line variables that pollute the (nmake /P) logs
-for %%v in (LF1 LF2 LF3 LF4 LF5 MACRO /MACRO ON_MACRO_EXIT FUNCTION RETURN) do set "%%v="
-%EXEC% %CMD%
+for %%v in (LF1 LF2 LF3 LF4 LF5 MACRO /MACRO ON_MACRO_EXIT) do set "%%v="
+set "-L=-L"
+if defined LOGFILE set "-L=-l"
+%EXEC% %-L% %CMD%
 endlocal & set ERROR=%ERRORLEVEL%
 if not "%ERROR%"=="0" set RESULT=Failure
 %IF_NOEXEC% if defined LOGFILE del %LOGFILE% & goto :eof


Add simple batch script to tag new releases and update properties

error: pathspec 'tag_new_release.bat' did not match any file(s) known to git

--- tag_new_release.bat
+++ tag_new_release.bat
@@ -0,0 +1,26 @@
+@echo off
+SET CURDIR=%CD%
+
+Set /P version=Enter release version number (e.g. 1.2.3):
+If "%version%"=="" goto :err
+goto:noerr
+
+:err
+echo No release version entered
+goto:end
+
+:noerr
+SET SRC=https://metageta.googlecode.com/svn/trunk
+SET DST=https://metageta.googlecode.com/svn/tags/%version%
+
+svn copy %SRC% %DST% -m "Tagging version %version%"
+svn checkout --depth=empty %DST% %TEMP%\metageta-%version%
+cd %TEMP%\metageta-%version%
+svn propset displayversion %version% .
+svn propset version %version%.$Revision$ .
+svn commit -m "Updating version properties %version%"
+cd %CURDIR%
+del /f /q %TEMP%\metageta-%version%
+
+:end
+pause


Updated version to Baseclass.Contrib.Nuget.Linked\Baseclass.Contrib.Nuget.Linked 1.0.1

--- CreatePackages.bat
+++ CreatePackages.bat
@@ -1,3 +1,3 @@
 .nuget\nuget.exe pack Baseclass.Contrib.Nuget.Output\Baseclass.Contrib.Nuget.Output.nuspec -Version 1.0.1

-.nuget\nuget.exe pack Baseclass.Contrib.Nuget.Linked\Baseclass.Contrib.Nuget.Linked.nuspec -Version 1.0.0+.nuget\nuget.exe pack Baseclass.Contrib.Nuget.Linked\Baseclass.Contrib.Nuget.Linked.nuspec -Version 1.0.1


Far3.bat improved

Far3.bat improved

--- Far3.bat
+++ Far3.bat
@@ -34,8 +34,15 @@

 if not exist "%FAR_HOME%\Far.exe.ini" (
 	echo:
-	echo:*** Copying Far Manager global configuration
-	copy /b "%FAR_CONF%\Far.exe.ini" "%FAR_HOME%\Far.exe.ini" || (
+	echo:*** "%FAR_HOME%\Far.exe.ini" not found
+	if exist "%FAR_CONF%\Far.exe.ini" (
+		echo:*** Copying from "%FAR_CONF%\Far.exe.ini"
+		copy /b "%FAR_CONF%\Far.exe.ini" "%FAR_HOME%\Far.exe.ini"
+	) else (
+		echo:*** Creating
+		call :far.exe.ini_create >"%FAR_HOME%\Far.exe.ini"
+	)
+	if errorlevel 1 (
 		call :error "Cannot copy %FAR_CONF%\Far.exe.ini to %FAR_HOME%"
 		goto :EOF
 	)
@@ -65,6 +72,26 @@
 echo:
 call :usage
 pause
+goto :EOF
+
+:: ========================================================================
+
+:far.exe.ini_create
+echo:
+echo:[General]
+echo:
+echo:UseSystemProfiles=0
+echo:
+echo:UserProfileDir=%%FARHOME%%\..\..\etc\Far3\Profile
+echo:UserLocalProfileDir=%%FARHOME%%\..\..\etc\Far3\Profile
+echo:
+echo:TemplateProfile=%%FARHOME%%\..\..\etc\Far3\Default.farconfig
+echo:
+echo:GlobalUserMenuDir=%%FARHOME%%\..\..\etc\Far3
+echo:
+echo:DefaultLanguage=Russian
+echo:
+echo:ReadOnlyConfig=0
 goto :EOF

 :: ========================================================================


build: script updated for new Windows image (#94)

--- .kokoro/test.bat
+++ .kokoro/test.bat
@@ -17,14 +17,12 @@
 cd /d %~dp0
 cd ..

-@rem The image we're currently running has a broken version of Node.js enabled
-@rem by nvm (v10.15.3), which has no npm bin. This hack uses the functional
-@rem Node v8.9.1 to install npm@latest, it then uses this version of npm to
-@rem install npm for v10.15.3.
-call nvm use v8.9.1 || goto :error
-call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm-bootstrap\bin\npm-cli.js i npm -g || goto :error
-call nvm use v10.15.3 || goto :error
-call node C:\Users\kbuilder\AppData\Roaming\nvm-ps\versions\v8.9.1\node_modules\npm\bin\npm-cli.js i npm -g || goto :error
+@rem npm path is not currently set in our image, we should fix this next time
+@rem we upgrade Node.js in the image:
+SET PATH=%PATH%;/cygdrive/c/Program Files/nodejs/npm
+
+call nvm use v12.14.1
+call which node

 call npm install || goto :error
 call npm run test || goto :error