Hello community,

here is the log from the commit of package pm-utils for 
openSUSE:12.1:Update:Test checked in at 2012-03-05 14:14:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.1:Update:Test/pm-utils (Old)
 and      /work/SRC/openSUSE:12.1:Update:Test/.pm-utils.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pm-utils", Maintainer is "[email protected]"

Changes:
--------
--- /work/SRC/openSUSE:12.1:Update:Test/pm-utils/pm-utils.changes       
2012-02-13 16:11:45.000000000 +0100
+++ /work/SRC/openSUSE:12.1:Update:Test/.pm-utils.new/pm-utils.changes  
2012-03-05 14:14:12.000000000 +0100
@@ -1,0 +2,8 @@
+Tue Feb 28 03:57:13 UTC 2012 - [email protected]
+
+- Add pm-utils-dhcp-interfaces.patch, fix script 50rcnetwork error
+  and update savestate/restorestate functions.
+- Format pm-utils-1.4.1-vtXX-upower-battery-AC-adapter.patch to
+  standard, use pushd/popd in spec(bnc#749031,swampid#45819).
+
+-------------------------------------------------------------------

New:
----
  pm-utils-dhcp-interfaces.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pm-utils.spec ++++++
--- /var/tmp/diff_new_pack.uZimvL/_old  2012-03-05 14:14:12.000000000 +0100
+++ /var/tmp/diff_new_pack.uZimvL/_new  2012-03-05 14:14:12.000000000 +0100
@@ -47,6 +47,8 @@
 Patch5:         pm-utils-1.3.0-suse-directfb-ignore-fbmodes.patch
 #PATCH-FIX-OPENSUSE: Update NetworkManager's Sleep method bnc#735837
 Patch6:         pm-utils-1.4.1-networkmanager.patch
+#PATCH-FIX-OPENSUSE: Fix 50rcnetwork  bnc#749031
+Patch10:        pm-utils-dhcp-interfaces.patch
 Patch11:        pm-utils-1.4.1-vtXX-upower-battery-AC-adapter.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
@@ -96,8 +98,10 @@
 %patch4 -p1 -b .suse-logging
 %patch5 -p1 -b .directfb-ignore-fbmodes
 %patch6 -p1 -b .networkmanager
-cd ..
-%patch11 -p0
+pushd ../pm-utils-suse
+%patch10 -p2
+%patch11 -p1
+popd
 
 %build
 %{configure} \

++++++ pm-utils-1.4.1-vtXX-upower-battery-AC-adapter.patch ++++++
--- /var/tmp/diff_new_pack.uZimvL/_old  2012-03-05 14:14:12.000000000 +0100
+++ /var/tmp/diff_new_pack.uZimvL/_new  2012-03-05 14:14:12.000000000 +0100
@@ -1,100 +1,59 @@
-*** pm-utils-suse/bin/powersave        2011-03-01 21:18:38.351062624 +0100
-*** pm-utils-suse/bin/powersave        2011-03-01 21:25:43.213064195 +0100
-***************
-*** 54,60 ****
-              continue
-          fi
-          # type 2 is battery
-!         if upower_device_get_property "${DEVICE}" String:Type 2>/dev/null | 
grep -q "2$"; then
-              echo "${DEVICE}"
-          fi
-      done
---- 54,60 ----
-              continue
-          fi
-          # type 2 is battery
-!         if upower_device_get_property "${DEVICE}" string:Type 2>/dev/null | 
grep uint | grep -q "2$"; then
-              echo "${DEVICE}"
-          fi
-      done
-***************
-*** 63,69 ****
-  # 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
-          # type 1 is Line Power
-          if upower_device_get_property "${DEVICE}" string:Type 2>/dev/null | 
grep -q "1$"; then
-              echo "${DEVICE}"
---- 63,69 ----
-  # 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 | 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,212 ****
-      done
-  }
-  
-  function upower_battery_info {
-      C=1
-      for BATTERY in `upower_enumerate_batteries`; do
-  
-!         SEC=`upower_device_get_property "${BATTERY}" TimeToEmpty`
-          if [ $SEC -ne 0 ]; then
-              let MIN=SEC/60
-          else
-              MIN=0
-          fi
-  
-!      PERC=`upower_device_get_property "${BATTERY}" Percentage`
-  
-!         case `upower_device_get_property "${BATTERY}" State` in
-              1) STATE="Charging" ;;
-              2) STATE="Discharging" ;;
-              3) STATE="Empty" ;;
---- 193,216 ----
-      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
-  
-!         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}" string:Percentage | 
dbus-getv double`
-  
-!         case `upower_device_get_property "${BATTERY}" string:State | 
dbus-getv uint` in
-              1) STATE="Charging" ;;
-              2) STATE="Discharging" ;;
-              3) STATE="Empty" ;;
-***************
-*** 217,223 ****
-          esac
-  
-       echo "Battery$C:"
-!      echo -e "\t Remaining percent: $PERC"
-       echo -e "\t Remaining minutes: $MIN"
-       echo -e "\t Charging state: $STATE"
-  
---- 221,227 ----
-          esac
-  
-       echo "Battery$C:"
-!      echo -e "\t Remaining percent: $PERC%"
-       echo -e "\t Remaining minutes: $MIN"
-       echo -e "\t Charging state: $STATE"
-  
+Index: pm-utils-suse/bin/powersave
+===================================================================
+--- pm-utils-suse.orig/bin/powersave
++++ pm-utils-suse/bin/powersave
+@@ -54,7 +54,7 @@ function upower_enumerate_batteries() {
+             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 @@ function upower_enumerate_batteries() {
+ # 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 @@ function hal_battery_info {
+     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 @@ function upower_battery_info {
+         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"
+ 

++++++ pm-utils-dhcp-interfaces.patch ++++++
Index: pm-utils/pm-utils-suse/hooks/sleep.d/50rcnetwork
===================================================================
--- pm-utils.orig/pm-utils-suse/hooks/sleep.d/50rcnetwork
+++ pm-utils/pm-utils-suse/hooks/sleep.d/50rcnetwork
@@ -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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to