rpms/wallpapoz/F-11 wallpapoz-0.4.1-rev92-compiz-respawn.patch, 1.4, 1.5 wallpapoz-0.4.1-rev92-kill-daemon-without-x.patch, 1.1, 1.2 wallpapoz.spec, 1.30, 1.31

Mamoru Tasaka mtasaka at fedoraproject.org
Sun Feb 28 17:59:31 UTC 2010


Author: mtasaka

Update of /cvs/extras/rpms/wallpapoz/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10461/F-11

Modified Files:
	wallpapoz-0.4.1-rev92-compiz-respawn.patch 
	wallpapoz-0.4.1-rev92-kill-daemon-without-x.patch 
	wallpapoz.spec 
Log Message:
* Mon Mar  1 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-18.svn92_trunk
- -compiz-respawn.patch: simplify
- Handle more cases where X is no longer available (bug 569135)
- Handle fork() failure (bug 566594)


wallpapoz-0.4.1-rev92-compiz-respawn.patch:
 share/wallpapoz/lib/wallpapoz_system.py |   29 +++++++++++++++++++++++++++--
 src/daemon_wallpapoz                    |   11 ++++++++++-
 2 files changed, 37 insertions(+), 3 deletions(-)

Index: wallpapoz-0.4.1-rev92-compiz-respawn.patch
===================================================================
RCS file: /cvs/extras/rpms/wallpapoz/F-11/wallpapoz-0.4.1-rev92-compiz-respawn.patch,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -p -r1.4 -r1.5
--- wallpapoz-0.4.1-rev92-compiz-respawn.patch	25 Feb 2010 19:57:10 -0000	1.4
+++ wallpapoz-0.4.1-rev92-compiz-respawn.patch	28 Feb 2010 17:59:31 -0000	1.5
@@ -1,6 +1,6 @@
 --- wallpapoz-0.4.1-svn92_trunk/share/wallpapoz/lib/wallpapoz_system.py.compiz	2009-08-30 01:22:07.000000000 +0900
-+++ wallpapoz-0.4.1-svn92_trunk/share/wallpapoz/lib/wallpapoz_system.py	2010-02-26 04:44:33.000000000 +0900
-@@ -25,14 +25,28 @@
++++ wallpapoz-0.4.1-svn92_trunk/share/wallpapoz/lib/wallpapoz_system.py	2010-03-01 02:28:48.000000000 +0900
+@@ -25,14 +25,26 @@
  # achieve goal by calling external program
  
  import os
@@ -23,25 +23,29 @@
 +    if not WallpapozSystem.static_check_beryl_called_p :
 +      WallpapozSystem.static_check_beryl_called_p = True
 +      WallpapozSystem.static_beryl = self.beryl
-+    if self.beryl != WallpapozSystem.static_beryl :
-+      self.respawn_system()
 +
      if self.beryl:
        self.finding_row_and_column()
      self.finding_total_workspaces()
-@@ -73,6 +87,11 @@
-     if self.geometry_height!=self.screen_height:
+@@ -69,10 +81,15 @@
+     self.beryl = False
+     if self.geometry_width!=self.screen_width:
+       self.beryl = True
+-      return
+-    if self.geometry_height!=self.screen_height:
++    elif self.geometry_height!=self.screen_height:
        self.beryl = True
  
-+  def beryl_status(self, update = False):
-+    if update:
-+      self.check_beryl()
-+    return self.beryl
++    # respawn daemon if self.beryl value changed
++    if WallpapozSystem.static_check_beryl_called_p:
++      if WallpapozSystem.static_beryl != self.beryl:
++        print "Compiz status changed, respawning daemon_wallpapoz."
++        self.respawn_system()
 +
    ## class method to find how many rows and columns of workspaces
    def finding_row_and_column(self):
      self.row_workspaces = self.geometry_height / self.screen_height
-@@ -113,3 +132,11 @@
+@@ -113,3 +130,11 @@
        return True
      else:
        return False
@@ -54,33 +58,18 @@
 +    sys.exit(1)
 +    return
 --- wallpapoz-0.4.1-svn92_trunk/src/daemon_wallpapoz.compiz	2009-08-30 01:22:07.000000000 +0900
-+++ wallpapoz-0.4.1-svn92_trunk/src/daemon_wallpapoz	2010-02-26 04:44:12.000000000 +0900
-@@ -107,6 +107,9 @@
-   delay = 60 * float(wallpapozxml.delay())
-   randomvar = int(wallpapozxml.is_random())
- 
-+  # get current compiz status
-+  previous_beryl_status = wallpapoz_system.beryl_status() 
-+
-   # how many workspace we use
-   if conf_type == "workspace":
-     # cleansing
-@@ -134,11 +137,25 @@
++++ wallpapoz-0.4.1-svn92_trunk/src/daemon_wallpapoz	2010-03-01 02:30:43.000000000 +0900
+@@ -134,11 +134,20 @@
      if wallpapozxml.get_type() == "workspace":
        while True:
  	# don't get rush
 -	time.sleep(1)
