qutebrowser: choose correct executable when restarting (#55739)

fixes #25832
This commit is contained in:
Robert Schütz 2019-02-24 13:40:41 +01:00 committed by GitHub
parent 7498aff7d8
commit 50a17aa46f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 0 deletions

View File

@ -53,7 +53,13 @@ in python3Packages.buildPythonApplication rec {
pyreadability pykeepass stem
];
patches = [
./fix-restart.patch
];
postPatch = ''
substituteInPlace qutebrowser/app.py --subst-var-by qutebrowser "$out/bin/qutebrowser"
sed -i "s,/usr/share/,$out/share/,g" qutebrowser/utils/standarddir.py
'' + lib.optionalString withPdfReader ''
sed -i "s,/usr/share/pdf.js,${pdfjs},g" qutebrowser/browser/pdfjs.py

View File

@ -0,0 +1,29 @@
diff --git a/qutebrowser/app.py b/qutebrowser/app.py
index 2b6896b76..ee05f379d 100644
--- a/qutebrowser/app.py
+++ b/qutebrowser/app.py
@@ -555,22 +555,8 @@ class Quitter:
args: The commandline as a list of strings.
cwd: The current working directory as a string.
"""
- if os.path.basename(sys.argv[0]) == 'qutebrowser':
- # Launched via launcher script
- args = [sys.argv[0]]
- cwd = None
- elif hasattr(sys, 'frozen'):
- args = [sys.executable]
- cwd = os.path.abspath(os.path.dirname(sys.executable))
- else:
- args = [sys.executable, '-m', 'qutebrowser']
- cwd = os.path.join(
- os.path.abspath(os.path.dirname(qutebrowser.__file__)), '..')
- if not os.path.isdir(cwd):
- # Probably running from a python egg. Let's fallback to
- # cwd=None and see if that works out.
- # See https://github.com/qutebrowser/qutebrowser/issues/323
- cwd = None
+ args = ['@qutebrowser@']
+ cwd = None
# Add all open pages so they get reopened.
page_args = []