rpms/wallpapoz/devel wallpapoz-0.4.1-rev92-dircheck.patch, NONE, 1.1 wallpapoz.spec, 1.27, 1.28

Mamoru Tasaka mtasaka at fedoraproject.org
Sun Feb 7 17:55:44 UTC 2010


Author: mtasaka

Update of /cvs/extras/rpms/wallpapoz/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv14150/devel

Modified Files:
	wallpapoz.spec 
Added Files:
	wallpapoz-0.4.1-rev92-dircheck.patch 
Log Message:
* Mon Feb  8 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-13.svn92_trunk
- Check if the selected item is really a directory on directory
  chooser dialog (bug 549219)


wallpapoz-0.4.1-rev92-dircheck.patch:
 wallpapoz |   33 +++++++++++++++++++++++++++++----
 1 file changed, 29 insertions(+), 4 deletions(-)

--- NEW FILE wallpapoz-0.4.1-rev92-dircheck.patch ---
--- wallpapoz-0.4.1-svn92_trunk/src/wallpapoz.dircheck	2010-02-08 02:25:38.000000000 +0900
+++ wallpapoz-0.4.1-svn92_trunk/src/wallpapoz	2010-02-08 02:16:08.000000000 +0900
@@ -538,6 +538,9 @@
         # if recursive, we use walktree
 	if recursive_widget.get_active():
 	  # looping with walktree method
+          if not os.path.isdir(cur_dir):
+            return
+
 	  for (basepath, children) in self.walktree(cur_dir,False):
 	    for child in children:
 	      # get the filename
@@ -553,7 +556,11 @@
         # if not just looping the directory with ordinary fashion
 	else:
 	  # looping all files in this directory
-	  for file in os.listdir(cur_dir):
+          try:
+            dlist = os.listdir(cur_dir)
+          except OSError:
+            return
+	  for file in dlist:
 	    # get the filename
 	    filename = os.path.join(cur_dir, file)
 	    # we interested in file, not directory
@@ -575,6 +582,9 @@
         # if recursive, we use walktree
 	if recursive_widget.get_active():
 	  # looping with walktree method
+          if not os.path.isdir(cur_dir):
+            return
+
 	  for (basepath, children) in self.walktree(cur_dir,False):
 	    for child in children:
 	      # get the filename
@@ -590,7 +600,11 @@
         # if not, just looping with ordinary fashion
         else:
 	  # looping all files in this directory
-	  for file in os.listdir(cur_dir):
+          try:
+            ddir = os.listdir(cur_dir)
+          except OSError:
+            return
+	  for file in ddir:
 	    # get the filename
 	    filename = os.path.join(cur_dir, file)
 	    # we interested in file, not directory
@@ -620,6 +634,9 @@
       cur_dir = filechooser_widget.get_filename()
       # if recursive, we use walktree
       if recursive_widget.get_active():
+        if not os.path.isdir(cur_dir):
+          return
+
 	# looping with walktree method
 	for (basepath, children) in self.walktree(cur_dir,False):
 	  for child in children:
@@ -636,7 +653,11 @@
       # if not recursive, just looping the directory with ordinary fashion
       else:
 	# looping all files in this directory
-	for file in os.listdir(cur_dir):
+        try:
+          dlist = os.listdir(cur_dir)
+        except OSError:
+          return
+	for file in dlist:
 	  # get the filename
 	  filename = os.path.join(cur_dir, file)
 	  # we interested in file, not directory
@@ -1219,7 +1240,11 @@
 
   # helping method
   def walktree (self, top = ".", depthfirst = True):
-    names = os.listdir(top)
+    try:
+      names = os.listdir(top)
+    except OSError:
+      names = []
+      yield top, names
     if not depthfirst:
       yield top, names
     for name in names:


Index: wallpapoz.spec
===================================================================
RCS file: /cvs/extras/rpms/wallpapoz/devel/wallpapoz.spec,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -p -r1.27 -r1.28
--- wallpapoz.spec	3 Feb 2010 20:06:07 -0000	1.27
+++ wallpapoz.spec	7 Feb 2010 17:55:44 -0000	1.28
@@ -8,7 +8,7 @@
 %define         mainver         0.4.1
 %undefine         betaver
 %define         svnver          svn92_trunk
-%define         fedorarel       12
+%define         fedorarel       13
 
 %define         rel             %{?betaver:0.}%{fedorarel}%{?svnver:.%svnver}%{?betaver:.%betaver}
 
@@ -29,6 +29,7 @@ Source12:       kill-daemon_wallpapoz
 Source13:       command-wrapper.sh
 Patch0:         wallpapoz-0.4.1-rev92-compiz-respawn.patch
 Patch1:         wallpapoz-0.4.1-rev92-path-fedora.patch
+Patch2:         wallpapoz-0.4.1-rev92-dircheck.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildArch:      noarch
@@ -62,6 +63,7 @@ wallpapers for different workspaces or v
 %setup -q -n %{name}-%{version}%{?svnver:-%svnver}
 %patch0 -p1 -b .compiz
 %patch1 -p1 -b .path
+%patch2 -p1 -b .dircheck
 
 %build
 
@@ -127,6 +129,10 @@ desktop-file-install \
 %{_datadir}/applications/fedora-%{name}.desktop
 
 %changelog
+* Mon Feb  8 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-13.svn92_trunk
+- Check if the selected item is really a directory on directory
+  chooser dialog (bug 549219)
+
 * Thu Feb  4 2010 Mamoru Tasaka <mtasaka at ioa.s.u-tokyo.ac.jp> - 0.4.1-12.svn92_trunk
 - Some fixes for daemon_wallpapoz under compiz
   (bug 531342, 542244)



More information about the scm-commits mailing list