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}"
21 popd 2>/dev
/null || true
24 trap cleanup_tmpdir SIGINT
29 if test "$1" = 0 -o -z "$1"; then
36 # Checkout the git tree
37 mkdir
-p "${WAF_TMPDIR}"
38 pushd "${WAF_TMPDIR}" || cleanup_and_exit
1
40 git clone
"${WAF_GIT}"
42 if [ $ret -ne 0 ]; then
43 echo "ERROR: Failed to clone repository"
47 pushd waf || cleanup_and_exit
1
48 git checkout
-b "waf-${WAF_VERSION}" "waf-${WAF_VERSION}"
50 if [ $ret -ne 0 ]; then
51 echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository"
54 popd || cleanup_and_exit
1
56 popd || cleanup_and_exit
1
59 pushd "${WAF_SAMBA_DIR}" || cleanup_and_exit
1
63 rsync
-av "${WAF_TMPDIR}/waf/waflib" .
65 if [ $ret -ne 0 ]; then
66 echo "ERROR: Failed copy waflib"
69 chmod -x waflib
/Context.py
73 popd || cleanup_and_exit
1
76 echo "Now please change VERSION in buildtools/bin/waf and"
77 echo "Context.HEXVERSION in buildtools/wafsamba/wafsamba.py"
78 grep WAFVERSION
"${WAF_SAMBA_DIR}/waflib/Context.py"
79 grep HEXVERSION
"${WAF_SAMBA_DIR}/waflib/Context.py"