~ubuntu-branches/ubuntu/precise/gnome-do/precise-proposed

« back to all changes in this revision

Viewing changes to debian/patches/04_create_plugin_dir.dpatch

  • Committer: Bazaar Package Importer
  • Author(s): Christopher James Halse Rogers
  • Date: 2008-03-28 08:22:04 UTC
  • Revision ID: james.westby@ubuntu.com-20080328082204-qb6qca79ro63us9r
Tags: 0.4.0.1-0ubuntu2
* The "Let's make ALL the UI work" upload.
* debian/patches/04_create_plugin_dir:
  + Create user-local plugin directory on start, if it doesn't already exist.
    Fixes the "Open Plugins Directory" button (LP #207631).  Patch from
    upstream bzr.
* debian/patches/05_less_debug_spew:
  + Don't print thousands of lines of [INFO] messages when started with
    --quiet (LP: #204452).  Patch from upstream bzr.
* debian/control:
  + Depends: fits easily on a single line; do so.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh /usr/share/dpatch/dpatch-run
 
2
## 04_create_plugin_dir.dpatch by Christopher James Halse Rogers <raof@ubuntu.com>
 
3
##
 
4
## All lines beginning with `## DP:' are a description of the patch.
 
5
## DP: Create the user-local plugin directory on load.  LP #207631
 
6
 
 
7
@DPATCH@
 
8
diff -urNad gnome-do-0.4.0.1~/Do.Addins/src/Paths.cs gnome-do-0.4.0.1/Do.Addins/src/Paths.cs
 
9
--- gnome-do-0.4.0.1~/Do.Addins/src/Paths.cs    2008-03-14 19:26:18.000000000 +1100
 
10
+++ gnome-do-0.4.0.1/Do.Addins/src/Paths.cs     2008-03-28 08:11:39.000000000 +1100
 
11
@@ -32,20 +32,39 @@
 
12
 
 
13
                static Paths ()
 
14
                {
 
15
-                       if (File.Exists (Temp))
 
16
-                               File.Delete (Temp);
 
17
+                       if (File.Exists (Temp)) {
 
18
+                               try {
 
19
+                                       File.Delete (Temp);
 
20
+                               } catch (Exception e) {
 
21
+                                       Console.Error.WriteLine ("Could not delete temporary directory {0}: {1}",
 
22
+                                               Temp, e.Message);
 
23
+                               }
 
24
+                       }
 
25
 
 
26
-                       CreateDirs (ApplicationData, Temp);
 
27
+                       CreateDirs (ApplicationData, UserData, UserPlugins, Temp);
 
28
                }
 
29
 
 
30
                private static void CreateDirs (string first, params string [] rest)
 
31
                {
 
32
-                       if (!Directory.Exists (first))
 
33
-                               Directory.CreateDirectory (first);
 
34
+                       if (!Directory.Exists (first)) {
 
35
+                               try {
 
36
+                                       Directory.CreateDirectory (first);
 
37
+                               } catch (Exception e) {
 
38
+                                       Console.Error.WriteLine ("Failed to create directory {0}: {1}",
 
39
+                                               first, e.Message);
 
40
+                               }
 
41
+                       }
 
42
 
 
43
-                       foreach (string dir in rest)
 
44
-                               if (!Directory.Exists (dir))
 
45
-                                       Directory.CreateDirectory (dir);
 
46
+                       foreach (string dir in rest) {
 
47
+                               if (!Directory.Exists (dir)) {
 
48
+                                       try {
 
49
+                                               Directory.CreateDirectory (dir);
 
50
+                                       } catch (Exception e) {
 
51
+                                               Console.Error.WriteLine ("Failed to create directory {0}: {1}",
 
52
+                                                       dir, e.Message);
 
53
+                                       }
 
54
+                               }
 
55
+                       }
 
56
                }
 
57
 
 
58
                public static string ReadXdgUserDir (string key, string fallback)