mirror of
https://github.com/sched-ext/scx.git
synced 2024-11-25 12:10:24 +00:00
273728fd2b
When fetching external git repositories (libbpf and bpftool) we don't check if the target commit exists. This can leads to issues such as #400, because we may silently use HEAD, instead of the specified commit. Prevent this by returning an error when the target SHA1 cannot be found. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
15 lines
266 B
Bash
15 lines
266 B
Bash
#!/bin/bash
|
|
|
|
URL=https://github.com/libbpf/bpftool.git
|
|
|
|
cd $1
|
|
rm -rf bpftool
|
|
git clone --depth=1 ${URL}
|
|
cd bpftool
|
|
git fetch --depth=1 origin $2 || {
|
|
echo "commit $2 does not exists in ${URL}"
|
|
exit 1
|
|
}
|
|
git checkout $2
|
|
git submodule update --init --recursive
|