s3: smbd: Add SMB2_FILE_POSIX_INFORMATION getinfo info level (100 on the wire).
[Samba.git] / third_party / waf / update.sh
blob45fbeec5eff2a8cb8a62a3c97b4d7d7e0973d944
1 #!/bin/bash
3 if [[ $# -lt 1 ]]; then
4 echo "Usage: update.sh VERSION"
5 exit 1
6 fi
8 WAF_VERSION="${1}"
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}"
19 cleanup_tmpdir()
21 popd 2>/dev/null || true
22 rm -rf "$WAF_TMPDIR"
24 trap cleanup_tmpdir SIGINT
26 cleanup_and_exit()
28 cleanup_tmpdir
29 if test "$1" = 0 -o -z "$1"; then
30 exit 0
31 else
32 exit "$1"
36 # Checkout the git tree
37 mkdir -p "${WAF_TMPDIR}"
38 pushd "${WAF_TMPDIR}" || cleanup_and_exit 1
40 git clone "${WAF_GIT}"
41 ret=$?
42 if [ $ret -ne 0 ]; then
43 echo "ERROR: Failed to clone repository"
44 cleanup_and_exit 1
47 pushd waf || cleanup_and_exit 1
48 git checkout -b "waf-${WAF_VERSION}" "waf-${WAF_VERSION}"
49 ret=$?
50 if [ $ret -ne 0 ]; then
51 echo "ERROR: Failed to checkout waf-${WAF_VERSION} repository"
52 cleanup_and_exit 1
54 popd || cleanup_and_exit 1
56 popd || cleanup_and_exit 1
58 # Update waflib
59 pushd "${WAF_SAMBA_DIR}" || cleanup_and_exit 1
60 pwd
62 rm -rf waflib/
63 rsync -av "${WAF_TMPDIR}/waf/waflib" .
64 ret=$?
65 if [ $ret -ne 0 ]; then
66 echo "ERROR: Failed copy waflib"
67 cleanup_and_exit 1
69 chmod -x waflib/Context.py
71 git add waflib
73 popd || cleanup_and_exit 1
75 echo
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"
80 echo
82 cleanup_and_exit 0