aboutsummaryrefslogtreecommitdiff
path: root/pkgs/applications/misc/mysql-workbench/hardcode-paths.patch
blob: dddf992e4c1206bad1ac07dad5c412e89d2f62b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
--- a/frontend/linux/workbench/mysql-workbench.in
+++ b/frontend/linux/workbench/mysql-workbench.in
@@ -99,8 +99,8 @@
 if test "$WB_DEBUG" != ""; then
   $WB_DEBUG $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
 else
-  if type -p catchsegv > /dev/null; then
-  catchsegv $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
+  if type -p @catchsegv@ > /dev/null; then
+  @catchsegv@ $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
   else
   $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
   fi
--- a/plugins/migration/frontend/migration_bulk_copy_data.py
+++ b/plugins/migration/frontend/migration_bulk_copy_data.py
@@ -110,7 +110,7 @@
         return 'sh'
 
     def generate_import_script(self, connection_args, path_to_file, schema_name):
-        output = ['#!/bin/bash']
+        output = ['#!/usr/bin/env bash']
         output.append('MYPATH=\`pwd\`')
         
         output.append('if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
@@ -164,7 +164,7 @@
         return 'sh'
 
     def generate_import_script(self, connection_args, path_to_file, schema_name):
-        output = ['#!/bin/bash']
+        output = ['#!/usr/bin/env bash']
         output.append('MYPATH=\`pwd\`')
         
         output.append('if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
@@ -417,7 +417,7 @@
     
         with open(script_path, 'w+') as f:
             os.chmod(script_path, 0700)
-            f.write('#!/bin/bash\n\n')
+            f.write('#!/usr/bin/env bash\n\n')
             f.write('MYPATH=`pwd`\n')
             
             f.write("arg_source_password=\"<put source password here>\"\n")
@@ -521,7 +521,7 @@
     
         with open(script_path, 'w+') as f:
             os.chmod(script_path, 0700)
-            f.write('#!/bin/bash\n\n')
+            f.write('#!/usr/bin/env bash\n\n')
             f.write('MYPATH=`pwd`\n')
             
             f.write("arg_source_password=\"<put source password here>\"\n")
--- a/plugins/wb.admin/backend/wb_server_control.py
+++ b/plugins/wb.admin/backend/wb_server_control.py
@@ -39,7 +39,7 @@
 
 UnixVariant = {
     "" : {
-        'sudo_command' : "/usr/bin/sudo -k -S -p EnterPasswordHere ",
+        'sudo_command' : "@sudo@ -k -S -p EnterPasswordHere ",
     }
 }
 
--- a/plugins/wb.admin/backend/wb_server_management.py
+++ b/plugins/wb.admin/backend/wb_server_management.py
@@ -40,7 +40,7 @@
 
 def reset_sudo_prefix():
     global default_sudo_prefix
-    default_sudo_prefix       = '/usr/bin/sudo -k -S -p EnterPasswordHere'
+    default_sudo_prefix       = '@sudo@ -k -S -p EnterPasswordHere'
 
 reset_sudo_prefix()
 
@@ -100,7 +100,7 @@
 
     if to_spawn:
         command += ' &'
-        sudo_prefix += ' /usr/bin/nohup'
+        sudo_prefix += ' @nohup@'
       
     # If as_user is the CURRENT then there's no need to sudo
     if as_user != Users.CURRENT:
@@ -111,7 +111,7 @@
         if '/bin/sh' in sudo_prefix or '/bin/bash' in sudo_prefix:
             command = "LANG=C " + sudo_prefix + " \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
         else:
-            command = "LANG=C " + sudo_prefix + " /bin/bash -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
+            command = "LANG=C " + sudo_prefix + " @bash@ -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
 
     return command
 
@@ -896,9 +896,9 @@
             if as_user == Users.CURRENT:
                 raise PermissionDeniedError("Cannot set owner of directory %s" % path)        
             else:
-                command = "/bin/mkdir %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
+                command = "@mkdir@ %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
         else:
-            command = "/bin/mkdir %s" % (quote_path(path))
+            command = "@mkdir@ %s" % (quote_path(path))
             
         res = self.process_ops.exec_cmd(command,
                                         as_user   = as_user,
@@ -927,7 +927,7 @@
     @useAbsPath("path")
     def remove_directory(self, path, as_user = Users.CURRENT, user_password = None):
         output = StringIO.StringIO()
-        res = self.process_ops.exec_cmd('/bin/rmdir ' + quote_path(path),
+        res = self.process_ops.exec_cmd('@rmdir@ ' + quote_path(path),
                                         as_user   = as_user,
                                         user_password = user_password,
                                         output_handler = output.write,
@@ -940,7 +940,7 @@
     @useAbsPath("path")
     def remove_directory_recursive(self, path, as_user = Users.CURRENT, user_password = None):
         output = StringIO.StringIO()
-        res = self.process_ops.exec_cmd('/bin/rm -R ' + quote_path(path),
+        res = self.process_ops.exec_cmd('@rm@ -R ' + quote_path(path),
                                         as_user   = as_user,
                                         user_password = user_password,
                                         output_handler = output.write,
@@ -953,7 +953,7 @@
     @useAbsPath("path")
     def delete_file(self, path, as_user = Users.CURRENT, user_password = None):
         output = StringIO.StringIO()
-        res = self.process_ops.exec_cmd("/bin/rm " + quote_path(path),
+        res = self.process_ops.exec_cmd("@rm@ " + quote_path(path),
                                         as_user   = as_user,
                                         user_password = user_password,
                                         output_handler = output.write,
@@ -1001,7 +1001,7 @@
     def _copy_file(self, source, dest, as_user = Users.CURRENT, user_password = None):
         output = StringIO.StringIO()
         
-        res = self.process_ops.exec_cmd("LC_ALL=C /bin/cp " + quote_path(source) + " " + quote_path(dest),
+        res = self.process_ops.exec_cmd("LC_ALL=C @cp@ " + quote_path(source) + " " + quote_path(dest),
                       as_user   = as_user,
                       user_password = user_password,
                       output_handler = output.write,
@@ -1077,9 +1077,9 @@
             # for ls -l, the output format changes depending on stdout being a terminal or not
             # since both cases are possible, we need to handle both at the same time (1st line being total <nnnn> or not)
             # the good news is that if the line is there, then it will always start with total, regardless of the locale
-            command = 'LC_ALL=C /bin/ls -l -p %s' % quote_path(path)
+            command = 'LC_ALL=C @ls@ -l -p %s' % quote_path(path)
         else:
-            command = 'LC_ALL=C /bin/ls -1 -p %s' % quote_path(path)
+            command = 'LC_ALL=C @ls@ -1 -p %s' % quote_path(path)
             
         output = StringIO.StringIO()
         res = self.process_ops.exec_cmd(command,
@@ -2160,9 +2160,9 @@
     def get_range(self, start, end):
         f = StringIO.StringIO()
         if not self._need_sudo:
-            ret = self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
+            ret = self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
         else:
-            ret = self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write)
+            ret = self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i count=%i 2> /dev/null" % (quote_path(self.path), start, end-start), as_user = Users.ADMIN, user_password=self.get_password, output_handler=f.write)
 
         if ret != 0:
             raise RuntimeError("Could not get data from file %s" % self.path)
@@ -2170,9 +2170,9 @@
 
     def read_task(self, offset, file):
         if not self._need_sudo:
-            self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write)
+            self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=file.write)
         else:
-            self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write)
+            self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self.get_password, output_handler=file.write)
         # this will signal the reader end that there's no more data
         file.close()
 
@@ -2198,9 +2198,9 @@
         self._pos = offset
         f = StringIO.StringIO()
         if not self._need_sudo:
-            self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
+            self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.CURRENT, user_password=None, output_handler=f.write)
         else:
-            self.server_helper.execute_command("/bin/dd if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write)
+            self.server_helper.execute_command("@dd@ if=%s ibs=1 skip=%i 2> /dev/null" % (quote_path(self.path), offset), as_user = Users.ADMIN, user_password=self._password, output_handler=f.write)
         self.data = f
         self.data.seek(0)
         if self.skip_first_newline: