-
Notifications
You must be signed in to change notification settings - Fork 0
/
find-outdated-patches
executable file
·36 lines (28 loc) · 1.06 KB
/
find-outdated-patches
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/usr/bin/env bash
# file : find-outdated-patches
# license : MIT
# Print the names of files under downstream/ that have changed upstream since
# the specified git revision.
#
owd="$(pwd)"
trap "{ cd '$owd'; exit 1; }" ERR
set -o errtrace # Trap in functions and subshells.
set -o pipefail # Fail if any pipeline command fails.
shopt -s lastpipe # Execute last pipeline command in the current shell.
shopt -s nullglob # Expand no-match globs to nothing rather than themselves.
function info () { echo "$*" 1>&2; }
function error () { info "$*"; exit 1; }
rev="$1" # The git revision.
if [[ -z "$rev" ]]; then
error "usage: $(basename "$0") <git-revision>"
fi
# For each file in downstream/, use git-diff to check whether it has changed
# since the specified revision.
#
for f in $(find downstream/ -type f); do
f="${f/'downstream/qtbase/'/}" # Path relative to upstream/qtbase/.
f="${f%.in}" # Strip .in suffix, if present.
if [[ "$(git -C upstream/qtbase/ diff --name-only "$rev" -- "$f")" ]]; then
echo "qtbase/$f"
fi
done