0
0
mirror of https://github.com/termux-pacman/glibc-packages.git synced 2024-11-23 14:46:18 +00:00
glibc-packages/gpkg/python/setdirs.patch
Ivan Max 815ad09362
new pkgs: (#154)
gpkg/python
gpkg/python-pip
gpkg/python-xcbgen

gpkg/glibc: disable syscall __NR_mbind, __NR_chown32 and __NR_chown
2023-11-06 20:25:12 +03:00

91 lines
3.1 KiB
Diff

diff --git a/Lib/aifc.py b/Lib/aifc.py
index 5254987..1a67752 100644
--- a/Lib/aifc.py
+++ b/Lib/aifc.py
@@ -961,7 +961,7 @@ def open(f, mode=None):
if __name__ == '__main__':
import sys
if not sys.argv[1:]:
- sys.argv.append('/usr/demos/data/audio/bach.aiff')
+ sys.argv.append('@TERMUX_PREFIX@/demos/data/audio/bach.aiff')
fn = sys.argv[1]
with open(fn, 'r') as f:
print("Reading", fn)
diff --git a/Lib/ctypes/util.py b/Lib/ctypes/util.py
index 0c2510e..8c78013 100644
--- a/Lib/ctypes/util.py
+++ b/Lib/ctypes/util.py
@@ -209,7 +209,7 @@ elif os.name == "posix":
expr = os.fsencode(expr)
try:
- proc = subprocess.Popen(('/sbin/ldconfig', '-r'),
+ proc = subprocess.Popen(('@TERMUX_PREFIX@/bin/ldconfig', '-r'),
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL)
except OSError: # E.g. command not found
diff --git a/Lib/mimetypes.py b/Lib/mimetypes.py
index f6c43b3..b573915 100644
--- a/Lib/mimetypes.py
+++ b/Lib/mimetypes.py
@@ -55,6 +55,7 @@ knownfiles = [
"/usr/local/lib/netscape/mime.types",
"/usr/local/etc/httpd/conf/mime.types", # Apache 1.2
"/usr/local/etc/mime.types", # Apache 1.3
+ "@TERMUX_PREFIX@/etc/mime.types",
]
inited = False
diff --git a/Lib/posixpath.py b/Lib/posixpath.py
index 5b4d78b..89f7ee6 100644
--- a/Lib/posixpath.py
+++ b/Lib/posixpath.py
@@ -18,7 +18,7 @@ pardir = '..'
extsep = '.'
sep = '/'
pathsep = ':'
-defpath = '/bin:/usr/bin'
+defpath = '@TERMUX_PREFIX@/bin'
altsep = None
devnull = '/dev/null'
diff --git a/Lib/subprocess.py b/Lib/subprocess.py
index 6df5dd5..1624442 100644
--- a/Lib/subprocess.py
+++ b/Lib/subprocess.py
@@ -1809,8 +1809,7 @@ class Popen:
if shell:
# On Android the default shell is at '/system/bin/sh'.
- unix_shell = ('/system/bin/sh' if
- hasattr(sys, 'getandroidapilevel') else '/bin/sh')
+ unix_shell = ('@TERMUX_PREFIX@/bin/sh')
args = [unix_shell, "-c"] + args
if executable:
args[0] = executable
diff --git a/Lib/tempfile.py b/Lib/tempfile.py
index 480c172..989c615 100644
--- a/Lib/tempfile.py
+++ b/Lib/tempfile.py
@@ -170,7 +170,7 @@ def _candidate_tempdir_list():
_os.path.expandvars(r'%SYSTEMROOT%\Temp'),
r'c:\temp', r'c:\tmp', r'\temp', r'\tmp' ])
else:
- dirlist.extend([ '/tmp', '/var/tmp', '/usr/tmp' ])
+ dirlist.extend([ '@TERMUX_PREFIX_CLASSICAL@/tmp' ])
# As a last resort, the current directory.
try:
diff --git a/Lib/uuid.py b/Lib/uuid.py
index e863b63..3cbd75b 100644
--- a/Lib/uuid.py
+++ b/Lib/uuid.py
@@ -362,7 +362,6 @@ def _get_command_stdout(command, *args):
try:
path_dirs = os.environ.get('PATH', os.defpath).split(os.pathsep)
- path_dirs.extend(['/sbin', '/usr/sbin'])
executable = shutil.which(command, path=os.pathsep.join(path_dirs))
if executable is None:
return None