File pm-utils-fix-bashisms.patch of Package pm-utils

diff -Ndur pm-utils/pm/sleep.d/02rtcwake pm-utils-fix-bashisms/pm/sleep.d/02rtcwake
--- pm-utils/pm/sleep.d/02rtcwake	2013-10-24 17:28:13.000000000 +0300
+++ pm-utils-fix-bashisms/pm/sleep.d/02rtcwake	2014-11-29 03:39:14.481291580 +0200
@@ -18,19 +18,19 @@
 
 rtcwake_config_file="/etc/pm/config.d/rtcwake.config"
 
-function start_of_day {
+start_of_day() {
 	echo `date -d "$1" "+%D"`
 }
 
-function since_epoch {
+since_epoch() {
 	echo `date -d "$1" "+%s"`
 }
 
-function day_of_week {
+day_of_week() {
 	echo `date -d "$1" "+%u"`
 }
 
-function isAlarmDow {
+isAlarmDow() {
 	is=0
 	for dow in $RTCWAKE_DAYS; do
 		if test "x$dow" = "x$1"; then
@@ -41,7 +41,7 @@
 	echo $is
 }
 
-function set_alarm
+set_alarm()
 {
 	# If USER_RTCWAKE_ALLOWED is yes and the user passed in a num_seconds_to_sleep variable, then
 	# we will respect it (and ignore the system config)
diff -Ndur pm-utils/pm/sleep.d/05nfscheck pm-utils-fix-bashisms/pm/sleep.d/05nfscheck
--- pm-utils/pm/sleep.d/05nfscheck	2013-10-24 17:28:13.000000000 +0300
+++ pm-utils-fix-bashisms/pm/sleep.d/05nfscheck	2014-11-29 03:40:01.152288422 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # Abort the hibernation process of there are NFS mounts
 # https://bugzilla.novell.com/show_bug.cgi?id=568132
 # Author Carlos Robinson <carlos.e.r@opensuse.org>
@@ -6,7 +6,7 @@
 . "${PM_FUNCTIONS}"
 
 
-function checknfsmount() {
+checknfsmount() {
     [ -n "`mount | grep "type nfs" | grep -v "/proc/fs/nfsd"`" ]
 }
 
diff -Ndur pm-utils/pm/sleep.d/06autofs pm-utils-fix-bashisms/pm/sleep.d/06autofs
--- pm-utils/pm/sleep.d/06autofs	2013-10-24 17:28:13.000000000 +0300
+++ pm-utils-fix-bashisms/pm/sleep.d/06autofs	2014-11-29 03:40:12.300287668 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 . "${PM_FUNCTIONS}"
 
diff -Ndur pm-utils/pm/sleep.d/30s2disk-check pm-utils-fix-bashisms/pm/sleep.d/30s2disk-check
--- pm-utils/pm/sleep.d/30s2disk-check	2013-10-24 17:28:13.000000000 +0300
+++ pm-utils-fix-bashisms/pm/sleep.d/30s2disk-check	2014-11-29 03:41:14.318283473 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Stefan Seyfried, SUSE Linux Products GmbH, 2006
 # mostly taken from the powersave project
@@ -47,9 +47,9 @@
 		fi
 		[ "$TYPE" != "partition" ] && continue
 		[ "$DEV" != "$RESUME" ] && continue
-		FREE=$[($SIZE-$USED)*1024]  # get free space on DEV
+		FREE=$((($SIZE - $USED) * 1024))  # get free space on DEV
 		if [ $FREE -lt $IMAGE_SIZE ]; then
-			IMAGE_SIZE=$[$FREE-10*1024*1024]
+			IMAGE_SIZE=$(($FREE - 10 * 1024 * 1024))
 		fi
                 OK=1
 		break   # we found the partition, no need to look further
diff -Ndur pm-utils/pm/sleep.d/45pcmcia pm-utils-fix-bashisms/pm/sleep.d/45pcmcia
--- pm-utils/pm/sleep.d/45pcmcia	2013-10-24 17:28:13.000000000 +0300
+++ pm-utils-fix-bashisms/pm/sleep.d/45pcmcia	2014-11-29 03:41:29.081282474 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 . "${PM_FUNCTIONS}"
 
diff -Ndur pm-utils/pm/sleep.d/50rcnetwork pm-utils-fix-bashisms/pm/sleep.d/50rcnetwork
--- pm-utils/pm/sleep.d/50rcnetwork	2013-10-24 17:28:13.000000000 +0300
+++ pm-utils-fix-bashisms/pm/sleep.d/50rcnetwork	2014-11-29 03:41:45.449281367 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Prevent lease timing out for networks controlled by ifup/ifdown
 # bnc#603291
diff -Ndur pm-utils/pm/sleep.d/75ndiswrapper pm-utils-fix-bashisms/pm/sleep.d/75ndiswrapper
--- pm-utils/pm/sleep.d/75ndiswrapper	2013-10-24 17:28:13.000000000 +0300
+++ pm-utils-fix-bashisms/pm/sleep.d/75ndiswrapper	2014-11-29 03:42:00.130280373 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 # The ndiswrapper hook - relead the ndiswrapper module
 # TODO: use module_reload from PM_FUNCTIONS
 
diff -Ndur pm-utils/pm/sleep.d/80videobios pm-utils-fix-bashisms/pm/sleep.d/80videobios
--- pm-utils/pm/sleep.d/80videobios	2013-10-24 17:28:13.000000000 +0300
+++ pm-utils-fix-bashisms/pm/sleep.d/80videobios	2014-11-29 03:42:59.517276356 +0200
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 #
 # Stefan Seyfried, SUSE Linux Products GmbH, 2006
 # mostly taken from the powersave project
@@ -8,7 +8,7 @@
 #############################################################################
 # if the system is configured for 855resolution, we first patch the BIOS
 # to avoid that the X server crashes after switching back to X
-patch-bios()
+patch_bios()
 {
 	if [ -e /etc/sysconfig/videobios ]; then
 		. /etc/sysconfig/videobios
@@ -22,11 +22,11 @@
 
 case $1 in
 	thaw)
-		patch-bios
+		patch_bios
 		;;
 	resume)
 		if [ "$2" = suspend_hybrid ]; then
-			patch-bios
+			patch_bios
 		fi
 		;;
         *) exit $NA
openSUSE Build Service is sponsored by