Commit 0038f396 authored by Jamie McCrae's avatar Jamie McCrae Committed by Dominik Ermel
Browse files

boot: zcbor: Move copy script



Moves and updates the copy script to the zcbor folder

Signed-off-by: default avatarJamie McCrae <jamie.mccrae@nordicsemi.no>
parent b3888298
Loading
Loading
Loading
Loading
+0 −40
Original line number Diff line number Diff line
#!/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"
+22 −0
Original line number Diff line number Diff line
#!/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"