From dc03d519fba9d0f4fe252e56547f428ae3aca4ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Wed, 5 May 2021 08:55:48 +0200 Subject: [PATCH] Proper CRLF handling Add proper CLRF-LF rules to .gitattributes. Renormalize the bat files to LF in the repo and CRLF on disk. Remove executable bit of files which shouldn't have it set --- .gitattributes | 19 ++ modules/libcom/src/freeList/freeListLib.c | 0 modules/libcom/src/valgrind/valgrind.h | 0 modules/libcom/test/Makefile | 0 startup/win32.bat | 212 +++++++++++----------- startup/windows.bat | 212 +++++++++++----------- 6 files changed, 231 insertions(+), 212 deletions(-) mode change 100755 => 100644 modules/libcom/src/freeList/freeListLib.c mode change 100755 => 100644 modules/libcom/src/valgrind/valgrind.h mode change 100755 => 100644 modules/libcom/test/Makefile diff --git a/.gitattributes b/.gitattributes index d71c782e0..5221674ea 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,22 @@ .appveyor/ export-ignore .appveyor.yml export-ignore README export-subst + +#Which files need CRLF handling +# default to automatic +* text=auto + +# batch script parser on windows requires CRLF +*.bat text eol=crlf + +# extensions for scripts which may be executable via. "#!..." must have LF +*.pl text eol=lf +*.plt text eol=lf +*.sh text eol=lf +*.cmd text eol=lf +# .cmd in unexpanded templates +*.cmd@* text eol=lf +# executable scripts w/o extensions +modules/ca/src/client/S99caRepeater@ text eol=lf +modules/libcom/src/log/S99logServer@ text eol=lf +startup/EpicsHostArch text eol=lf diff --git a/modules/libcom/src/freeList/freeListLib.c b/modules/libcom/src/freeList/freeListLib.c old mode 100755 new mode 100644 diff --git a/modules/libcom/src/valgrind/valgrind.h b/modules/libcom/src/valgrind/valgrind.h old mode 100755 new mode 100644 diff --git a/modules/libcom/test/Makefile b/modules/libcom/test/Makefile old mode 100755 new mode 100644 diff --git a/startup/win32.bat b/startup/win32.bat index dc50e6a72..818912547 100755 --- a/startup/win32.bat +++ b/startup/win32.bat @@ -1,106 +1,106 @@ -@echo off -rem ************************************************************************* -rem Copyright (c) 2017 UChicago Argonne LLC, as Operator of Argonne -rem National Laboratory. -rem Copyright (c) 2002 The Regents of the University of California, as -rem Operator of Los Alamos National Laboratory. -rem SPDX-License-Identifier: EPICS -rem EPICS BASE is distributed subject to a Software License Agreement found -rem in file LICENSE that is included with this distribution. -rem ************************************************************************* -rem -rem Site-specific EPICS environment settings -rem -rem Sets EPICS_HOST_ARCH and the environment for Microsoft Visual Studio. -rem Optionally, resets PATH, adds Strawberry Perl to PATH, and adds the -rem EPICS Base install host architecture bin directory to PATH. -rem - -rem ---------------------------------------------------------------------- -rem Site serviceable parts (These definitions may be modified) -rem ---------------------------------------------------------------------- - -rem The values of the definitions in this section must not contain -rem double-quotes. -rem -rem * Right: set _foo=C:\foo -rem * Right: set "_foo=C:\foo" -rem * Wrong: set _foo="C:\foo" - -rem Automatically set up the environment when possible ("yes" or "no"). -rem If set to yes, as much of the environment will be set up as possible. -rem If set to no, just the minimum environment will be set up. More -rem specific _auto_* definitions take precedence over this definition. -set _auto=no - -rem Automatically reset PATH ("yes" or "no"). If set to yes, PATH will -rem be reset to the value of _path_new. If set to no, PATH will not be -rem reset. -set _auto_path_reset=%_auto% - -rem Automatically append to PATH ("yes" or "no"). If set to yes, the -rem EPICS Base install host architecture bin directory will be added to -rem PATH if possible. If set to no, the bin directory will not be added -rem to PATH. -set _auto_path_append=%_auto% - -rem The new value for PATH. If _auto_path_reset is yes, PATH will be set -rem to it. -set _path_new=C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem - -rem The location of Strawberry Perl (pathname). If empty, Strawberry Perl -rem is assumed to already be in PATH and will not be added. If nonempty, -rem Strawberry Perl will be added to PATH. -set _strawberry_perl_home=C:\Strawberry - -rem The location of Microsoft Visual Studio (pathname). -set _visual_studio_home=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community - -rem The EPICS host architecture specification for EPICS_HOST_ARCH -rem (-[-] as defined in configure/CONFIG_SITE). -set _epics_host_arch=win32-x86 - -rem The install location of EPICS Base (pathname). If nonempty and -rem _auto_path_append is yes, it will be used to add the host architecture -rem bin directory to PATH. -set _epics_base= - -rem ---------------------------------------------------------------------- -rem Internal parts (There is typically no need to modify these) -rem ---------------------------------------------------------------------- - -rem Reset PATH -if "%_auto_path_reset%" == "yes" ( - set "PATH=%_path_new%" -) - -rem Add Strawberry Perl to PATH -if "%_strawberry_perl_home%" == "" goto after_add_strawberry_perl -rem Can't do this inside parentheses because PATH would be read only once -set "PATH=%PATH%;%_strawberry_perl_home%\c\bin" -set "PATH=%PATH%;%_strawberry_perl_home%\perl\site\bin" -set "PATH=%PATH%;%_strawberry_perl_home%\perl\bin" -:after_add_strawberry_perl - -rem Set the environment for Microsoft Visual Studio -call "%_visual_studio_home%\VC\Auxiliary\Build\vcvarsall.bat" x86 - -rem Set the EPICS host architecture specification -set "EPICS_HOST_ARCH=%_epics_host_arch%" - -rem Add the EPICS Base host architecture bin directory to PATH -if "%_auto_path_append%" == "yes" ( - if not "%_epics_base%" == "" ( - set "PATH=%PATH%;%_epics_base%\bin\%_epics_host_arch%" - ) -) - -rem Don't leak variables into the environment -set _auto= -set _auto_path_reset= -set _auto_path_append= -set _path_new= -set _strawberry_perl_home= -set _visual_studio_home= -set _epics_host_arch= -set _epics_base= +@echo off +rem ************************************************************************* +rem Copyright (c) 2017 UChicago Argonne LLC, as Operator of Argonne +rem National Laboratory. +rem Copyright (c) 2002 The Regents of the University of California, as +rem Operator of Los Alamos National Laboratory. +rem SPDX-License-Identifier: EPICS +rem EPICS BASE is distributed subject to a Software License Agreement found +rem in file LICENSE that is included with this distribution. +rem ************************************************************************* +rem +rem Site-specific EPICS environment settings +rem +rem Sets EPICS_HOST_ARCH and the environment for Microsoft Visual Studio. +rem Optionally, resets PATH, adds Strawberry Perl to PATH, and adds the +rem EPICS Base install host architecture bin directory to PATH. +rem + +rem ---------------------------------------------------------------------- +rem Site serviceable parts (These definitions may be modified) +rem ---------------------------------------------------------------------- + +rem The values of the definitions in this section must not contain +rem double-quotes. +rem +rem * Right: set _foo=C:\foo +rem * Right: set "_foo=C:\foo" +rem * Wrong: set _foo="C:\foo" + +rem Automatically set up the environment when possible ("yes" or "no"). +rem If set to yes, as much of the environment will be set up as possible. +rem If set to no, just the minimum environment will be set up. More +rem specific _auto_* definitions take precedence over this definition. +set _auto=no + +rem Automatically reset PATH ("yes" or "no"). If set to yes, PATH will +rem be reset to the value of _path_new. If set to no, PATH will not be +rem reset. +set _auto_path_reset=%_auto% + +rem Automatically append to PATH ("yes" or "no"). If set to yes, the +rem EPICS Base install host architecture bin directory will be added to +rem PATH if possible. If set to no, the bin directory will not be added +rem to PATH. +set _auto_path_append=%_auto% + +rem The new value for PATH. If _auto_path_reset is yes, PATH will be set +rem to it. +set _path_new=C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem + +rem The location of Strawberry Perl (pathname). If empty, Strawberry Perl +rem is assumed to already be in PATH and will not be added. If nonempty, +rem Strawberry Perl will be added to PATH. +set _strawberry_perl_home=C:\Strawberry + +rem The location of Microsoft Visual Studio (pathname). +set _visual_studio_home=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community + +rem The EPICS host architecture specification for EPICS_HOST_ARCH +rem (-[-] as defined in configure/CONFIG_SITE). +set _epics_host_arch=win32-x86 + +rem The install location of EPICS Base (pathname). If nonempty and +rem _auto_path_append is yes, it will be used to add the host architecture +rem bin directory to PATH. +set _epics_base= + +rem ---------------------------------------------------------------------- +rem Internal parts (There is typically no need to modify these) +rem ---------------------------------------------------------------------- + +rem Reset PATH +if "%_auto_path_reset%" == "yes" ( + set "PATH=%_path_new%" +) + +rem Add Strawberry Perl to PATH +if "%_strawberry_perl_home%" == "" goto after_add_strawberry_perl +rem Can't do this inside parentheses because PATH would be read only once +set "PATH=%PATH%;%_strawberry_perl_home%\c\bin" +set "PATH=%PATH%;%_strawberry_perl_home%\perl\site\bin" +set "PATH=%PATH%;%_strawberry_perl_home%\perl\bin" +:after_add_strawberry_perl + +rem Set the environment for Microsoft Visual Studio +call "%_visual_studio_home%\VC\Auxiliary\Build\vcvarsall.bat" x86 + +rem Set the EPICS host architecture specification +set "EPICS_HOST_ARCH=%_epics_host_arch%" + +rem Add the EPICS Base host architecture bin directory to PATH +if "%_auto_path_append%" == "yes" ( + if not "%_epics_base%" == "" ( + set "PATH=%PATH%;%_epics_base%\bin\%_epics_host_arch%" + ) +) + +rem Don't leak variables into the environment +set _auto= +set _auto_path_reset= +set _auto_path_append= +set _path_new= +set _strawberry_perl_home= +set _visual_studio_home= +set _epics_host_arch= +set _epics_base= diff --git a/startup/windows.bat b/startup/windows.bat index a36e43fdb..27b6dcc0b 100644 --- a/startup/windows.bat +++ b/startup/windows.bat @@ -1,106 +1,106 @@ -@echo off -rem ************************************************************************* -rem Copyright (c) 2017 UChicago Argonne LLC, as Operator of Argonne -rem National Laboratory. -rem Copyright (c) 2002 The Regents of the University of California, as -rem Operator of Los Alamos National Laboratory. -rem SPDX-License-Identifier: EPICS -rem EPICS BASE is distributed subject to a Software License Agreement found -rem in file LICENSE that is included with this distribution. -rem ************************************************************************* -rem -rem Site-specific EPICS environment settings -rem -rem Sets EPICS_HOST_ARCH and the environment for Microsoft Visual Studio. -rem Optionally, resets PATH, adds Strawberry Perl to PATH, and adds the -rem EPICS Base install host architecture bin directory to PATH. -rem - -rem ---------------------------------------------------------------------- -rem Site serviceable parts (These definitions may be modified) -rem ---------------------------------------------------------------------- - -rem The values of the definitions in this section must not contain -rem double-quotes. -rem -rem * Right: set _foo=C:\foo -rem * Right: set "_foo=C:\foo" -rem * Wrong: set _foo="C:\foo" - -rem Automatically set up the environment when possible ("yes" or "no"). -rem If set to yes, as much of the environment will be set up as possible. -rem If set to no, just the minimum environment will be set up. More -rem specific _auto_* definitions take precedence over this definition. -set _auto=no - -rem Automatically reset PATH ("yes" or "no"). If set to yes, PATH will -rem be reset to the value of _path_new. If set to no, PATH will not be -rem reset. -set _auto_path_reset=%_auto% - -rem Automatically append to PATH ("yes" or "no"). If set to yes, the -rem EPICS Base install host architecture bin directory will be added to -rem PATH if possible. If set to no, the bin directory will not be added -rem to PATH. -set _auto_path_append=%_auto% - -rem The new value for PATH. If _auto_path_reset is yes, PATH will be set -rem to it. -set _path_new=C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem - -rem The location of Strawberry Perl (pathname). If empty, Strawberry Perl -rem is assumed to already be in PATH and will not be added. If nonempty, -rem Strawberry Perl will be added to PATH. -set _strawberry_perl_home=C:\Strawberry - -rem The location of Microsoft Visual Studio (pathname). -set _visual_studio_home=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community - -rem The EPICS host architecture specification for EPICS_HOST_ARCH -rem (-[-] as defined in configure/CONFIG_SITE). -set _epics_host_arch=windows-x64 - -rem The install location of EPICS Base (pathname). If nonempty and -rem _auto_path_append is yes, it will be used to add the host architecture -rem bin directory to PATH. -set _epics_base= - -rem ---------------------------------------------------------------------- -rem Internal parts (There is typically no need to modify these) -rem ---------------------------------------------------------------------- - -rem Reset PATH -if "%_auto_path_reset%" == "yes" ( - set "PATH=%_path_new%" -) - -rem Add Strawberry Perl to PATH -if "%_strawberry_perl_home%" == "" goto after_add_strawberry_perl -rem Can't do this inside parentheses because PATH would be read only once -set "PATH=%PATH%;%_strawberry_perl_home%\c\bin" -set "PATH=%PATH%;%_strawberry_perl_home%\perl\site\bin" -set "PATH=%PATH%;%_strawberry_perl_home%\perl\bin" -:after_add_strawberry_perl - -rem Set the environment for Microsoft Visual Studio -call "%_visual_studio_home%\VC\Auxiliary\Build\vcvarsall.bat" x64 - -rem Set the EPICS host architecture specification -set "EPICS_HOST_ARCH=%_epics_host_arch%" - -rem Add the EPICS Base host architecture bin directory to PATH -if "%_auto_path_append%" == "yes" ( - if not "%_epics_base%" == "" ( - set "PATH=%PATH%;%_epics_base%\bin\%_epics_host_arch%" - ) -) - -rem Don't leak variables into the environment -set _auto= -set _auto_path_reset= -set _auto_path_append= -set _path_new= -set _strawberry_perl_home= -set _visual_studio_home= -set _epics_host_arch= -set _epics_base= +@echo off +rem ************************************************************************* +rem Copyright (c) 2017 UChicago Argonne LLC, as Operator of Argonne +rem National Laboratory. +rem Copyright (c) 2002 The Regents of the University of California, as +rem Operator of Los Alamos National Laboratory. +rem SPDX-License-Identifier: EPICS +rem EPICS BASE is distributed subject to a Software License Agreement found +rem in file LICENSE that is included with this distribution. +rem ************************************************************************* +rem +rem Site-specific EPICS environment settings +rem +rem Sets EPICS_HOST_ARCH and the environment for Microsoft Visual Studio. +rem Optionally, resets PATH, adds Strawberry Perl to PATH, and adds the +rem EPICS Base install host architecture bin directory to PATH. +rem + +rem ---------------------------------------------------------------------- +rem Site serviceable parts (These definitions may be modified) +rem ---------------------------------------------------------------------- + +rem The values of the definitions in this section must not contain +rem double-quotes. +rem +rem * Right: set _foo=C:\foo +rem * Right: set "_foo=C:\foo" +rem * Wrong: set _foo="C:\foo" + +rem Automatically set up the environment when possible ("yes" or "no"). +rem If set to yes, as much of the environment will be set up as possible. +rem If set to no, just the minimum environment will be set up. More +rem specific _auto_* definitions take precedence over this definition. +set _auto=no + +rem Automatically reset PATH ("yes" or "no"). If set to yes, PATH will +rem be reset to the value of _path_new. If set to no, PATH will not be +rem reset. +set _auto_path_reset=%_auto% + +rem Automatically append to PATH ("yes" or "no"). If set to yes, the +rem EPICS Base install host architecture bin directory will be added to +rem PATH if possible. If set to no, the bin directory will not be added +rem to PATH. +set _auto_path_append=%_auto% + +rem The new value for PATH. If _auto_path_reset is yes, PATH will be set +rem to it. +set _path_new=C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem + +rem The location of Strawberry Perl (pathname). If empty, Strawberry Perl +rem is assumed to already be in PATH and will not be added. If nonempty, +rem Strawberry Perl will be added to PATH. +set _strawberry_perl_home=C:\Strawberry + +rem The location of Microsoft Visual Studio (pathname). +set _visual_studio_home=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community + +rem The EPICS host architecture specification for EPICS_HOST_ARCH +rem (-[-] as defined in configure/CONFIG_SITE). +set _epics_host_arch=windows-x64 + +rem The install location of EPICS Base (pathname). If nonempty and +rem _auto_path_append is yes, it will be used to add the host architecture +rem bin directory to PATH. +set _epics_base= + +rem ---------------------------------------------------------------------- +rem Internal parts (There is typically no need to modify these) +rem ---------------------------------------------------------------------- + +rem Reset PATH +if "%_auto_path_reset%" == "yes" ( + set "PATH=%_path_new%" +) + +rem Add Strawberry Perl to PATH +if "%_strawberry_perl_home%" == "" goto after_add_strawberry_perl +rem Can't do this inside parentheses because PATH would be read only once +set "PATH=%PATH%;%_strawberry_perl_home%\c\bin" +set "PATH=%PATH%;%_strawberry_perl_home%\perl\site\bin" +set "PATH=%PATH%;%_strawberry_perl_home%\perl\bin" +:after_add_strawberry_perl + +rem Set the environment for Microsoft Visual Studio +call "%_visual_studio_home%\VC\Auxiliary\Build\vcvarsall.bat" x64 + +rem Set the EPICS host architecture specification +set "EPICS_HOST_ARCH=%_epics_host_arch%" + +rem Add the EPICS Base host architecture bin directory to PATH +if "%_auto_path_append%" == "yes" ( + if not "%_epics_base%" == "" ( + set "PATH=%PATH%;%_epics_base%\bin\%_epics_host_arch%" + ) +) + +rem Don't leak variables into the environment +set _auto= +set _auto_path_reset= +set _auto_path_append= +set _path_new= +set _strawberry_perl_home= +set _visual_studio_home= +set _epics_host_arch= +set _epics_base=