redox/changelog.sh

50 lines
1.4 KiB
Bash
Raw Normal View History

2022-11-23 18:37:35 +01:00
#!/usr/bin/env bash
set -e
LAST_RELEASE_TAG="$(git describe --tags --abbrev=0)"
LAST_RELEASE_TIMESTAMP="$(git log --format="%ct" -1 "${LAST_RELEASE_TAG}")"
echo "Last release: ${LAST_RELEASE_TAG} at ${LAST_RELEASE_TIMESTAMP}"
REPOS=(
2022-11-23 18:59:53 +01:00
redox=.
cookbook=cookbook
2022-11-23 19:26:37 +01:00
rust=rust
2022-11-23 18:37:35 +01:00
)
for package in $(installer/target/release/redox_installer --list-packages -c config/x86_64/desktop.toml)
do
2022-11-23 18:59:53 +01:00
REPOS+=("${package}=cookbook/recipes/${package}/source")
2022-11-23 18:37:35 +01:00
done
# TODO: resolve dependencies instead of manually adding these initfs packages
for package in init logd nulld ramfs randd zerod
do
2022-11-23 18:59:53 +01:00
REPOS+=("${package}=cookbook/recipes/${package}/source")
2022-11-23 18:37:35 +01:00
done
2022-11-23 18:59:53 +01:00
for name_repo in "${REPOS[@]}"
2022-11-23 18:37:35 +01:00
do
2022-11-23 18:59:53 +01:00
name="$(echo "${name_repo}" | cut -d "=" -f 1)"
repo="$(echo "${name_repo}" | cut -d "=" -f 2-)"
2022-11-23 18:37:35 +01:00
echo -en "\x1B[1m${name}:\x1B[0m "
2022-11-23 18:59:53 +01:00
if [ -e "${repo}/.git" ]
2022-11-23 18:37:35 +01:00
then
2022-11-23 18:59:53 +01:00
remote="$(git -C "${repo}" remote get-url origin)"
website="${remote%.*}"
before="$(git -C "${repo}" log --until="${LAST_RELEASE_TIMESTAMP}" --format="%h" -1)"
after="$(git -C "${repo}" log --since="${LAST_RELEASE_TIMESTAMP}" --format="%h" -1)"
if [ -z "${before}" ]
then
echo "New repository at ${website}"
elif [ -z "${after}" ]
then
echo "No changes"
else
echo "${website}/-/compare/${before}...${after}"
fi
2022-11-23 18:37:35 +01:00
else
2022-11-23 18:59:53 +01:00
echo "Not a git repository"
2022-11-23 18:37:35 +01:00
fi
done