aboutsummaryrefslogtreecommitdiff
path: root/bin/gana_update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gana_update.sh')
-rwxr-xr-xbin/gana_update.sh59
1 files changed, 59 insertions, 0 deletions
diff --git a/bin/gana_update.sh b/bin/gana_update.sh
new file mode 100755
index 000000000..0707433f5
--- /dev/null
+++ b/bin/gana_update.sh
@@ -0,0 +1,59 @@
1# This is more portable than `which' but comes with
2# the caveat of not(?) properly working on busybox's ash:
3existence()
4{
5 type "$1" >/dev/null 2>&1
6}
7
8gana_update()
9{
10 if [ ! -z $GNUNET_SKIP_GANA ]; then
11 echo "Skipping GANA update"
12 return
13 fi
14 echo "Updating GANA..."
15 if existence recfmt; then
16 cwd=$PWD
17 cd contrib/gana || exit 1
18 # GNS
19 echo "Updating GNS record types"
20 cd gnu-name-system-record-types && \
21 make >/dev/null && \
22 cp gnu_name_system_record_types.h ../../../src/include/ || exit 1
23 echo "Creating default TLDs"
24 cd ../gnu-name-system-default-tlds && \
25 make >/dev/null && \
26 cp tlds.conf ../../../src/service/gns || exit 1
27 echo "Creating default GNS protocol numbers"
28 cd ../gns-protocol-numbers && \
29 make >/dev/null && \
30 cp gnu_name_system_protocols.h ../../../src/include/ || exit 1
31 echo "Creating default GNS service port nummbers"
32 cd ../gns-service-port-numbers && \
33 make >/dev/null && \
34 cp gnu_name_system_service_ports.h ../../../src/include/ || exit 1
35
36 # Signatures
37 echo "Updating GNUnet signatures"
38 cd ../gnunet-signatures && \
39 make >/dev/null && \
40 cp gnunet_signatures.h ../../../src/include || exit 1
41 # DHT Block Types
42 echo "Updating DHT record types"
43 cd ../gnunet-dht-block-types && \
44 make >/dev/null && \
45 cp gnunet_dht_block_types.h ../../../src/include || exit 1
46 echo "Generating GNUnet error types"
47 cd ../gnunet-error-codes && \
48 make >/dev/null && \
49 cp gnunet_error_codes.h ../../../src/include && \
50 cp gnunet_error_codes.c ../../../src/lib/util || exit 1
51 cd $cwd
52 else
53 echo "ERROR: No recutils found! Unable to generate recent GANA headers and configs."
54 exit 1
55 fi
56 echo "GANA finished"
57}
58
59gana_update