Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using egrep #20522

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/tools/eclipsesym/cmdline2xml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
exit 2
fi

readlink () { echo $(cd $(dirname $1); pwd)/$(basename $1); }

Check warning on line 29 in dist/tools/eclipsesym/cmdline2xml.sh

View workflow job for this annotation

GitHub Actions / static-tests

Double quote to prevent globbing and word splitting. [SC2086]

Check warning on line 29 in dist/tools/eclipsesym/cmdline2xml.sh

View workflow job for this annotation

GitHub Actions / static-tests

Quote this to prevent word splitting. [SC2046]

Check warning on line 29 in dist/tools/eclipsesym/cmdline2xml.sh

View workflow job for this annotation

GitHub Actions / static-tests

Use 'cd ... || exit' or 'cd ... || return' in case cd fails. [SC2164]

XML_INSTRUCTIONS='
<!--
Expand All @@ -47,15 +47,15 @@
XML_MACRO_SECTION_BEGIN='<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">'
XML_INCLUDE_SECTION_BEGIN='<section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.IncludePaths">'
XML_SECTION_END='</section>'
XML_MACRO_TEMPLATE='"<macro><name>"$1"</name><value>"$2"</value></macro>"'

Check warning on line 50 in dist/tools/eclipsesym/cmdline2xml.sh

View workflow job for this annotation

GitHub Actions / static-tests

Expressions don't expand in single quotes, use double quotes for that. [SC2016]
XML_INCLUDE_TEMPLATE='"<includepath workspace_path=\"true\">"$0"</includepath>"'

Check warning on line 51 in dist/tools/eclipsesym/cmdline2xml.sh

View workflow job for this annotation

GitHub Actions / static-tests

Expressions don't expand in single quotes, use double quotes for that. [SC2016]
LANGUAGES=( 'GNU C' 'GNU C++' 'Assembly' 'C Source File' 'C++ Source File' 'Assembly Source File' )
ECLIPSE_PROJECT_NAME='RIOT'

GCCCOMMANDLINE=$(cat)

# Find all includes
INCLUDES=$(${ECHO} "${GCCCOMMANDLINE}" | sed -e 's/ /\n/g' | egrep '^-I' | cut -c3-)
INCLUDES=$(${ECHO} "${GCCCOMMANDLINE}" | sed -e 's/ /\n/g' | grep -E '^-I' | cut -c3-)

# Parse and rewrite to project relative paths
INCLUDES_REL=""
Expand All @@ -66,7 +66,7 @@
done

# Grab macro definitions
MACROS=$(${ECHO} "${GCCCOMMANDLINE}" | sed -e 's/ /\n/g' | egrep '^-D' | cut -c3-)
MACROS=$(${ECHO} "${GCCCOMMANDLINE}" | sed -e 's/ /\n/g' | grep -E '^-D' | cut -c3-)

# Output
${ECHO} "${XML_HEADER}"
Expand Down
Loading