Skip to content

Commit

Permalink
remove old GINKGO_LICENCE_BEACON
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcelKoch committed Sep 12, 2023
1 parent 3bcacb6 commit 23da386
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
4 changes: 2 additions & 2 deletions dev_tools/oneapi/add_host_function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ SKIP="false"

rm "${MAP_FILE}"
while IFS='' read -r line || [ -n "$line" ]; do
if [ "${EXTRACT_KERNEL}" = "false" ] && ([ "${line}" = "/*${GINKGO_LICENSE_BEACON}" ] || [ "${DURING_LICENSE}" = "true" ]); then
if [ "${EXTRACT_KERNEL}" = "false" ] && ([[ "${line}" =~ {GINKGO_LICENSE_BEGIN} ]] || [ "${DURING_LICENSE}" = "true" ]); then
DURING_LICENSE="true"
if [ "${line}" = "${GINKGO_LICENSE_BEACON}*/" ]; then
if [[ "${line}" =~ ${GINKGO_LICENSE_END} ]]; then
DURING_LICENSE="false"
SKIP="true"
fi
Expand Down
6 changes: 4 additions & 2 deletions dev_tools/oneapi/convert_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ fi
rm "${OUTPUT_FILE}"
echo "#define GET_QUEUE 0" >> "${OUTPUT_FILE}"
# add empty ginkgo license such that format_header recognize some header before header def macro
echo "/*${GINKGO_LICENSE_BEACON}" >> "${OUTPUT_FILE}"
echo "${GINKGO_LICENSE_BEACON}*/" >> "${OUTPUT_FILE}"
CURRENT_YEAR=$(date +%Y)
echo "${GINKGO_LICENSE_BEGIN} 2017-${CURRENT_YEAR} The Ginkgo authors" > "$1"
echo "//" >> "$1"
echo "${GINKGO_LICENSE_END} BSD-3-Clause" >> "$1"
rm "${GLOBAL_FILE}"
rm "${EMBED_FILE}"

Expand Down
3 changes: 2 additions & 1 deletion dev_tools/oneapi/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ check_closed() {
fi
}

GINKGO_LICENSE_BEACON="******************************<GINKGO LICENSE>******************************"
GINKGO_LICENSE_BEGIN="// SPDX-FileCopyrightText:"
GINKGO_LICENSE_END="// SPDX-License-Identifier:"
HOST_SUFFIX="_AUTOHOSTFUNC"
MAP_FILE="map_list"
4 changes: 3 additions & 1 deletion dev_tools/scripts/add_license.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ if ! command -v date &> /dev/null; then
fi

CURRENT_YEAR=$(date +%Y)
echo -e "${GINKGO_LICENSE_BEGIN} 2017-${CURRENT_YEAR} The Ginkgo authors\n//\n${GINKGO_LICENSE_END} BSD-3-Clause\n" > "${COMMENTED_LICENSE_FILE}"
echo "${GINKGO_LICENSE_BEGIN} 2017-${CURRENT_YEAR} The Ginkgo authors" > "$1"
echo "//" >> "$1"
echo "${GINKGO_LICENSE_END} BSD-3-Clause" >> "$1"

# Does not work if a found file (including the path) contains a newline
find "${GINKGO_ROOT_DIR}" \
Expand Down
15 changes: 8 additions & 7 deletions dev_tools/scripts/format_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ if [ ! -f "$1" ]; then
exit 1
fi

GINKGO_LICENSE_BEACON="******************************<GINKGO LICENSE>******************************"
GINKGO_LICENSE_BEGIN="// SPDX-FileCopyrightText:"
GINKGO_LICENSE_END="// SPDX-License-Identifier:"

CONTENT="content.cpp" # Store the residual part (start from namespace)
BEFORE="before.cpp" # Store the main header and the #ifdef/#define of header file
Expand Down Expand Up @@ -230,9 +231,9 @@ CONSIDER_REGEX="${START_BLOCK_REX}|${END_BLOCK_REX}|${COMMENT_REGEX}|${INCLUDE_R

# This part capture the main header and give the possible fail arrangement information
while IFS='' read -r line || [ -n "$line" ]; do
if [ "${line}" = "/*${GINKGO_LICENSE_BEACON}" ] || [ "${DURING_LICENSE}" = "true" ]; then
if [[ "${line}" =~ ${GINKGO_LICENSE_BEGIN} ]] || [ "${DURING_LICENSE}" = "true" ]; then
DURING_LICENSE="true"
if [ "${line}" = "${GINKGO_LICENSE_BEACON}*/" ]; then
if [[ "${line}" =~ ${GINKGO_LICENSE_END} ]]; then
DURING_LICENSE="false"
SKIP="true"
fi
Expand Down Expand Up @@ -292,10 +293,10 @@ if [ "${ALARM}" = "true" ]; then
fi

# Write license
echo "/*${GINKGO_LICENSE_BEACON}" > "$1"
cat LICENSE >> "$1"
echo "${GINKGO_LICENSE_BEACON}*/" >> "$1"
echo "" >> "$1"
CURRENT_YEAR=$(date +%Y)
echo "${GINKGO_LICENSE_BEGIN} 2017-${CURRENT_YEAR} The Ginkgo authors" > "$1"
echo "//" >> "$1"
echo "${GINKGO_LICENSE_END} BSD-3-Clause" >> "$1"

# Write the definition of header according to path
if [ -n "${IFNDEF}" ] && [ -n "${DEFINE}" ]; then
Expand Down

0 comments on commit 23da386

Please sign in to comment.