2018-10-07 03:58:27 +02:00
|
|
|
#!/usr/bin/env bash
|
2015-11-04 05:01:53 +01:00
|
|
|
#
|
util/: Replace GPLv2 boiler plate with SPDX header
Used commands:
perl -i -p0e 's|\/\*[\s*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-only */|' $(cat filelist)
perl -i -p0e 's|This[\s*]*program[\s*]*is[\s*]*free[\s*]*software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*either[\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License,[\s*]*or[\s*]*.at[\s*]*your[\s*]*option.*[\s*]*any[\s*]*later[\s*]*version.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-2.0-or-later */|' $(cat filelist)
perl -i -p0e 's|\/\*[\s*]*.*This[\s*#]*program[\s*#]*is[\s*#]*free[\s*#]*software[;:,][\s*#]*you[\s*#]*can[\s*#]*redistribute[\s*#]*it[\s*#]*and/or[\s*#]*modify[\s*#]*it[\s*#]*under[\s*#]*the[\s*#]*terms[\s*#]*of[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*as[\s*#]*published[\s*#]*by[\s*#]*the[\s*#]*Free[\s*#]*Software[\s*#]*Foundation[;:,][\s*#]*either[\s*#]*version[\s*#]*3[\s*#]*of[\s*#]*the[\s*#]*License[;:,][\s*#]*or[\s*#]*.at[\s*#]*your[\s*#]*option.*[\s*#]*any[\s*#]*later[\s*#]*version.[\s*#]*This[\s*#]*program[\s*#]*is[\s*#]*distributed[\s*#]*in[\s*#]*the[\s*#]*hope[\s*#]*that[\s*#]*it[\s*#]*will[\s*#]*be[\s*#]*useful[;:,][\s*#]*but[\s*#]*WITHOUT[\s*#]*ANY[\s*#]*WARRANTY[;:,][\s*#]*without[\s*#]*even[\s*#]*the[\s*#]*implied[\s*#]*warranty[\s*#]*of[\s*#]*MERCHANTABILITY[\s*#]*or[\s*#]*FITNESS[\s*#]*FOR[\s*#]*A[\s*#]*PARTICULAR[\s*#]*PURPOSE.[\s*#]*See[\s*#]*the[\s*#]*GNU[\s*#]*General[\s*#]*Public[\s*#]*License[\s*#]*for[\s*#]*more[\s*#]*details.[\s*]*\*\/|/* SPDX-License-Identifier: GPL-3.0-or-later */|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w]*.*is free software[:;][\#\s]*you[\#\s]*can[\#\s]*redistribute[\#\s]*it[\#\s]*and\/or[\#\s]*modify[\#\s]*it[\s\#]*under[\s \#]*the[\s\#]*terms[\s\#]*of[\s\#]*the[\s\#]*GNU[\s\#]*General[\s\#]*Public[\s\#]*License[\s\#]*as[\s\#]*published[\s\#]*by[\s\#]*the[\s\#]*Free[\s\#]*Software[\s\#]*Foundation[;,][\s\#]*version[\s\#]*2[\s\#]*of[\s\#]*the[\s\#]*License.*[\s\#]*This[\s\#]*program[\s\#]*is[\s\#]*distributed[\s\#]*in[\s\#]*the[\s\#]*hope[\s\#]*that[\s\#]*it[\s\#]*will[\#\s]*be[\#\s]*useful,[\#\s]*but[\#\s]*WITHOUT[\#\s]*ANY[\#\s]*WARRANTY;[\#\s]*without[\#\s]*even[\#\s]*the[\#\s]*implied[\#\s]*warranty[\#\s]*of[\#\s]*MERCHANTABILITY[\#\s]*or[\#\s]*FITNESS[\#\s]*FOR[\#\s]*A[\#\s]*PARTICULAR[\#\s]*PURPOSE.[\#\s]*See[\#\s]*the[\#\s]*GNU[\#\s]*General[\#\s]*Public[\#\s]*License[\#\s]*for[\#\s]*more[\#\s]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
perl -i -p0e 's|(\#\#*)[\w*]*.*is free software[:;][\s*]*you[\s*]*can[\s*]*redistribute[\s*]*it[\s*]*and\/or[\s*]*modify[\s*]*it[\s*]*under[\s*]*the[\s*]*terms[\s*]*of[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*as[\s*]*published[\s*]*by[\s*]*the[\s*]*Free[\s*]*Software[\s*]*Foundation[;,][\s*]*version[\s*]*2[\s*]*of[\s*]*the[\s*]*License.[\s*]*This[\s*]*program[\s*]*is[\s*]*distributed[\s*]*in[\s*]*the[\s*]*hope[\s*]*that[\s*]*it[\s*]*will[\s*]*be[\s*]*useful,[\s*]*but[\s*]*WITHOUT[\s*]*ANY[\s*]*WARRANTY;[\s*]*without[\s*]*even[\s*]*the[\s*]*implied[\s*]*warranty[\s*]*of[\s*]*MERCHANTABILITY[\s*]*or[\s*]*FITNESS[\s*]*FOR[\s*]*A[\s*]*PARTICULAR[\s*]*PURPOSE.[\s*]*See[\s*]*the[\s*]*GNU[\s*]*General[\s*]*Public[\s*]*License[\s*]*for[\s*]*more[\s*]*details.\s(#* *\n)*|\1 SPDX-License-Identifier: GPL-2.0-only\n\n|' $(cat filelist)
Change-Id: I1008a63b804f355a916221ac994701d7584f60ff
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/41177
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2020-05-08 20:48:04 +02:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2015-11-04 05:01:53 +01:00
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# This script creates a list of commits between two releases, broken out into
|
|
|
|
# fairly inexact categories, based on the directories that files are in. If
|
|
|
|
# a commit touched anything in the path that is checked earlier, it's counted
|
|
|
|
# as being in that category.
|
|
|
|
#
|
|
|
|
# Don't run this in your current working tree, it checks out different versions
|
|
|
|
# and can lose things.
|
|
|
|
|
|
|
|
# set -x # uncomment for debug
|
2015-11-04 05:01:53 +01:00
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Check for tools
|
|
|
|
|
2018-12-20 17:17:03 +01:00
|
|
|
if ! ( git --version && cloc --version && rename --version ) > /dev/null 2>&1
|
2016-10-02 04:13:43 +02:00
|
|
|
then
|
2022-02-28 22:41:57 +01:00
|
|
|
echo "ERROR: cloc, git or rename is not installed. Exiting" >&2
|
2015-11-04 05:01:53 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-01-13 17:31:28 +01:00
|
|
|
if ! { cdup="$(git rev-parse --show-cdup 2>/dev/null)" && [ -z "${cdup}" ]; }
|
|
|
|
then
|
2022-02-28 22:41:57 +01:00
|
|
|
echo "ERROR: This is not the top directory of a git repo. Exiting." >&2
|
2016-10-02 04:13:43 +02:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Try to verify that the repo is clean before losing state.
|
2022-02-28 22:41:57 +01:00
|
|
|
if ! git diff-index --quiet --cached HEAD 2>/dev/null || \
|
|
|
|
[ "$(git diff origin/master --shortstat 2>/dev/null | tail -n1)" != "" ]; then
|
|
|
|
echo "ERROR: repo is not clean. Exiting." >&2
|
2015-11-04 05:01:53 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Verify the command line arguments
|
|
|
|
if [ "$1" == "--help" ] || [ -z "$1" ] || [ -z "$2" ]; then
|
|
|
|
echo
|
|
|
|
echo "Usage: $0 <old_version> <new_version> [release notes file]"
|
|
|
|
echo "Old version should be a tag (4.1), a branch (origin/4.1), or a commit id"
|
2022-02-28 22:41:57 +01:00
|
|
|
echo "New version can be a branch (origin/master) a tag (4.2), or a commit id"
|
2016-10-02 04:13:43 +02:00
|
|
|
echo "Logfile can be a new file or an existing file to update"
|
|
|
|
echo "Example: \"$0 origin/4.1 4.2 rnotes.txt\""
|
|
|
|
echo
|
|
|
|
echo "Note that the script starts at the commit AFTER the old version."
|
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
else
|
|
|
|
OLD_GIT_VERSION="$1"
|
|
|
|
NEW_GIT_VERSION="$2"
|
2022-02-28 22:41:57 +01:00
|
|
|
if [[ "$OLD_GIT_VERSION" = "HEAD" || "$NEW_GIT_VERSION" = "HEAD" ]]; then
|
|
|
|
echo "Error: using HEAD as a reference doesn't work" >&2
|
2020-05-11 23:47:12 +02:00
|
|
|
echo
|
|
|
|
exit 1
|
|
|
|
fi
|
2016-10-02 04:13:43 +02:00
|
|
|
TOTAL_COMMITS=$(git log --pretty=oneline \
|
|
|
|
"${OLD_GIT_VERSION}..${NEW_GIT_VERSION}" 2>/dev/null | wc -l)
|
|
|
|
fi
|
|
|
|
|
|
|
|
TOP=$(pwd)
|
|
|
|
|
|
|
|
if [ -n "$3" ]; then
|
|
|
|
MAIN_LOGFILE="${TOP}/$3"
|
|
|
|
else
|
|
|
|
MAIN_LOGFILE="${TOP}/relnotes.txt"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Figure out which logfile we're writing to. If the specified logfile exists,
|
|
|
|
# we need to write to a temporary logfile, then append changes to the main
|
|
|
|
# logfile.
|
2015-11-04 05:01:53 +01:00
|
|
|
if [ -f "$MAIN_LOGFILE" ]; then
|
|
|
|
LOGFILE="$(mktemp "LOGFILE.XXXX")"
|
|
|
|
LOGFILE="${TOP}/$LOGFILE"
|
|
|
|
UPDATE_MAIN_LOGFILE=1
|
|
|
|
else
|
|
|
|
LOGFILE="$MAIN_LOGFILE"
|
|
|
|
fi
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
get_author_commit_count() {
|
|
|
|
git log "${NEW_GIT_VERSION}" 2>/dev/null | grep -c "^Author: $1"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Print and log the versions
|
2015-11-04 05:01:53 +01:00
|
|
|
log_versions() {
|
|
|
|
echo "Log of commit $1 to commit $2"
|
|
|
|
echo "Log of commit $1 to commit $2" >> "$LOGFILE"
|
2016-10-02 04:13:43 +02:00
|
|
|
echo "Total commits: ${TOTAL_COMMITS}"
|
|
|
|
echo "Total commits: ${TOTAL_COMMITS}" >> "$LOGFILE"
|
2015-11-04 05:01:53 +01:00
|
|
|
echo
|
|
|
|
}
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Get the first commit id in the current tree
|
2015-11-04 05:01:53 +01:00
|
|
|
get_latest_commit_id() {
|
2017-11-05 01:36:19 +01:00
|
|
|
(
|
2022-02-28 22:41:57 +01:00
|
|
|
cd "$1" || exit 1
|
|
|
|
git log -n 1 2>/dev/null | grep '^commit ' | head -1 | sed 's/commit //' | sed 's/ .*//'
|
2017-11-05 01:36:19 +01:00
|
|
|
)
|
2015-11-04 05:01:53 +01:00
|
|
|
}
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Main get log function
|
2015-11-04 05:01:53 +01:00
|
|
|
_get_log() {
|
|
|
|
local oldver="$1"
|
|
|
|
local newver="$2"
|
|
|
|
local title="$3"
|
|
|
|
local paths="$4"
|
2017-11-05 01:36:19 +01:00
|
|
|
local keywords="$5"
|
2015-11-04 05:01:53 +01:00
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
# Leave ${paths} unquoted in the git commands
|
2016-10-02 04:13:43 +02:00
|
|
|
# shellcheck disable=SC2086
|
2017-11-05 01:36:19 +01:00
|
|
|
{ \
|
|
|
|
if [ -n "$paths" ]; then \
|
|
|
|
git log --abbrev-commit --pretty=oneline \
|
|
|
|
"${oldver}..${newver}" -- ${paths} \
|
|
|
|
2>/dev/null; \
|
|
|
|
fi; \
|
|
|
|
if [ -n "$keywords" ]; then \
|
|
|
|
git log --abbrev-commit --pretty=oneline \
|
|
|
|
"${oldver}..${newver}" 2>/dev/null \
|
|
|
|
| grep -i "$keywords"; \
|
|
|
|
fi \
|
|
|
|
} | sort -t ' ' -k 2 | uniq
|
2015-11-04 05:01:53 +01:00
|
|
|
}
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Output to a new log, then compare to the first logfile, and only output
|
|
|
|
# non duplicated lines to the final file.
|
2015-11-04 05:01:53 +01:00
|
|
|
get_log_dedupe() {
|
|
|
|
local title="$1"
|
|
|
|
local paths="$2"
|
2017-11-05 01:36:19 +01:00
|
|
|
local keywords="$3"
|
2016-10-02 04:13:43 +02:00
|
|
|
local log
|
|
|
|
local commits
|
|
|
|
|
2015-11-04 05:01:53 +01:00
|
|
|
dedupe_tmpfile="$(mktemp "LOGFILE.XXXX")"
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
log=$(_get_log "$OLD_GIT_VERSION" "$NEW_GIT_VERSION" \
|
2017-11-05 01:36:19 +01:00
|
|
|
"$title" "$paths" "$keywords")
|
2015-11-04 05:01:53 +01:00
|
|
|
|
|
|
|
echo "$log" > "$dedupe_tmpfile"
|
|
|
|
|
|
|
|
log=$(grep -Fxv -f "$LOGFILE" "$dedupe_tmpfile")
|
2016-10-02 04:13:43 +02:00
|
|
|
commits=$(echo "$log" | wc -l)
|
2015-11-04 05:01:53 +01:00
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
if [ -n "$log" ]; then
|
|
|
|
#echo "$title: $paths $keywords" >> "$LOGFILE"
|
|
|
|
printf "%s\n%s\n\n" "##### $title ($commits commits) #####" \
|
|
|
|
"$log" >> "$LOGFILE"
|
|
|
|
fi
|
2015-11-04 05:01:53 +01:00
|
|
|
|
|
|
|
rm "$dedupe_tmpfile"
|
|
|
|
}
|
|
|
|
|
|
|
|
# get logs for the submodules
|
|
|
|
get_log_submodule() {
|
|
|
|
local old_version="$1"
|
|
|
|
local new_version="$2"
|
|
|
|
local submodule_dir="$3"
|
2016-10-02 04:13:43 +02:00
|
|
|
local log
|
|
|
|
local commits
|
2015-11-04 05:01:53 +01:00
|
|
|
|
|
|
|
printf "Submodule %s\n" "$submodule_dir"
|
|
|
|
printf "commit %s to commit %s\n\n" "$old_version" "$new_version"
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
if ! (
|
|
|
|
cd "${TOP}/$submodule_dir" || exit 1
|
|
|
|
log="$(_get_log "$old_version" "$new_version" "$submodule_dir" "." "")" || exit 1
|
2016-10-02 04:13:43 +02:00
|
|
|
commits=$(echo "$log" | wc -l)
|
2015-11-04 05:01:53 +01:00
|
|
|
|
|
|
|
if [ -n "$log" ]; then
|
2017-11-05 01:36:19 +01:00
|
|
|
printf "%s\n" "$submodule_dir ($commits commits)" >> "$LOGFILE"
|
|
|
|
printf "\n" >> "$LOGFILE"
|
2015-11-04 05:01:53 +01:00
|
|
|
fi
|
2022-02-28 22:41:57 +01:00
|
|
|
); then
|
|
|
|
version_ctrl_c
|
|
|
|
fi
|
2015-11-04 05:01:53 +01:00
|
|
|
}
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
find_areas() {
|
2017-11-05 01:36:19 +01:00
|
|
|
local directory="$1"
|
|
|
|
local filename="$2"
|
|
|
|
local skip="$3"
|
|
|
|
find "$directory" -name "$filename" | sed "s|/$filename||" | sed "s|/$directory||" | grep -v "$skip" | sort
|
2016-10-02 04:13:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
# Make sure things get cleaned up if ctl-c is pressed while the old version
|
|
|
|
# is checked out and files are renamed. This can be a real mess to clean
|
|
|
|
# up manually.
|
2015-11-04 05:01:53 +01:00
|
|
|
version_ctrl_c() {
|
2022-02-28 22:41:57 +01:00
|
|
|
printf "\n Cleaning up and exiting.\n" >&2
|
2016-10-02 04:13:43 +02:00
|
|
|
find 'src' -name 'gnumakefile' \
|
|
|
|
-exec rename 's/gnumakefile/Makefile\.inc/' {} \;
|
|
|
|
git checkout origin/master > /dev/null 2>&1
|
2015-11-04 05:01:53 +01:00
|
|
|
git submodule update --init --checkout > /dev/null 2>&1
|
|
|
|
rm "$LOGFILE"
|
|
|
|
exit 1;
|
|
|
|
}
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Calculate areas that have been added or removed based on file lists
|
|
|
|
show_diff () {
|
|
|
|
local new
|
|
|
|
local old
|
|
|
|
|
2019-11-20 16:05:21 +01:00
|
|
|
new="$(comm -13 <(echo "$2") <(echo "$3"))"
|
|
|
|
old="$(comm -23 <(echo "$2") <(echo "$3"))"
|
|
|
|
|
|
|
|
# Allow running a postprocessor, given as 4th argument over the
|
|
|
|
# resulting diff, provide context if it's old or new data
|
|
|
|
if [ -n "$4" ]; then
|
|
|
|
new=$(echo "$new" | $4 new | sort)
|
|
|
|
old=$(echo "$old" | $4 old | sort)
|
|
|
|
fi
|
2022-02-28 22:41:57 +01:00
|
|
|
new="$(printf "%s" "$new" | sed 's/^/* /')"
|
|
|
|
old="$(printf "%s" "$old" | sed 's/^/* /')"
|
2019-11-20 16:05:21 +01:00
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
if [ -n "$new" ]; then
|
|
|
|
printf "Added %s $1:\n-------------------\n%s\n\n" \
|
|
|
|
"$(echo "$new" | wc -l)" "$new" >> "$LOGFILE"
|
|
|
|
fi
|
|
|
|
if [ -n "$old" ]; then
|
|
|
|
printf "Removed %s $1:\n-------------------\n%s\n\n" \
|
|
|
|
"$(echo "$old" | wc -l)" "$old" >> "$LOGFILE"
|
|
|
|
fi
|
|
|
|
}
|
2015-11-04 05:01:53 +01:00
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
get_sloc () {
|
|
|
|
# Because cloc works on extensions, and .inc identifies as pascal,
|
2019-11-20 17:15:13 +01:00
|
|
|
# while we use it both for Makefile.inc and some files that are
|
|
|
|
# really C, do three passes: everything but .inc files, all .inc files
|
|
|
|
# that aren't Makefiles, all Makefile.inc, then combine them.
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
local base
|
|
|
|
base=$(mktemp)
|
|
|
|
find src -name Makefile.inc > "${base}.mak"
|
2019-11-20 17:15:13 +01:00
|
|
|
|
|
|
|
cloc --progress-rate=0 --quiet \
|
|
|
|
--script-lang="Bourne Shell",bash --exclude-ext=inc \
|
2022-02-28 22:41:57 +01:00
|
|
|
--exclude-dir=vendorcode "--out=${base}" src
|
2019-11-20 17:15:13 +01:00
|
|
|
cloc --progress-rate=0 --quiet \
|
2022-02-28 22:41:57 +01:00
|
|
|
"--exclude-list-file=${base}.mak" --force-lang=c,inc \
|
|
|
|
--exclude-dir=vendorcode "--out=${base}.c" src
|
2019-11-20 17:15:13 +01:00
|
|
|
cloc --progress-rate=0 --quiet \
|
2022-02-28 22:41:57 +01:00
|
|
|
"--list-file=${base}.mak" --force-lang=make,inc \
|
|
|
|
--exclude-dir=vendorcode "--out=${base}.m" src
|
2019-11-20 17:15:13 +01:00
|
|
|
cloc --progress-rate=0 --quiet --sum-reports \
|
2022-02-28 22:41:57 +01:00
|
|
|
"${base}" "${base}.c" "${base}.m" --out "${base}.result"
|
2017-11-05 01:36:19 +01:00
|
|
|
|
2019-11-20 17:15:13 +01:00
|
|
|
echo
|
2022-02-28 22:41:57 +01:00
|
|
|
cat "${base}.result.lang"
|
2017-11-05 01:36:19 +01:00
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
rm -f "${base}"*
|
2017-11-05 01:36:19 +01:00
|
|
|
}
|
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Start collecting data from the old and new revisions.
|
|
|
|
# This is relatively disruptive to the tree, so trap on ctl-c so that
|
|
|
|
# things can be put back to normal
|
|
|
|
trap version_ctrl_c SIGINT
|
2015-11-04 05:01:53 +01:00
|
|
|
|
|
|
|
#check out old version and get information
|
2022-02-28 22:41:57 +01:00
|
|
|
echo "Finding old submodule versions..." >&2
|
2016-10-02 04:13:43 +02:00
|
|
|
git checkout "$OLD_GIT_VERSION" > /dev/null 2>&1
|
2022-02-28 22:41:57 +01:00
|
|
|
echo "Git version: $(git log --oneline -n 1)"
|
2015-11-04 05:01:53 +01:00
|
|
|
git submodule update --init --checkout > /dev/null 2>&1
|
2017-11-05 01:36:19 +01:00
|
|
|
for module in $(git submodule --quiet foreach pwd); do
|
|
|
|
name="$(basename "$module" | sed 's/-/_/g')"
|
|
|
|
version="${name^^}_OLD_VERSION"
|
2022-02-28 22:41:57 +01:00
|
|
|
declare "$version"="$(get_latest_commit_id "$module")"
|
2017-11-05 01:36:19 +01:00
|
|
|
done
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
printf "Logging directories in the old tree\n" >&2
|
2017-11-05 01:36:19 +01:00
|
|
|
mainboard_list_old=$(grep -h "^[[:space:]]*config\>[[:space:]]*\<BOARD_" src/mainboard/*/*/Kconfig.name 2>/dev/null | sed "s,^.*\<BOARD_\([A-Z0-9_]*\)\>.*$,\1," | sort)
|
|
|
|
cpu_list_old=$(find_areas "src/cpu" "Kconfig" "intel/common")
|
|
|
|
soc_list_old=$(find_areas "src/soc" "Makefile.inc" "intel/common\|amd/common\|romstage")
|
|
|
|
northbridge_list_old=$(find_areas "src/northbridge" "Kconfig" "")
|
|
|
|
sio_list_old=$(find_areas "src/superio" "Makefile.inc" "")
|
|
|
|
southbridge_list_old=$(find_areas "src/southbridge" "Kconfig" "")
|
2016-10-02 04:13:43 +02:00
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
echo "Calculating old SLOC"
|
2017-11-05 01:36:19 +01:00
|
|
|
OLD_SLOC=$(get_sloc)
|
2015-11-04 05:01:53 +01:00
|
|
|
|
|
|
|
#check out new version and get information
|
2022-02-28 22:41:57 +01:00
|
|
|
printf -- "\nFinding new submodule versions...\n" >&2
|
2016-10-02 04:13:43 +02:00
|
|
|
git checkout "$NEW_GIT_VERSION" > /dev/null 2>&1
|
2022-02-28 22:41:57 +01:00
|
|
|
echo "Git version: $(git log --oneline -n 1)"
|
2015-11-04 05:01:53 +01:00
|
|
|
git submodule update --init --checkout > /dev/null 2>&1
|
2016-10-02 04:13:43 +02:00
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
for module in $(git submodule --quiet foreach pwd); do
|
|
|
|
name="$(basename "$module" | sed 's/-/_/g')"
|
|
|
|
version="${name^^}_NEW_VERSION"
|
2022-02-28 22:41:57 +01:00
|
|
|
declare "$version"="$(get_latest_commit_id "$module")"
|
2017-11-05 01:36:19 +01:00
|
|
|
done
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
echo "Logging directories in the new tree." >&2
|
2017-11-05 01:36:19 +01:00
|
|
|
mainboard_list_new=$(grep -h "^[[:space:]]*config\>[[:space:]]*\<BOARD_" src/mainboard/*/*/Kconfig.name 2>/dev/null | sed "s,^.*\<BOARD_\([A-Z0-9_]*\)\>.*$,\1," | sort)
|
|
|
|
cpu_list_new=$(find_areas "src/cpu" "Kconfig" "intel/common")
|
|
|
|
soc_list_new=$(find_areas "src/soc" "Makefile.inc" "intel/common\|amd/common\|romstage")
|
|
|
|
northbridge_list_new=$(find_areas "src/northbridge" "Kconfig" "")
|
|
|
|
sio_list_new=$(find_areas "src/superio" "Makefile.inc" "")
|
|
|
|
southbridge_list_new=$(find_areas "src/southbridge" "Kconfig" "")
|
|
|
|
|
2015-11-04 05:01:53 +01:00
|
|
|
printf "Calculating new SLOC\n"
|
2017-11-05 01:36:19 +01:00
|
|
|
NEW_SLOC=$(get_sloc)
|
2015-11-04 05:01:53 +01:00
|
|
|
|
|
|
|
git checkout origin/master > /dev/null 2>&1
|
|
|
|
git submodule update --init --checkout > /dev/null 2>&1
|
|
|
|
trap "" SIGINT
|
2022-02-28 22:41:57 +01:00
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Done collecting data from the old and new versions
|
2015-11-04 05:01:53 +01:00
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
# Start outputting to logfile
|
|
|
|
echo "Generating release notes from version ${OLD_GIT_VERSION} to ${NEW_GIT_VERSION}"
|
|
|
|
echo; echo "Main repo"
|
|
|
|
echo "Main repo" >> "$LOGFILE"
|
2015-11-04 05:01:53 +01:00
|
|
|
echo "------------------" >> "$LOGFILE"
|
2016-10-02 04:13:43 +02:00
|
|
|
log_versions "$(git log --pretty=%H \
|
|
|
|
"${OLD_GIT_VERSION}..${NEW_GIT_VERSION}" 2>/dev/null | tail -1)" \
|
|
|
|
"$(git log --pretty=%H \
|
|
|
|
"${OLD_GIT_VERSION}..${NEW_GIT_VERSION}" 2>/dev/null | head -1 )"
|
|
|
|
echo "" >> "$LOGFILE"
|
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
### SPECIFIC AREAS FOR RELEASE ###
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Documentation" "Documentation README"
|
|
|
|
|
|
|
|
get_log_dedupe "cleanup" "" "add missing\|fix typo\|clean up\|spelling\|Use tabs\|space [around\|before]\|code formatting\|commented code\|code cleanup\|capitalize\|[unnecessary\|unneeded\|trailing] whitespace\|checkpatch\|remove [unused\|dead\|unneeded\|duplicated\|not used]\|[transition away from\|get rid of\|don't use] device_t"
|
|
|
|
|
|
|
|
get_log_dedupe "ACPI Changes" "" "ASL 2.0 syntax"
|
2015-11-04 05:01:53 +01:00
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Google Kahlee / AMD Gardenia" "src/mainboard/google/kahlee src/mainboard/amd/gardenia" "kahlee\|gardenia"
|
|
|
|
get_log_dedupe "AMD Stoney Ridge" "src/soc/amd/stoneyridge" "stoney"
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Google Zork / AMD Mandolin / AMD Bilby" "src/mainboard/amd/mandolin src/mainboard/google/zork src/mainboard/amd/bilby" "mandolin\|zork\|bilby"
|
|
|
|
get_log_dedupe "AMD Picasso" "src/soc/amd/picasso" "picasso"
|
|
|
|
|
|
|
|
get_log_dedupe "Google Guybrush / AMD Majolica" "src/mainboard/google/guybrush src/mainboard/amd/majolica" "majolica\|guybrush"
|
|
|
|
get_log_dedupe "AMD cezanne" "src/soc/amd/cezanne" "cezanne"
|
|
|
|
|
|
|
|
get_log_dedupe "AMD chausie / Google Skyrim" "src/mainboard/amd/chausie src/mainboard/google/skyrim" "chausie\|skyrim"
|
|
|
|
get_log_dedupe "AMD sabrina" "src/soc/amd/sabrina" "sabrina"
|
|
|
|
|
|
|
|
get_log_dedupe "Google Brya / Intel adlrvp" "src/mainboard/intel/adlrvp src/mainboard/google/brya" "brya\|adlrvp"
|
|
|
|
get_log_dedupe "Intel Alder Lake" "src/soc/intel/alderlake" "alderlake\|adl\|alder lake"
|
|
|
|
|
|
|
|
get_log_dedupe "intel Elkhart Lake" "src/soc/intel/elkhartlake" "elkhartlake\|ehl\|elkhart lake"
|
|
|
|
|
|
|
|
get_log_dedupe "Google Dedede" "src/mainboard/google/dedede" "dedede"
|
|
|
|
get_log_dedupe "intel Jasper Lake" "src/soc/intel/jasperlake" "jasperlake\|jsl\|jasper lake"
|
|
|
|
|
|
|
|
get_log_dedupe "Intel Tiger Lake" "src/soc/intel/tigerlake" "tigerlake\|tgl\|tiger lake"
|
|
|
|
|
|
|
|
get_log_dedupe "Google Hatch" "src/mainboard/google/hatch" "hatch"
|
|
|
|
get_log_dedupe "Intel Comet Lake" "src/soc/intel/cometlake" "cometlake\|cml\|comet lake"
|
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Google Eve / Poppy / Fizz / Soraka / Nautilus / Intel KblRvp" "src/mainboard/google/eve src/mainboard/google/poppy src/mainboard/google/fizz src/mainboard/intel/kblrvp" "eve[ :]\|poppy\|fizz\|soraka\|nautilus\|kblrvp"
|
2022-02-28 22:41:57 +01:00
|
|
|
|
|
|
|
get_log_dedupe "Intel Kunimitsu / Google Chell / Lars / Glados" "src/mainboard/google/lars src/mainboard/google/chell src/mainboard/google/glados src/mainboard/intel/kunimitsu" "chell\|lars\|kunimitsu"
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Purism SKL" "src/mainboard/purism/librem_skl" "librem13v2\|librem_skl"
|
|
|
|
get_log_dedupe "Intel Skylake / Kabylake" "src/soc/intel/skylake" "skylake\|sky.lake\|kabylake\|kaby.lake"
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Intel Glkrvp / Google Octopus / Bip / Yorp" "src/mainboard/google/octopus src/mainboard/intel/glkrvp" "octopus\|glkrvp|\bip\|yorp"
|
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Google Cyan / Intel Strago" "src/mainboard/google/cyan src/mainboard/intel/strago" "cyan\|strago"
|
|
|
|
get_log_dedupe "Intel Braswell" "src/soc/intel/braswell" "braswell"
|
|
|
|
|
|
|
|
get_log_dedupe "Google Kevin / Gru / Bob / Scarlet / Nefario" "src/mainboard/google/gru" "kevin\|gru[^b]"
|
|
|
|
get_log_dedupe "Rockchip rk3399" "src/soc/rockchip/rk3399" "rk3399"
|
|
|
|
|
|
|
|
get_log_dedupe "Google Reef / Pyro / Sand / Snappy / Nasher" "src/mainboard/google/reef" "reef\|pyro\|sand[ :]\|snappy\|nasher"
|
|
|
|
#get_log_dedupe "Intel apollolake_rvp leafhill minnow3" "src/mainboard/intel/apollolake_rvp src/mainboard/intel/leafhill src/mainboard/intel/minnow3" "apollolake_rvp\|leafhill\|minnow3"
|
|
|
|
get_log_dedupe "Siemens mc_apl1" "src/mainboard/siemens/mc_apl1" "mc_apl1"
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Intel Apollolake/ Geminilake" "src/soc/intel/apollolake" "apollolake\|apollo.lake\|geminilake\|gemini.lake\|apl\|glk"
|
2017-11-05 01:36:19 +01:00
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Google Zoombini / Intel cannonlake_rvp" "src/mainboard/google/zoombini src/mainboard/intel/cannonlake_rvp" "zoombini\|cannonlake_rvp"
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Intel CannonLake" "src/soc/intel/cannonlake src/mainboard/intel/cannonlake_rvp" "cannonlake"
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Google Kuki" "src/mainboard/google/kukui" "kukui"
|
|
|
|
get_log_dedupe "mediatek/mt8183" "src/soc/mediatek/mt8183" "mt8183"
|
|
|
|
|
|
|
|
get_log_dedupe "Google Cheza" "src/mainboard/google/cheza" "cheza"
|
|
|
|
get_log_dedupe "Qualcomm sdm845" "src/soc/qualcomm/sdm845" "sdm845"
|
|
|
|
|
|
|
|
get_log_dedupe "Prodrive Hermes / Google Sarien / Intel coffeelake_rvp" "src/mainboard/intel/coffeelake_rvp src/mainboard/google/sarien src/mainboard/prodrive/hermes"
|
|
|
|
get_log_dedupe "Intel Coffeelake" "soc/intel/coffeelake"
|
|
|
|
|
|
|
|
get_log_dedupe "Cavium" "src/soc/cavium src/mainboard/cavium src/mainboard/opencellular/elgon "
|
|
|
|
get_log_dedupe "Scaleway Tagada" "src/mainboard/scaleway/tagada" "tagada"
|
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Intel Galileo" "src/mainboard/intel/galileo" "galileo"
|
|
|
|
get_log_dedupe "Intel Quark" "src/soc/intel/quark" "quark"
|
|
|
|
|
|
|
|
get_log_dedupe "Intel Baytrail" "src/soc/intel/baytrail" "baytrail"
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Google Gale / Qualcomm QX ipq40xx" "src/mainboard/google/gale src/soc/qualcomm/ipq40xx" "gale\|ipq40"
|
|
|
|
get_log_dedupe "Google Rotor / Marvell Mvmap2315" "src/soc/marvell/mvmap2315 src/mainboard/google/rotor" "marvell\|mvmap\|rotor"
|
2017-11-05 01:36:19 +01:00
|
|
|
|
|
|
|
get_log_dedupe "Gigabyte ga-g41m-es2l" "src/mainboard/gigabyte/ga-g41m-es2l" "es2l"
|
|
|
|
get_log_dedupe "Intel x4x northbridge / LGA775" "src/northbridge/intel/x4x src/cpu/intel/socket_LGA775" "x4x\|lga775"
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Intel Haswell / Broadwell" "src/northbridge/haswell" "haswell"
|
|
|
|
get_log_dedupe "Intel Lynxpoint" "src/southbridge/intel/lynxpoint" "lynxpoint"
|
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Intel Sandybridge / Ivybridge" "src/southbridge/intel/bd82x6x src/southbridge/intel/fsp_bd82x6x src/northbridge/intel/sandybridge src/northbridge/intel/fsp_sandybridge src/cpu/intel/fsp_model_206ax src/cpu/intel/model_206ax" "sandybridge\|ivybridge\|bd82x6x"
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Google Herbrine" "src/mainboard/google/herobrine" "herobrine"
|
|
|
|
get_log_dedupe "Qualcomm SC7280" "src/soc/qualcomm/sc2780" "sc2780"
|
|
|
|
|
|
|
|
get_log_dedupe "Google Corsola" "src/mainboard/google/corsola" "corsola"
|
|
|
|
get_log_dedupe "Mediatek MT8186" "src/soc/mediatek/mt8186" "mt8186"
|
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Intel Common" "src/soc/intel/common src/southbridge/intel/common src/northbridge/intel/common" ""
|
|
|
|
get_log_dedupe "Amd Common" "src/soc/amd/common src/southbridge/amd/common" ""
|
|
|
|
|
2019-06-30 11:41:51 +02:00
|
|
|
get_log_dedupe "Nvidia" "src/southbridge/nvidia" ""
|
|
|
|
get_log_dedupe "Via" "src/northbridge/via src/southbridge/via" ""
|
|
|
|
get_log_dedupe "Broadcom" "src/southbridge/broadcom" ""
|
|
|
|
get_log_dedupe "Qualcomm" "src/soc/qualcomm" ""
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Mediatek" "src/soc/mediatek" ""
|
2019-06-30 11:41:51 +02:00
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Intel vendorcode / FSP" "src/drivers/intel/fsp* src/vendorcode/intel" ""
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "AMD vendorcode / AGESA / PI" "src/vendorcode/amd" "agesa\|binarypi"
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Google vendorcode" "src/vendorcode/google"
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Cavium vendorcode" "src/vendorcode/cavium"
|
2017-11-05 01:36:19 +01:00
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "Security" "src/drivers/i2c/tpm src/security" "tpm"
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Vboot" "src/vboot" "vboot"
|
|
|
|
|
|
|
|
|
|
|
|
### GENERAL AREAS FOR RELEASE ###
|
|
|
|
# shellcheck disable=SC2013
|
|
|
|
{
|
|
|
|
|
|
|
|
get_log_dedupe "X86 intel" \
|
|
|
|
"src/cpu/intel src/soc/intel src/northbridge/intel \
|
|
|
|
src/southbridge/intel src/include/intel src/drivers/intel"
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "X86 AMD" \
|
2017-11-05 01:36:19 +01:00
|
|
|
"src/cpu/amd src/northbridge/amd src/southbridge/amd src/include/amd src/soc/amd" \
|
|
|
|
"agesa\|binarypi\|binary.pi"
|
|
|
|
|
|
|
|
get_log_dedupe "X86 common" \
|
|
|
|
"src/arch/x86 src/cpu/x86 src/include/x86 src/include/pc80"
|
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_dedupe "ARM" \
|
|
|
|
"$(for codedir in $(grep -rl "_ARM" --include=Kconfig | \
|
|
|
|
grep -v 'src/mainboard\|payloads/\|drivers/\|vendorcode/\|console' ); \
|
|
|
|
do dirname "$codedir"; done | grep -v '^src$')"
|
|
|
|
|
|
|
|
get_log_dedupe "RISC-V" \
|
|
|
|
"$(for codedir in $(grep -rl "_RISCV" --include=Kconfig | grep -v 'payloads/\|drivers/\|vendorcode/\|console' ); do dirname "$codedir"; done | grep -v '^src$')" \
|
|
|
|
"riscv\|risc-v\|lowrisc\|sifive"
|
|
|
|
}
|
|
|
|
|
|
|
|
get_log_dedupe "Google Mainboards" "src/mainboard/google"
|
|
|
|
get_log_dedupe "Intel Mainboards" "src/mainboard/intel"
|
|
|
|
get_log_dedupe "AMD Mainboards" "src/mainboard/amd"
|
2017-11-05 01:36:19 +01:00
|
|
|
get_log_dedupe "Mainboards" "src/mainboard/"
|
|
|
|
|
|
|
|
# Next, print all the rest of the specific areas
|
|
|
|
get_log_dedupe "ACPI" "src/acpi/"
|
|
|
|
get_log_dedupe "Console" "src/console src/include/console"
|
|
|
|
get_log_dedupe "SuperIO" "src/superio src/include/superio"
|
|
|
|
get_log_dedupe "EC" "src/ec"
|
|
|
|
get_log_dedupe "Drivers" "src/drivers"
|
|
|
|
get_log_dedupe "Devices" "src/device src/include/device"
|
|
|
|
|
|
|
|
# 5th, print the generic areas - This goes late so that the specific
|
|
|
|
# area changes will catch any commits in these areas first.
|
|
|
|
get_log_dedupe "Toolchain" "util/crossgcc"
|
|
|
|
get_log_dedupe "cbfstool" "util/cbfstool"
|
|
|
|
get_log_dedupe "Lint tools" "util/lint"
|
|
|
|
get_log_dedupe "Lib" "src/lib"
|
|
|
|
get_log_dedupe "Commonlib" "src/commonlib"
|
|
|
|
get_log_dedupe "Include" "src/include"
|
|
|
|
get_log_dedupe "Utilities" "util"
|
|
|
|
get_log_dedupe "Payloads" "payloads"
|
|
|
|
get_log_dedupe "Vendorcode" "src/vendorcode"
|
|
|
|
|
|
|
|
# Then look at areas that are usually outside the mainboards and architectures
|
|
|
|
get_log_dedupe "Build system" \
|
|
|
|
"Makefile Makefile.inc toolchain.inc src/Kconfig src/cpu/Makefile.inc"
|
|
|
|
|
|
|
|
get_log_dedupe "Submodules" "3rdparty util/nvidia/cbootimage"
|
2019-06-30 11:41:51 +02:00
|
|
|
|
|
|
|
get_log_dedupe "Maintainers" "MAINTAINERS" ""
|
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
# Finally, get anything that was missed above
|
|
|
|
get_log_dedupe "MISC" "."
|
|
|
|
|
2019-11-20 16:05:21 +01:00
|
|
|
# Replace VENDOR_DEVICE from stdin with their nice names on stdout
|
|
|
|
real_mainboard_names() {
|
|
|
|
local tree_version=$1 # "old" or "new"
|
|
|
|
local git_version_var=${tree_version^^}_GIT_VERSION
|
|
|
|
local git_version=${!git_version_var}
|
|
|
|
local line
|
2022-02-28 22:41:57 +01:00
|
|
|
local file
|
|
|
|
local vendor
|
2019-11-20 16:05:21 +01:00
|
|
|
|
2022-02-28 22:41:57 +01:00
|
|
|
while read -r line; do
|
|
|
|
file="$(git grep -l "^[[:space:]]*config\>[[:space:]]*\<BOARD_${line}\$" "${git_version}" -- src/mainboard/\*/\*/Kconfig.name | sed "s,^${git_version}:,,")"
|
2019-11-20 16:05:21 +01:00
|
|
|
if [ -z "$file" ]; then
|
|
|
|
echo "This shouldn't happen: couldn't find Kconfig for $line"
|
|
|
|
exit 1
|
|
|
|
fi
|
2022-02-28 22:41:57 +01:00
|
|
|
vendor="$(git grep \" "${git_version}" -- "$(echo "${file}" | cut -d/ -f1-3,5)" | cut -d\" -f2)"
|
|
|
|
git grep -h -A1 "^[[:space:]]*config\>[[:space:]]*\<BOARD_${line}\$" "${git_version}" -- "${file}" | grep \" |cut -d\" -f2 |sed "s,^,${vendor} ,"
|
2019-11-20 16:05:21 +01:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2017-11-05 01:36:19 +01:00
|
|
|
# Show areas that have been added or removed
|
2019-11-20 16:05:21 +01:00
|
|
|
show_diff "mainboards" "$mainboard_list_old" "$mainboard_list_new" real_mainboard_names
|
2017-11-05 01:36:19 +01:00
|
|
|
show_diff "processors" "$cpu_list_old" "$cpu_list_new"
|
|
|
|
show_diff "socs" "$soc_list_old" "$soc_list_new"
|
|
|
|
show_diff "northbridges" "$northbridge_list_old" "$northbridge_list_new"
|
|
|
|
show_diff "southbridges" "$southbridge_list_old" "$southbridge_list_new"
|
|
|
|
show_diff "sios" "$sio_list_old" "$sio_list_new"
|
|
|
|
|
|
|
|
# Log submodules
|
|
|
|
printf "Submodules\n----------\n" >> "$LOGFILE"
|
|
|
|
for module in $(git submodule --quiet foreach pwd); do
|
|
|
|
name=$(basename "$module")
|
2022-02-28 22:41:57 +01:00
|
|
|
module="$(realpath "${module}")"
|
|
|
|
workingdir="$(realpath "${PWD}")"
|
2017-11-05 01:36:19 +01:00
|
|
|
# shellcheck disable=SC2001
|
2022-02-28 22:41:57 +01:00
|
|
|
path=${module#"$workingdir"}
|
2017-11-05 01:36:19 +01:00
|
|
|
old_version=$(echo "${name^^}_OLD_VERSION" | sed 's/-/_/g')
|
|
|
|
new_version=$(echo "${name^^}_NEW_VERSION" | sed 's/-/_/g')
|
2022-02-28 22:41:57 +01:00
|
|
|
get_log_submodule "${!old_version}" "${!new_version}" "${path}"
|
2017-11-05 01:36:19 +01:00
|
|
|
done
|
2015-11-04 05:01:53 +01:00
|
|
|
|
2016-10-02 04:13:43 +02:00
|
|
|
printf "\nrepo statistics\n-------------------\n" >> "$LOGFILE"
|
|
|
|
before_names="$(mktemp "OLDNAMES.XXXX")"
|
|
|
|
after_names="$(mktemp "NEWNAMES.XXXX")"
|
|
|
|
NEW_AUTHORS=$(git log --pretty=%an "${OLD_GIT_VERSION}" 2>/dev/null | sort | \
|
|
|
|
uniq > "$before_names" && \
|
|
|
|
git log --pretty=%an "${NEW_GIT_VERSION}" 2>/dev/null | \
|
|
|
|
sort | uniq > "$after_names" && \
|
|
|
|
grep -Fxv -c -f "$before_names" "$after_names")
|
2019-11-20 16:49:41 +01:00
|
|
|
NEW_AUTHOR_LIST=$( grep -Fxv -f "$before_names" "$after_names")
|
|
|
|
rm -f "$before_names" "$after_names"
|
2016-10-02 04:13:43 +02:00
|
|
|
{
|
|
|
|
printf -- "- Total commits: %s\n" "$TOTAL_COMMITS"
|
|
|
|
printf -- "- Total authors: %s\n" \
|
|
|
|
"$(git log "${OLD_GIT_VERSION}..${NEW_GIT_VERSION}" 2>/dev/null | \
|
|
|
|
grep -e '^Author:' | sed 's/.*Author: //' | sed 's/ <.*.>//' | \
|
|
|
|
sort | uniq | wc -l)"
|
|
|
|
printf -- "- New authors: %s\n\nNew Authors:\n%s\n" "$NEW_AUTHORS" \
|
|
|
|
"$NEW_AUTHOR_LIST"
|
|
|
|
} >> "$LOGFILE"
|
|
|
|
|
|
|
|
printf "Getting developer list\n"
|
|
|
|
printf "\n%-40s: %5s\n" "Developer" "Commits" >> "$LOGFILE"
|
|
|
|
git log "${OLD_GIT_VERSION}..${NEW_GIT_VERSION}" 2>/dev/null | grep '^Author: ' | \
|
|
|
|
sed 's|Author: ||' | sed 's|\s<.*||' | sort | uniq | \
|
|
|
|
while read -r line; do
|
|
|
|
printf "%-40s: %5s %5s\n" "$line" \
|
|
|
|
"$(git log "${OLD_GIT_VERSION}" 2>/dev/null | \
|
|
|
|
grep -c "^Author: ${line} <")" \
|
|
|
|
"$(git log "${NEW_GIT_VERSION}" 2>/dev/null | \
|
|
|
|
grep -c "^Author: ${line} <")" >> "$LOGFILE";
|
|
|
|
done
|
2015-11-04 05:01:53 +01:00
|
|
|
|
|
|
|
printf "\nOld SLOC (%s)\n%s" "$NOW" "$OLD_SLOC" >> "$LOGFILE"
|
|
|
|
printf "\nNew SLOC (%s)\n%s" "$NOW" "$NEW_SLOC" >> "$LOGFILE"
|
|
|
|
|
|
|
|
# Add the collected data to the top of the existing logfile for parsing
|
|
|
|
if [ -n "$UPDATE_MAIN_LOGFILE" ]; then
|
|
|
|
tmpfile="$(mktemp "LOGFILE.XXXX")"
|
|
|
|
grep -Fxv -f "$MAIN_LOGFILE" "$LOGFILE" > "$tmpfile"
|
|
|
|
printf "\n\n" >> "$tmpfile"
|
|
|
|
cat "$MAIN_LOGFILE" >> "$tmpfile"
|
|
|
|
mv "$tmpfile" "$MAIN_LOGFILE"
|
|
|
|
rm -f "$LOGFILE"
|
|
|
|
fi
|
2016-10-02 04:13:43 +02:00
|
|
|
|
|
|
|
printf "Done.\n"
|