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/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/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/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/0001-fixes-includes.patch lib_patch.Upstream
package/elftosb/0002-force-cxx-compiler.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 package/elfutils/0001-Add-a-enable-disable-progs-configure-option.patch lib_patch.Upstream

View File

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

View File

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