[geeqie] Cherry-pick a few commits (from Vladimir Nadvornik, Klaus Ethgen and Vladislav Naumov). With the mod

Michael Schwendt mschwendt at fedoraproject.org
Sun Oct 16 22:54:12 UTC 2011


commit ef3019084e7d965adec221cfd31d58dc8c51b8f5
Author: Michael Schwendt <mschwendt at fedoraproject.org>
Date:   Mon Oct 17 00:54:09 2011 +0200

    Cherry-pick a few commits (from Vladimir Nadvornik, Klaus Ethgen
    and Vladislav Naumov). With the modified filelist_sort_compare_filedata
    method, Geeqie passes another stress test I've created in order
    to track down rare file_data_unref crashes.

 geeqie-1.0-copy-chown.patch       |   49 ++++++++++++++++++++++++++++++++++
 geeqie-1.0-filedata-compare.patch |   53 +++++++++++++++++++++++++++++++++++++
 geeqie-1.0-ui_pathsel.patch       |   44 ++++++++++++++++++++++++++++++
 geeqie.spec                       |   16 ++++++++++-
 4 files changed, 161 insertions(+), 1 deletions(-)
---
diff --git a/geeqie-1.0-copy-chown.patch b/geeqie-1.0-copy-chown.patch
new file mode 100644
index 0000000..9aef27d
--- /dev/null
+++ b/geeqie-1.0-copy-chown.patch
@@ -0,0 +1,49 @@
+From dc8933e3c0ae3e0021d13beb666d6729267c7624 Mon Sep 17 00:00:00 2001
+From: Vladislav Naumov <vnaum at vnaum.com>
+Date: Thu, 16 Dec 2010 21:55:03 +0100
+Subject: [PATCH] Fix bug 2999830: do not report failed chown() on copy.
+
+Debian bug 574853 reported by Ian Zimmerman <itz at buug.org>
+
+I was trying to copy images from my camera which is mounted as a USB
+mass storage device.  The files on the mount are owned by root, and
+geeqie tries to chown (and chgrp) the copy, fails, and displays an
+error message.  This is only mildly annoying when copying a single
+file, but when I want to copy multiple files the failure stops the
+operation after the first file.
+
+Patch by Vladislav Naumov <vnaum at vnaum.com>
+
+This patch ignores chown errors, while still doing chown
+(so root still can copy files preserving ownership).
+
+http://sourceforge.net/tracker/?func=detail&aid=2999830&group_id=222125&atid=1054680
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=574853 (original report)
+---
+ src/ui_fileops.c |   10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/src/ui_fileops.c b/src/ui_fileops.c
+index aa3cc8d..33c6560 100644
+--- a/src/ui_fileops.c
++++ b/src/ui_fileops.c
+@@ -490,8 +490,14 @@ gboolean copy_file_attributes(const gchar *s, const gchar *t, gint perms, gint m
+ 
+ 		/* set the dest file attributes to that of source (ignoring errors) */
+ 
+-		if (perms && chown(tl, st.st_uid, st.st_gid) < 0) ret = FALSE;
+-		if (perms && chmod(tl, st.st_mode) < 0) ret = FALSE;
++		if (perms)
++			{
++			ret = chown(tl, st.st_uid, st.st_gid);
++			/* Ignores chown errors, while still doing chown
++			   (so root still can copy files preserving ownership) */
++			ret = TRUE;
++			if (chmod(tl, st.st_mode) < 0) ret = FALSE;
++			}
+ 
+ 		tb.actime = st.st_atime;
+ 		tb.modtime = st.st_mtime;
+-- 
+1.6.1
+
diff --git a/geeqie-1.0-filedata-compare.patch b/geeqie-1.0-filedata-compare.patch
new file mode 100644
index 0000000..50a1c0f
--- /dev/null
+++ b/geeqie-1.0-filedata-compare.patch
@@ -0,0 +1,53 @@
+From 18d80ca385e38b3bf9bc4ef36264bb4d430aa1f6 Mon Sep 17 00:00:00 2001
+From: Vladimir Nadvornik <nadvornik at suse.cz>
+Date: Fri, 30 Sep 2011 23:57:31 +0200
+Subject: [PATCH] fixed filelist_sort_compare_filedata to not return 0 no different files
+
+---
+ src/filedata.c |   15 ++++++++++++---
+ 1 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/src/filedata.c b/src/filedata.c
+index f6e3896..78fd74e 100644
+--- a/src/filedata.c
++++ b/src/filedata.c
+@@ -852,6 +852,7 @@ static gboolean filelist_sort_ascend = TRUE;
+ 
+ gint filelist_sort_compare_filedata(FileData *fa, FileData *fb)
+ {
++	gint ret;
+ 	if (!filelist_sort_ascend)
+ 		{
+ 		FileData *tmp = fa;
+@@ -875,7 +876,8 @@ gint filelist_sort_compare_filedata(FileData *fa, FileData *fb)
+ 			break;
+ #ifdef HAVE_STRVERSCMP
+ 		case SORT_NUMBER:
+-			return strverscmp(fa->name, fb->name);
++			ret = strverscmp(fa->name, fb->name);
++			if (ret != 0) return ret;
+ 			break;
+ #endif
+ 		default:
+@@ -883,9 +885,16 @@ gint filelist_sort_compare_filedata(FileData *fa, FileData *fb)
+ 		}
+ 
+ 	if (options->file_sort.case_sensitive)
+-		return strcmp(fa->collate_key_name, fb->collate_key_name);
++		ret = strcmp(fa->collate_key_name, fb->collate_key_name);
+ 	else
+-		return strcmp(fa->collate_key_name_nocase, fb->collate_key_name_nocase);
++		ret = strcmp(fa->collate_key_name_nocase, fb->collate_key_name_nocase);
++
++	if (ret != 0) return ret;
++	
++	/* do not return 0 unless the files are really the same 
++	   file_data_pool ensures that original_path is unique 
++	*/
++	return strcmp(fa->original_path, fb->original_path);
+ }
+ 
+ gint filelist_sort_compare_filedata_full(FileData *fa, FileData *fb, SortType method, gboolean ascend)
+-- 
+1.6.1
+
diff --git a/geeqie-1.0-ui_pathsel.patch b/geeqie-1.0-ui_pathsel.patch
new file mode 100644
index 0000000..019ce41
--- /dev/null
+++ b/geeqie-1.0-ui_pathsel.patch
@@ -0,0 +1,44 @@
+From 738ed337ffaa80276901451847fa83f865b1c439 Mon Sep 17 00:00:00 2001
+From: Klaus Ethgen <Klaus at Ethgen.de>
+Date: Sat, 9 Apr 2011 19:47:30 +0100
+Subject: [PATCH] Do not delete path settings when adding new directory
+
+This patch will change the way, geeqie is mangling the path name in the
+rename (copy) dialog when creating new directory. Will fix the bugs
+Debian:529531 and SF:2795791.
+---
+ src/ui_pathsel.c |   11 +++++++++--
+ 1 files changed, 9 insertions(+), 2 deletions(-)
+
+diff --git a/src/ui_pathsel.c b/src/ui_pathsel.c
+index 6b69c05..d58c5ac 100644
+--- a/src/ui_pathsel.c
++++ b/src/ui_pathsel.c
+@@ -740,7 +740,10 @@ static void dest_new_dir_cb(GtkWidget *widget, gpointer data)
+ 	tmp = gtk_entry_get_text(GTK_ENTRY(dd->entry));
+ 	if (!isname(tmp))
+ 		{
+-		path = g_strdup(tmp);
++		buf = remove_trailing_slash(tmp);
++		path = g_strdup(buf);
++		g_free(buf);
++		buf = remove_level_from_path(path);
+ 		from_text = TRUE;
+ 		}
+ 	else
+@@ -765,7 +768,11 @@ static void dest_new_dir_cb(GtkWidget *widget, gpointer data)
+ 		GtkListStore *store;
+ 		const gchar *text;
+ 
+-		if (from_text) gtk_entry_set_text(GTK_ENTRY(dd->entry), dd->path);
++		if (from_text)
++			{
++			dest_populate(dd, buf);
++			g_free(buf);
++			}
+ 
+ 		store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(dd->d_view)));
+ 
+-- 
+1.6.1
+
diff --git a/geeqie.spec b/geeqie.spec
index a451a55..537e294 100644
--- a/geeqie.spec
+++ b/geeqie.spec
@@ -3,7 +3,7 @@
 Summary: Image browser and viewer
 Name: geeqie
 Version: 1.0
