packaging: Reformat shell scripts
authorAndreas Schneider <asn@samba.org>
Mon, 21 Feb 2022 12:53:56 +0000 (13:53 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 24 Feb 2022 10:13:36 +0000 (10:13 +0000)
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

packaging/Example/package-prep
packaging/NetworkManager/30-winbind-systemd
packaging/bin/fill-templates
packaging/bin/update-pkginfo
packaging/printing/smbprint

index e8f5089a865f67fbabd467715e7b8b0b181ac589..ae09638311062bd757ff34b99be32abf83042767 100755 (executable)
@@ -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
index 9db422afea0241748799954d71d76fa8644e457c..f740bb8a399c5569239e40d12593ea44793e3c01 100755 (executable)
@@ -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
index cbd49337ed7d5a9195d84a66c59c27ed62551ebf..cd711bd3294b14e134813be434141e64fafcb95b 100755 (executable)
@@ -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
index 7587f689d910ff148946204ef8a0d206a987a36b..486c8c70d4bc9deb883d73bbbe2c4cca906e6050 100755 (executable)
@@ -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
index a02d7543accd606af05dc4a62989b5a6f05881a4..a21385aa25c01a93d0c93c625d40396947363fb2 100644 (file)
@@ -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