diff options
author | ng0 <ng0@n0.is> | 2019-11-19 19:34:18 +0000 |
---|---|---|
committer | ng0 <ng0@n0.is> | 2019-11-19 19:34:18 +0000 |
commit | 5be2c3823065e40ee94be79deeeaa709eb006ef8 (patch) | |
tree | e3de5ba58780d872a0a093a05f3c8cb763e61d07 /bootstrap | |
parent | fb8cb824e2e258bae6135ffd1c1223a1e76a8887 (diff) | |
download | gnunet-fuse-5be2c3823065e40ee94be79deeeaa709eb006ef8.tar.gz gnunet-fuse-5be2c3823065e40ee94be79deeeaa709eb006ef8.zip |
extend bootstrap script for uncrustify
Diffstat (limited to 'bootstrap')
-rwxr-xr-x | bootstrap | 50 |
1 files changed, 49 insertions, 1 deletions
@@ -1,3 +1,51 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | autoreconf -fi | ||
3 | 2 | ||
3 | |||
4 | # This is more portable than `which' but comes with | ||
5 | # the caveat of not(?) properly working on busybox's ash: | ||
6 | existence() | ||
7 | { | ||
8 | command -v "$1" >/dev/null 2>&1 | ||
9 | } | ||
10 | |||
11 | check_uncrustify() | ||
12 | { | ||
13 | if existence uncrustify; then | ||
14 | echo "Installing uncrustify hook and configuration" | ||
15 | ln -fs contrib/build-common/conf/uncrustify.cfg uncrustify.cfg 2> /dev/null | ||
16 | ln -fs contrib/build-common/conf/uncrustify_precommit .git/hooks/pre-commit 2> /dev/null | ||
17 | else | ||
18 | echo "Uncrustify not detected, hook not installed." | ||
19 | echo "Please install uncrustify if you plan on doing development" | ||
20 | fi | ||
21 | } | ||
22 | |||
23 | submodules() | ||
24 | { | ||
25 | # Try to update the submodule. Since bootstrap | ||
26 | # is also invoked by distributors, we must | ||
27 | # ignore any failing of this function as we | ||
28 | # could have no outgoing network connection | ||
29 | # in a restricted environment. | ||
30 | if ! git --version >/dev/null; then | ||
31 | echo "git not installed, skipping submodule update" | ||
32 | else | ||
33 | git submodule update --init || true | ||
34 | git submodule update --recursive --remote || true | ||
35 | git submodule sync || true | ||
36 | fi | ||
37 | } | ||
38 | |||
39 | auto_reconf() | ||
40 | { | ||
41 | autoreconf -fi | ||
42 | } | ||
43 | |||
44 | main() | ||
45 | { | ||
46 | submodules | ||
47 | check_uncrustify | ||
48 | auto_reconf | ||
49 | } | ||
50 | |||
51 | main "$@" | ||