@REM Called from zipamtemp.bat

@set TEMPLST=templist%TEMPV%.txt
@set TEMPDLST=tempdiff%TEMPV%.txt

@if "%TEMPV%x" == "x" goto ERR1

@if "%TEMPPANGO%x" == "yesx" (
@if "%TEMPZ4%x" == "x" goto ERR4
)

@if "%TEMPGLIB%x" == "yesx" (
@if "%TEMPZ2%x" == "x" goto ERR2
@if "%TEMPZ3%x" == "x" goto ERR3
@if NOT EXIST \Projects\glib-2.24.2\. goto NOGLIB

@cd \Projects
@if EXIST %TEMPLST% @del %TEMPLST%
@call dc4w -sd:%TEMPLST%  glib-org glib-2.24.2
@if NOT EXIST %TEMPLST% goto DC4wERR
@cd \Projects\glib-2.24.2
@if NOT EXIST ..\%TEMPLST% goto DC4wERR
@call zip8 -a -o -P %TEMPZ2% msvc\*.inp msvc\*.h msvc\*.bat msvc\*.txt msvc\*.c*
@call zip8 -a -o -P %TEMPZ3% @..\%TEMPLST%
@cd \Gtools\perl
@if NOT EXIST %TEMPZ2% goto ERR22
@if NOT EXIST %TEMPZ3% goto ERR33

)

@if "%TEMPPANGO%x" == "yesx" (
@if NOT EXIST \Projects\pango\. goto NOPANGO
@cd \Projects\pango
@call zip8 -a -o -P %TEMPZ4% msvc\*.inp msvc\*.h msvc\*.bat msvc\*.txt msvc\*.c*
@cd \Gtools\perl
@if NOT EXIST %TEMPZ4% goto ERR44
)

@if "%TEMPDIFF%x" == "yesx" (
@echo Doint DIFF zips... %TEMPZ5A% and %TEMPZ5B%
@if "%TEMPZ5A%x" == "x" goto ERR5A
@if "%TEMPZ5B%x" == "x" goto ERR5B
@if NOT EXIST \Projects\diffutils\. goto NODIFF
@if NOT EXIST D:\Projects-archive\diffutils-3.0\. goto NODIFF
@cd \Projects
@if EXIST %TEMPDLST% @del %TEMPDLST% > nul
@echo Moment... getting %TEMPDLST% list file...
@call dc4w -sd:%TEMPDLST%  D:\Projects-archive\diffutils-3.0 diffutils
@if NOT EXIST %TEMPDLST% goto NODIFF
@cd \Projects\diffutils

@echo Create %TEMPZ5A% ...
@REM pause

@call zip8 -a -o -P %TEMPZ5A% msvc\*.inp msvc\*.h msvc\*.bat msvc\*.txt msvc\*.c*

@echo Create %TEMPZ5B% ... from [%TEMPDLST%] list text...
@REM pause 

@call zip8 -a -o -P %TEMPZ5B% @..\%TEMPDLST%

@cd \Gtools\perl
@if NOT EXIST %TEMPZ5A% goto ERR55A
@if NOT EXIST %TEMPZ5B% goto ERR55B

)

@REM cls
@set TEMPZCNT=0
@echo.
@echo List of ZIP file contents...
@echo.

@if "%TEMPGLIB%x" == "yesx" (
@set /A TEMPZCNT+=1
@call zip8 -vb %TEMPZ2%
@set /A TEMPZCNT+=1
@call zip8 -vb %TEMPZ3%
)

@if "%TEMPPANGO%x" == "yesx" (
@set /A TEMPZCNT+=1
@call zip8 -vb %TEMPZ4%
)

@if "%TEMPDIFF%x" == "yesx" (
@set /A TEMPZCNT+=1
@call zip8 -vb %TEMPZ5A%
@set /A TEMPZCNT+=1
@call zip8 -vb %TEMPZ5B%
)

@if "%TEMPZCNT%x" == "0x" goto END

@echo.
@echo Review contents of the above %TEMPZCNT% ZIPS, and it they
@echo look ok, any key to continue...
@echo.

@goto PAUSE

:DC4WERR
@cd \Gtools\perl
@echo ERROR: DC4w has NOT created the file %TEMPLST%
@goto PAUSE

:ERR1
@echo ERROR: TEMPV not set in environment
@goto PAUSE

:ERR2
@echo ERROR: TEMPZ2 not set in environment
@goto PAUSE

:ERR3
@echo ERROR: TEMPZ3 not set in environment
@goto PAUSE

:ERR4
@echo ERROR: TEMPZ4 not set in environment
@goto PAUSE

:ERR5A
@echo ERROR: TEMPZ5A not set in environment
@goto PAUSE
:ERR5B
@echo ERROR: TEMPZ5B not set in environment
@goto PAUSE

:ERR22
@echo ERROR: %TEMPZ2% not CREATED
@goto PAUSE

:ERR33
@echo ERROR: %TEMPZ3% not CREATED
@goto PAUSE

:ERR44
@echo ERROR: %TEMPZ4% not CREATED
@goto PAUSE

:ERR55A
@echo ERROR: %TEMPZ5A% not CREATED
@goto PAUSE
:ERR55B
@echo ERROR: %TEMPZ5B% not CREATED
@goto PAUSE

:NOGLIB
@echo ERROR: No GLIB folder - \Projects\glib-2.24.2
@echo Check name, location and FIX %0
@goto PAUSE

:NODIFF
@echo ERROR: No DIFF folder - \Projects\diffutils
@echo Or D:\Projects-archive\diffutils-3.0
@echo Check names, locations and FIX %0
@goto PAUSE

:PAUSE
@pause

:END
