mirror of https://github.com/CGAL/cgal
Merge pull request #6733 from lrineau/egrep
sed -i -e 's/egrep/grep -E/g'
This commit is contained in:
commit
06ddf68124
|
|
@ -623,7 +623,7 @@ if [ -f '${LIST_TEST_PACKAGES}' ]; then
|
|||
# copy it, else prepare for the special "skipped" case in the table.
|
||||
for PACKAGE in \$(ls "${CGAL_TEST_DIR}"); do
|
||||
if [ -d "${CGAL_TEST_DIR}/\$PACKAGE" ]; then
|
||||
if source '${LIST_TEST_PACKAGES}' '${CGAL_ROOT}' | egrep -q \$PACKAGE; then
|
||||
if source '${LIST_TEST_PACKAGES}' '${CGAL_ROOT}' | grep -E -q \$PACKAGE; then
|
||||
mkdir "${CGAL_BINARY_DIR}/test/\${PACKAGE}"
|
||||
cp -r "${CGAL_TEST_DIR}/\${PACKAGE}" '${CGAL_BINARY_DIR}/test'
|
||||
elif [ "\$PACKAGE" = "resources" ]; then
|
||||
|
|
|
|||
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
setopt extendedglob
|
||||
|
||||
file ^build*/(demo|test|examples|include|doc|src)/**/*.(h|hpp|H|C|c|cpp)| egrep -v ':[[:space:]]+(C(\+\+)? source, |LaTeX document, |HTML document, )?(ASCII|UTF-8 Unicode) text(, with very long lines)?$'
|
||||
file ^build*/(demo|test|examples|include|doc|src)/**/*.(h|hpp|H|C|c|cpp)| grep -E -v ':[[:space:]]+(C(\+\+)? source, |LaTeX document, |HTML document, )?(ASCII|UTF-8 Unicode) text(, with very long lines)?$'
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ git fetch $USER_REPO
|
|||
git checkout $BRANCH_NAME
|
||||
git reset --hard $USER_REPO/$BRANCH_NAME
|
||||
#setup the list_test_packages
|
||||
TMP_LIST=$(git diff --name-only cgal/$BASE_NAME...HEAD |egrep -v /doc |egrep "\.h"\|"\.cpp" |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |egrep -v Installation||true)
|
||||
TMP_LIST=$(git diff --name-only cgal/$BASE_NAME...HEAD |grep -E -v /doc |grep -E "\.h"\|"\.cpp" |cut -s -d/ -f1 |sort -u | xargs -I {} ls -d {}/package_info 2>/dev/null |cut -d/ -f1 |grep -E -v Installation||true)
|
||||
|
||||
LIST_OF_PKGS=""
|
||||
for PKG in $(ls) ; do
|
||||
|
|
|
|||
|
|
@ -95,9 +95,9 @@ done
|
|||
|
||||
# check project in cmake scripts is correct
|
||||
echo '.. Checking if all CMakeLists.txt project names are correct...'
|
||||
project_name_tests=$(for i in ^build*/test/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); egrep "${pkg}_Tests\s*\)" -L $i; done)
|
||||
project_name_examples=$(for i in ^build*/examples/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); egrep "${pkg}_Examples\s*\)" -L $i; done)
|
||||
project_name_demo=$(for i in ^build*/demo/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); egrep "${pkg}_Demo\s*\)" -L $i; done)
|
||||
project_name_tests=$(for i in ^build*/test/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); grep -E "${pkg}_Tests\s*\)" -L $i; done)
|
||||
project_name_examples=$(for i in ^build*/examples/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); grep -E "${pkg}_Examples\s*\)" -L $i; done)
|
||||
project_name_demo=$(for i in ^build*/demo/*/CMakeLists.txt; do pkg=$(echo $i | awk -F "/" '{print $3}'); grep -E "${pkg}_Demo\s*\)" -L $i; done)
|
||||
|
||||
if [ -n "${project_name_tests}" ]; then
|
||||
echo "CMakeLists with incorrect project name"
|
||||
|
|
@ -146,7 +146,7 @@ fi
|
|||
|
||||
#check GPL header files without license include directive
|
||||
echo '.. Checking include directives in GPL header files...'
|
||||
file_without_license_include=$(for pkg in `find */package_info -name 'license.txt' | awk -F "/" '{print $1}'`; do if [ -e ${pkg}/include ]; then find ${pkg}/include -type f -name '*.h' | xargs -r egrep -l "^#\s*define\s+CGAL_.*_H\s*$" | xargs -r egrep -l "SPDX-License-Identifier.*[ (]GPL" | xargs -r grep -L "#include <CGAL/license"; fi; done)
|
||||
file_without_license_include=$(for pkg in `find */package_info -name 'license.txt' | awk -F "/" '{print $1}'`; do if [ -e ${pkg}/include ]; then find ${pkg}/include -type f -name '*.h' | xargs -r grep -E -l "^#\s*define\s+CGAL_.*_H\s*$" | xargs -r grep -E -l "SPDX-License-Identifier.*[ (]GPL" | xargs -r grep -L "#include <CGAL/license"; fi; done)
|
||||
if [ -n "${file_without_license_include}" ]; then
|
||||
echo "The following files do not have an include directive of the package license header:"
|
||||
echo ${file_without_license_include}
|
||||
|
|
@ -155,7 +155,7 @@ fi
|
|||
|
||||
#check no file contains non-utf8 characters
|
||||
echo '.. Checking if non utf-8 characters are used...'
|
||||
txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | egrep -v "UTF-8|ASCII|CSV|XML|EPS|FIG|assembler source|Perl script|from flex")
|
||||
txt_not_utf8=$(git ls-files -z --stage | awk -F"\t" 'BEGIN { RS="\0" }; { printf "%s\n", $2; }' | xargs file -N | grep "text" | grep -E -v "UTF-8|ASCII|CSV|XML|EPS|FIG|assembler source|Perl script|from flex")
|
||||
if [ -n "${txt_not_utf8}" ]; then
|
||||
echo "The following files have non utf-8 characters:"
|
||||
echo ${txt_not_utf8}
|
||||
|
|
@ -164,7 +164,7 @@ fi
|
|||
|
||||
#check no file contains tab characters
|
||||
echo '.. Checking if tab character is used...'
|
||||
file_with_tabs=$(git ls-files --stage | egrep '\.txt|\.h$|\.cpp|\.hpp' | awk '{print $4}' | xargs grep -P -l '\t')
|
||||
file_with_tabs=$(git ls-files --stage | grep -E '\.txt|\.h$|\.cpp|\.hpp' | awk '{print $4}' | xargs grep -P -l '\t')
|
||||
if [ -n "${file_with_tabs}" ]; then
|
||||
echo "The following files have tabs:"
|
||||
echo ${file_with_tabs}
|
||||
|
|
@ -173,7 +173,7 @@ fi
|
|||
|
||||
#check no file contains trailing whitespaces characters
|
||||
echo '.. Look for trailing whitespaces...'
|
||||
files_with_trailingws=$(git ls-files --stage | egrep '\.txt|\.h$|\.cpp|\.hpp' | awk '{print $4}' | xargs grep -P -l '\s+$')
|
||||
files_with_trailingws=$(git ls-files --stage | grep -E '\.txt|\.h$|\.cpp|\.hpp' | awk '{print $4}' | xargs grep -P -l '\s+$')
|
||||
if [ -n "${files_with_trailingws}" ]; then
|
||||
echo "The following files have trailing whitespaces:"
|
||||
echo ${files_with_trailingws}
|
||||
|
|
@ -191,7 +191,7 @@ fi
|
|||
|
||||
#check documented function named parameters exists
|
||||
echo '.. Checking documented function named parameters'
|
||||
nps=$(git ls-files --stage | egrep '\.h' | awk '{print $4}' | xargs egrep "cgalParamNBegin\{.+\}" | perl -lne 'print for /cgalParamNBegin{(.+)}/' | sort -u )
|
||||
nps=$(git ls-files --stage | grep -E '\.h' | awk '{print $4}' | xargs grep -E "cgalParamNBegin\{.+\}" | perl -lne 'print for /cgalParamNBegin{(.+)}/' | sort -u )
|
||||
git_dir=`pwd`
|
||||
tmp_dir=`mktemp -d`
|
||||
cd $tmp_dir
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ EOF
|
|||
BASE=`basename $BASE .CPP`
|
||||
BASE=`basename $BASE .c++`
|
||||
BASE=`basename $BASE .C`
|
||||
egrep '\bmain[ \t]*\(' $file >/dev/null 2>&1
|
||||
grep -E '\bmain[ \t]*\(' $file >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "create_single_source_cgal_program( \"$file\" )"
|
||||
if [ -n "$ENABLE_CTEST" ]; then
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ EOF
|
|||
BASE=`basename $BASE .CPP`
|
||||
BASE=`basename $BASE .c++`
|
||||
BASE=`basename $BASE .C`
|
||||
egrep '\bmain[ \t]*\(' $file >/dev/null 2>&1
|
||||
grep -E '\bmain[ \t]*\(' $file >/dev/null 2>&1
|
||||
if [ $? -eq 0 ]; then
|
||||
echo "create_single_source_cgal_program( \"$file\" )"
|
||||
echo "Adding a target ${BASE}..." >&3
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ run_testsuite()
|
|||
[ x"$1" = x"icons" -o x"$1" = x"resources" ] && exit 0
|
||||
|
||||
if [ -z "$1" ] ; then
|
||||
TEST_DIRECTORIES=`ls | egrep -v 'icons|resources'`
|
||||
TEST_DIRECTORIES=`ls | grep -E -v 'icons|resources'`
|
||||
else
|
||||
TEST_DIRECTORIES="$*"
|
||||
fi
|
||||
|
|
|
|||
Loading…
Reference in New Issue