nixpkgs/pkgs/applications/misc/mysql-workbench/hardcode-paths.patch

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

208 lines
11 KiB
Diff
Raw Normal View History

2024-07-02 22:49:06 +00:00
diff --git a/frontend/linux/workbench/mysql-workbench.in b/frontend/linux/workbench/mysql-workbench.in
index cbecde4..ea5d3cc 100755
--- a/frontend/linux/workbench/mysql-workbench.in
+++ b/frontend/linux/workbench/mysql-workbench.in
@@ -100,8 +100,8 @@ fi
2018-08-08 22:22:59 +00:00
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
2024-07-02 22:49:06 +00:00
diff --git a/plugins/migration/frontend/migration_bulk_copy_data.py b/plugins/migration/frontend/migration_bulk_copy_data.py
index da6aa9f..9f4fe78 100644
--- a/plugins/migration/frontend/migration_bulk_copy_data.py
+++ b/plugins/migration/frontend/migration_bulk_copy_data.py
@@ -111,7 +111,7 @@ class ImportScriptLinux(ImportScript):
2018-08-08 22:22:59 +00:00
return 'sh'
def generate_import_script(self, connection_args, path_to_file, schema_name):
- output = ['#!/bin/bash']
+ output = ['#!/usr/bin/env bash']
2024-07-02 22:49:06 +00:00
output.append(r'MYPATH=\`pwd\`')
2018-08-08 22:22:59 +00:00
2024-07-02 22:49:06 +00:00
output.append(r'if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
@@ -165,7 +165,7 @@ class ImportScriptDarwin(ImportScript):
2018-08-08 22:22:59 +00:00
return 'sh'
def generate_import_script(self, connection_args, path_to_file, schema_name):
- output = ['#!/bin/bash']
+ output = ['#!/usr/bin/env bash']
2024-07-02 22:49:06 +00:00
output.append(r'MYPATH=\`pwd\`')
2018-08-08 22:22:59 +00:00
2024-07-02 22:49:06 +00:00
output.append(r'if [ -f \$MYPATH/%s ] ; then' % self.error_log_name)
@@ -418,7 +418,7 @@ class DataCopyScriptLinux(DataCopyScript):
2018-08-08 22:22:59 +00:00
with open(script_path, 'w+') as f:
2022-09-14 09:46:13 +00:00
os.chmod(script_path, 0o700)
2018-08-08 22:22:59 +00:00
- 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")
2024-07-02 22:49:06 +00:00
@@ -522,7 +522,7 @@ class DataCopyScriptDarwin(DataCopyScript):
2018-08-08 22:22:59 +00:00
with open(script_path, 'w+') as f:
2022-09-14 09:46:13 +00:00
os.chmod(script_path, 0o700)
2018-08-08 22:22:59 +00:00
- 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")
2024-07-02 22:49:06 +00:00
diff --git a/plugins/wb.admin/backend/wb_server_control.py b/plugins/wb.admin/backend/wb_server_control.py
index 353f461..f7daa9e 100644
--- a/plugins/wb.admin/backend/wb_server_control.py
+++ b/plugins/wb.admin/backend/wb_server_control.py
@@ -40,7 +40,7 @@ import re
2018-08-08 22:22:59 +00:00
UnixVariant = {
"" : {
- 'sudo_command' : "/usr/bin/sudo -k -S -p EnterPasswordHere ",
+ 'sudo_command' : "@sudo@ -k -S -p EnterPasswordHere ",
}
}
2024-07-02 22:49:06 +00:00
diff --git a/plugins/wb.admin/backend/wb_server_management.py b/plugins/wb.admin/backend/wb_server_management.py
index 40ed515..00da327 100644
--- a/plugins/wb.admin/backend/wb_server_management.py
+++ b/plugins/wb.admin/backend/wb_server_management.py
@@ -41,7 +41,7 @@ default_sudo_prefix = ''
2018-08-08 22:22:59 +00:00
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()
2024-07-02 22:49:06 +00:00
@@ -101,7 +101,7 @@ def wrap_for_sudo(command, sudo_prefix, as_user = Users.ADMIN, to_spawn = False)
2018-08-08 22:22:59 +00:00
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:
2024-07-02 22:49:06 +00:00
@@ -112,7 +112,7 @@ def wrap_for_sudo(command, sudo_prefix, as_user = Users.ADMIN, to_spawn = False)
2018-08-08 22:22:59 +00:00
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
2024-07-02 22:49:06 +00:00
@@ -879,9 +879,9 @@ class FileOpsLinuxBase(object):
2022-09-14 09:46:13 +00:00
@useAbsPath("path")
def get_file_owner(self, path, as_user = Users.CURRENT, user_password = None):
if self.target_os == wbaOS.linux:
- command = 'LC_ALL=C stat -c %U '
+ command = 'LC_ALL=C @stat@ -c %U '
else:
- command = 'LC_ALL=C /usr/bin/stat -f "%Su" '
+ command = 'LC_ALL=C @stat@ -f "%Su" '
output = io.StringIO()
command = command + quote_path(path)
2024-07-02 22:49:06 +00:00
@@ -905,9 +905,9 @@ class FileOpsLinuxBase(object):
2018-08-08 22:22:59 +00:00
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,
2024-07-02 22:49:06 +00:00
@@ -936,7 +936,7 @@ class FileOpsLinuxBase(object):
2018-08-08 22:22:59 +00:00
@useAbsPath("path")
def remove_directory(self, path, as_user = Users.CURRENT, user_password = None):
2022-09-14 09:46:13 +00:00
output = io.StringIO()
2018-08-08 22:22:59 +00:00
- 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,
2024-07-02 22:49:06 +00:00
@@ -949,7 +949,7 @@ class FileOpsLinuxBase(object):
2018-08-08 22:22:59 +00:00
@useAbsPath("path")
def remove_directory_recursive(self, path, as_user = Users.CURRENT, user_password = None):
2022-09-14 09:46:13 +00:00
output = io.StringIO()
2018-08-08 22:22:59 +00:00
- 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,
2024-07-02 22:49:06 +00:00
@@ -962,7 +962,7 @@ class FileOpsLinuxBase(object):
2018-08-08 22:22:59 +00:00
@useAbsPath("path")
def delete_file(self, path, as_user = Users.CURRENT, user_password = None):
2022-09-14 09:46:13 +00:00
output = io.StringIO()
2018-08-08 22:22:59 +00:00
- 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,
2024-07-02 22:49:06 +00:00
@@ -1010,7 +1010,7 @@ class FileOpsLinuxBase(object):
2018-08-08 22:22:59 +00:00
def _copy_file(self, source, dest, as_user = Users.CURRENT, user_password = None):
2022-09-14 09:46:13 +00:00
output = io.StringIO()
2018-08-08 22:22:59 +00:00
- 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,
2024-07-02 22:49:06 +00:00
@@ -1086,9 +1086,9 @@ class FileOpsLinuxBase(object):
2018-08-08 22:22:59 +00:00
# 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)
2022-09-14 09:46:13 +00:00
output = io.StringIO()
2018-08-08 22:22:59 +00:00
res = self.process_ops.exec_cmd(command,
2024-07-02 22:49:06 +00:00
@@ -2164,9 +2164,9 @@ class SudoTailInputFile(object):
2018-08-08 22:22:59 +00:00
def get_range(self, start, end):
2022-09-14 09:46:13 +00:00
f = io.StringIO()
2018-08-08 22:22:59 +00:00
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)
2024-07-02 22:49:06 +00:00
@@ -2174,9 +2174,9 @@ class SudoTailInputFile(object):
2018-08-08 22:22:59 +00:00
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()
2024-07-02 22:49:06 +00:00
@@ -2203,9 +2203,9 @@ class SudoTailInputFile(object):
2018-08-08 22:22:59 +00:00
self._pos = offset
2022-09-14 09:46:13 +00:00
f = io.StringIO()
2018-08-08 22:22:59 +00:00
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: