package/ejabberd: fix warnings reported by check-package

Signed-off-by: Johan Oudinet <johan.oudinet@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
This commit is contained in:
Johan Oudinet
2024-08-29 16:49:39 +02:00
committed by Yann E. MORIN
parent c000e858e6
commit ec9a66d1bc
3 changed files with 57 additions and 56 deletions

View File

@@ -464,8 +464,6 @@ package/efl/0001-ecore_evas-engines-drm-meson.build-use-gl_deps-as-en.patch lib_
package/efl/0002-ecore_evas-engines-drm-meson.build-fix-gl_drm-includ.patch lib_patch.Upstream
package/efl/0003-ecore_fb-fix-build-with-tslib.patch lib_patch.Upstream
package/eigen/0001-Adds-new-CMake-Options-for-controlling-build-compone.patch lib_patch.Upstream
package/ejabberd/S50ejabberd Shellcheck lib_sysv.Indent lib_sysv.Variables
package/ejabberd/check-erlang-lib Shellcheck
package/elftosb/0001-fixes-includes.patch lib_patch.Upstream
package/elftosb/0002-force-cxx-compiler.patch lib_patch.Upstream
package/elfutils/0001-Add-a-enable-disable-progs-configure-option.patch lib_patch.Upstream

View File

@@ -3,52 +3,54 @@
# Start/stop ejabberd
#
DAEMON=ejabberd
CTL=/usr/sbin/ejabberdctl
DEFAULT=/etc/ejabberd/ejabberdctl.cfg
INSTALLUSER=ejabberd
RUNDIR=/var/run/ejabberd
# Read default configuration file if present.
# shellcheck source=/dev/null
[ -r "$DEFAULT" ] && . "$DEFAULT"
# Create RUNDIR.
mkrundir() {
install -d -o "$INSTALLUSER" -g "$INSTALLUSER" "$RUNDIR"
install -d -o "$INSTALLUSER" -g "$INSTALLUSER" "$RUNDIR"
}
case "$1" in
start)
mkrundir || exit 1
printf "Starting ejabberd... "
"$CTL" start
# Wait until ejabberd is up and running.
if "$CTL" started; then
echo "done"
else
echo "failed"
fi
;;
stop)
printf "Stopping ejabberd... "
"$CTL" stop > /dev/null
if [ $? -eq 3 ] || "$CTL" stopped; then
echo "OK"
else
echo "failed"
fi
;;
status)
"$CTL" status
;;
restart|force-reload)
"$0" stop || true
"$0" start
;;
live)
mkrundir || exit 1
"$CTL" live
;;
*)
echo "Usage: $0 {start|stop|status|restart|force-reload|live}"
exit 1
start)
mkrundir || exit 1
printf 'Starting %s: ' "$DAEMON"
"$CTL" start
# Wait until ejabberd is up and running.
if "$CTL" started; then
echo "done"
else
echo "failed"
fi
;;
stop)
printf 'Stopping %s: ' "$DAEMON"
"$CTL" stop > /dev/null
if [ $? -eq 3 ] || "$CTL" stopped; then
echo "OK"
else
echo "failed"
fi
;;
status)
"$CTL" status
;;
restart|force-reload)
"$0" stop || true
"$0" start
;;
live)
mkrundir || exit 1
"$CTL" live
;;
*)
echo "Usage: $0 {start|stop|status|restart|force-reload|live}"
exit 1
esac

View File

@@ -9,9 +9,9 @@
# without calling erlang.
usage() {
cat <<EOF
cat <<EOF
Usage:
$0 library
$0 library
Look for Erlang's library in TARGET_DIR/usr/lib/erlang/lib.
If the library is found, it returns the path to the latest version,
@@ -24,15 +24,15 @@ EOF
}
die () {
echo "$@" >&2
exit 1
echo "$@" >&2
exit 1
}
if [ $# -ne 1 ]; then
usage
exit 0
usage
exit 0
else
library="$1"
library="$1"
fi
target_dir="${TARGET_DIR:-output/target}"
@@ -40,16 +40,17 @@ target_dir="${TARGET_DIR:-output/target}"
[ -d "$target_dir" ] || die "TARGET_DIR is not a directory. Please \
specify the TARGET_DIR environment variable."
case "$(ls -1d -- "$target_dir/usr/lib/erlang/lib/$library-"* | wc -l)" in
0)
echo "not found"
;;
1)
echo "$target_dir/usr/lib/erlang/lib/$library-"* \
| sed -e "s,^$target_dir,,"
;;
*)
die "Several versions of $library have been found. Please \
remove the unused ones."
;;
case "$(find "$target_dir/usr/lib/erlang/lib" -maxdepth 1 \
-name "$library-*" -type d | wc -l)" in
0)
echo "not found"
;;
1)
echo "$target_dir/usr/lib/erlang/lib/$library-"* \
| sed -e "s,^$target_dir,,"
;;
*)
die "Several versions of $library have been found. Please \
remove the unused ones."
;;
esac