boot: zcbor: Move copy script
Moves and updates the copy script to the zcbor folder Signed-off-by: Jamie McCrae <jamie.mccrae@nordicsemi.no>
This commit is contained in:
parent
b388829846
commit
0038f3967b
|
@ -1,40 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ "$1" == "--help" ] || [ "$1" == "" ]; then
|
||||
echo "Regenerate serial_recovery_cbor.c|h if the zcbor submodule is updated."
|
||||
echo "Usage: $0 <copyright>"
|
||||
echo " e.g. $0 \"2022 Nordic Semiconductor ASA\""
|
||||
exit -1
|
||||
fi
|
||||
|
||||
add_copy_notice() {
|
||||
echo "$(printf '/*
|
||||
* This file has been %s from the zcbor library.
|
||||
* Commit %s
|
||||
*/
|
||||
|
||||
' "$2" "$(zcbor --version)"; cat $1;)" > $1
|
||||
}
|
||||
|
||||
echo "Copying zcbor_decode.c|h"
|
||||
copy_with_copy_notice() {
|
||||
cp $1 $2
|
||||
add_copy_notice $2 "copied"
|
||||
}
|
||||
|
||||
add_copyright() {
|
||||
echo "$(printf '/*
|
||||
* Copyright (c) %s
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
' "$2"; cat $1;)" > $1
|
||||
}
|
||||
|
||||
add_copy_notice zcbor_decode.c "copied"
|
||||
add_copy_notice zcbor_encode.c "copied"
|
||||
add_copy_notice zcbor_common.c "copied"
|
||||
add_copy_notice zcbor_decode.h "copied"
|
||||
add_copy_notice zcbor_encode.h "copied"
|
||||
add_copy_notice zcbor_common.h "copied"
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ "$1" == "--help" ]; then
|
||||
echo "Add header if the zcbor files are updated."
|
||||
exit -1
|
||||
fi
|
||||
|
||||
add_copy_notice() {
|
||||
echo "$(printf '/*
|
||||
* This file has been %s from the zcbor library.
|
||||
* Commit %s
|
||||
*/
|
||||
|
||||
' "$2" "$(zcbor --version)"; cat $1;)" > $1
|
||||
}
|
||||
|
||||
add_copy_notice src/zcbor_decode.c "copied"
|
||||
add_copy_notice src/zcbor_encode.c "copied"
|
||||
add_copy_notice src/zcbor_common.c "copied"
|
||||
add_copy_notice include/zcbor_decode.h "copied"
|
||||
add_copy_notice include/zcbor_encode.h "copied"
|
||||
add_copy_notice include/zcbor_common.h "copied"
|
Loading…
Reference in New Issue