1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-10 12:58:35 +03:00

buildtools: Reformat shell scripts

shfmt -f buildtools | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Andreas Schneider 2022-02-19 08:52:17 +01:00 committed by Andreas Schneider
parent a9eebca923
commit 2d5d88ff34
6 changed files with 80 additions and 81 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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