mirror of
https://github.com/moparisthebest/curl
synced 2024-12-22 08:08:50 -05:00
checksrc.bat: Added the ability to scan src and lib source independently
This commit is contained in:
parent
e4a0a9ef18
commit
a8c7f0fcbf
@ -27,6 +27,8 @@ rem ***************************************************************************
|
|||||||
|
|
||||||
rem Set our variables
|
rem Set our variables
|
||||||
setlocal
|
setlocal
|
||||||
|
set CHECK_LIB=TRUE
|
||||||
|
set CHECK_SRC=TRUE
|
||||||
|
|
||||||
:parseArgs
|
:parseArgs
|
||||||
if "%~1" == "" goto prerequisites
|
if "%~1" == "" goto prerequisites
|
||||||
@ -37,6 +39,12 @@ rem ***************************************************************************
|
|||||||
goto syntax
|
goto syntax
|
||||||
) else if /i "%~1" == "-help" (
|
) else if /i "%~1" == "-help" (
|
||||||
goto syntax
|
goto syntax
|
||||||
|
) else if /i "%~1" == "lib" (
|
||||||
|
set CHECK_LIB=TRUE
|
||||||
|
set CHECK_SRC=FALSE
|
||||||
|
) else if /i "%~1" == "src" (
|
||||||
|
set CHECK_LIB=FALSE
|
||||||
|
set CHECK_SRC=TRUE
|
||||||
) else (
|
) else (
|
||||||
if not defined SRC_DIR (
|
if not defined SRC_DIR (
|
||||||
set SRC_DIR=%~1%
|
set SRC_DIR=%~1%
|
||||||
@ -68,22 +76,26 @@ rem ***************************************************************************
|
|||||||
if not exist "%SRC_DIR%" goto nosrc
|
if not exist "%SRC_DIR%" goto nosrc
|
||||||
|
|
||||||
:start
|
:start
|
||||||
rem Check the src directory
|
if "%CHECK_SRC%" == "TRUE" (
|
||||||
if exist %SRC_DIR%\src (
|
rem Check the src directory
|
||||||
for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" -Wtool_hugehelp.c "%%i"
|
if exist %SRC_DIR%\src (
|
||||||
for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" "%%i"
|
for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" -Wtool_hugehelp.c "%%i"
|
||||||
|
for /f "delims=" %%i in ('dir "%SRC_DIR%\src\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\src" "%%i"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
rem Check the lib directory
|
if "%CHECK_LIB%" == "TRUE" (
|
||||||
if exist %SRC_DIR%\lib (
|
rem Check the lib directory
|
||||||
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" "%%i"
|
if exist %SRC_DIR%\lib (
|
||||||
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" -Wcurl_config.h.cmake "%%i"
|
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" "%%i"
|
||||||
)
|
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib" -Wcurl_config.h.cmake "%%i"
|
||||||
|
)
|
||||||
|
|
||||||
rem Check the lib\vtls directory
|
rem Check the lib\vtls directory
|
||||||
if exist %SRC_DIR%\lib\vtls (
|
if exist %SRC_DIR%\lib\vtls (
|
||||||
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
|
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.c.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
|
||||||
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
|
for /f "delims=" %%i in ('dir "%SRC_DIR%\lib\vtls\*.h.*" /b 2^>NUL') do @perl "%SRC_DIR%\lib\checksrc.pl" "-D%SRC_DIR%\lib\vtls" "%%i"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
goto success
|
goto success
|
||||||
@ -91,7 +103,12 @@ rem ***************************************************************************
|
|||||||
:syntax
|
:syntax
|
||||||
rem Display the help
|
rem Display the help
|
||||||
echo.
|
echo.
|
||||||
echo Usage: checksrc [directory]
|
echo Usage: checksrc [product] [directory]
|
||||||
|
echo.
|
||||||
|
echo Product:
|
||||||
|
echo.
|
||||||
|
echo lib - Scan the libcurl source
|
||||||
|
echo src - Scan the command-line tool source
|
||||||
echo.
|
echo.
|
||||||
echo directory - Specifies the curl source directory
|
echo directory - Specifies the curl source directory
|
||||||
goto success
|
goto success
|
||||||
|
Loading…
Reference in New Issue
Block a user