build/sync.sh

32 lines
960 B
Bash
Raw Normal View History

2022-08-22 17:51:08 +02:00
#!/bin/bash
TOPDIR=$(pwd)
2022-08-22 22:55:41 +02:00
changelog=${TOPDIR}/changelog-${device}-${version}.md
2022-08-22 17:51:08 +02:00
declare -A before
tmp=($(repo forall -c 'echo "${REPO_PATH}:$(git rev-parse HEAD)"'))
for i in "${tmp[@]}"; do
IFS=: read -r folder commit <<<"${i}"
before[${folder}]=${commit}
done
repo sync -q -c -j 6 --fail-fast --force-sync --no-tags
echo -e "# Build $(date '+%Y-%m-%d %H:%M:%S') UTC\n" >>"${changelog}"
tmp=($(repo forall -c 'echo "${REPO_PATH}:$(git rev-parse HEAD)"'))
for i in "${tmp[@]}"; do
IFS=: read -r folder commit <<<"${i}"
2022-08-22 21:15:44 +02:00
if [[ "${folder}" != lineage/* && "${before[${folder}]}" != "${commit}" ]]; then
cd "${folder}" || continue
2022-08-22 17:51:08 +02:00
{
2022-09-03 13:34:13 +02:00
echo "## ${folder} ${before[${folder}]}..${commit}"
2022-08-22 17:51:08 +02:00
git --no-pager log --pretty=format:"- %s" "${before[${folder}]}".."${commit}"
echo
} >>"${changelog}"
2022-08-22 21:15:44 +02:00
cd "${TOPDIR}" || continue
2022-08-22 17:51:08 +02:00
fi
done
echo -e "\n" >>"${changelog}"
cat "${changelog}"