mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-04-21 09:03:25 +02:00
linux installer: ensure python libdir exists
When using a staging root, the environment module failed to install.
This commit is contained in:
parent
af39e30d63
commit
c4f232b967
1 changed files with 4 additions and 3 deletions
|
|
@ -141,12 +141,14 @@ def run(self, opts):
|
|||
def install_env_module(self):
|
||||
import distutils.sysconfig as s
|
||||
libdir = s.get_python_lib(prefix=self.opts.staging_root)
|
||||
if os.path.exists(libdir):
|
||||
try:
|
||||
if not os.path.exists(libdir):
|
||||
os.makedirs(libdir)
|
||||
path = os.path.join(libdir, 'init_calibre.py')
|
||||
self.info('Installing calibre environment module: '+path)
|
||||
with open(path, 'wb') as f:
|
||||
f.write(HEADER.format(**self.template_args()))
|
||||
else:
|
||||
except:
|
||||
self.warn('Cannot install calibre environment module to: '+libdir)
|
||||
|
||||
def install_files(self):
|
||||
|
|
@ -331,4 +333,3 @@ def pre_sub_commands(self, opts):
|
|||
|
||||
def run(self, opts):
|
||||
self.info('\n\nAll done! You should now be able to run "%s setup.py install" to install calibre' % sys.executable)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue