mactop: 0.1.9 -> 0.2.3 (#370511)
[NixPkgs.git] / pkgs / by-name / my / mysql-workbench / hardcode-paths.patch
blob8f7b317fb6ca7fc7b25b26265f852ce209e8b42a
1 diff --git a/frontend/linux/workbench/mysql-workbench.in b/frontend/linux/workbench/mysql-workbench.in
2 index cbecde4..ea5d3cc 100755
3 --- a/frontend/linux/workbench/mysql-workbench.in
4 +++ b/frontend/linux/workbench/mysql-workbench.in
5 @@ -100,8 +100,8 @@ fi
6 if test "$WB_DEBUG" != ""; then
7 $WB_DEBUG $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
8 else
9 - if type -p catchsegv > /dev/null; then
10 - catchsegv $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
11 + if type -p @catchsegv@ > /dev/null; then
12 + @catchsegv@ $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
13 else
14 $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
16 diff --git a/plugins/migration/frontend/migration_bulk_copy_data.py b/plugins/migration/frontend/migration_bulk_copy_data.py
17 index da6aa9f..9f4fe78 100644
18 --- a/plugins/migration/frontend/migration_bulk_copy_data.py
19 +++ b/plugins/migration/frontend/migration_bulk_copy_data.py
20 @@ -111,7 +111,7 @@ class ImportScriptLinux(ImportScript):
21 return 'sh'
23 def generate_import_script(self, connection_args, path_to_file, schema_name):
24 - output = ['#!/bin/bash']
25 + output = ['#!/usr/bin/env bash']
26 output.append(r'MYPATH=\`pwd\`')
28 output.append(r'if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
29 @@ -165,7 +165,7 @@ class ImportScriptDarwin(ImportScript):
30 return 'sh'
32 def generate_import_script(self, connection_args, path_to_file, schema_name):
33 - output = ['#!/bin/bash']
34 + output = ['#!/usr/bin/env bash']
35 output.append(r'MYPATH=\`pwd\`')
37 output.append(r'if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
38 @@ -418,7 +418,7 @@ class DataCopyScriptLinux(DataCopyScript):
40 with open(script_path, 'w+') as f:
41 os.chmod(script_path, 0o700)
42 - f.write('#!/bin/bash\n\n')
43 + f.write('#!/usr/bin/env bash\n\n')
44 f.write('MYPATH=`pwd`\n')
46 f.write("arg_source_password=\"<put source password here>\"\n")
47 @@ -522,7 +522,7 @@ class DataCopyScriptDarwin(DataCopyScript):
49 with open(script_path, 'w+') as f:
50 os.chmod(script_path, 0o700)
51 - f.write('#!/bin/bash\n\n')
52 + f.write('#!/usr/bin/env bash\n\n')
53 f.write('MYPATH=`pwd`\n')
55 f.write("arg_source_password=\"<put source password here>\"\n")
56 diff --git a/plugins/wb.admin/backend/wb_server_control.py b/plugins/wb.admin/backend/wb_server_control.py
57 index 353f461..f7daa9e 100644
58 --- a/plugins/wb.admin/backend/wb_server_control.py
59 +++ b/plugins/wb.admin/backend/wb_server_control.py
60 @@ -40,7 +40,7 @@ import re
62 UnixVariant = {
63 "" : {
64 - 'sudo_command' : "/usr/bin/sudo -k -S -p EnterPasswordHere ",
65 + 'sudo_command' : "@sudo@ -k -S -p EnterPasswordHere ",
69 diff --git a/plugins/wb.admin/backend/wb_server_management.py b/plugins/wb.admin/backend/wb_server_management.py
70 index 40ed515..00da327 100644
71 --- a/plugins/wb.admin/backend/wb_server_management.py
72 +++ b/plugins/wb.admin/backend/wb_server_management.py
73 @@ -41,7 +41,7 @@ default_sudo_prefix = ''
75 def reset_sudo_prefix():
76 global default_sudo_prefix
77 - default_sudo_prefix = '/usr/bin/sudo -k -S -p EnterPasswordHere'
78 + default_sudo_prefix = '@sudo@ -k -S -p EnterPasswordHere'
80 reset_sudo_prefix()
82 @@ -101,7 +101,7 @@ def wrap_for_sudo(command, sudo_prefix, as_user = Users.ADMIN, to_spawn = False)
84 if to_spawn:
85 command += ' &'
86 - sudo_prefix += ' /usr/bin/nohup'
87 + sudo_prefix += ' @nohup@'
89 # If as_user is the CURRENT then there's no need to sudo
90 if as_user != Users.CURRENT:
91 @@ -112,7 +112,7 @@ def wrap_for_sudo(command, sudo_prefix, as_user = Users.ADMIN, to_spawn = False)
92 if '/bin/sh' in sudo_prefix or '/bin/bash' in sudo_prefix:
93 command = "LANG=C " + sudo_prefix + " \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
94 else:
95 - command = "LANG=C " + sudo_prefix + " /bin/bash -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
96 + command = "LANG=C " + sudo_prefix + " @bash@ -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
98 return command
100 @@ -879,9 +879,9 @@ class FileOpsLinuxBase(object):
101 @useAbsPath("path")
102 def get_file_owner(self, path, as_user = Users.CURRENT, user_password = None):
103 if self.target_os == wbaOS.linux:
104 - command = 'LC_ALL=C stat -c %U '
105 + command = 'LC_ALL=C @stat@ -c %U '
106 else:
107 - command = 'LC_ALL=C /usr/bin/stat -f "%Su" '
108 + command = 'LC_ALL=C @stat@ -f "%Su" '
110 output = io.StringIO()
111 command = command + quote_path(path)
112 @@ -905,9 +905,9 @@ class FileOpsLinuxBase(object):
113 if as_user == Users.CURRENT:
114 raise PermissionDeniedError("Cannot set owner of directory %s" % path)
115 else:
116 - command = "/bin/mkdir %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
117 + command = "@mkdir@ %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
118 else:
119 - command = "/bin/mkdir %s" % (quote_path(path))
120 + command = "@mkdir@ %s" % (quote_path(path))
122 res = self.process_ops.exec_cmd(command,
123 as_user = as_user,
124 @@ -936,7 +936,7 @@ class FileOpsLinuxBase(object):
125 @useAbsPath("path")
126 def remove_directory(self, path, as_user = Users.CURRENT, user_password = None):
127 output = io.StringIO()
128 - res = self.process_ops.exec_cmd('/bin/rmdir ' + quote_path(path),
129 + res = self.process_ops.exec_cmd('@rmdir@ ' + quote_path(path),
130 as_user = as_user,
131 user_password = user_password,
132 output_handler = output.write,
133 @@ -949,7 +949,7 @@ class FileOpsLinuxBase(object):
134 @useAbsPath("path")
135 def remove_directory_recursive(self, path, as_user = Users.CURRENT, user_password = None):
136 output = io.StringIO()
137 - res = self.process_ops.exec_cmd('/bin/rm -R ' + quote_path(path),
138 + res = self.process_ops.exec_cmd('@rm@ -R ' + quote_path(path),
139 as_user = as_user,
140 user_password = user_password,
141 output_handler = output.write,
142 @@ -962,7 +962,7 @@ class FileOpsLinuxBase(object):
143 @useAbsPath("path")
144 def delete_file(self, path, as_user = Users.CURRENT, user_password = None):
145 output = io.StringIO()
146 - res = self.process_ops.exec_cmd("/bin/rm " + quote_path(path),
147 + res = self.process_ops.exec_cmd("@rm@ " + quote_path(path),
148 as_user = as_user,
149 user_password = user_password,
150 output_handler = output.write,
151 @@ -1010,7 +1010,7 @@ class FileOpsLinuxBase(object):
152 def _copy_file(self, source, dest, as_user = Users.CURRENT, user_password = None):
153 output = io.StringIO()
155 - res = self.process_ops.exec_cmd("LC_ALL=C /bin/cp " + quote_path(source) + " " + quote_path(dest),
156 + res = self.process_ops.exec_cmd("LC_ALL=C @cp@ " + quote_path(source) + " " + quote_path(dest),
157 as_user = as_user,
158 user_password = user_password,
159 output_handler = output.write,
160 @@ -1086,9 +1086,9 @@ class FileOpsLinuxBase(object):
161 # for ls -l, the output format changes depending on stdout being a terminal or not
162 # since both cases are possible, we need to handle both at the same time (1st line being total <nnnn> or not)
163 # the good news is that if the line is there, then it will always start with total, regardless of the locale
164 - command = 'LC_ALL=C /bin/ls -l -p %s' % quote_path(path)
165 + command = 'LC_ALL=C @ls@ -l -p %s' % quote_path(path)
166 else:
167 - command = 'LC_ALL=C /bin/ls -1 -p %s' % quote_path(path)
168 + command = 'LC_ALL=C @ls@ -1 -p %s' % quote_path(path)
170 output = io.StringIO()
171 res = self.process_ops.exec_cmd(command,
172 @@ -2164,9 +2164,9 @@ class SudoTailInputFile(object):
173 def get_range(self, start, end):
174 f = io.StringIO()
175 if not self._need_sudo:
176 - 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)
177 + 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)
178 else:
179 - 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)
180 + 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)
182 if ret != 0:
183 raise RuntimeError("Could not get data from file %s" % self.path)
184 @@ -2174,9 +2174,9 @@ class SudoTailInputFile(object):
186 def read_task(self, offset, file):
187 if not self._need_sudo:
188 - 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)
189 + 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)
190 else:
191 - 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)
192 + 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)
193 # this will signal the reader end that there's no more data
194 file.close()
196 @@ -2203,9 +2203,9 @@ class SudoTailInputFile(object):
197 self._pos = offset
198 f = io.StringIO()
199 if not self._need_sudo:
200 - 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)
201 + 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)
202 else:
203 - 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)
204 + 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)
205 self.data = f
206 self.data.seek(0)
207 if self.skip_first_newline: