mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-18 12:52:44 +01:00
Merge pull request #2279 from Farthen/pr@licensecheck-bsd
dist/tools/licenses: support BSD sed
This commit is contained in:
commit
d8d3e7e4e5
5
dist/tools/licenses/check.sh
vendored
5
dist/tools/licenses/check.sh
vendored
@ -13,6 +13,9 @@ OUTPUT="${CHECKROOT}/out"
|
||||
UNKNOWN="${OUTPUT}/unknown"
|
||||
TMP="${CHECKROOT}/.tmp"
|
||||
|
||||
# Needed for compatibility with BSD sed
|
||||
TAB_CHAR="$(printf '\t')"
|
||||
|
||||
# prepare
|
||||
ROOT=$(git rev-parse --show-toplevel)
|
||||
LICENSES=$(ls "${LICENSEDIR}")
|
||||
@ -63,7 +66,7 @@ fi
|
||||
# categorize files
|
||||
for FILE in ${FILES}; do
|
||||
FAIL=1
|
||||
head -100 "${ROOT}/${FILE}" | sed -e 's/[\/\*\t]/ /g' -e 's/$/ /' | tr -d '\r\n' | sed -e 's/ */ /g' > "${TMP}"
|
||||
head -100 "${ROOT}/${FILE}" | sed -e 's/[\/\*'"${TAB_CHAR}"']/ /g' -e 's/$/ /' | tr -d '\r\n' | sed -e 's/ */ /g' > "${TMP}"
|
||||
for LICENSE in ${LICENSES}; do
|
||||
if pcregrep -q -f "${LICENSEDIR}/${LICENSE}" "${TMP}"; then
|
||||
echo "${FILE}" >> "${OUTPUT}/${LICENSE}"
|
||||
|
Loading…
Reference in New Issue
Block a user