diff options
author | Andreas Schneider <asn@samba.org> | 2022-02-21 13:53:56 +0100 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2022-02-24 10:13:36 +0000 |
commit | 38498024974455f02a99171f10d30a583e7208b6 (patch) | |
tree | a0f860744ab0f8e3f00dbbfa1e0643aaff5579f1 | |
parent | d42f08d16b95a7a5e0073577fe540c0923511a72 (diff) | |
download | samba-38498024974455f02a99171f10d30a583e7208b6.tar.gz |
packaging: Reformat shell scripts
shfmt -f packaging/ | xargs shfmt -w -p -i 0 -fn
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb 24 10:13:36 UTC 2022 on sn-devel-184
-rwxr-xr-x | packaging/Example/package-prep | 14 | ||||
-rwxr-xr-x | packaging/NetworkManager/30-winbind-systemd | 16 | ||||
-rwxr-xr-x | packaging/bin/fill-templates | 22 | ||||
-rwxr-xr-x | packaging/bin/update-pkginfo | 18 | ||||
-rw-r--r-- | packaging/printing/smbprint | 22 |
5 files changed, 47 insertions, 45 deletions
diff --git a/packaging/Example/package-prep b/packaging/Example/package-prep index e8f5089a865..ae096383110 100755 --- a/packaging/Example/package-prep +++ b/packaging/Example/package-prep @@ -4,12 +4,14 @@ tar xvf skeleton.tar # Now link the skeleton directory structure into the final install tree. -( cd /usr/local; - mv man man.orig; - mv samba samba.orig; - NOWDIR=`pwd`; - ln -sf $NOWDIR/usr/local/man man; - ln -sf $NOWDIR/usr/local/samba samba; ) +( + cd /usr/local + mv man man.orig + mv samba samba.orig + NOWDIR=$(pwd) + ln -sf $NOWDIR/usr/local/man man + ln -sf $NOWDIR/usr/local/samba samba +) # Unpack the master source tarball gunzip samba-X.X.X.tar.gz diff --git a/packaging/NetworkManager/30-winbind-systemd b/packaging/NetworkManager/30-winbind-systemd index 9db422afea0..f740bb8a399 100755 --- a/packaging/NetworkManager/30-winbind-systemd +++ b/packaging/NetworkManager/30-winbind-systemd @@ -7,14 +7,14 @@ winbind_offline_logon=$(testparm -s --parameter-name "winbind offline logon" 2>/ test "${winbind_offline_logon}" = "Yes" || exit 0 case "$2" in - up|vpn-up) - nmb_is_active=$($SYSTEMCTL is-active nmb.service) - if test "${nmb_is_active}" = "active"; then - $SYSTEMCTL try-restart nmb.service || : - fi - /usr/bin/smbcontrol winbind online || : +up | vpn-up) + nmb_is_active=$($SYSTEMCTL is-active nmb.service) + if test "${nmb_is_active}" = "active"; then + $SYSTEMCTL try-restart nmb.service || : + fi + /usr/bin/smbcontrol winbind online || : ;; - down) - /usr/bin/smbcontrol winbind offline +down) + /usr/bin/smbcontrol winbind offline ;; esac diff --git a/packaging/bin/fill-templates b/packaging/bin/fill-templates index cbd49337ed7..cd711bd3294 100755 --- a/packaging/bin/fill-templates +++ b/packaging/bin/fill-templates @@ -17,31 +17,31 @@ TOPDIR=${DIRNAME}/../.. SRCDIR=${TOPDIR}/source3 VERSION_H=${SRCDIR}/include/version.h -pushd ${SRCDIR} > /dev/null 2>&1 +pushd ${SRCDIR} >/dev/null 2>&1 ./script/mkversion.sh -popd > /dev/null 2>&1 +popd >/dev/null 2>&1 -if [ ! -f ${VERSION_H} ] ; then +if [ ! -f ${VERSION_H} ]; then echo "Error creating version.h" exit 1 fi -VERSION=`grep "define SAMBA_VERSION_OFFICIAL_STRING" ${VERSION_H} | awk '{print $3}'` +VERSION=$(grep "define SAMBA_VERSION_OFFICIAL_STRING" ${VERSION_H} | awk '{print $3}') -vendor_version=`grep "define SAMBA_VERSION_VENDOR_SUFFIX" ${VERSION_H} | awk '{print $3}'` -if test "x${vendor_version}" != "x" ; then +vendor_version=$(grep "define SAMBA_VERSION_VENDOR_SUFFIX" ${VERSION_H} | awk '{print $3}') +if test "x${vendor_version}" != "x"; then VERSION="${VERSION}-${vendor_version}" fi -vendor_patch=`grep "define SAMBA_VERSION_VENDOR_PATCH" ${VERSION_H} | awk '{print $3}'` -if test "x${vendor_patch}" != "x" ; then +vendor_patch=$(grep "define SAMBA_VERSION_VENDOR_PATCH" ${VERSION_H} | awk '{print $3}') +if test "x${vendor_patch}" != "x"; then VERSION="${VERSION}-${vendor_patch}" fi -VERSION=`echo ${VERSION} | sed 's/\"//g'` +VERSION=$(echo ${VERSION} | sed 's/\"//g') echo "VERSION: ${VERSION}" -pushd ${TOPDIR}/packaging > /dev/null 2>&1 +pushd ${TOPDIR}/packaging >/dev/null 2>&1 ./bin/update-pkginfo "${VERSION}" 1 "" -popd > /dev/null 2>&1 +popd >/dev/null 2>&1 diff --git a/packaging/bin/update-pkginfo b/packaging/bin/update-pkginfo index 7587f689d91..486c8c70d4b 100755 --- a/packaging/bin/update-pkginfo +++ b/packaging/bin/update-pkginfo @@ -11,21 +11,21 @@ else fi if [ $# -ne 3 ]; then - echo Usage: update-pkginfo VERSION RELEASE REVISION - exit 1 + echo Usage: update-pkginfo VERSION RELEASE REVISION + exit 1 fi DIRNAME=$(dirname $0) TOPDIR=${DIRNAME}/../../ PACKAGINGDIR=${TOPDIR}/packaging -pushd ${PACKAGINGDIR} > /dev/null 2>&1 -for f in `find . -type f -name "*.tmpl"`; do - f2=`echo $f | sed s/.tmpl//g` - echo $f2 - sed -e s/PVERSION/$VERSION/g \ +pushd ${PACKAGINGDIR} >/dev/null 2>&1 +for f in $(find . -type f -name "*.tmpl"); do + f2=$(echo $f | sed s/.tmpl//g) + echo $f2 + sed -e s/PVERSION/$VERSION/g \ -e s/PRELEASE/$RELEASE/g \ -e s/PREVISION/${REVISION}/g \ - -e s/PRPMREV/${RPMREVISION}/g < $f > $f2 + -e s/PRPMREV/${RPMREVISION}/g <$f >$f2 done -popd > /dev/null 2>&1 +popd >/dev/null 2>&1 diff --git a/packaging/printing/smbprint b/packaging/printing/smbprint index a02d7543acc..a21385aa25c 100644 --- a/packaging/printing/smbprint +++ b/packaging/printing/smbprint @@ -47,7 +47,7 @@ # Concat this with /.config to get the config file. # eval acct_file=\${$#} -spool_dir=`dirname $acct_file` +spool_dir=$(dirname $acct_file) config_file=$spool_dir/.config # Should read the following variables set in the config file: @@ -56,29 +56,29 @@ config_file=$spool_dir/.config # user # password -eval `cat $config_file` +eval $(cat $config_file) -share=`echo $share | sed "s/[\]/\//g"` +share=$(echo $share | sed "s/[\]/\//g") if [ "$user" != "" ]; then - usercmd="-U" + usercmd="-U" else - usercmd="" + usercmd="" fi if [ "$workgroup" != "" ]; then - workgroupcmd="-W" + workgroupcmd="-W" else - workgroupcmd="" + workgroupcmd="" fi if [ "$translate" = "yes" ]; then - command="translate ; print -" + command="translate ; print -" else - command="print -" + command="print -" fi #echo $share $password $translate $x_command > /tmp/smbprint.log cat | /usr/bin/smbclient "$share" "$password" -E ${hostip:+-I} \ - $hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup" \ - -c "$command" 2>/dev/null + $hostip -N -P $usercmd "$user" $workgroupcmd "$workgroup" \ + -c "$command" 2>/dev/null |