mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-23 16:20:49 +00:00
Merge pull request #7896 from AgathiyanB/gitignore-generated-files-toggle
Add script to toggle ignoring generated files
This commit is contained in:
commit
2f12a29cdd
3
library/.gitignore
vendored
3
library/.gitignore
vendored
@ -2,8 +2,9 @@ libmbed*
|
|||||||
*.sln
|
*.sln
|
||||||
*.vcxproj
|
*.vcxproj
|
||||||
|
|
||||||
# Automatically generated files
|
###START_GENERATED_FILES###
|
||||||
/error.c
|
/error.c
|
||||||
/version_features.c
|
/version_features.c
|
||||||
/ssl_debug_helpers_generated.c
|
/ssl_debug_helpers_generated.c
|
||||||
/psa_crypto_driver_wrappers.c
|
/psa_crypto_driver_wrappers.c
|
||||||
|
###END_GENERATED_FILES###
|
||||||
|
10
programs/.gitignore
vendored
10
programs/.gitignore
vendored
@ -5,10 +5,6 @@
|
|||||||
*.sln
|
*.sln
|
||||||
*.vcxproj
|
*.vcxproj
|
||||||
|
|
||||||
# Generated source files
|
|
||||||
/psa/psa_constant_names_generated.c
|
|
||||||
/test/query_config.c
|
|
||||||
|
|
||||||
aes/crypt_and_hash
|
aes/crypt_and_hash
|
||||||
cipher/cipher_aead_demo
|
cipher/cipher_aead_demo
|
||||||
hash/generic_sum
|
hash/generic_sum
|
||||||
@ -75,5 +71,11 @@ x509/crl_app
|
|||||||
x509/load_roots
|
x509/load_roots
|
||||||
x509/req_app
|
x509/req_app
|
||||||
|
|
||||||
|
###START_GENERATED_FILES###
|
||||||
|
# Generated source files
|
||||||
|
/psa/psa_constant_names_generated.c
|
||||||
|
/test/query_config.c
|
||||||
|
|
||||||
# Generated data files
|
# Generated data files
|
||||||
pkey/keyfile.key
|
pkey/keyfile.key
|
||||||
|
###END_GENERATED_FILES###
|
||||||
|
71
scripts/gitignore_patch.sh
Executable file
71
scripts/gitignore_patch.sh
Executable file
@ -0,0 +1,71 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Copyright The Mbed TLS Contributors
|
||||||
|
# SPDX-License-Identifier: Apache-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.
|
||||||
|
#
|
||||||
|
# Purpose
|
||||||
|
#
|
||||||
|
# For adapting gitignore files for releases so generated files can be included.
|
||||||
|
#
|
||||||
|
# Usage: gitignore_add_generated_files.sh [ -h | --help ] etc
|
||||||
|
#
|
||||||
|
|
||||||
|
set -eu
|
||||||
|
|
||||||
|
print_usage()
|
||||||
|
{
|
||||||
|
echo "Usage: $0"
|
||||||
|
echo -e " -h|--help\t\tPrint this help."
|
||||||
|
echo -e " -i|--ignore\t\tAdd generated files to the gitignores."
|
||||||
|
echo -e " -u|--unignore\t\tRemove generated files from the gitignores."
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ $# -eq 0 ]]; then
|
||||||
|
print_usage
|
||||||
|
exit 1
|
||||||
|
elif [[ $# -ge 2 ]]; then
|
||||||
|
echo "Too many arguments!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
-i | --ignore)
|
||||||
|
IGNORE=true
|
||||||
|
;;
|
||||||
|
-u | --uignore)
|
||||||
|
IGNORE=false
|
||||||
|
;;
|
||||||
|
-h | --help | "")
|
||||||
|
print_usage
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Unknown argument: $1"
|
||||||
|
echo "run '$0 --help' for options"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
GITIGNORES=$(find . -name ".gitignore")
|
||||||
|
for GITIGNORE in $GITIGNORES; do
|
||||||
|
if $IGNORE; then
|
||||||
|
sed -i '/###START_COMMENTED_GENERATED_FILES###/,/###END_COMMENTED_GENERATED_FILES###/s/^# //' $GITIGNORE
|
||||||
|
sed -i 's/###START_COMMENTED_GENERATED_FILES###/###START_GENERATED_FILES###/' $GITIGNORE
|
||||||
|
sed -i 's/###END_COMMENTED_GENERATED_FILES###/###END_GENERATED_FILES###/' $GITIGNORE
|
||||||
|
else
|
||||||
|
sed -i '/###START_GENERATED_FILES###/,/###END_GENERATED_FILES###/s/^/# /' $GITIGNORE
|
||||||
|
sed -i 's/###START_GENERATED_FILES###/###START_COMMENTED_GENERATED_FILES###/' $GITIGNORE
|
||||||
|
sed -i 's/###END_GENERATED_FILES###/###END_COMMENTED_GENERATED_FILES###/' $GITIGNORE
|
||||||
|
fi
|
||||||
|
done
|
12
tests/.gitignore
vendored
12
tests/.gitignore
vendored
@ -1,11 +1,6 @@
|
|||||||
*.sln
|
*.sln
|
||||||
*.vcxproj
|
*.vcxproj
|
||||||
|
|
||||||
# Generated source files
|
|
||||||
/suites/*.generated.data
|
|
||||||
/suites/test_suite_psa_crypto_storage_format.v[0-9]*.data
|
|
||||||
/suites/test_suite_psa_crypto_storage_format.current.data
|
|
||||||
|
|
||||||
*.log
|
*.log
|
||||||
/test_suite*
|
/test_suite*
|
||||||
data_files/mpi_write
|
data_files/mpi_write
|
||||||
@ -20,3 +15,10 @@ include/test/instrument_record_status.h
|
|||||||
src/libmbed*
|
src/libmbed*
|
||||||
|
|
||||||
libtestdriver1/*
|
libtestdriver1/*
|
||||||
|
|
||||||
|
###START_GENERATED_FILES###
|
||||||
|
# Generated source files
|
||||||
|
/suites/*.generated.data
|
||||||
|
/suites/test_suite_psa_crypto_storage_format.v[0-9]*.data
|
||||||
|
/suites/test_suite_psa_crypto_storage_format.current.data
|
||||||
|
###END_GENERATED_FILES###
|
||||||
|
10
visualc/VS2013/.gitignore
vendored
10
visualc/VS2013/.gitignore
vendored
@ -1,7 +1,3 @@
|
|||||||
# Files automatically generated by generate_visualc_files.pl
|
|
||||||
/mbedTLS.sln
|
|
||||||
/*.vcxproj
|
|
||||||
|
|
||||||
# Files that may be left over from check-generated-files.sh
|
# Files that may be left over from check-generated-files.sh
|
||||||
/*.bak
|
/*.bak
|
||||||
|
|
||||||
@ -12,3 +8,9 @@
|
|||||||
/Release/
|
/Release/
|
||||||
/*.vcxproj.filters
|
/*.vcxproj.filters
|
||||||
/*.vcxproj.user
|
/*.vcxproj.user
|
||||||
|
|
||||||
|
###START_GENERATED_FILES###
|
||||||
|
# Files automatically generated by generate_visualc_files.pl
|
||||||
|
/mbedTLS.sln
|
||||||
|
/*.vcxproj
|
||||||
|
###END_GENERATED_FILES###
|
||||||
|
Loading…
x
Reference in New Issue
Block a user