blob: a109057d547e76b45801e696c55cc35d2cab79e3 [file] [log] [blame]
Alexander Afanasyeva9369b42017-01-11 11:58:00 -08001#!/usr/bin/env bash
2set -e
3
4JDIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
5source "$JDIR"/util.sh
6
7set -x
8
9pushd "${CACHE_DIR:-/tmp}" >/dev/null
10
11INSTALLED_VERSION=$((cd NFD && git rev-parse HEAD) 2>/dev/null || echo NONE)
12
13sudo rm -Rf NFD-latest
14
15git clone git://github.com/named-data/NFD NFD-latest
16
17LATEST_VERSION=$((cd NFD-latest && git rev-parse HEAD) 2>/dev/null || echo UNKNOWN)
18
19if [[ $INSTALLED_VERSION != $LATEST_VERSION ]]; then
20 sudo rm -Rf NFD
21 mv NFD-latest NFD
22else
23 sudo rm -Rf NFD-latest
24fi
25
26sudo killall nfd || true
27
28sudo rm -f /usr/local/bin/nfd
29sudo rm -f /usr/local/etc/ndn/nfd.conf
30
31pushd NFD >/dev/null
32
33git submodule init
34git submodule sync
35git submodule update
36
37## Cleanup
38sudo ./waf -j1 --color=yes distclean
39
40./waf -j1 --color=yes configure
41./waf -j1 --color=yes build
42sudo ./waf -j1 --color=yes install
43sudo cp /usr/local/etc/ndn/nfd.conf.sample /usr/local/etc/ndn/nfd.conf
44
45popd >/dev/null
46popd >/dev/null