-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathcheck_toolchain_revisions.sh
57 lines (48 loc) · 1.51 KB
/
check_toolchain_revisions.sh
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
52
53
54
55
56
57
#!/bin/bash
set -e
# If any tracked revision no longer matches the local revision, blast the extenal toolchain directories
function check_revision()
{
echo Checking current revision for $1 in $2
if [ -d $2/.git ]; then
current_rev=$(git --git-dir=$2/.git rev-parse HEAD);
fi
echo current_rev for $1 is $current_rev;
tracked_rev=$(cat $3);
echo tracked_rev for $1 is $tracked_rev;
if [ "$current_rev" != "$tracked_rev" ]; then
echo Revisions for $1 do not match.;
if [ -d external ]; then
echo Removing current desktop toolchain;
rm -rf external/*;
fi
if [ -d build-android/external ]; then
echo Removing current android toolchain;
rm -rf build-android/external/*;
fi
echo Done removing toolchains.
exit 0;
fi
}
# Parameters are tool, current git repo location, tracked revision location
tool=glslang
dir=external/glslang
rev=external_revisions/glslang_revision
check_revision $tool $dir $rev
tool=glslang_android
dir=build-android/external/glslang
rev=build-android/glslang_revision_android
check_revision $tool $dir $rev
tool=spirv-tools_android
dir=build-android/external/spirv-tools
rev=build-android/spirv-tools_revision_android
check_revision $tool $dir $rev
tool=spirv-headers_android
dir=build-android/external/spirv-tools/external/spirv-headers
rev=build-android/spirv-headers_revision_android
check_revision $tool $dir $rev
tool=shaderc_android
dir=build-android/external/shaderc
rev=build-android/shaderc_revision_android
check_revision $tool $dir $rev
exit 0