-+        # sleep a bit more
++       # sleep a bit more
 +	time.sleep(2)
 +
-+        # check if compiz is working every loop
-+        cur_beryl_status = wallpapoz_system.beryl_status(update = True)
-+        if previous_beryl_status != cur_beryl_status:
-+          # compiz status changed, respawn daemon_wallpapoz
-+          print "Compiz status changed, respawning daemon_wallpapoz."
-+          wallpapoz_system.respawn_system()
-+
-+        previous_beryl_status = cur_beryl_status
++	# check if compiz is working every loop (and
++	# if compiz status changed, respawn daemon)
++	wallpapoz_system.check_beryl()
  
  	# what workspace we are in now?
  	cur_desk = wallpapoz_system.current_desktop()

wallpapoz-0.4.1-rev92-kill-daemon-without-x.patch:
 wallpapoz_system.py |   47 ++++++++++++++++++++++++++++++++++++++++++-----
 1 file changed, 42 insertions(+), 5 deletions(-)

Index: wallpapoz-0.4.1-rev92-kill-daemon-without-x.patch
===================================================================
RCS file: /cvs/extras/rpms/wallpapoz/F-11/wallpapoz-0.4.1-rev92-kill-daemon-without-x.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- wallpapoz-0.4.1-rev92-kill-daemon-without-x.patch	8 Feb 2010 18:32:02 -0000	1.1
+++ wallpapoz-0.4.1-rev92-kill-daemon-without-x.patch	28 Feb 2010 17:59:31 -0000	1.2
@@ -1,5 +1,5 @@
---- wallpapoz-0.4.1-svn92_trunk/share/wallpapoz/lib/wallpapoz_system.py.kill_nox	2010-02-09 03:05:24.000000000 +0900
-+++ wallpapoz-0.4.1-svn92_trunk/share/wallpapoz/lib/wallpapoz_system.py	2010-02-09 03:07:00.000000000 +0900
+--- wallpapoz-0.4.1-svn92_trunk/share/wallpapoz/lib/wallpapoz_system.py.kill_nox	2010-03-01 02:24:19.000000000 +0900
++++ wallpapoz-0.4.1-svn92_trunk/share/wallpapoz/lib/wallpapoz_system.py	2010-03-01 02:25:20.000000000 +0900
 @@ -24,9 +24,11 @@
  ## wallpapoz_system.py -- finds current desktop and changes wallpaper
  # achieve goal by calling external program
@@ -12,29 +12,42 @@
  
  class WallpapozSystem:
  
-@@ -38,12 +40,34 @@
+@@ -49,12 +51,47 @@
        self.finding_row_and_column()
      self.finding_total_workspaces()
  
-+  def exec_cmd(self, cmd):
-+    p = subprocess.Popen(
-+      cmd,
-+      stdout = subprocess.PIPE,
-+      stderr = subprocess.PIPE,
-+      shell = True
-+      )
++  def exec_cmd_under_X(self, cmd):
++    try:
++      p = subprocess.Popen(
++        cmd,
++        stdout = subprocess.PIPE,
++        stderr = subprocess.PIPE,
++        shell = True
++        )
++    except OSError:
++      print "Fork failed for %s, exiting." %cmd
++      sys.exit(1)
 +
 +    pstdout = p.stdout.read()
 +    pstderr = p.stderr.read()
 +    ret = p.wait()
 +
-+    if ( ret != 0 ) and ( ret & 0xFF ):
-+      err_str = 'unable to open display'
++    kill_daemon = False
 +
-+      if pstderr.find(err_str) >= 0:
++    if (ret != 0) and (ret & 0xFF):
++      if pstderr.find('unable to open display') >= 0:
++        kill_daemon = True
++      if ((cmd.find('xwininfo') >= 0) and 
++        (pstderr.find("Can't get window attributes") >= 0)):
++        kill_daemon = True
++
++    if (cmd.find('xprop') >= 0) and (pstdout.find('no such atom') >= 0):
++        kill_daemon = True
++
++    if kill_daemon:
 +        ## No X resource available, kill daemon_wallpapoz
-+        cpid = os.getpid()
-+        os.kill (cpid, signal.SIGTERM)
++        print "X resource seems no longer available, killing daemon_wallpapoz."
++        sys.exit(1)
 +
 +    return pstdout
 +
@@ -44,39 +57,39 @@
    ## class method to find monitor resolution
    def finding_screen_resolution(self):
 -    raw_resolution = os.popen('xwininfo -root').read()
-+    raw_resolution = self.exec_cmd('xwininfo -root')
++    raw_resolution = self.exec_cmd_under_X('xwininfo -root')
      start_width = raw_resolution.find('Width')
      end_width = raw_resolution.find('\n',start_width)
      start_height = raw_resolution.find('Height')
