[Pkg-cli-apps-commits] r3787 - in /packages/f-spot/trunk/debian: changelog patches/00list patches/fix_deleting_1000_photos.dpatch

diocles-guest at users.alioth.debian.org diocles-guest at users.alioth.debian.org
Sun Mar 9 03:19:03 UTC 2008


Author: diocles-guest
Date: Sun Mar  9 03:19:03 2008
New Revision: 3787

URL: http://svn.debian.org/wsvn/pkg-cli-apps/?sc=1&rev=3787
Log:
Fix deleting >1000 photos at once. (Closes: #462798)

Added:
    packages/f-spot/trunk/debian/patches/fix_deleting_1000_photos.dpatch   (with props)
Modified:
    packages/f-spot/trunk/debian/changelog
    packages/f-spot/trunk/debian/patches/00list

Modified: packages/f-spot/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-cli-apps/packages/f-spot/trunk/debian/changelog?rev=3787&op=diff
==============================================================================
--- packages/f-spot/trunk/debian/changelog (original)
+++ packages/f-spot/trunk/debian/changelog Sun Mar  9 03:19:03 2008
@@ -11,14 +11,21 @@
     + Update patches for bitrot:
       - debian/patches/unlink_nunit.dpatch
       - debian/patches/link_system_libs.dpatch
-  * debian/patches/01_build-system.dpatch,
-    debian/patches/10_cs-changes.dpatch: Delete unused patches.
-  * debian/patches/fix_bashisms.dpatch: Ensure f-spot-sqlite-upgrade will
-    run correctly under shells other than bash. (Closes: #464652)
-  * debian/patches/98_autoreconf.dpatch: Move all automake changes from
-    other patches into single patch, for easier maintenance.
-
- -- Tim Retout <tim at retout.co.uk>  Sun, 09 Mar 2008 02:59:58 +0000
+  * Delete unused patches:
+    + debian/patches/01_build-system.dpatch
+    + debian/patches/10_cs-changes.dpatch
+  * New patches:
+    + debian/patches/fix_bashisms.dpatch:
+      - Ensure f-spot-sqlite-upgrade will run correctly under shells other
+        than bash. (Closes: #464652)
+    + debian/patches/fix_deleting_1000_photos.dpatch:
+      - Fix from upstream bug tracker for deleting >1000 photos.
+        (Closes: #462798)
+    + debian/patches/98_autoreconf.dpatch:
+      - Move all generated changes from other patches into single patch,
+        for easier maintenance.
+
+ -- Tim Retout <tim at retout.co.uk>  Sun, 09 Mar 2008 03:12:25 +0000
 
 f-spot (0.4.1-4) unstable; urgency=low
 

Modified: packages/f-spot/trunk/debian/patches/00list
URL: http://svn.debian.org/wsvn/pkg-cli-apps/packages/f-spot/trunk/debian/patches/00list?rev=3787&op=diff
==============================================================================
--- packages/f-spot/trunk/debian/patches/00list (original)
+++ packages/f-spot/trunk/debian/patches/00list Sun Mar  9 03:19:03 2008
@@ -6,6 +6,9 @@
 
 # Bugfix for bashisms (#464652)
 fix_bashisms
+
+# Bugfix for deleting >1000 photos (#462798)
+fix_deleting_1000_photos
 
 # Bugfix for build breakage.
 fix_gallery_extension_install_hook

Added: packages/f-spot/trunk/debian/patches/fix_deleting_1000_photos.dpatch
URL: http://svn.debian.org/wsvn/pkg-cli-apps/packages/f-spot/trunk/debian/patches/fix_deleting_1000_photos.dpatch?rev=3787&op=file
==============================================================================
--- packages/f-spot/trunk/debian/patches/fix_deleting_1000_photos.dpatch (added)
+++ packages/f-spot/trunk/debian/patches/fix_deleting_1000_photos.dpatch Sun Mar  9 03:19:03 2008
@@ -1,0 +1,40 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix_deleting_1000_photos.dpatch by Tim Retout <tim at retout.co.uk>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Patch from b.g.o. by Lorenzo Milesi <lorenzo.milesi at yetopen.it>
+## DP: Fixes Debian bug #462798.
+
+ at DPATCH@
+diff -urNad f-spot~/src/PhotoStore.cs f-spot/src/PhotoStore.cs
+--- f-spot~/src/PhotoStore.cs	2008-03-09 02:43:50.000000000 +0000
++++ f-spot/src/PhotoStore.cs	2008-03-09 03:06:16.000000000 +0000
+@@ -389,22 +389,16 @@
+ 	{
+ 		EmitRemoved (items);
+ 
+-		StringBuilder query_builder = new StringBuilder ();
+-		StringBuilder tv_query_builder = new StringBuilder ();
++		ArrayList query_builder = new ArrayList ();
+ 		for (int i = 0; i < items.Length; i++) {
+-			if (i > 0) {
+-				query_builder.Append (" OR ");
+-				tv_query_builder.Append (" OR ");
+-			}
+-
+-			query_builder.Append (String.Format ("id = {0}", items[i].Id));
+-			tv_query_builder.Append (String.Format ("photo_id = {0}", items[i].Id));
++			query_builder.Add (String.Format ("{0}", items[i].Id));
+ 			RemoveFromCache (items[i]);
+ 		}
+ 
+-		Database.ExecuteNonQuery (String.Format ("DELETE FROM photos WHERE {0}", query_builder.ToString ()));
+-		Database.ExecuteNonQuery (String.Format ("DELETE FROM photo_tags WHERE {0}", tv_query_builder.ToString ()));
+-		Database.ExecuteNonQuery (String.Format ("DELETE FROM photo_versions WHERE {0}", tv_query_builder.ToString ()));
++		String id_list = String.Join ("','", ((String []) query_builder.ToArray (typeof(String))));
++		Database.ExecuteNonQuery (String.Format ("DELETE FROM photos WHERE id IN ('{0}')", id_list));
++		Database.ExecuteNonQuery (String.Format ("DELETE FROM photo_tags WHERE photo_id IN ('{0}')", id_list));
++		Database.ExecuteNonQuery (String.Format ("DELETE FROM photo_versions WHERE photo_id IN ('{0}')", id_list));
+ 
+ 	}
+ 

Propchange: packages/f-spot/trunk/debian/patches/fix_deleting_1000_photos.dpatch
------------------------------------------------------------------------------
    svn:executable = *




More information about the Pkg-cli-apps-commits mailing list