-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathdotnet-prepare
More file actions
executable file
·51 lines (48 loc) · 1.26 KB
/
dotnet-prepare
File metadata and controls
executable file
·51 lines (48 loc) · 1.26 KB
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
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
set -e -u -x -o pipefail
filter=()
if git -C "$(dirname "$0")" fetch --filter=tree:0 >/dev/null 2>&1; then
filter=(--filter=tree:0)
fi
function backport {
# Commit that introduced the bug, or an empty string.
fixes=$1
# Commit or patch that fixes the bug, optionally followed by backported or
# conflicting commits.
commitids=$2
if [ -n "$fixes" ] && ! git merge-base --is-ancestor "$fixes" HEAD; then
return
fi
for commitid in $commitids; do
if [ -e "$commitid" ]; then
continue
fi
if git merge-base --is-ancestor "$commitid" HEAD; then
return
fi
done
for commitid in $commitids; do
if [ -e "$commitid" ]; then
git am "$commitid"
else
git cherry-pick -X theirs "$commitid"
fi
break
done
}
function prepare_sdk {
pushd dotnet
if [[ -s ../dotnet-patches/series ]] &&
! git merge-base --is-ancestor "49278fa" HEAD; then
rm -rf .pc
ln -fsT ../dotnet-patches patches
quilt push -a
else
git fetch origin main
backport "" e64f84d
fi
popd
}
projects=(dotnet)
git submodule update "${filter[@]}" --init --recursive -- "${projects[@]}"
eval prepare_sdk