~ubuntu-branches/ubuntu/wily/gnome-do/wily

« back to all changes in this revision

Viewing changes to debian/patches/03_fix_gks_crashers.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2011-02-15 21:50:02 UTC
  • mfrom: (1.1.10 upstream)
  • Revision ID: james.westby@ubuntu.com-20110215215002-1j8ylb69o15asb06
Tags: 0.8.4-0ubuntu1
* The Race Against FF upload.  Merge from unreleased Debian git.
  Remaining Ubuntu changes:
  + debian/patches/05_disable_resize_grips.patch.diff:
    Disable resize handles for the Do windows.
  + debian/control:
    Bump gtk# build dep for HasResizeGrip API.
* New Debian changes:
* The long fortold release
  + Fixes a threadsafety issue resulting in 100% CPU usage (Closes: 565591,
    LP: #450852).
  + Proxies all keyring calls to the GTK main thread, as required by the new
    gnome-keyring (Closes: 603876, LP: #553643)
* debian/patches/00_bundledlibs.dpatch:
* debian/rules:
  + Upstream has dropped bundled gmcs binary; now 100% DFSG-free, so we don't
    have to repack the tarball or patch the buildsystem.
* debian/patches/03_disable_docky.dpatch:
  + Drop.  Docky is now gone in the upstream tarball.
* debian/rules:
* debian/control:
* debian/patches/*:
  + Switch to quilt to harmonise with other pkg-cli-* packages.
* debian/control:
  + Drop recommends on gnome-do-docklets.  Docky is now a separate package,
    so the docklets are useless for Do.
  + Bump Breaks on gnome-do-plugins to 0.8.3.  Do no longer provides the Wink
    library, which has been imported into the 0.8.3 do-plugins sources.
  + Bump standards-version; no changes needed.
  + Migrate to git and update VCS fields appropriately

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#! /bin/sh /usr/share/dpatch/dpatch-run
2
 
## 03_fix_gks_crahers.dpatch by Christopher James Halse Rogers <raof@ubuntu.com>
3
 
##
4
 
## All lines beginning with `## DP:' are a description of the patch.
5
 
## DP: No description.
6
 
 
7
 
@DPATCH@
8
 
diff -urNad fix-lp555137~/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/GnomeKeyringSecurePreferencesService.cs fix-lp555137/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/GnomeKeyringSecurePreferencesService.cs
9
 
--- fix-lp555137~/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/GnomeKeyringSecurePreferencesService.cs   2010-04-14 11:42:39.000000000 +1000
10
 
+++ fix-lp555137/Do.Platform.Linux/src/Do.Platform/Do.Platform.Linux/GnomeKeyringSecurePreferencesService.cs    2010-04-14 12:27:33.252245271 +1000
11
 
@@ -20,6 +20,7 @@
12
 
 
13
 
 using System;
14
 
 using System.Collections;
15
 
+using System.Threading;
16
 
 using System.ComponentModel;
17
 
 
18
 
 using Mono.Unix;
19
 
@@ -61,52 +62,76 @@
20
 
                public bool Set (string key, string val)
21
 
                {
22
 
                        Hashtable keyData;
23
 
-                       
24
 
+
25
 
                        if (!Ring.Available) {
26
 
                                Log.Error (KeyringUnavailableMessage);
27
 
                                return false;
28
 
                        }
29
 
 
30
 
                        keyData = new Hashtable ();
31
 
-                       keyData [AbsolutePathForKey (key)] = key;
32
 
-                       
33
 
-                       try {
34
 
-                               Ring.CreateItem (Ring.GetDefaultKeyring (), ItemType.GenericSecret, AbsolutePathForKey (key), keyData, val.ToString (), true);
35
 
-                       } catch (KeyringException e) {
36
 
-                               Log.Error (ErrorSavingMessage, key, e.Message);
37
 
-                               Log.Debug (e.StackTrace);
38
 
+                       keyData[AbsolutePathForKey (key)] = key;
39
 
+
40
 
+                       bool success = false;
41
 
+                       AutoResetEvent completed = new AutoResetEvent (false);
42
 
+
43
 
+                       Services.Application.RunOnMainThread (delegate {
44
 
+                               try {
45
 
+                                       Ring.CreateItem (Ring.GetDefaultKeyring (), ItemType.GenericSecret, AbsolutePathForKey (key), keyData, val.ToString (), true);
46
 
+                                       success = true;
47
 
+                               } catch (KeyringException e) {
48
 
+                                       Log.Error (ErrorSavingMessage, key, e.Message);
49
 
+                                       Log.Debug (e.StackTrace);
50
 
+                                       success = false;
51
 
+                               } finally {
52
 
+                                       completed.Set ();
53
 
+                               }
54
 
+                       });
55
 
+                       if (!completed.WaitOne (200)) {
56
 
                                return false;
57
 
                        }
58
 
-
59
 
-                       return true;
60
 
+                       return success;
61
 
                }
62
 
 
63
 
                public bool TryGet (string key, out string val)
64
 
                {
65
 
                        Hashtable keyData;
66
 
-                       
67
 
-                       val = "";
68
 
-                       
69
 
+
70
 
+                       string secret = "";
71
 
+
72
 
                        if (!Ring.Available) {
73
 
                                Log.Error (KeyringUnavailableMessage);
74
 
+                               val = "";
75
 
                                return false;
76
 
                        }
77
 
 
78
 
                        keyData = new Hashtable ();
79
 
-                       keyData [AbsolutePathForKey (key)] = key;
80
 
+                       keyData[AbsolutePathForKey (key)] = key;
81
 
                        
82
 
-                       try {
83
 
-                               foreach (ItemData item in Ring.Find (ItemType.GenericSecret, keyData)) {
84
 
-                                       if (!item.Attributes.ContainsKey (AbsolutePathForKey (key))) continue;
85
 
+                       bool success = false;
86
 
+                       AutoResetEvent completed = new AutoResetEvent (false);
87
 
 
88
 
-                                       val = item.Secret;
89
 
-                                       return true;
90
 
+                       Services.Application.RunOnMainThread (delegate {
91
 
+                               try {
92
 
+                                       foreach (ItemData item in Ring.Find (ItemType.GenericSecret, keyData)) {
93
 
+                                               if (!item.Attributes.ContainsKey (AbsolutePathForKey (key)))
94
 
+                                                       continue;
95
 
+
96
 
+                                               secret = item.Secret;
97
 
+                                               success = true;
98
 
+                                               break;
99
 
+                                       }
100
 
+                               } catch (KeyringException) {
101
 
+                                       Log.Debug (KeyNotFoundMessage, AbsolutePathForKey (key));
102
 
+                                       success = false;
103
 
+                               } finally {
104
 
+                                       completed.Set ();
105
 
                                }
106
 
-                       } catch (KeyringException) {
107
 
-                               Log.Debug (KeyNotFoundMessage, AbsolutePathForKey (key));
108
 
+                       });
109
 
+                       if (!completed.WaitOne (200)) {
110
 
+                               success = false;
111
 
                        }
112
 
-
113
 
-                       return false;
114
 
+                       val = secret;
115
 
+                       return success;
116
 
                }
117
 
                
118
 
                #endregion