mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
DRYer
This commit is contained in:
parent
e723ec4c47
commit
ea2816dc85
@ -8,7 +8,8 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import os, shutil, subprocess, glob, tempfile, json, time, filecmp, atexit, sys
|
import os, shutil, subprocess, glob, tempfile, json, time, filecmp, atexit, sys
|
||||||
|
|
||||||
from setup import Command, __version__, require_clean_git, require_git_master, installer_name
|
from setup import Command, __version__, require_clean_git, require_git_master
|
||||||
|
from setup.upload import installers
|
||||||
from setup.parallel_build import parallel_build
|
from setup.parallel_build import parallel_build
|
||||||
|
|
||||||
class Stage1(Command):
|
class Stage1(Command):
|
||||||
@ -98,8 +99,7 @@ class Stage2(Command):
|
|||||||
for p in sorted(processes, key=lambda p:p.duration):
|
for p in sorted(processes, key=lambda p:p.duration):
|
||||||
self.info('Built %s in %d minutes and %d seconds' % (p.bname, p.duration // 60, p.duration % 60))
|
self.info('Built %s in %d minutes and %d seconds' % (p.bname, p.duration // 60, p.duration % 60))
|
||||||
|
|
||||||
for ext, is64bit in {'msi': True, 'msi':False, 'exe':False, 'dmg':True, 'txz':True, 'txz':False}.iteritems():
|
for installer in installers(include_source=False):
|
||||||
installer = installer_name(ext, is64bit)
|
|
||||||
if not os.path.exists(self.j(self.d(self.SRC), installer)):
|
if not os.path.exists(self.j(self.d(self.SRC), installer)):
|
||||||
raise SystemExit('The installer %s does not exist' % os.path.basename(installer))
|
raise SystemExit('The installer %s does not exist' % os.path.basename(installer))
|
||||||
|
|
||||||
|
@ -25,11 +25,12 @@ STAGING_HOST = 'download.calibre-ebook.com'
|
|||||||
STAGING_USER = 'root'
|
STAGING_USER = 'root'
|
||||||
STAGING_DIR = '/root/staging'
|
STAGING_DIR = '/root/staging'
|
||||||
|
|
||||||
def installers():
|
def installers(include_source=True):
|
||||||
installers = list(map(installer_name, ('dmg', 'msi', 'txz')))
|
installers = list(map(installer_name, ('dmg', 'msi', 'txz')))
|
||||||
installers.append(installer_name('txz', is64bit=True))
|
installers.append(installer_name('txz', is64bit=True))
|
||||||
installers.append(installer_name('msi', is64bit=True))
|
installers.append(installer_name('msi', is64bit=True))
|
||||||
installers.insert(0, 'dist/%s-%s.tar.xz'%(__appname__, __version__))
|
if include_source:
|
||||||
|
installers.insert(0, 'dist/%s-%s.tar.xz'%(__appname__, __version__))
|
||||||
installers.append('dist/%s-portable-installer-%s.exe'%(__appname__, __version__))
|
installers.append('dist/%s-portable-installer-%s.exe'%(__appname__, __version__))
|
||||||
return installers
|
return installers
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user