blob: d94f6c3e32e4eb182d00c42abad07bfc08f5d3be (
plain) (
blame)
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
37
38
39
40
41
|
#!/bin/sh
set -e
die() {
echo "error: $*" >&2
exit 1
}
run() {
echo "+ $*" >&2
"$@"
}
set --
while read -r file; do
# skip empty patches (cover letter)
if grep -q "^diff --git " "$file"; then
set -- "$@" "$file"
fi
done
if [ $# -eq 0 ]; then
exit 0
fi
echo 'Cloning upstream repo in temp dir ...'
tmp=$(mktemp -d)
trap "rm -rf -- $tmp" EXIT
run git clone -q --depth=1 "https://git.sr.ht/~rjarry/aerc" "$tmp" ||
die "Failed to clone upstream repository. No network connection?"
export GIT_DIR="$tmp/.git"
run cd $tmp
run git am -3 "$@" ||
die "Failed to apply patch on upstream master branch. git pull --rebase?"
for target in all lint tests check-patches; do
run make $target ||
die "Please fix the above issues and amend your patch(es)."
done
|