Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / applications / misc / mysql-workbench / hardcode-paths.patch
bloba90075210cf694903467c681c7f6757ec22ffb71
1 diff -u -r a/frontend/linux/workbench/mysql-workbench.in b/frontend/linux/workbench/mysql-workbench.in
2 --- a/frontend/linux/workbench/mysql-workbench.in 2022-03-25 09:06:06.000000000 +0200
3 +++ b/frontend/linux/workbench/mysql-workbench.in 2022-06-17 00:22:51.290117109 +0300
4 @@ -100,8 +100,8 @@
5 if test "$WB_DEBUG" != ""; then
6 $WB_DEBUG $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
7 else
8 - if type -p catchsegv > /dev/null; then
9 - catchsegv $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
10 + if type -p @catchsegv@ > /dev/null; then
11 + @catchsegv@ $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
12 else
13 $MWB_BINARIES_DIR/mysql-workbench-bin "$@"
15 diff -u -r a/plugins/migration/frontend/migration_bulk_copy_data.py b/plugins/migration/frontend/migration_bulk_copy_data.py
16 --- a/plugins/migration/frontend/migration_bulk_copy_data.py 2022-03-25 09:06:06.000000000 +0200
17 +++ b/plugins/migration/frontend/migration_bulk_copy_data.py 2022-06-17 00:13:29.430055453 +0300
18 @@ -110,7 +110,7 @@
19 return 'sh'
21 def generate_import_script(self, connection_args, path_to_file, schema_name):
22 - output = ['#!/bin/bash']
23 + output = ['#!/usr/bin/env bash']
24 output.append('MYPATH=\`pwd\`')
26 output.append('if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
27 @@ -164,7 +164,7 @@
28 return 'sh'
30 def generate_import_script(self, connection_args, path_to_file, schema_name):
31 - output = ['#!/bin/bash']
32 + output = ['#!/usr/bin/env bash']
33 output.append('MYPATH=\`pwd\`')
35 output.append('if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
36 @@ -417,7 +417,7 @@
38 with open(script_path, 'w+') as f:
39 os.chmod(script_path, 0o700)
40 - f.write('#!/bin/bash\n\n')
41 + f.write('#!/usr/bin/env bash\n\n')
42 f.write('MYPATH=`pwd`\n')
44 f.write("arg_source_password=\"<put source password here>\"\n")
45 @@ -521,7 +521,7 @@
47 with open(script_path, 'w+') as f:
48 os.chmod(script_path, 0o700)
49 - f.write('#!/bin/bash\n\n')
50 + f.write('#!/usr/bin/env bash\n\n')
51 f.write('MYPATH=`pwd`\n')
53 f.write("arg_source_password=\"<put source password here>\"\n")
54 diff -u -r a/plugins/wb.admin/backend/wb_server_control.py b/plugins/wb.admin/backend/wb_server_control.py
55 --- a/plugins/wb.admin/backend/wb_server_control.py 2022-03-25 09:06:06.000000000 +0200
56 +++ b/plugins/wb.admin/backend/wb_server_control.py 2022-06-17 00:14:26.937905324 +0300
57 @@ -39,7 +39,7 @@
59 UnixVariant = {
60 "" : {
61 - 'sudo_command' : "/usr/bin/sudo -k -S -p EnterPasswordHere ",
62 + 'sudo_command' : "@sudo@ -k -S -p EnterPasswordHere ",
66 diff -u -r a/plugins/wb.admin/backend/wb_server_management.py b/plugins/wb.admin/backend/wb_server_management.py
67 --- a/plugins/wb.admin/backend/wb_server_management.py 2022-03-25 09:06:06.000000000 +0200
68 +++ b/plugins/wb.admin/backend/wb_server_management.py 2022-06-17 00:18:58.034028354 +0300
69 @@ -40,7 +40,7 @@
71 def reset_sudo_prefix():
72 global default_sudo_prefix
73 - default_sudo_prefix = '/usr/bin/sudo -k -S -p EnterPasswordHere'
74 + default_sudo_prefix = '@sudo@ -k -S -p EnterPasswordHere'
76 reset_sudo_prefix()
78 @@ -100,7 +100,7 @@
80 if to_spawn:
81 command += ' &'
82 - sudo_prefix += ' /usr/bin/nohup'
83 + sudo_prefix += ' @nohup@'
85 # If as_user is the CURRENT then there's no need to sudo
86 if as_user != Users.CURRENT:
87 @@ -111,7 +111,7 @@
88 if '/bin/sh' in sudo_prefix or '/bin/bash' in sudo_prefix:
89 command = "LANG=C " + sudo_prefix + " \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
90 else:
91 - command = "LANG=C " + sudo_prefix + " /bin/bash -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
92 + command = "LANG=C " + sudo_prefix + " @bash@ -c \"" + command.replace('\\', '\\\\').replace('"', r'\"').replace('$','\\$') + "\""
94 return command
96 @@ -878,9 +878,9 @@
97 @useAbsPath("path")
98 def get_file_owner(self, path, as_user = Users.CURRENT, user_password = None):
99 if self.target_os == wbaOS.linux:
100 - command = 'LC_ALL=C stat -c %U '
101 + command = 'LC_ALL=C @stat@ -c %U '
102 else:
103 - command = 'LC_ALL=C /usr/bin/stat -f "%Su" '
104 + command = 'LC_ALL=C @stat@ -f "%Su" '
106 output = io.StringIO()
107 command = command + quote_path(path)
108 @@ -904,9 +904,9 @@
109 if as_user == Users.CURRENT:
110 raise PermissionDeniedError("Cannot set owner of directory %s" % path)
111 else:
112 - command = "/bin/mkdir %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
113 + command = "@mkdir@ %s && chown %s %s" % (quote_path(path), with_owner, quote_path(path))
114 else:
115 - command = "/bin/mkdir %s" % (quote_path(path))
116 + command = "@mkdir@ %s" % (quote_path(path))
118 res = self.process_ops.exec_cmd(command,
119 as_user = as_user,
120 @@ -935,7 +935,7 @@
121 @useAbsPath("path")
122 def remove_directory(self, path, as_user = Users.CURRENT, user_password = None):
123 output = io.StringIO()
124 - res = self.process_ops.exec_cmd('/bin/rmdir ' + quote_path(path),
125 + res = self.process_ops.exec_cmd('@rmdir@ ' + quote_path(path),
126 as_user = as_user,
127 user_password = user_password,
128 output_handler = output.write,
129 @@ -948,7 +948,7 @@
130 @useAbsPath("path")
131 def remove_directory_recursive(self, path, as_user = Users.CURRENT, user_password = None):
132 output = io.StringIO()
133 - res = self.process_ops.exec_cmd('/bin/rm -R ' + quote_path(path),
134 + res = self.process_ops.exec_cmd('@rm@ -R ' + quote_path(path),
135 as_user = as_user,
136 user_password = user_password,
137 output_handler = output.write,
138 @@ -961,7 +961,7 @@
139 @useAbsPath("path")
140 def delete_file(self, path, as_user = Users.CURRENT, user_password = None):
141 output = io.StringIO()
142 - res = self.process_ops.exec_cmd("/bin/rm " + quote_path(path),
143 + res = self.process_ops.exec_cmd("@rm@ " + quote_path(path),
144 as_user = as_user,
145 user_password = user_password,
146 output_handler = output.write,
147 @@ -1009,7 +1009,7 @@
148 def _copy_file(self, source, dest, as_user = Users.CURRENT, user_password = None):
149 output = io.StringIO()
151 - res = self.process_ops.exec_cmd("LC_ALL=C /bin/cp " + quote_path(source) + " " + quote_path(dest),
152 + res = self.process_ops.exec_cmd("LC_ALL=C @cp@ " + quote_path(source) + " " + quote_path(dest),
153 as_user = as_user,
154 user_password = user_password,
155 output_handler = output.write,
156 @@ -1085,9 +1085,9 @@
157 # for ls -l, the output format changes depending on stdout being a terminal or not
158 # since both cases are possible, we need to handle both at the same time (1st line being total <nnnn> or not)
159 # the good news is that if the line is there, then it will always start with total, regardless of the locale
160 - command = 'LC_ALL=C /bin/ls -l -p %s' % quote_path(path)
161 + command = 'LC_ALL=C @ls@ -l -p %s' % quote_path(path)
162 else:
163 - command = 'LC_ALL=C /bin/ls -1 -p %s' % quote_path(path)
164 + command = 'LC_ALL=C @ls@ -1 -p %s' % quote_path(path)
166 output = io.StringIO()
167 res = self.process_ops.exec_cmd(command,
168 @@ -2163,9 +2163,9 @@
169 def get_range(self, start, end):
170 f = io.StringIO()
171 if not self._need_sudo:
172 - 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)
173 + 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)
174 else:
175 - 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)
176 + 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)
178 if ret != 0:
179 raise RuntimeError("Could not get data from file %s" % self.path)
180 @@ -2173,9 +2173,9 @@
182 def read_task(self, offset, file):
183 if not self._need_sudo:
184 - 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)
185 + 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)
186 else:
187 - 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)
188 + 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)
189 # this will signal the reader end that there's no more data
190 file.close()
192 @@ -2202,9 +2202,9 @@
193 self._pos = offset
194 f = io.StringIO()
195 if not self._need_sudo:
196 - 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)
197 + 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)
198 else:
199 - 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)
200 + 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)
201 self.data = f
202 self.data.seek(0)
203 if self.skip_first_newline: