mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Use a static tmp dir for user manual builds
This commit is contained in:
parent
07274c3ffa
commit
f8deedd4c8
@ -296,3 +296,9 @@ def installer_names(include_source=True):
|
|||||||
yield f'{base}-{__version__}-{arch}.txz'
|
yield f'{base}-{__version__}-{arch}.txz'
|
||||||
if include_source:
|
if include_source:
|
||||||
yield f'{base}-{__version__}.tar.xz'
|
yield f'{base}-{__version__}.tar.xz'
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache
|
||||||
|
def manual_build_dir():
|
||||||
|
# cant use tempfile.gettempdir() as calibre.startup overrides it
|
||||||
|
return os.path.join('/tmp', 'user-manual-build')
|
||||||
|
@ -11,10 +11,9 @@ import os
|
|||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
from setup import Command, __version__, installer_names, require_clean_git, require_git_master
|
from setup import Command, __version__, installer_names, manual_build_dir, require_clean_git, require_git_master
|
||||||
from setup.parallel_build import create_job, parallel_build
|
from setup.parallel_build import create_job, parallel_build
|
||||||
|
|
||||||
|
|
||||||
@ -180,7 +179,7 @@ class Manual(Command):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def run(self, opts):
|
def run(self, opts):
|
||||||
tdir = self.j(tempfile.gettempdir(), 'user-manual-build')
|
tdir = manual_build_dir()
|
||||||
if os.path.exists(tdir):
|
if os.path.exists(tdir):
|
||||||
shutil.rmtree(tdir)
|
shutil.rmtree(tdir)
|
||||||
os.mkdir(tdir)
|
os.mkdir(tdir)
|
||||||
|
@ -15,7 +15,7 @@ import subprocess
|
|||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
from subprocess import check_call
|
from subprocess import check_call
|
||||||
from tempfile import NamedTemporaryFile, gettempdir, mkdtemp
|
from tempfile import NamedTemporaryFile, mkdtemp
|
||||||
from zipfile import ZipFile
|
from zipfile import ZipFile
|
||||||
|
|
||||||
from polyglot.builtins import iteritems
|
from polyglot.builtins import iteritems
|
||||||
@ -25,7 +25,7 @@ if __name__ == '__main__':
|
|||||||
d = os.path.dirname
|
d = os.path.dirname
|
||||||
sys.path.insert(0, d(d(os.path.abspath(__file__))))
|
sys.path.insert(0, d(d(os.path.abspath(__file__))))
|
||||||
|
|
||||||
from setup import Command, __appname__, __version__, installer_names
|
from setup import Command, __appname__, __version__, installer_names, manual_build_dir
|
||||||
|
|
||||||
DOWNLOADS = '/srv/main/downloads'
|
DOWNLOADS = '/srv/main/downloads'
|
||||||
HTML2LRF = 'calibre/ebooks/lrf/html/demo'
|
HTML2LRF = 'calibre/ebooks/lrf/html/demo'
|
||||||
@ -343,7 +343,7 @@ class UploadUserManual(Command): # {{{
|
|||||||
for x in glob.glob(self.j(path, '*')):
|
for x in glob.glob(self.j(path, '*')):
|
||||||
self.build_plugin_example(x)
|
self.build_plugin_example(x)
|
||||||
|
|
||||||
srcdir = self.j(gettempdir(), 'user-manual-build', 'en', 'html') + '/'
|
srcdir = self.j(manual_build_dir(), 'en', 'html') + '/'
|
||||||
check_call(
|
check_call(
|
||||||
' '.join(
|
' '.join(
|
||||||
['rsync', '-zz', '-rl', '--info=progress2', srcdir, 'main:/srv/manual/']
|
['rsync', '-zz', '-rl', '--info=progress2', srcdir, 'main:/srv/manual/']
|
||||||
|
Loading…
x
Reference in New Issue
Block a user