Skip to content

Commit

Permalink
packaging: Reformat shell scripts
Browse files Browse the repository at this point in the history
shfmt -f packaging/ | xargs shfmt -w -p -i 0 -fn

Signed-off-by: Andreas Schneider <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>

Autobuild-User(master): Andreas Schneider <[email protected]>
Autobuild-Date(master): Thu Feb 24 10:13:36 UTC 2022 on sn-devel-184
  • Loading branch information
cryptomilk committed Feb 24, 2022
1 parent d42f08d commit 3849802
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 45 deletions.
14 changes: 8 additions & 6 deletions packaging/Example/package-prep
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions packaging/NetworkManager/30-winbind-systemd
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 11 additions & 11 deletions packaging/bin/fill-templates
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 9 additions & 9 deletions packaging/bin/update-pkginfo
Original file line number Diff line number Diff line change
Expand Up @@ -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
22 changes: 11 additions & 11 deletions packaging/printing/smbprint
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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

0 comments on commit 3849802

Please sign in to comment.