summarylogtreecommitdiffstats
path: root/paths-in-opt.patch
diff options
context:
space:
mode:
authorScore_Under2020-03-21 01:20:36 +0000
committerScore_Under2020-03-21 01:20:36 +0000
commit46b5c90d941878d6d6df5ee5f2c0c2037ae50c4d (patch)
treef278d70235246f7cc1058a03e511198c1e9e685c /paths-in-opt.patch
parent714391ae7f9b012e053368e6fe997263bca6dc29 (diff)
downloadaur-46b5c90d941878d6d6df5ee5f2c0c2037ae50c4d.tar.gz
Update for v389
Diffstat (limited to 'paths-in-opt.patch')
-rw-r--r--paths-in-opt.patch46
1 files changed, 22 insertions, 24 deletions
diff --git a/paths-in-opt.patch b/paths-in-opt.patch
index 8b0054631bf7..c76252842e91 100644
--- a/paths-in-opt.patch
+++ b/paths-in-opt.patch
@@ -1,8 +1,8 @@
diff --git a/include/ClientGUI.py b/include/ClientGUI.py
-index b6913b2..e23ef1b 100755
+index 87a1213..ce62212 100755
--- a/include/ClientGUI.py
+++ b/include/ClientGUI.py
-@@ -738,7 +738,7 @@ class FrameGUI( ClientGUITopLevelWindows.MainFrameThatResizes ):
+@@ -740,7 +740,7 @@ class FrameGUI( ClientGUITopLevelWindows.MainFrameThatResizes ):
python_executable = python_executable.replace( 'pythonw', 'python' )
@@ -12,46 +12,44 @@ index b6913b2..e23ef1b 100755
cmd = [ python_executable, server_script_path, db_param ]
diff --git a/include/HydrusConstants.py b/include/HydrusConstants.py
-index 3969396..bd6651a 100755
+index 5b0aa75..10b528c 100755
--- a/include/HydrusConstants.py
+++ b/include/HydrusConstants.py
-@@ -2,33 +2,9 @@ import os
- import sys
+@@ -4,31 +4,8 @@ import sys
+ # old method of getting frozen dir, doesn't work for symlinks looks like:
+ # BASE_DIR = getattr( sys, '_MEIPASS', None )
- # dirs
-+RUNNING_FROM_FROZEN_BUILD = False
-
--if getattr( sys, 'frozen', False ):
+-RUNNING_FROM_FROZEN_BUILD = getattr( sys, 'frozen', False )
+-
+-if RUNNING_FROM_FROZEN_BUILD:
-
-- RUNNING_FROM_FROZEN_BUILD = True
+- real_exe_path = os.path.realpath( sys.executable )
-
-- # we are in a pyinstaller frozen app
+- BASE_DIR = os.path.dirname( real_exe_path )
-
-- BASE_DIR = getattr( sys, '_MEIPASS', None )
+-else:
-
-- if BASE_DIR is None:
+- try:
-
-- raise Exception( 'It seems this hydrus is running from a frozen bundle, but there was no _MEIPASS variable under sys to define the bundle directory.' )
+- hc_realpath_dir = os.path.dirname( os.path.realpath( __file__ ) )
+-
+- BASE_DIR = os.path.split( hc_realpath_dir )[0]
+-
+- except NameError: # if __file__ is not defined due to some weird OS
+-
+- BASE_DIR = os.path.realpath( sys.path[0] )
-
--
--else:
--
-- # maybe this is better?
-- # os.path.dirname( __file__ )
--
-- RUNNING_FROM_FROZEN_BUILD = False
--
-- BASE_DIR = sys.path[0]
-
- if BASE_DIR == '':
-
- BASE_DIR = os.getcwd()
-
++RUNNING_FROM_FROZEN_BUILD = False
+BASE_DIR = os.path.expanduser("~/.local/share/hydrus")
PLATFORM_WINDOWS = False
PLATFORM_MACOS = False
-@@ -41,23 +17,16 @@ elif sys.platform == 'linux': PLATFORM_LINUX = True
+@@ -41,23 +18,16 @@ elif sys.platform == 'linux': PLATFORM_LINUX = True
RUNNING_FROM_SOURCE = sys.argv[0].endswith( '.py' ) or sys.argv[0].endswith( '.pyw' )
RUNNING_FROM_MACOS_APP = os.path.exists( os.path.join( BASE_DIR, 'running_from_app' ) )