-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbuild.sh
67 lines (54 loc) · 1.3 KB
/
build.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
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
set -ex
SUITES=(focal impish jammy noble)
function install_debrep {
LATEST="$(git ls-remote https://github.com/pop-os/debrepbuild | grep HEAD | cut -c-7)"
if type debrep; then
CURRENT="$(debrep --version | cut -d' ' -f5 | cut -c2- | cut -c-7)"
if [ ! "$CURRENT" ] || [ "$CURRENT" != "$LATEST" ]; then
INSTALL=1
fi
else
INSTALL=1
fi
if [ "$INSTALL" ]; then
rustup run stable cargo install --git https://github.com/pop-os/debrepbuild --force
fi
}
function update_submodules {
git submodule update --init --recursive --remote
}
function merge_repo {
for suite in "${SUITES[@]}"; do
if [ -f "$1/suites/$suite.toml" ]
then
tail -n +6 "$1/suites/$suite.toml" | grep -v extra_repos >> "build/suites/$suite.toml"
fi
done
rsync -avz --exclude='LICENSE' \
--exclude='suites/' \
--exclude='README.md' \
$1/ \
build/
}
function merge_repos {
mkdir -p build/{keys,suites}
cp keys/* build/keys/
for suite in "${SUITES[@]}"; do
cp "suites/$suite.toml" "build/suites/$suite.toml"
done
merge_repo cuda
merge_repo repo-curated-free
merge_repo natron
}
function copy_assets {
rsync -avz assets build/
}
install_debrep
update_submodules
merge_repos
copy_assets
cd build
bash acquire_assets.sh # fetches files needed to create CUDA packages
debrep build
cd ..