~ubuntu-branches/debian/sid/f-spot/sid

« back to all changes in this revision

Viewing changes to lib/mono-addins/Mono.Addins/Mono.Addins.Database/SetupProcess.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane
  • Date: 2010-05-17 11:59:58 UTC
  • mfrom: (2.4.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100517115958-rplbws9ddda5ikcp
* New upstream release 0.6.2:
 + Stable release before starting large cleanup refactorings, mostly 
   usability, bug fixes and translations as well as some modernization.
   A large part of this comes from the Ubuntu one hundred papercuts effort.
 + Replaced the old slow slideshow code with new fast SlideShow
   (Gabriel Burt)
 + Wording changes for clarity (Edit Tag) (Jeffrey Finkelstein)
 + Fix version selection tooltip (Lorenzo Milesi)
 + Add gconf schema (Jeffrey Stedfast)
 + Added a border to filmstrip thumbnails (Matt Perry) (LP: #513036)
 + Fix display names of color profiles (Pascal de Bruijn)
 + Fix histogram colors on theme change (Paul Wellner Bou)
 + Always update ImageView adjustments when scaling.
   (Wojciech Dzierżanowski)
 + Correctly set attributes on copying (Yann Leprince)
 + Correct mnemonics in create tag dialog (Yves Kurz)
 + Provide sane defaults for image resize size (Yves Kurz)
 + Updates to the build system, including fixes for distcheck
   (Ruben Vermeersch)
 + Fix wording for duplicate hashing (Matt Perry)
 + Fix wording for imported tags tag (Ian Churcher)
 + Fix label alignment in preferences dialog (Pascal de Bruijn)
 + Add unique# and use it to handle our activation (Stephane Delcroix)
 + Stop bundling Mono.Addins (Stephane Delcroix)
 + Avoid leakage in straighten and softfocus editor (Stephane Delcroix)
 + Allow to copy files to clipboard (Stephane Delcroix)
 + Large number of color management related fixes (Stephane Delcroix)
 + Removed the Beagle plugin at the request of the openSUSE team
   (Ruben Vermeersch)
 + A pile of other cleanups and fixes (Ruben Vermeersch)
   - Including '"Import tags" category sounds like an action' (LP: #488784)
 + Two performance improvement patches for our database interaction
   (Michal Nánási)
 + Fix the longstanding issue of F-Spot changing photo timestamps
   (Paul Wellner Bou) (Closes: #445511) (LP: #175191)
 + Tons of translation updates (seriously)
* debian/control, debian/rules: Drop gnome-screensaver build-dep and set
  variables at configure time. Should reduce the BD chain significantly. 
* debian/control: Increase minimum version on libgphoto2-dev BD in line with
  configure requirements.
* debian/control: Add build-dependency on libunique-dev to build new
  unique-sharp bindings which f-spot now uses to handle activation.
* debian/patches/debian_link-system-mono-addins.patch: Drop, now upstream 
* debian/patches/*: Refresh to apply to new upstream version 
* debian/rules: Pass include directories to autoreconf to have the correct
  macros in scope for the new build system 
* debian/patches/ubuntu*: Steal patches from Ubuntu package to improve
  --view mode and add an undo/redo stack. Rebase on new upstream version.
  Thanks to Chris Halse Rogers.
* debian/patches/ubuntu_fname_quote_percent.patch: Drop, now upstream.
* debian/patches/git_transition_duration.patch: Cherrypick patch from
  upstream to reduce the transition duration when entering fullscreen to
  600ms. 
* debian/rules: Incorporate Ubuntu specific changes, and guard by a call to
  dpkg-vendor.
* debian/rules: Don't try to install the gconf schemas when building 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// SetupProcess.cs
3
 
//
4
 
// Author:
5
 
//   Lluis Sanchez Gual
6
 
//
7
 
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
8
 
//
9
 
// Permission is hereby granted, free of charge, to any person obtaining
10
 
// a copy of this software and associated documentation files (the
11
 
// "Software"), to deal in the Software without restriction, including
12
 
// without limitation the rights to use, copy, modify, merge, publish,
13
 
// distribute, sublicense, and/or sell copies of the Software, and to
14
 
// permit persons to whom the Software is furnished to do so, subject to
15
 
// the following conditions:
16
 
// 
17
 
// The above copyright notice and this permission notice shall be
18
 
// included in all copies or substantial portions of the Software.
19
 
// 
20
 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21
 
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22
 
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23
 
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24
 
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25
 
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26
 
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
 
//
28
 
 
29
 
 
30
 
using System;
31
 
using System.Collections.Specialized;
32
 
using System.IO;
33
 
using System.Text;
34
 
using System.Diagnostics;
35
 
using System.Runtime.Serialization.Formatters.Binary;
36
 
 
37
 
namespace Mono.Addins.Database
38
 
{
39
 
        internal class SetupProcess
40
 
        {
41
 
                internal static void ExecuteCommand (IProgressStatus monitor, string registryPath, string startupDir, string name, params string[] args)
42
 
                {
43
 
                        string asm = new Uri (typeof(SetupProcess).Assembly.CodeBase).LocalPath;
44
 
                        string verboseParam = monitor.LogLevel.ToString ();
45
 
                        
46
 
                        // Arguments string
47
 
                        StringBuilder sb = new StringBuilder ();
48
 
                        sb.Append (verboseParam).Append (' ').Append (name);
49
 
                        foreach (string arg in args)
50
 
                                sb.Append (" \"").Append (arg).Append ("\"");
51
 
                        
52
 
                        Process process = new Process ();
53
 
                        if (Util.IsWindows)
54
 
                                process.StartInfo = new ProcessStartInfo (asm, sb.ToString ());
55
 
                        else {
56
 
                                asm = asm.Replace(" ", @"\ ");
57
 
                                process.StartInfo = new ProcessStartInfo ("mono", "--debug " + asm + " " + sb.ToString ());
58
 
                        }
59
 
                        process.StartInfo.WorkingDirectory = AppDomain.CurrentDomain.BaseDirectory;
60
 
                        process.StartInfo.UseShellExecute = false;
61
 
                        process.StartInfo.RedirectStandardInput = true;
62
 
                        process.StartInfo.RedirectStandardOutput = true;
63
 
                        process.StartInfo.RedirectStandardError = true;
64
 
                        process.EnableRaisingEvents = true;
65
 
                        try {
66
 
                                process.Start ();
67
 
                        } catch (Exception ex) {
68
 
                                Console.WriteLine (ex);
69
 
                                throw;
70
 
                        }
71
 
                        
72
 
                        process.StandardInput.WriteLine (registryPath);
73
 
                        process.StandardInput.WriteLine (startupDir);
74
 
                        process.StandardInput.Flush ();
75
 
 
76
 
//                      string rr = process.StandardOutput.ReadToEnd ();
77
 
//                      Console.WriteLine (rr);
78
 
                        
79
 
                        StringCollection progessLog = new StringCollection ();
80
 
                        ProcessProgressStatus.MonitorProcessStatus (monitor, process.StandardOutput, progessLog);
81
 
                        process.WaitForExit ();
82
 
                        if (process.ExitCode != 0)
83
 
                                throw new ProcessFailedException (progessLog);
84
 
                }
85
 
                
86
 
                public static int Main (string[] args)
87
 
                {
88
 
                        ProcessProgressStatus monitor = new ProcessProgressStatus (int.Parse (args[0]));
89
 
                        
90
 
                        try {
91
 
                                string registryPath = Console.In.ReadLine ();
92
 
                                string startupDir = Console.In.ReadLine ();
93
 
                                
94
 
                                AddinDatabase.RunningSetupProcess = true;
95
 
                                AddinRegistry reg = new AddinRegistry (registryPath, startupDir);
96
 
                        
97
 
                                switch (args [1]) {
98
 
                                case "scan":
99
 
                                        string folder = args.Length > 2 ? args [2] : null;
100
 
                                        if (folder.Length == 0) folder = null;
101
 
                                        StringCollection filesToIgnore = new StringCollection ();
102
 
                                        for (int n=3; n<args.Length; n++)
103
 
                                                filesToIgnore.Add (args[n]);
104
 
                                        reg.ScanFolders (monitor, folder, filesToIgnore);
105
 
                                        break;
106
 
                                case "get-desc":
107
 
                                        reg.ParseAddin (monitor, args[2], args[3]);
108
 
                                        break;
109
 
                                }
110
 
                        } catch (Exception ex) {
111
 
                                monitor.ReportError ("Unexpected error in setup process", ex);
112
 
                                return 1;
113
 
                        }
114
 
                        return 0;
115
 
                }
116
 
        }
117
 
        
118
 
        class ProcessFailedException: Exception
119
 
        {
120
 
                StringCollection progessLog;
121
 
                
122
 
                public ProcessFailedException (StringCollection progessLog)
123
 
                {
124
 
                        this.progessLog = progessLog;
125
 
                }
126
 
                
127
 
                public StringCollection ProgessLog {
128
 
                        get { return progessLog; }
129
 
                }
130
 
                
131
 
                public string LastLog {
132
 
                        get { return progessLog.Count > 0 ? progessLog [progessLog.Count - 1] : ""; }
133
 
                }
134
 
        }
135
 
}