2012-11-26 17:18:12 +01:00
|
|
|
#!/bin/bash
|
2016-05-23 01:22:58 +02:00
|
|
|
#
|
2020-08-19 16:37:36 +02:00
|
|
|
# Copyright The Mbed TLS Contributors
|
Update license headers to Apache-2.0 OR GPL-2.0-or-later
This will allow us to ship the LTS branches in a single archive
This commit was generated using the following script:
# ========================
#!/bin/sh
header1='\ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later\
*\
* This file is provided under the Apache License 2.0, or the\
* GNU General Public License v2.0 or later.\
*\
* **********\
* Apache License 2.0:\
*\
* Licensed under the Apache License, Version 2.0 (the "License"); you may\
* not use this file except in compliance with the License.\
* You may obtain a copy of the License at\
*\
* http://www.apache.org/licenses/LICENSE-2.0\
*\
* Unless required by applicable law or agreed to in writing, software\
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\
* See the License for the specific language governing permissions and\
* limitations under the License.\
*\
* **********\
*\
* **********\
* GNU General Public License v2.0 or later:\
*\
* This program is free software; you can redistribute it and/or modify\
* it under the terms of the GNU General Public License as published by\
* the Free Software Foundation; either version 2 of the License, or\
* (at your option) any later version.\
*\
* This program is distributed in the hope that it will be useful,\
* but WITHOUT ANY WARRANTY; without even the implied warranty of\
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\
* GNU General Public License for more details.\
*\
* You should have received a copy of the GNU General Public License along\
* with this program; if not, write to the Free Software Foundation, Inc.,\
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\
*\
* **********'
find -path './.git' -prune -o '(' -name '*.c' -o -name '*.cpp' -o -name '*.fmt' -o -name '*.h' ')' -print | xargs sed -i "
# Normalize the first line of the copyright headers (no text on the first line of a block comment)
/^\/\*.*Copyright.*Arm/I s/\/\*/&\n */
# Insert new copyright header
/SPDX-License-Identifier/ i\
$header1
# Delete old copyright header
/SPDX-License-Identifier/,$ {
# Delete lines until the one preceding the mbedtls declaration
N
1,/This file is part of/ {
/This file is part of/! D
}
}
"
# Format copyright header for inclusion into scripts
header2=$(echo "$header1" | sed 's/^\\\? \* \?/#/')
find -path './.git' -prune -o '(' -name '*.gdb' -o -name '*.pl' -o -name '*.py' -o -name '*.sh' ')' -print | xargs sed -i "
# Insert new copyright header
/SPDX-License-Identifier/ i\
$header2
# Delete old copyright header
/SPDX-License-Identifier/,$ {
# Delete lines until the one preceding the mbedtls declaration
N
1,/This file is part of/ {
/This file is part of/! D
}
}
"
# ========================
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2020-06-05 13:02:18 +02:00
|
|
|
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
|
|
|
|
#
|
|
|
|
# This file is provided under the Apache License 2.0, or the
|
|
|
|
# GNU General Public License v2.0 or later.
|
|
|
|
#
|
|
|
|
# **********
|
|
|
|
# Apache License 2.0:
|
2020-05-26 01:54:15 +02:00
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
|
|
# not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
Update license headers to Apache-2.0 OR GPL-2.0-or-later
This will allow us to ship the LTS branches in a single archive
This commit was generated using the following script:
# ========================
#!/bin/sh
header1='\ * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later\
*\
* This file is provided under the Apache License 2.0, or the\
* GNU General Public License v2.0 or later.\
*\
* **********\
* Apache License 2.0:\
*\
* Licensed under the Apache License, Version 2.0 (the "License"); you may\
* not use this file except in compliance with the License.\
* You may obtain a copy of the License at\
*\
* http://www.apache.org/licenses/LICENSE-2.0\
*\
* Unless required by applicable law or agreed to in writing, software\
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\
* See the License for the specific language governing permissions and\
* limitations under the License.\
*\
* **********\
*\
* **********\
* GNU General Public License v2.0 or later:\
*\
* This program is free software; you can redistribute it and/or modify\
* it under the terms of the GNU General Public License as published by\
* the Free Software Foundation; either version 2 of the License, or\
* (at your option) any later version.\
*\
* This program is distributed in the hope that it will be useful,\
* but WITHOUT ANY WARRANTY; without even the implied warranty of\
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\
* GNU General Public License for more details.\
*\
* You should have received a copy of the GNU General Public License along\
* with this program; if not, write to the Free Software Foundation, Inc.,\
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\
*\
* **********'
find -path './.git' -prune -o '(' -name '*.c' -o -name '*.cpp' -o -name '*.fmt' -o -name '*.h' ')' -print | xargs sed -i "
# Normalize the first line of the copyright headers (no text on the first line of a block comment)
/^\/\*.*Copyright.*Arm/I s/\/\*/&\n */
# Insert new copyright header
/SPDX-License-Identifier/ i\
$header1
# Delete old copyright header
/SPDX-License-Identifier/,$ {
# Delete lines until the one preceding the mbedtls declaration
N
1,/This file is part of/ {
/This file is part of/! D
}
}
"
# Format copyright header for inclusion into scripts
header2=$(echo "$header1" | sed 's/^\\\? \* \?/#/')
find -path './.git' -prune -o '(' -name '*.gdb' -o -name '*.pl' -o -name '*.py' -o -name '*.sh' ')' -print | xargs sed -i "
# Insert new copyright header
/SPDX-License-Identifier/ i\
$header2
# Delete old copyright header
/SPDX-License-Identifier/,$ {
# Delete lines until the one preceding the mbedtls declaration
N
1,/This file is part of/ {
/This file is part of/! D
}
}
"
# ========================
Signed-off-by: Bence Szépkúti <bence.szepkuti@arm.com>
2020-06-05 13:02:18 +02:00
|
|
|
# **********
|
|
|
|
#
|
|
|
|
# **********
|
|
|
|
# GNU General Public License v2.0 or later:
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License along
|
|
|
|
# with this program; if not, write to the Free Software Foundation, Inc.,
|
|
|
|
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
#
|
|
|
|
# **********
|
|
|
|
#
|
2016-05-23 01:22:58 +02:00
|
|
|
# Purpose
|
|
|
|
#
|
|
|
|
# Sets the version numbers in the source code to those given.
|
|
|
|
#
|
|
|
|
# Usage: bump_version.sh [ --version <version> ] [ --so-crypto <version>]
|
|
|
|
# [ --so-x509 <version> ] [ --so-tls <version> ]
|
|
|
|
# [ -v | --verbose ] [ -h | --help ]
|
|
|
|
#
|
2012-11-26 17:18:12 +01:00
|
|
|
|
|
|
|
VERSION=""
|
|
|
|
SOVERSION=""
|
|
|
|
|
|
|
|
# Parse arguments
|
|
|
|
#
|
|
|
|
until [ -z "$1" ]
|
|
|
|
do
|
|
|
|
case "$1" in
|
|
|
|
--version)
|
|
|
|
# Version to use
|
|
|
|
shift
|
|
|
|
VERSION=$1
|
|
|
|
;;
|
2015-06-25 11:54:52 +02:00
|
|
|
--so-crypto)
|
2012-11-26 17:18:12 +01:00
|
|
|
shift
|
2015-06-25 11:54:52 +02:00
|
|
|
SO_CRYPTO=$1
|
|
|
|
;;
|
|
|
|
--so-x509)
|
|
|
|
shift
|
|
|
|
SO_X509=$1
|
|
|
|
;;
|
|
|
|
--so-tls)
|
|
|
|
shift
|
|
|
|
SO_TLS=$1
|
2012-11-26 17:18:12 +01:00
|
|
|
;;
|
|
|
|
-v|--verbose)
|
|
|
|
# Be verbose
|
|
|
|
VERBOSE="1"
|
|
|
|
;;
|
|
|
|
-h|--help)
|
|
|
|
# print help
|
|
|
|
echo "Usage: $0"
|
2015-06-25 11:54:52 +02:00
|
|
|
echo -e " -h|--help\t\tPrint this help."
|
2012-11-26 17:18:12 +01:00
|
|
|
echo -e " --version <version>\tVersion to bump to."
|
2015-06-25 11:54:52 +02:00
|
|
|
echo -e " --so-crypto <version>\tSO version to bump libmbedcrypto to."
|
|
|
|
echo -e " --so-x509 <version>\tSO version to bump libmbedx509 to."
|
|
|
|
echo -e " --so-tls <version>\tSO version to bump libmbedtls to."
|
2012-11-26 17:18:12 +01:00
|
|
|
echo -e " -v|--verbose\t\tVerbose."
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
# print error
|
|
|
|
echo "Unknown argument: '$1'"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
if [ "X" = "X$VERSION" ];
|
|
|
|
then
|
|
|
|
echo "No version specified. Unable to continue."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
[ $VERBOSE ] && echo "Bumping VERSION in library/CMakeLists.txt"
|
2015-06-25 11:51:12 +02:00
|
|
|
sed -e "s/ VERSION [0-9.]\{1,\}/ VERSION $VERSION/g" < library/CMakeLists.txt > tmp
|
2012-11-26 17:18:12 +01:00
|
|
|
mv tmp library/CMakeLists.txt
|
|
|
|
|
2015-06-25 11:54:52 +02:00
|
|
|
if [ "X" != "X$SO_CRYPTO" ];
|
|
|
|
then
|
|
|
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedcrypto in library/CMakeLists.txt"
|
|
|
|
sed -e "/mbedcrypto/ s/ SOVERSION [0-9]\{1,\}/ SOVERSION $SO_CRYPTO/g" < library/CMakeLists.txt > tmp
|
|
|
|
mv tmp library/CMakeLists.txt
|
|
|
|
|
|
|
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedcrypto in library/Makefile"
|
|
|
|
sed -e "s/SOEXT_CRYPTO=so.[0-9]\{1,\}/SOEXT_CRYPTO=so.$SO_CRYPTO/g" < library/Makefile > tmp
|
|
|
|
mv tmp library/Makefile
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "X" != "X$SO_X509" ];
|
|
|
|
then
|
|
|
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedx509 in library/CMakeLists.txt"
|
|
|
|
sed -e "/mbedx509/ s/ SOVERSION [0-9]\{1,\}/ SOVERSION $SO_X509/g" < library/CMakeLists.txt > tmp
|
|
|
|
mv tmp library/CMakeLists.txt
|
|
|
|
|
|
|
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedx509 in library/Makefile"
|
|
|
|
sed -e "s/SOEXT_X509=so.[0-9]\{1,\}/SOEXT_X509=so.$SO_X509/g" < library/Makefile > tmp
|
|
|
|
mv tmp library/Makefile
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "X" != "X$SO_TLS" ];
|
2012-11-26 17:18:12 +01:00
|
|
|
then
|
2015-06-25 11:54:52 +02:00
|
|
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedtls in library/CMakeLists.txt"
|
|
|
|
sed -e "/mbedtls/ s/ SOVERSION [0-9]\{1,\}/ SOVERSION $SO_TLS/g" < library/CMakeLists.txt > tmp
|
2012-11-26 17:18:12 +01:00
|
|
|
mv tmp library/CMakeLists.txt
|
2013-11-05 11:28:32 +01:00
|
|
|
|
2015-06-25 11:54:52 +02:00
|
|
|
[ $VERBOSE ] && echo "Bumping SOVERSION for libmbedtls in library/Makefile"
|
|
|
|
sed -e "s/SOEXT_TLS=so.[0-9]\{1,\}/SOEXT_TLS=so.$SO_TLS/g" < library/Makefile > tmp
|
2013-11-05 11:28:32 +01:00
|
|
|
mv tmp library/Makefile
|
2012-11-26 17:18:12 +01:00
|
|
|
fi
|
|
|
|
|
2015-03-09 18:05:11 +01:00
|
|
|
[ $VERBOSE ] && echo "Bumping VERSION in include/mbedtls/version.h"
|
2012-11-26 17:18:12 +01:00
|
|
|
read MAJOR MINOR PATCH <<<$(IFS="."; echo $VERSION)
|
|
|
|
VERSION_NR="$( printf "0x%02X%02X%02X00" $MAJOR $MINOR $PATCH )"
|
2015-03-09 18:05:11 +01:00
|
|
|
cat include/mbedtls/version.h | \
|
2015-06-25 11:51:12 +02:00
|
|
|
sed -e "s/_VERSION_MAJOR .\{1,\}/_VERSION_MAJOR $MAJOR/" | \
|
|
|
|
sed -e "s/_VERSION_MINOR .\{1,\}/_VERSION_MINOR $MINOR/" | \
|
|
|
|
sed -e "s/_VERSION_PATCH .\{1,\}/_VERSION_PATCH $PATCH/" | \
|
|
|
|
sed -e "s/_VERSION_NUMBER .\{1,\}/_VERSION_NUMBER $VERSION_NR/" | \
|
|
|
|
sed -e "s/_VERSION_STRING .\{1,\}/_VERSION_STRING \"$VERSION\"/" | \
|
|
|
|
sed -e "s/_VERSION_STRING_FULL .\{1,\}/_VERSION_STRING_FULL \"mbed TLS $VERSION\"/" \
|
2012-11-26 17:18:12 +01:00
|
|
|
> tmp
|
2015-03-09 18:05:11 +01:00
|
|
|
mv tmp include/mbedtls/version.h
|
2012-11-26 17:18:12 +01:00
|
|
|
|
|
|
|
[ $VERBOSE ] && echo "Bumping version in tests/suites/test_suite_version.data"
|
2015-06-25 11:51:12 +02:00
|
|
|
sed -e "s/version:\".\{1,\}/version:\"$VERSION\"/g" < tests/suites/test_suite_version.data > tmp
|
2012-11-26 17:18:12 +01:00
|
|
|
mv tmp tests/suites/test_suite_version.data
|
|
|
|
|
2015-01-22 18:01:27 +01:00
|
|
|
[ $VERBOSE ] && echo "Bumping PROJECT_NAME in doxygen/mbedtls.doxyfile and doxygen/input/doc_mainpage.h"
|
|
|
|
for i in doxygen/mbedtls.doxyfile doxygen/input/doc_mainpage.h;
|
2012-11-26 17:18:12 +01:00
|
|
|
do
|
2015-06-25 11:51:12 +02:00
|
|
|
sed -e "s/mbed TLS v[0-9\.]\{1,\}/mbed TLS v$VERSION/g" < $i > tmp
|
2012-11-26 17:18:12 +01:00
|
|
|
mv tmp $i
|
|
|
|
done
|
|
|
|
|
2014-04-30 11:49:44 +02:00
|
|
|
[ $VERBOSE ] && echo "Re-generating library/error.c"
|
2014-05-09 13:40:14 +02:00
|
|
|
scripts/generate_errors.pl
|
2014-04-30 11:49:44 +02:00
|
|
|
|
2018-10-16 23:13:57 +02:00
|
|
|
[ $VERBOSE ] && echo "Re-generating programs/ssl/query_config.c"
|
|
|
|
scripts/generate_query_config.pl
|
|
|
|
|
2014-04-30 11:49:44 +02:00
|
|
|
[ $VERBOSE ] && echo "Re-generating library/version_features.c"
|
2014-05-09 13:40:14 +02:00
|
|
|
scripts/generate_features.pl
|
2014-05-09 13:25:10 +02:00
|
|
|
|
|
|
|
[ $VERBOSE ] && echo "Re-generating visualc files"
|
|
|
|
scripts/generate_visualc_files.pl
|
2016-05-23 01:22:58 +02:00
|
|
|
|