-@@ -56,11 +80,11 @@
+@@ -67,11 +104,11 @@
      if self.beryl:
        self.total_workspaces = self.row_workspaces * self.column_workspaces
      else:
 -      self.total_workspaces = int(os.popen("xprop -root _NET_NUMBER_OF_DESKTOPS").read()[36:38])
-+      self.total_workspaces = int(self.exec_cmd("xprop -root _NET_NUMBER_OF_DESKTOPS")[36:38])
++      self.total_workspaces = int(self.exec_cmd_under_X("xprop -root _NET_NUMBER_OF_DESKTOPS")[36:38])
  
    ## class method to find if user use beryl in his system or not
    def check_beryl(self):
 -    raw_geometry = os.popen('xprop -root _NET_DESKTOP_GEOMETRY').read()
-+    raw_geometry = self.exec_cmd('xprop -root _NET_DESKTOP_GEOMETRY')
++    raw_geometry = self.exec_cmd_under_X('xprop -root _NET_DESKTOP_GEOMETRY')
      # output of xprop -root _NET_DESKTOP_GEOMETRY is '_NET_DESKTOP_GEOMETRY(CARDINAL) = 1024, 768\n'
      # and we just need the '1024, 768' part
      raw_geometry = raw_geometry[34:raw_geometry.find('\n')]
-@@ -90,7 +114,7 @@
+@@ -102,7 +139,7 @@
    ## class method to know what workspace we are in now
    def current_desktop(self):
      if self.beryl:
 -      raw_viewport = os.popen('xprop -root _NET_DESKTOP_VIEWPORT').read()
-+      raw_viewport = self.exec_cmd('xprop -root _NET_DESKTOP_VIEWPORT')
++      raw_viewport = self.exec_cmd_under_X('xprop -root _NET_DESKTOP_VIEWPORT')
        # output of xprop -root _NET_DESKTOP_VIEWPORT is '_NET_DESKTOP_VIEWPORT(CARDINAL) = 1024, 768\n'
        # and we just need the '1024, 768' part
        raw_viewport = raw_viewport[34:raw_viewport.find('\n')]
-@@ -99,7 +123,7 @@
+@@ -111,7 +148,7 @@
        y_pos = int(viewport[1]) / self.screen_height
        workspace = x_pos + self.column_workspaces * y_pos
      else:
 -      raw_workspace = os.popen('xprop -root _NET_CURRENT_DESKTOP').read()
-+      raw_workspace = self.exec_cmd('xprop -root _NET_CURRENT_DESKTOP')
++      raw_workspace = self.exec_cmd_under_X('xprop -root _NET_CURRENT_DESKTOP')
        workspace = int(raw_workspace[33] + raw_workspace[34])
      return workspace
  


Index: wallpapoz.spec
===================================================================
RCS file: /cvs/extras/rpms/wallpapoz/F-11/wallpapoz.spec,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -p -r1.30 -r1.31
--- wallpapoz.spec	25 Feb 2010 19:57:10 -0000	1.30
+++ wallpapoz.spec	28 Feb 2010 17:59:31 -0000	1.31
@@ -8,7 +8,7 @@
 %define         mainver         0.4.1
 %undefine         betaver
 %define         svnver          svn92_trunk
-%define         fedorarel       17
+%define         fedorarel       18
 
 %define         rel             %{?betaver:0.}%{fedorarel}%{?svnver:.%svnver}%{?betaver:.%betaver}
 
@@ -25,7 +25,7 @@ Source0:        %{srcurl}files/%{name}-%
 Source11:       wallpapoz-autostart.desktop
 %endif
 # Misc fixes for daemon_wallpapoz under compiz working,
-# containing fix for bug 531342, 542244
+# containing fix for bug 531342, 542244, bug 567437
 Patch0:         wallpapoz-0.4.1-rev92-compiz-respawn.patch
 # Check if selected item is really a directory when adding directory
 # bug 549219
@@ -35,7 +35,8 @@ Patch3:         wallpapoz-0.4.1-rev92-no
 # Intialization for pasting selected items
 Patch4:         wallpapoz-0.4.1-rev92-paste-initialization.patch
 # Kill daemon_wallpapoz when X resource is no longer available
-# bug 531343, 538533, 541434, 556377
+# bug 531343, 538533, 541434, 556377, 569135
+# (and bug 566594)
 Patch5:         wallpapoz-0.4.1-rev92-kill-daemon-without-x.patch
 # Kill other daemon_wallpapoz if running
 Patch6:         wallpapoz-0.4.1-rev92-kill-multiple-daemon.patch
@@ -122,6 +123,11 @@ desktop-file-install \
 %{_datadir}/applications/fedora-%{name}.desktop
 
 %changelog
+* Mon Mar  1 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-18.svn92_trunk
+- -compiz-respawn.patch: simplify
+- Handle more cases where X is no longer available (bug 569135)
+- Handle fork() failure (bug 566594)
+
 * Fri Feb 26 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-17.svn92_trunk
 - Another try for race condition on checking compiz status
   (bug 567437)



More information about the scm-commits mailing list