File tree Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Expand file tree Collapse file tree 1 file changed +25
-2
lines changed Original file line number Diff line number Diff line change 1
- #! /bin/bash
1
+ #! /bin/bash -x
2
2
3
3
BRANCH=
4
4
BUILD_NUMBER=
5
5
PR_NUMBER=
6
+ SRC_DIR=" ../llvm.src"
7
+ DST_DIR=" ."
6
8
7
9
# $1 exit code
8
10
# $2 error message
@@ -15,17 +17,38 @@ exit_if_err()
15
17
}
16
18
17
19
unset OPTIND
18
- while getopts " :b:r:n:" option; do
20
+ while getopts " :b:r:n:s:d " option; do
19
21
case $option in
20
22
b) BRANCH=$OPTARG ;;
21
23
n) BUILD_NUMBER=$OPTARG ;;
24
+ s) SRC_DIR=$OPTARG ;;
25
+ d) DST_DIR=$OPTARG ;;
22
26
r) PR_NUMBER=$OPTARG ;;
23
27
esac
24
28
done && shift $(( $OPTIND - 1 ))
25
29
26
30
# we're in llvm.obj dir
27
31
BUILD_DIR=${PWD}
28
32
33
+ # Get changed build script files
34
+ cd ${SRC_DIR}
35
+ git fetch -t origin refs/pull/${PR_NUMBER} /merge
36
+ exit_if_err $? " fail to get tags"
37
+ git checkout -B refs/pull/${PR_NUMBER} /merge
38
+ exit_if_err $? " fail to get tags"
39
+ base_commit=` git merge-base origin/sycl refs/pull/${PR_NUMBER} /merge`
40
+ exit_if_err $? " fail to get base commit"
41
+
42
+ BUILD_SCRIPT=` git --no-pager diff ${base_commit} refs/pull/${PR_NUMBER} /merge --name-only buildbot`
43
+ cd -
44
+
45
+ # # Clean up build directory if build scripts has changed
46
+ cd ${DST_DIR}
47
+ if [ -n " $BUILD_SCRIPT " ]; then
48
+ rm -rf *
49
+ fi
50
+ cd -
51
+
29
52
# # GET dependencies
30
53
if [ ! -d " OpenCL-Headers" ]; then
31
54
git clone https://github.com/KhronosGroup/OpenCL-Headers OpenCL-Headers
You can’t perform that action at this time.
0 commit comments