-Release: 12%{?dist}
+Release: 13%{?dist}
 License: GPLv3
 Group: User Interface/X
 # svn + autogen
@@ -22,6 +22,11 @@ Patch2: geeqie-1.0-sidecars-case.patch
 Patch3: geeqie-1.0-vflist-refresh.patch
 # bz 728802
 Patch4: geeqie-1.0-exif-728802.patch
+# nadvornik master tree
+Patch5: geeqie-1.0-filedata-compare.patch
+# upstream stable tree
+Patch6: geeqie-1.0-copy-chown.patch
+Patch7: geeqie-1.0-ui_pathsel.patch
 
 BuildRequires: gtk2-devel
 BuildRequires: lcms-devel
@@ -64,6 +69,9 @@ done
 %patch2 -p1 -b .sidecars-case
 %patch3 -p1 -b .vflist-refresh
 %patch4 -p1 -b .exif-728802
+%patch5 -p1 -b .filedata-compare
+%patch6 -p1 -b .copy-chown
+%patch7 -p1 -b .ui_pathsel
 
 
 %build
@@ -112,6 +120,12 @@ update-desktop-database &> /dev/null || :
 
 
 %changelog
+* Sun Oct 16 2011 Michael Schwendt <mschwendt at fedoraproject.org> - 1.0-13
+- Cherry-pick a few commits (from Vladimir Nadvornik, Klaus Ethgen
+  and Vladislav Naumov). With the modified filelist_sort_compare_filedata
+  method, Geeqie passes another stress test I've created in order
+  to track down rare file_data_unref crashes.
+
 * Fri Oct 14 2011 Rex Dieter <rdieter at fedoraproject.org> - 1.0-12
 - rebuild (exiv2)
 


More information about the scm-commits mailing list