Hello community, here is the log from the commit of package pm-utils for openSUSE:Factory checked in at 2012-03-01 07:25:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/pm-utils (Old) and /work/SRC/openSUSE:Factory/.pm-utils.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Package is "pm-utils", Maintainer is "MVyskocil@suse.com" Changes: -------- --- /work/SRC/openSUSE:Factory/pm-utils/pm-utils.changes 2012-02-16 16:23:03.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.pm-utils.new/pm-utils.changes 2012-03-01 07:26:20.000000000 +0100 @@ -1,0 +2,7 @@ +Tue Feb 28 14:45:13 UTC 2012 - mvyskocil@suse.cz + +- fix script 50rcnetwork error and update savestate/restorestate + functions(bnc#749031). +- obsolete pm-utils-1.4.1-vtXX-upower-battery-AC-adapter.patch already in git + +------------------------------------------------------------------- Old: ---- pm-utils-1.4.1-vtXX-upower-battery-AC-adapter.patch pm-utils-suse-c4a2acedc2a25d61c7a82f050a2d98d2690ed16d.tar.bz2 New: ---- pm-utils-suse-41cb0c42e5f739b73d66f7a5de0d6d4d92b3c375.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ pm-utils.spec ++++++ --- /var/tmp/diff_new_pack.MxKbEt/_old 2012-03-01 07:26:21.000000000 +0100 +++ /var/tmp/diff_new_pack.MxKbEt/_new 2012-03-01 07:26:21.000000000 +0100 @@ -29,7 +29,7 @@ Url: http://pm-utils.freedesktop.org/wiki/ Source0: %{name}-%{version}.tar.bz2 # http://gitorious.org/opensuse/pm-utils-suse -Source1: pm-utils-suse-c4a2acedc2a25d61c7a82f050a2d98d2690ed16d.tar.bz2 +Source1: pm-utils-suse-41cb0c42e5f739b73d66f7a5de0d6d4d92b3c375.tar.bz2 Source2: http://pm-utils.freedesktop.org/releases/pm-quirks-20100316.tar.bz2 #PATCH-FIX-OPENSUSE: fixes a dbus-send call Patch0: pm-utils-1.2.6.1-fix-broken-dbus-send.diff @@ -43,18 +43,17 @@ Patch4: pm-utils-1.3.0-suse-logging.patch #PATCH-FIX-OPENSUSE: export SUSE_IGNORE_FBMODES to workaround bnc#304995 Patch5: pm-utils-1.3.0-suse-directfb-ignore-fbmodes.patch -Patch11: pm-utils-1.4.1-vtXX-upower-battery-AC-adapter.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build PreReq: %insserv_prereq # hooks requires some external tools -Requires: grep -Requires: sed +Requires: coreutils Requires: ethtool Requires: gawk -Requires: coreutils +Requires: grep Requires: module-init-tools +Requires: sed Requires: upower @@ -90,8 +89,6 @@ %patch3 -p1 -b .suse-grub %patch4 -p1 -b .suse-logging %patch5 -p1 -b .directfb-ignore-fbmodes -cd .. -%patch11 -p0 %build %{configure} \ ++++++ pm-utils-suse-c4a2acedc2a25d61c7a82f050a2d98d2690ed16d.tar.bz2 -> pm-utils-suse-41cb0c42e5f739b73d66f7a5de0d6d4d92b3c375.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pm-utils-suse/bin/powersave new/pm-utils-suse/bin/powersave --- old/pm-utils-suse/bin/powersave 2010-09-20 13:36:41.000000000 +0200 +++ new/pm-utils-suse/bin/powersave 2012-02-28 15:43:13.000000000 +0100 @@ -54,7 +54,7 @@ continue fi # type 2 is battery - if upower_device_get_property "${DEVICE}" String:Type 2>/dev/null | grep -q "2$"; then + if upower_device_get_property "${DEVICE}" string:Type 2>/dev/null | grep uint | grep -q "2$"; then echo "${DEVICE}" fi done @@ -63,7 +63,7 @@ # print the ac_adapter found on system # Note: it prints the first match, as it expects only one per machine function upower_find_ac_adapter() { - for DEVICE in $(upower_call_method org.freedesktop.UPower.EnumerateDevices); do + for DEVICE in $(upower_call_method org.freedesktop.UPower.EnumerateDevices | grep -o '/org[A-Za-z0-9/_]*'); do # type 1 is Line Power if upower_device_get_property "${DEVICE}" string:Type 2>/dev/null | grep -q "1$"; then echo "${DEVICE}" @@ -193,20 +193,24 @@ done } +function dbus-getv { + sed -n "s#.*[ \t]*$1[0-9]*[ \t]*##p" +} + function upower_battery_info { C=1 for BATTERY in `upower_enumerate_batteries`; do - SEC=`upower_device_get_property "${BATTERY}" TimeToEmpty` + let SEC="`upower_device_get_property "${BATTERY}" string:TimeToEmpty | dbus-getv int`" if [ $SEC -ne 0 ]; then let MIN=SEC/60 else MIN=0 fi - PERC=`upower_device_get_property "${BATTERY}" Percentage` + PERC=`upower_device_get_property "${BATTERY}" string:Percentage | dbus-getv double` - case `upower_device_get_property "${BATTERY}" State` in + case `upower_device_get_property "${BATTERY}" string:State | dbus-getv uint` in 1) STATE="Charging" ;; 2) STATE="Discharging" ;; 3) STATE="Empty" ;; @@ -217,7 +221,7 @@ esac echo "Battery$C:" - echo -e "\t Remaining percent: $PERC" + echo -e "\t Remaining percent: $PERC%" echo -e "\t Remaining minutes: $MIN" echo -e "\t Charging state: $STATE" @@ -334,7 +338,7 @@ if [ $ret -ne 0 ]; then echo "CPU Frequency scaling not supported" - return ret + return $ret fi case "$governor" in diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pm-utils-suse/hooks/sleep.d/05nfscheck new/pm-utils-suse/hooks/sleep.d/05nfscheck --- old/pm-utils-suse/hooks/sleep.d/05nfscheck 1970-01-01 01:00:00.000000000 +0100 +++ new/pm-utils-suse/hooks/sleep.d/05nfscheck 2012-02-28 15:43:14.000000000 +0100 @@ -0,0 +1,28 @@ +#!/bin/bash +# 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> + +. "${PM_FUNCTIONS}" + + +function checknfsmount() { + [ -n "`mount | grep "type nfs" | grep -v "/proc/fs/nfsd"`" ] +} + +RETVAL=0 +case "$1" in + hibernate|suspend) + if checknfsmount; then + MESSAGE="ERROR: active NFS mount found. Aborting $1 process." + command_exists logger && /bin/logger -t pm-utils -p syslog.err $MESSAGE + inhibit "${MESSAGE}" + RETVAL=1 + fi + ;; + thaw|resume) + ;; + *) exit $NA + ;; +esac +exit $RETVAL diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/pm-utils-suse/hooks/sleep.d/50rcnetwork new/pm-utils-suse/hooks/sleep.d/50rcnetwork --- old/pm-utils-suse/hooks/sleep.d/50rcnetwork 2010-09-20 13:36:41.000000000 +0200 +++ new/pm-utils-suse/hooks/sleep.d/50rcnetwork 2012-02-28 15:43:14.000000000 +0100 @@ -16,21 +16,23 @@ [ -r /etc/sysconfig/network/config ] && . /etc/sysconfig/network/config [ -r /etc/sysconfig/network/scripts/functions ] && . /etc/sysconfig/network/scripts/functions -command_exists dhcp_clients || exit $NA - # NetworkManager is handled by 55NetworkManager, so skip this script if # nm is enabled in sysconfig ... -[ x"${NETWORKMANAGER}" -eq x"yes" ] && exit $NA +[ x"${NETWORKMANAGER}" = x"yes" ] && exit $NA # ... or if is running command_exists nm_running && nm_running && exit $NA +# check network/scripts/function provides dhcp_interfaces() +# function returning a list of interfaces with running dhcp. +command_exists dhcp_interfaces || exit $NA + case "$1" in hibernate|suspend) - save_state "dhcp_clients" "`dhcp_clients`" + savestate "dhcp_interfaces" "`dhcp_interfaces`" service network stop-all-dhcp-clients ;; thaw|resume) - for interface in `restore_state "dhcp_clients"`; do + for interface in `restorestate "dhcp_interfaces"`; do service network restart ${interface} done ;; -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org