diff --git a/src/calibre/linux_installer.py b/src/calibre/linux_installer.py index 9d215ba87e..7a55d134d3 100644 --- a/src/calibre/linux_installer.py +++ b/src/calibre/linux_installer.py @@ -204,12 +204,12 @@ class ProgressBar: LAUNCHER='''\ -#!/bin/sh +#!/bin/bash frozen_path=%s export ORIGWD=`pwd` export LD_LIBRARY_PATH=$frozen_path:$LD_LIBRARY_PATH cd $frozen_path -./%s $* +./%s "$@" ''' def extract_tarball(tar, destdir): diff --git a/src/calibre/parallel.py b/src/calibre/parallel.py index c2f0149ae8..3d169f4822 100644 --- a/src/calibre/parallel.py +++ b/src/calibre/parallel.py @@ -11,7 +11,7 @@ from calibre.ebooks.lrf.any.convert_from import main as any2lrf from calibre.ebooks.lrf.web.convert_from import main as web2lrf from calibre.ebooks.lrf.feeds.convert_from import main as feeds2lrf from calibre.gui2.lrf_renderer.main import main as lrfviewer -from calibre import iswindows, __appname__ +from calibre import iswindows, __appname__, islinux try: from calibre.utils.single_qt_application import SingleApplication except: @@ -41,7 +41,11 @@ if iswindows: python = os.path.join(os.path.dirname(python), 'parallel.exe') else: python = os.path.join(os.path.dirname(python), 'Scripts\\parallel.exe') - popen = partial(subprocess.Popen, creationflags=0x08) # CREATE_NO_WINDOW=0x08 so that no ugly console is popped up + popen = partial(subprocess.Popen, creationflags=0x08) # CREATE_NO_WINDOW=0x08 so that no ugly console is popped up + +if islinux and hasattr(sys, 'frozen_path'): + python = os.path.join(getattr(sys, 'frozen_path'), 'parallel') + popen = partial(subprocess.Popen, cwd=getattr(sys, 'frozen_path')) def cleanup(tdir): try: diff --git a/upload.py b/upload.py index 15362fbeba..157cce4e7c 100644 --- a/upload.py +++ b/upload.py @@ -125,7 +125,8 @@ open(hook, 'wb').write('hiddenimports = %%s'%%repr(temp) + '\\n') sys.path.insert(0, CALIBRESRC) from calibre.linux import entry_points -executables, scripts = ['calibre_postinstall'], [os.path.join(CALIBRESRC, 'calibre', 'linux.py')] +executables, scripts = ['calibre_postinstall', 'parallel'], + [os.path.join(CALIBRESRC, 'calibre', 'linux.py'), os.path.join(CALIBRESRC, 'calibre', 'parallel.py')] for entry in entry_points['console_scripts'] + entry_points['gui_scripts']: fields = entry.split('=')