Skip to content

Commit

Permalink
Merge pull request #3 from SgrrZhf/topics/huizha01/2.9.0-updates
Browse files Browse the repository at this point in the history
TF-A 2.9.0 updates
  • Loading branch information
povergoing committed Jun 15, 2023
2 parents 28f5e13 + 42e05cb commit 421dc05
Show file tree
Hide file tree
Showing 1,444 changed files with 77,429 additions and 19,134 deletions.
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ build/

# Ignore build products from tools
tools/**/*.o
tools/**/*.d
tools/renesas/rcar_layout_create/*.bin
tools/renesas/rcar_layout_create/*.srec
tools/renesas/rcar_layout_create/*.map
Expand All @@ -31,6 +32,8 @@ tools/stm32image/*.o
tools/stm32image/stm32image
tools/stm32image/stm32image.exe
tools/sptool/__pycache__/
tools/encrypt_fw/encrypt_fw
tools/encrypt_fw/encrypt_fw.exe

# GNU GLOBAL files
GPATH
Expand All @@ -43,3 +46,9 @@ tags

# Node.js
node_modules/

# common python virtual environment directories
.env/
env/
.venv/
venv/
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh

# shellcheck source=./_/husky.sh
. "$(dirname "$0")/_/husky.sh"

"$(dirname "$0")/pre-commit.copyright" "$@"
63 changes: 63 additions & 0 deletions .husky/pre-commit.copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/bin/bash

# A hook script that checks if files staged for commit have updated Arm copyright year.
# In case they are not - updates the years and prompts user to add them to the change.
# This hook is called on "git commit" after changes have been staged, but before commit
# message has to be provided.

RED="\033[00;31m"
YELLOW="\033[00;33m"
BLANK="\033[00;00m"

FILES=`git diff --cached --name-only HEAD`
YEAR_NOW=`date +"%Y"`

YEAR_RGX="[0-9][0-9][0-9][0-9]"
ARM_RGX="\(ARM\|Arm\|arm\)"

exit_code=0

function user_warning() {
echo -e "Copyright of $RED$FILE$BLANK is out of date/incorrect"
echo -e "Updated copyright to"
grep -nr "opyright.*$YEAR_RGX.*$ARM_RGX" "$FILE"
echo
}

while read -r FILE; do
if [ -z "$FILE" ]
then
break
fi
# Check if correct copyright notice is in file.
# To reduce false positives, we assume files with no
# copyright notice do not require it.
if ! grep "opyright.*$YEAR_NOW.*$ARM_RGX" "$FILE">/dev/null 2>&1
then
# If it is "from_date - to_date" type of entry - change to_date entry.
if grep "opyright.*$YEAR_RGX.*-.*$YEAR_RGX.*$ARM_RGX" "$FILE" >/dev/null 2>&1
then
exit_code=1
sed -i "s/\(opyright.*\)$YEAR_RGX\(.*$ARM_RGX\)/\1$(date +"%Y"), Arm/" $FILE
user_warning
# If it is single "date" type of entry - add the copyright extension to current year.
elif grep "opyright.*$YEAR_RGX.*$ARM_RGX" "$FILE" >/dev/null 2>&1
then
exit_code=1
sed -i "s/\(opyright.*$YEAR_RGX\)\(.*$ARM_RGX\)/\1-$(date +"%Y"), Arm/" $FILE
user_warning
fi
# Even if the year is correct - verify that Arm copyright is formatted correctly.
elif grep "opyright.*\(ARM\|arm\)" "$FILE">/dev/null 2>&1
then
exit_code=1
sed -i "s/\(opyright.*\)\(ARM\|arm\)/\1Arm/" $FILE
user_warning
fi
done <<< "$FILES"

if [ $exit_code -eq 1 ]
then
echo -e "$RED""Please stage updated files$BLANK before commiting or use$YELLOW git commit --no-verify$BLANK to skip copyright check"
fi
exit $exit_code
4 changes: 3 additions & 1 deletion .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
# shellcheck source=./_/husky.sh
. "$(dirname "$0")/_/husky.sh"

"$(dirname "$0")/prepare-commit-msg.cz" "$@"
if ! git config --get tf-a.disableCommitizen > /dev/null; then
"$(dirname "$0")/prepare-commit-msg.cz" "$@"
fi
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v16.17.1
26 changes: 26 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Copyright (c) 2023, Arm Limited. All rights reserved
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Configuration file for the readthedocs deploy
# Available at https://trustedfirmware-a.readthedocs.io/en/latest/


# readthedocs config version
version: 2

build:
os: ubuntu-22.04 # Ubuntu Jammy LTS
tools:
python: "3.10"
apt_packages:
- plantuml
jobs:
post_create_environment:
- pip install poetry=="1.3.2"
- poetry config virtualenvs.create false
post_install:
- poetry install --with doc

sphinx:
configuration: docs/conf.py
19 changes: 18 additions & 1 deletion .versionrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2021, Arm Limited. All rights reserved.
* Copyright (c) 2021-2023, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
Expand Down Expand Up @@ -80,6 +80,23 @@ module.exports = {
"filename": "package.json",
"type": "json"
},
{
"filename": "pyproject.toml",
"updater": {
"readVersion": function (contents) {
const _ver = contents.match(/version\s=.*"(\d)\.(\d)\.(\d)/);

return `${_ver[1]}.${_ver[2]}.${_ver[2]}`;
},

"writeVersion": function (contents, version) {
const _ver = 'version = "' + version + '"'

return contents.replace(/^(version\s=\s")((\d).?)*$/m, _ver)
}

},
},
{
"filename": "package-lock.json",
"type": "json"
Expand Down
Loading

0 comments on commit 421dc05

Please sign in to comment.