~ubuntu-branches/ubuntu/vivid/mate-terminal/vivid

« back to all changes in this revision

Viewing changes to debian/patches/0001_mate-terminal-wrapper.patch

  • Committer: Package Import Robot
  • Author(s): Martin Wimpress
  • Date: 2015-04-21 01:42:46 UTC
  • Revision ID: package-import@ubuntu.com-20150421014246-jem3m3w4075n0yj9
Tags: 1.8.1+dfsg1-4ubuntu1
* debian/patches:
 + Add 0001_mate-terminal-wrapper.patch. Adds support for double quoted
   strings. Adapted from gnome-terminal.wrapper. (LP: #1445198).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Adds support for double quoted strings.
 
2
 Add 0001_mate-terminal-wrapper.patch, adapted from gnome-termnal.wrapper,
 
3
 that adds support for double quoted strings. (Closes LP: #1445198).
 
4
Author: Martin Wimpress <code@flexion.org>
 
5
Bug-Ubuntu: https://bugs.launchpad.net/bugs/1445198
 
6
 
 
7
--- mate-terminal-1.8.1+dfsg1.orig/mate-terminal.wrapper
 
8
+++ mate-terminal-1.8.1+dfsg1/mate-terminal.wrapper
 
9
@@ -1,44 +1,81 @@
 
10
-#!/usr/bin/env python
 
11
+#!/usr/bin/perl -w
 
12
 
 
13
-import sys
 
14
-import os
 
15
-import subprocess
 
16
+my $login=0;
 
17
 
 
18
-newargs = ['mate-terminal']
 
19
-oldargs = sys.argv[1:]
 
20
-
 
21
-while True:
 
22
-    try:
 
23
-        arg = oldargs.pop(0)
 
24
-
 
25
-        if arg == '-display':
 
26
-            os.environ['DISPLAY'] = oldargs.pop(0)
 
27
-        elif arg == '-name':
 
28
-            newargs.append('--window-with-profile=' + oldargs.pop(0))
 
29
-        elif arg == '-n':
 
30
-            sys.stderr.write('Set an icon in your profile')
 
31
-        elif arg == '-T' or arg == '-title':
 
32
-            newargs.append('-t')
 
33
-            newargs.append(oldargs.pop(0))
 
34
-        elif arg == '-ls' or arg == '+ls':
 
35
-            sys.stderr.write('Login shell not supported.  Set in your profile.')
 
36
-        elif arg == '-geometry':
 
37
-            newargs.append('--geometry=' + oldargs.pop(0))
 
38
-        elif arg == '-fn':
 
39
-            newargs.append('--font=' + oldargs.pop(0))
 
40
-        elif arg == '-fg':
 
41
-            newargs.append('--foreground=' + oldargs.pop(0))
 
42
-        elif arg == '-bg':
 
43
-            newargs.append('--background=' + oldargs.pop(0))
 
44
-        elif arg == '-tn':
 
45
-            newargs.append('--termname=' + oldargs.pop(0))
 
46
-        elif arg == '-h' or arg == '--help':
 
47
-            newargs.append('--help')
 
48
-        elif arg == '-e':
 
49
-            newargs.append('-x')
 
50
-            newargs += oldargs
 
51
-            break
 
52
-    except IndexError:
 
53
-        break
 
54
-
 
55
-subprocess.call(newargs)
 
56
+while ($opt = shift(@ARGV))
 
57
+{
 
58
+    if ($opt eq '-display')
 
59
+    {
 
60
+        $ENV{'DISPLAY'} = shift(@ARGV);
 
61
+    }
 
62
+    elsif ($opt eq '-name')
 
63
+    {
 
64
+        $arg = shift(@ARGV);
 
65
+        push(@args, "--window-with-profile=$arg");
 
66
+    }
 
67
+    elsif ($opt eq '-n')
 
68
+    {
 
69
+        # Accept but ignore
 
70
+        print STDERR "$0: to set an icon, please use -name <profile> and set a profile icon\n"
 
71
+    }
 
72
+    elsif ($opt eq '-T' || $opt eq '-title')
 
73
+    {
 
74
+        push(@args, '-t', shift(@ARGV));
 
75
+    }
 
76
+    elsif ($opt eq '-ls')
 
77
+    {
 
78
+        $login = 1;
 
79
+    }
 
80
+    elsif ($opt eq '+ls')
 
81
+    {
 
82
+        $login = 0;
 
83
+    }
 
84
+    elsif ($opt eq '-geometry')
 
85
+    {
 
86
+        $arg = shift(@ARGV);
 
87
+        push(@args, "--geometry=$arg");
 
88
+    }
 
89
+    elsif ($opt eq '-fn')
 
90
+    {
 
91
+        $arg = shift(@ARGV);
 
92
+        push(@args, "--font=$arg");
 
93
+    }
 
94
+    elsif ($opt eq '-fg')
 
95
+    {
 
96
+        $arg = shift(@ARGV);
 
97
+        push(@args, "--foreground=$arg");
 
98
+    }
 
99
+    elsif ($opt eq '-bg')
 
100
+    {
 
101
+        $arg = shift(@ARGV);
 
102
+        push(@args, "--background=$arg");
 
103
+    }
 
104
+    elsif ($opt eq '-tn')
 
105
+    {
 
106
+       $arg = shift(@ARGV);
 
107
+       push(@args, "--termname=$arg");
 
108
+    }
 
109
+    elsif ($opt eq '-e')
 
110
+    {
 
111
+        $arg = shift(@ARGV);
 
112
+        if (@ARGV)
 
113
+        {
 
114
+            push(@args, '-x', $arg, @ARGV);
 
115
+            last;
 
116
+        }
 
117
+        else
 
118
+        {
 
119
+            push(@args, '-e', $arg);
 
120
+        }
 
121
+        last;
 
122
+    }
 
123
+    elsif ($opt eq '-h' || $opt eq '--help')
 
124
+    {
 
125
+        push(@args, '--help');
 
126
+    }
 
127
+}
 
128
+if ($login == 1)
 
129
+{
 
130
+    @args = ('--login', @args);
 
131
+}
 
132
+exec('mate-terminal',@args);