From 060221841fd777b16db609eefe1e85862380279a Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Mon, 29 May 2017 21:37:31 -0500 Subject: system/apcupsd: fixup a restart issue + minor tweaks Thanks to Fabio Bas for the bug report and solution. Signed-off-by: Robby Workman --- system/apcupsd/apcupsd.SlackBuild | 8 ++--- .../patches/create_lockdir_in_init_script.diff | 11 ------- system/apcupsd/patches/init-script-fixups.diff | 35 ++++++++++++++++++++++ .../patches/nitpicky-fixes-to-init-script.diff | 29 ------------------ 4 files changed, 39 insertions(+), 44 deletions(-) delete mode 100644 system/apcupsd/patches/create_lockdir_in_init_script.diff create mode 100644 system/apcupsd/patches/init-script-fixups.diff delete mode 100644 system/apcupsd/patches/nitpicky-fixes-to-init-script.diff diff --git a/system/apcupsd/apcupsd.SlackBuild b/system/apcupsd/apcupsd.SlackBuild index 26601c3468..4a64e47297 100644 --- a/system/apcupsd/apcupsd.SlackBuild +++ b/system/apcupsd/apcupsd.SlackBuild @@ -27,12 +27,12 @@ PRGNAM=apcupsd VERSION=${VERSION:-3.14.14} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then case "$( uname -m )" in - i?86) ARCH=i486 ;; + i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$( uname -m ) ;; esac @@ -43,8 +43,8 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" diff --git a/system/apcupsd/patches/create_lockdir_in_init_script.diff b/system/apcupsd/patches/create_lockdir_in_init_script.diff deleted file mode 100644 index 024ac6d4cb..0000000000 --- a/system/apcupsd/patches/create_lockdir_in_init_script.diff +++ /dev/null @@ -1,11 +0,0 @@ -diff -Nur apcupsd-3.14.13.orig/platforms/slackware/apcupsd.in apcupsd-3.14.13/platforms/slackware/apcupsd.in ---- apcupsd-3.14.13.orig/platforms/slackware/apcupsd.in 2015-01-29 08:13:25.000000000 -0600 -+++ apcupsd-3.14.13/platforms/slackware/apcupsd.in 2015-08-17 22:49:30.754638339 -0500 -@@ -20,6 +20,7 @@ - if [ -f ${APCPID} ]; then - return=" Already running." - else -+ mkdir -p @LOCKDIR@ - @sbindir@/apcupsd && touch @LOCKDIR@/apcupsd \ - || return=" Failed." - fi diff --git a/system/apcupsd/patches/init-script-fixups.diff b/system/apcupsd/patches/init-script-fixups.diff new file mode 100644 index 0000000000..2e68c463fd --- /dev/null +++ b/system/apcupsd/patches/init-script-fixups.diff @@ -0,0 +1,35 @@ +diff -Nur apcupsd-3.14.14.orig/platforms/slackware/apcupsd.in apcupsd-3.14.14/platforms/slackware/apcupsd.in +--- apcupsd-3.14.14.orig/platforms/slackware/apcupsd.in 2015-01-29 08:13:25.000000000 -0600 ++++ apcupsd-3.14.14/platforms/slackware/apcupsd.in 2017-05-29 21:34:28.782782149 -0500 +@@ -9,17 +9,18 @@ + APCPID=@PIDDIR@/apcupsd.pid + DISTVER="@DISTVER@" + +-return=" Done." ++return="" + + + case "$1" in + start) + rm -f @PWRFAILDIR@/powerfail + rm -f @nologdir@/nologin +- echo -n "Starting apcupsd power management.." ++ echo -n "Starting apcupsd power management: /sbin/apcupsd" + if [ -f ${APCPID} ]; then + return=" Already running." + else ++ mkdir -p @LOCKDIR@ + @sbindir@/apcupsd && touch @LOCKDIR@/apcupsd \ + || return=" Failed." + fi +@@ -29,8 +30,9 @@ + stop) + echo -n "Stopping apcupsd power management.." + if [ -f ${APCPID} ]; then +- THEPID=`cat ${APCPID}` ++ THEPID=$(cat ${APCPID}) + kill ${THEPID} || return=" Failed." ++ sleep 2 + rm -f ${APCPID} + else + return=" Nothing to stop." diff --git a/system/apcupsd/patches/nitpicky-fixes-to-init-script.diff b/system/apcupsd/patches/nitpicky-fixes-to-init-script.diff deleted file mode 100644 index 0ba9058a5a..0000000000 --- a/system/apcupsd/patches/nitpicky-fixes-to-init-script.diff +++ /dev/null @@ -1,29 +0,0 @@ -diff -Nur apcupsd-3.14.13.orig/platforms/slackware/apcupsd.in apcupsd-3.14.13/platforms/slackware/apcupsd.in ---- apcupsd-3.14.13.orig/platforms/slackware/apcupsd.in 2015-08-17 22:51:39.595562965 -0500 -+++ apcupsd-3.14.13/platforms/slackware/apcupsd.in 2015-08-17 22:51:34.106608743 -0500 -@@ -9,14 +9,14 @@ - APCPID=@PIDDIR@/apcupsd.pid - DISTVER="@DISTVER@" - --return=" Done." -+return="" - - - case "$1" in - start) - rm -f @PWRFAILDIR@/powerfail - rm -f @nologdir@/nologin -- echo -n "Starting apcupsd power management.." -+ echo -n "Starting apcupsd power management: /sbin/apcupsd" - if [ -f ${APCPID} ]; then - return=" Already running." - else -@@ -30,7 +30,7 @@ - stop) - echo -n "Stopping apcupsd power management.." - if [ -f ${APCPID} ]; then -- THEPID=`cat ${APCPID}` -+ THEPID=$(cat ${APCPID}) - kill ${THEPID} || return=" Failed." - rm -f ${APCPID} - else -- cgit v1.2.3