The branch, master has been updated via 3990c33efec examples: Reformat shell scripts via 1b8b6ac801e docs-xml: Reformat shell scripts via 2d5d88ff345 buildtools: Reformat shell scripts via a9eebca923a configure: Reformat wrapper script via 38a1e4c5bd8 editorconfig: Change shell to tabs with tab width 8 from 5030bba13ae samba-dcerpcd: Silence a DEBUG message
https://git.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 3990c33efec319a1262688b7ef069f4ce6a01949 Author: Andreas Schneider <a...@samba.org> Date: Sat Feb 19 16:06:32 2022 +0100 examples: Reformat shell scripts shfmt -f examples/ | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org> Autobuild-Date(master): Tue Feb 22 16:20:58 UTC 2022 on sn-devel-184 commit 1b8b6ac801e94c3f2fb026e6dfe1275ae9caef47 Author: Andreas Schneider <a...@samba.org> Date: Sat Feb 19 08:56:15 2022 +0100 docs-xml: Reformat shell scripts shfmt -f docs-xml | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 2d5d88ff34532ba2d78997467e5720bba480f07e Author: Andreas Schneider <a...@samba.org> Date: Sat Feb 19 08:52:17 2022 +0100 buildtools: Reformat shell scripts shfmt -f buildtools | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit a9eebca923ae7461a94448d3f6800e36bbfc8e46 Author: Andreas Schneider <a...@samba.org> Date: Sat Feb 19 08:54:01 2022 +0100 configure: Reformat wrapper script shfmt -w -p -i 0 -fn configure Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> commit 38a1e4c5bd8c672b1e5f7b116fc1c5d0618fec17 Author: Andreas Schneider <a...@samba.org> Date: Sat Feb 19 16:10:29 2022 +0100 editorconfig: Change shell to tabs with tab width 8 Signed-off-by: Andreas Schneider <a...@samba.org> Reviewed-by: Andrew Bartlett <abart...@samba.org> ----------------------------------------------------------------------- Summary of changes: .editorconfig | 8 +- buildtools/compare_config_h4.sh | 4 +- buildtools/compare_generated.sh | 59 +++++---- buildtools/compare_install.sh | 4 +- buildtools/scripts/abi_gen.sh | 22 ++-- buildtools/scripts/autogen-waf.sh | 6 +- buildtools/testwaf.sh | 66 +++++----- configure | 2 +- docs-xml/smbdotconf/generate-file-list.sh | 9 +- examples/LDAP/get_next_oid | 12 +- examples/ad-bench/ad-bench.sh | 14 +-- examples/ad-bench/settings.sh | 5 +- examples/ad-bench/test_utils.sh | 14 +-- examples/ad-bench/time_group.sh | 38 +++--- examples/ad-bench/time_join.sh | 22 ++-- examples/ad-bench/time_kinit.sh | 18 +-- examples/ad-bench/time_ldap.sh | 45 ++++--- examples/ad-bench/time_user.sh | 38 +++--- examples/ad-bench/utils.sh | 72 ++++++----- examples/scripts/debugging/linux/backtrace | 12 +- examples/scripts/debugging/solaris/solaris-oops.sh | 28 +++-- examples/scripts/idmap/idmap_nis.sh | 133 +++++++++++---------- examples/scripts/wins_hook/dns_update | 8 +- examples/systemtap/generate-winbindd.stp.sh | 14 +-- 24 files changed, 343 insertions(+), 310 deletions(-) Changeset truncated at 500 lines: diff --git a/.editorconfig b/.editorconfig index b5d39118772..fa1c0680aa0 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,10 +18,10 @@ indent_size = 4 tab_width = 4 insert_final_newline = true -[*.{sh}] -indent_style = space -indent_size = 4 -tab_width = 4 +[*.sh] +indent_style = tab +indent_size = 8 +tab_width = 8 [*.{pl,pm}] indent_style = tab diff --git a/buildtools/compare_config_h4.sh b/buildtools/compare_config_h4.sh index b78b36fdd0f..fee8abfbd50 100755 --- a/buildtools/compare_config_h4.sh +++ b/buildtools/compare_config_h4.sh @@ -3,8 +3,8 @@ # compare the generated config.h from a waf build with existing samba # build -grep "^.define" bin/default/source4/include/config.h | sort > waf-config.h -grep "^.define" $HOME/samba_old/source4/include/config.h | sort > old-config.h +grep "^.define" bin/default/source4/include/config.h | sort >waf-config.h +grep "^.define" $HOME/samba_old/source4/include/config.h | sort >old-config.h comm -23 old-config.h waf-config.h diff --git a/buildtools/compare_generated.sh b/buildtools/compare_generated.sh index ebef8a979bd..e6265795813 100755 --- a/buildtools/compare_generated.sh +++ b/buildtools/compare_generated.sh @@ -10,41 +10,40 @@ gen_files=$(cd bin/default && find . -type f -name '*.[ch]') strip_file() { - in_file=$1 - out_file=$2 - cat $in_file | - grep -v 'The following definitions come from' | - grep -v 'Automatically generated at' | - grep -v 'Generated from' | - sed 's|/home/tnagy/samba/source4||g' | - sed 's|/home/tnagy/samba/|../|g' | - sed 's|bin/default/source4/||g' | - sed 's|bin/default/|../|g' | - sed 's/define _____/define ___/g' | - sed 's/define __*/define _/g' | - sed 's/define _DEFAULT_/define _/g' | - sed 's/define _SOURCE4_/define ___/g' | - sed 's/define ___/define _/g' | - sed 's/ifndef ___/ifndef _/g' | - sed 's|endif /* ____|endif /* __|g' | - sed s/__DEFAULT_SOURCE4/__/ | - sed s/__DEFAULT_SOURCE4/__/ | - sed s/__DEFAULT/____/ > $out_file + in_file=$1 + out_file=$2 + cat $in_file | + grep -v 'The following definitions come from' | + grep -v 'Automatically generated at' | + grep -v 'Generated from' | + sed 's|/home/tnagy/samba/source4||g' | + sed 's|/home/tnagy/samba/|../|g' | + sed 's|bin/default/source4/||g' | + sed 's|bin/default/|../|g' | + sed 's/define _____/define ___/g' | + sed 's/define __*/define _/g' | + sed 's/define _DEFAULT_/define _/g' | + sed 's/define _SOURCE4_/define ___/g' | + sed 's/define ___/define _/g' | + sed 's/ifndef ___/ifndef _/g' | + sed 's|endif /* ____|endif /* __|g' | + sed s/__DEFAULT_SOURCE4/__/ | + sed s/__DEFAULT_SOURCE4/__/ | + sed s/__DEFAULT/____/ >$out_file } compare_file() { - f=$f - bname=$(basename $f) - t1=/tmp/$bname.old.$$ - t2=/tmp/$bname.new.$$ - strip_file $old_build/$f $t1 - strip_file bin/default/$f $t2 - diff -u -b $t1 $t2 2>&1 - rm -f $t1 $t2 + f=$f + bname=$(basename $f) + t1=/tmp/$bname.old.$$ + t2=/tmp/$bname.new.$$ + strip_file $old_build/$f $t1 + strip_file bin/default/$f $t2 + diff -u -b $t1 $t2 2>&1 + rm -f $t1 $t2 } for f in $gen_files; do - compare_file $f + compare_file $f done - diff --git a/buildtools/compare_install.sh b/buildtools/compare_install.sh index b964117550b..37772a46a4c 100755 --- a/buildtools/compare_install.sh +++ b/buildtools/compare_install.sh @@ -3,6 +3,6 @@ prefix1="$1" prefix2="$2" -(cd $prefix1 && find . ) | sort > p1.txt -(cd $prefix2 && find . ) | sort > p2.txt +(cd $prefix1 && find .) | sort >p1.txt +(cd $prefix2 && find .) | sort >p2.txt diff -u p[12].txt diff --git a/buildtools/scripts/abi_gen.sh b/buildtools/scripts/abi_gen.sh index ddb0a7cc36f..c66a1b848a8 100755 --- a/buildtools/scripts/abi_gen.sh +++ b/buildtools/scripts/abi_gen.sh @@ -6,21 +6,21 @@ SHAREDLIB="$1" GDBSCRIPT="gdb_syms.$$" ( -cat <<EOF + cat <<EOF set height 0 set width 0 EOF -# On older linker versions _init|_fini symbols are not hidden. -objdump --dynamic-syms "${SHAREDLIB}" | \ - awk '$0 !~ /.hidden/ {if ($2 == "g" && $3 ~ /D(F|O)/ && $4 ~ /(.bss|.rodata|.text)/) print $NF}' | \ - sort | \ - while read -r s; do - echo "echo $s: " - echo p "${s}" -done -) > $GDBSCRIPT + # On older linker versions _init|_fini symbols are not hidden. + objdump --dynamic-syms "${SHAREDLIB}" | + awk '$0 !~ /.hidden/ {if ($2 == "g" && $3 ~ /D(F|O)/ && $4 ~ /(.bss|.rodata|.text)/) print $NF}' | + sort | + while read -r s; do + echo "echo $s: " + echo p "${s}" + done +) >$GDBSCRIPT # forcing the terminal avoids a problem on Fedora12 -TERM=none gdb -n -batch -x $GDBSCRIPT "$SHAREDLIB" < /dev/null +TERM=none gdb -n -batch -x $GDBSCRIPT "$SHAREDLIB" </dev/null rm -f $GDBSCRIPT diff --git a/buildtools/scripts/autogen-waf.sh b/buildtools/scripts/autogen-waf.sh index 7a6e94c5ec4..a0ed80c33fa 100755 --- a/buildtools/scripts/autogen-waf.sh +++ b/buildtools/scripts/autogen-waf.sh @@ -1,6 +1,6 @@ #!/bin/sh -p=`dirname $0` +p=$(dirname $0) echo "Setting up for waf build" @@ -13,12 +13,12 @@ echo "Found buildtools in $p/$d" echo "Setting up configure" rm -f $p/configure $p/include/config*.h* -sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" < "$p/$d/scripts/configure.waf" > $p/configure +sed "s|BUILDTOOLS|$d|g;s|BUILDPATH|$p|g" <"$p/$d/scripts/configure.waf" >$p/configure chmod +x $p/configure echo "Setting up Makefile" rm -f $p/makefile $p/Makefile -sed "s|BUILDTOOLS|$d|g" < "$p/$d/scripts/Makefile.waf" > $p/Makefile +sed "s|BUILDTOOLS|$d|g" <"$p/$d/scripts/Makefile.waf" >$p/Makefile echo "done. Now run $p/configure or $p/configure.developer then make." if [ $p != "." ]; then diff --git a/buildtools/testwaf.sh b/buildtools/testwaf.sh index 127e5258910..3e8e6431c78 100755 --- a/buildtools/testwaf.sh +++ b/buildtools/testwaf.sh @@ -9,52 +9,52 @@ cd $d/.. PREFIX=$HOME/testprefix if [ $# -gt 0 ]; then - tests="$*" + tests="$*" else - tests="lib/replace lib/talloc lib/tevent lib/tdb lib/ldb" + tests="lib/replace lib/talloc lib/tevent lib/tdb lib/ldb" fi echo "testing in dirs $tests" for d in $tests; do - echo "`date`: testing $d" - pushd $d - rm -rf bin - type waf - waf dist - ./configure -C --enable-developer --prefix=$PREFIX - time make - make install - make distcheck - case $d in + echo "$(date): testing $d" + pushd $d + rm -rf bin + type waf + waf dist + ./configure -C --enable-developer --prefix=$PREFIX + time make + make install + make distcheck + case $d in "lib/ldb") - ldd bin/ldbadd - ;; + ldd bin/ldbadd + ;; "lib/replace") - ldd bin/replace_testsuite - ;; + ldd bin/replace_testsuite + ;; "lib/talloc") - ldd bin/talloc_testsuite - ;; + ldd bin/talloc_testsuite + ;; "lib/tdb") - ldd bin/tdbtool - ;; - esac - popd + ldd bin/tdbtool + ;; + esac + popd done echo "testing python portability" pushd lib/talloc versions="python2.4 python2.5 python2.6 python3.0 python3.1" for p in $versions; do - ret=$(which $p || echo "failed") - if [ $ret = "failed" ]; then - echo "$p not found, skipping" - continue - fi - echo "Testing $p" - $p ../../buildtools/bin/waf configure -C --enable-developer --prefix=$PREFIX - $p ../../buildtools/bin/waf build install + ret=$(which $p || echo "failed") + if [ $ret = "failed" ]; then + echo "$p not found, skipping" + continue + fi + echo "Testing $p" + $p ../../buildtools/bin/waf configure -C --enable-developer --prefix=$PREFIX + $p ../../buildtools/bin/waf build install done popd @@ -62,9 +62,9 @@ echo "testing cross compiling" pushd lib/talloc ret=$(which arm-linux-gnueabi-gcc || echo "failed") if [ $ret != "failed" ]; then - CC=arm-linux-gnueabi-gcc ./configure -C --prefix=$PREFIX --cross-compile --cross-execute='runarm' - make && make install + CC=arm-linux-gnueabi-gcc ./configure -C --prefix=$PREFIX --cross-compile --cross-execute='runarm' + make && make install else - echo "Cross-compiler not installed, skipping test" + echo "Cross-compiler not installed, skipping test" fi popd diff --git a/configure b/configure index a6ca50feb47..237d2306f79 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #!/bin/sh -PREVPATH=`dirname $0` +PREVPATH=$(dirname $0) WAF=./buildtools/bin/waf diff --git a/docs-xml/smbdotconf/generate-file-list.sh b/docs-xml/smbdotconf/generate-file-list.sh index a86bac5c289..27c9c5b753e 100755 --- a/docs-xml/smbdotconf/generate-file-list.sh +++ b/docs-xml/smbdotconf/generate-file-list.sh @@ -21,20 +21,17 @@ echo "<!DOCTYPE section [ ]>" DIR=. -if [ "x$1" != "x" ] -then +if [ "x$1" != "x" ]; then DIR="$1" fi -OLD=`pwd` +OLD=$(pwd) cd $DIR echo "<section>" -for I in `find . -mindepth 2 -type f -name '*.xml' | sort -t/ -k3 | xargs` -do +for I in $(find . -mindepth 2 -type f -name '*.xml' | sort -t/ -k3 | xargs); do cat $I done echo "</section>" - cd $OLD diff --git a/examples/LDAP/get_next_oid b/examples/LDAP/get_next_oid index bf002003753..f268b47b50d 100755 --- a/examples/LDAP/get_next_oid +++ b/examples/LDAP/get_next_oid @@ -1,15 +1,15 @@ #!/bin/bash -nextattrib=`cat samba.schema | grep -i attributetype.*\(.*1.3.6.1.4.1.7165. | grep -v '^#' | \ - awk '{print $3}' | cut -d. -f 10 | sort -n | tail -1` +nextattrib=$(cat samba.schema | grep -i attributetype.*\(.*1.3.6.1.4.1.7165. | grep -v '^#' | + awk '{print $3}' | cut -d. -f 10 | sort -n | tail -1) -(( nextattrib += 1 )) +( (nextattrib += 1)) echo "attributetype ( 1.3.6.1.4.1.7165.2.1.$nextattrib NAME ...." -nextoc=`cat samba.schema | grep -i objectclass.*\(.*1.3.6.1.4.1.7165. | grep -v '^#' | \ - awk '{print $3}' | cut -d. -f 10 | sort -n | tail -1` +nextoc=$(cat samba.schema | grep -i objectclass.*\(.*1.3.6.1.4.1.7165. | grep -v '^#' | + awk '{print $3}' | cut -d. -f 10 | sort -n | tail -1) -(( nextoc += 1 )) +( (nextoc += 1)) echo "objectclass ( 1.3.6.1.4.1.7165.2.2.$nextoc NAME ...." diff --git a/examples/ad-bench/ad-bench.sh b/examples/ad-bench/ad-bench.sh index 84bb770e8c8..c4c2a4a1e7a 100755 --- a/examples/ad-bench/ad-bench.sh +++ b/examples/ad-bench/ad-bench.sh @@ -18,7 +18,7 @@ # You should have received a copy of the GNU General Public License # along with AD-Bench. If not, see <http://www.gnu.org/licenses/>. -source `dirname $0`/utils.sh +source $(dirname $0)/utils.sh if [ ! -f $RUNS ]; then echo "Error: please fill in $RUNS" @@ -27,12 +27,12 @@ if [ ! -f $RUNS ]; then exit 1 fi -for run in `cat $RUNS`; do +for run in $(cat $RUNS); do echo "START RUN" - bash `dirname $0`/time_kinit.sh `echo $run|cut -d ":" -f 1` - bash `dirname $0`/time_join.sh `echo $run|cut -d ":" -f 1` `echo $run|cut -d ":" -f 2` - bash `dirname $0`/time_user.sh `echo $run|cut -d ":" -f 1` `echo $run|cut -d ":" -f 2` - bash `dirname $0`/time_group.sh `echo $run|cut -d ":" -f 1` `echo $run|cut -d ":" -f 2` - bash `dirname $0`/time_ldap.sh `echo $run|cut -d ":" -f 1` `echo $run|cut -d ":" -f 2` + bash $(dirname $0)/time_kinit.sh $(echo $run | cut -d ":" -f 1) + bash $(dirname $0)/time_join.sh $(echo $run | cut -d ":" -f 1) $(echo $run | cut -d ":" -f 2) + bash $(dirname $0)/time_user.sh $(echo $run | cut -d ":" -f 1) $(echo $run | cut -d ":" -f 2) + bash $(dirname $0)/time_group.sh $(echo $run | cut -d ":" -f 1) $(echo $run | cut -d ":" -f 2) + bash $(dirname $0)/time_ldap.sh $(echo $run | cut -d ":" -f 1) $(echo $run | cut -d ":" -f 2) echo "END RUN" done diff --git a/examples/ad-bench/settings.sh b/examples/ad-bench/settings.sh index f01edc3d98a..b4a68ae8963 100644 --- a/examples/ad-bench/settings.sh +++ b/examples/ad-bench/settings.sh @@ -18,7 +18,6 @@ # You should have received a copy of the GNU General Public License # along with AD-Bench. If not, see <http://www.gnu.org/licenses/>. - DATE=date BC=bc SED=sed @@ -36,6 +35,6 @@ SEQ=seq NEW_KRB5CCNAME=/tmp/ad_test_ccname NET="${HOME}/samba/bin/net" -CONFIG_FILE=`dirname $0`/smb.conf +CONFIG_FILE=$(dirname $0)/smb.conf -RUNS=`dirname $0`/runs.txt +RUNS=$(dirname $0)/runs.txt diff --git a/examples/ad-bench/test_utils.sh b/examples/ad-bench/test_utils.sh index 7f46b07d63a..2580c9da73a 100644 --- a/examples/ad-bench/test_utils.sh +++ b/examples/ad-bench/test_utils.sh @@ -18,14 +18,12 @@ # You should have received a copy of the GNU General Public License # along with AD-Bench. If not, see <http://www.gnu.org/licenses/>. - -source `dirname $0`/utils.sh +source $(dirname $0)/utils.sh INPUT="administra...@ad.example.com%secret" -echo "Principal for $INPUT is " $( get_principal $INPUT ) -echo "Password for $INPUT is " $( get_password $INPUT ) -echo "Realm for $INPUT is " $( get_realm $INPUT ) -echo "NT_DOM for $INPUT is " $( get_nt_dom $INPUT ) - +echo "Principal for $INPUT is " $(get_principal $INPUT) +echo "Password for $INPUT is " $(get_password $INPUT) +echo "Realm for $INPUT is " $(get_realm $INPUT) +echo "NT_DOM for $INPUT is " $(get_nt_dom $INPUT) -echo "Padding 2: " $( pad_number 1 2 ) " 4: " $(pad_number 23 4) +echo "Padding 2: " $(pad_number 1 2) " 4: " $(pad_number 23 4) diff --git a/examples/ad-bench/time_group.sh b/examples/ad-bench/time_group.sh index bb989314b83..be47aac0e6c 100644 --- a/examples/ad-bench/time_group.sh +++ b/examples/ad-bench/time_group.sh @@ -20,7 +20,7 @@ ITERATIONS=100 -source `dirname $0`/utils.sh +source $(dirname $0)/utils.sh PRINCIPAL=$(get_principal $1) PASSWORD=$(get_password $1) @@ -28,9 +28,10 @@ REALM=$(get_realm $1) NT_DOM=$(get_nt_dom $1) SERVER=$2 -add_group () { +add_group() +{ GROUP=$1 - ${NET} ads group add "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads group add "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} >/dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} ads group add returned error: $RET" @@ -38,9 +39,10 @@ add_group () { fi } -del_group () { +del_group() +{ GROUP=$1 - ${NET} ads group delete "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads group delete "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} >/dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -48,8 +50,9 @@ del_group () { fi } -enum_group () { - ${NET} ads group -k --configfile=$CONFIG_FILE -S $SERVER > /dev/null +enum_group() +{ + ${NET} ads group -k --configfile=$CONFIG_FILE -S $SERVER >/dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -57,9 +60,10 @@ enum_group () { fi } -info_group () { +info_group() +{ GROUP=$1 - ${NET} ads group info "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} > /dev/null + ${NET} ads group info "${GROUP}" -k --configfile=$CONFIG_FILE -S ${SERVER} >/dev/null RET=$? if [ $RET -ne 0 ]; then echo "${NET} returned error: $RET" @@ -67,14 +71,16 @@ info_group () { fi } -set_up () { +set_up() -- Samba Shared Repository