3 if [[ $# -lt 1 ]]; then
4 echo "Usage: update.sh VERSION"
9 WAF_GIT
="https://gitlab.com/ita1024/waf.git"
10 WAF_UPDATE_SCRIPT
="$(readlink -f "$0")"
11 WAF_SAMBA_DIR
="$(dirname "${WAF_UPDATE_SCRIPT}")"
12 WAF_TMPDIR
=$
(mktemp
--tmpdir -d waf-XXXXXXXX
)
14 echo "VERSION: ${WAF_VERSION}"
15 echo "GIT URL: ${WAF_GIT}"
16 echo "WAF SAMBA DIR: ${WAF_SAMBA_DIR}"
17 echo "WAF TMP DIR: ${WAF_TMPDIR}"
20 popd 2>/dev
/null || true
23 trap cleanup_tmpdir SIGINT
27 if test "$1" = 0 -o -z "$1" ; then
34 # Checkout the git tree
35 mkdir
-p "${WAF_TMPDIR}"
36 pushd "${WAF_TMPDIR}" || cleanup_and_exit
1
38 git clone
"${WAF_GIT}"
40 if [ $ret -ne 0 ]; then
41 echo "ERROR: Failed to clone repository"
46 pushd waf || cleanup_and_exit
1
47 git checkout
-b "waf-${WAF_VERSION}" "waf-${WAF_VERSION}"
49 if [ $ret -ne 0 ]; then
50 echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository"
53 popd || cleanup_and_exit
1
55 popd || cleanup_and_exit
1
58 pushd "${WAF_SAMBA_DIR}" || cleanup_and_exit
1
62 rsync
-av "${WAF_TMPDIR}/waf/waflib" .
64 if [ $ret -ne 0 ]; then
65 echo "ERROR: Failed copy waflib"
68 chmod -x waflib
/Context.py
72 popd || cleanup_and_exit
1
75 echo "Now please change VERSION in buildtools/bin/waf and"
76 echo "Context.HEXVERSION in buildtools/wafsamba/wafsamba.py"