eza: update to 0.19.3
[void-pkg.git] / common / travis / changed_templates.sh
blob074c991d33afe439e4e31f14ec4c569d2f77831b
1 #!/bin/sh
3 # changed_templates.sh
5 tip="$(git rev-list -1 --parents HEAD)"
6 case "$tip" in
7 # This is a merge commit, pick last parent
8 *" "*" "*) tip="${tip##* }" ;;
9 # This is a non-merge commit, pick itself
10 *) tip="${tip%% *}" ;;
11 esac
13 base="$(git merge-base origin/HEAD "$tip")"
15 [ $(git rev-list --count "$tip" "^$base") -lt 200 ] || {
16 echo "::error title=Branch out of date::Your branch is too out of date. Please rebase on upstream and force-push."
17 exit 1
20 echo "$base $tip" >/tmp/revisions
22 /bin/echo -e '\x1b[32mChanged packages:\x1b[0m'
23 git diff-tree -r --no-renames --name-only --diff-filter=AM \
24 "$base" "$tip" \
25 -- 'srcpkgs/*/template' |
26 cut -d/ -f 2 |
27 xargs ./xbps-src sort-dependencies |
28 tee /tmp/templates |
29 sed "s/^/ /" >&2