Skip to content

Commit

Permalink
Builder: Zipped apps are included in the feed after build 1201
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Apr 16, 2014
1 parent 71d62c6 commit 6eaa27d
Showing 1 changed file with 31 additions and 12 deletions.
43 changes: 31 additions & 12 deletions distrib/builder/event.py
Expand Up @@ -38,10 +38,12 @@ def __init__(self, build=None, latestAvailable=False):
# Where the build is located.
self.buildDir = os.path.join(config.EVENT_DIR, self.name)

self.packages = ['doomsday', 'fmod']
self.packages = ['doomsday', 'doomsday_app', 'doomsday_shell_app', 'fmod']

self.packageName = {'doomsday': 'Doomsday',
'fmod': 'FMOD Ex Audio Plugin'}
self.packageName = {'doomsday': 'Doomsday',
'doomsday_app': 'Doomsday Engine.app',
'doomsday_shell_app': 'Doomsday Shell.app',
'fmod': 'FMOD Ex Audio Plugin'}

if self.num >= 816: # Added Mac OS X 10.8.
# Platforms: Name File ext sys_id()
Expand Down Expand Up @@ -85,12 +87,17 @@ def __init__(self, build=None, latestAvailable=False):

def package_type(self, name):
pkg = self.package_from_filename(name)
if pkg == 'doomsday':
return 'distribution'
else:
if pkg == 'fmod':
return 'plugin'
else:
return 'distribution'

def package_from_filename(self, name):
if name.endswith('.zip'):
if 'doomsday_osx' in name:
return 'doomsday_app'
if 'doomsday_shell_osx' in name:
return 'doomsday_shell_app'
if 'fmod' in name:
return 'fmod'
else:
Expand All @@ -101,18 +108,26 @@ def os_from_filename(self, name):
for n, ext, ident in self.oses:
if name.endswith(ext) or ident in name:
found = (n, ext, ident)
if n.startswith('Mac OS X 10.') and name.endswith('.zip'):
osx = '_osx' + n[12] + '_'
if osx in name:
found = (n, ext, ident)
return found

def version_from_filename(self, name):
ver = self.extract_version_from_filename(name)
if not ver and self.package_from_filename(name) == 'doomsday':
ver = self.extract_version_from_filename(name)
if not ver and self.package_from_filename(name) != 'fmod':
# Fall back to the event version, if it exists.
ev = self.version()
if ev: return ev
return ver

def extract_version_from_filename(self, name):
pos = name.find('_')
if '_osx' in name:
pos = name.find('_osx') + 6
else:
pos = 0
pos = name.find('_', pos)
if pos < 0: return None
dash = name.find('-', pos + 1)
us = name.find('_', pos + 1)
Expand Down Expand Up @@ -165,6 +180,10 @@ def list_package_files(self):
glob.glob(os.path.join(self.buildDir, '*.exe')) + \
glob.glob(os.path.join(self.buildDir, '*.deb')) + \
glob.glob(os.path.join(self.buildDir, '*.tar.gz'))

if self.num > 1201:
# Zipped apps added.
files += glob.glob(os.path.join(self.buildDir, '*.zip'))

return [os.path.basename(f) for f in files]

Expand Down Expand Up @@ -227,7 +246,7 @@ def compress_logs(self):

def download_uri(self, fn):
# Available on SourceForge?
if self.number() >= 350 and (fn.endswith('.exe') or fn.endswith('.deb') or fn.endswith('.dmg')):
if self.number() >= 350 and (fn.endswith('.exe') or fn.endswith('.deb') or fn.endswith('.dmg') or fn.endswith('.zip')):
if self.release_type() == 'stable':
return "http://sourceforge.net/projects/deng/files/Doomsday%%20Engine/%s/%s/download" \
% (self.version_base(), fn)
Expand Down Expand Up @@ -271,9 +290,9 @@ def html_table_log_issues(self, logName):
def html_description(self, encoded=True):
"""Composes an HTML build report."""

name = self.name
name = self.name
buildDir = self.buildDir
oses = self.oses
oses = self.oses

msg = '<p>' + self.text_summary() + '</p>'

Expand Down

0 comments on commit 6eaa27d

Please sign in to comment.