path)
+def _get_build_timestamp():
+ return time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime())
+
+
def transform_first_char(string, method):
"""Uses method() on the first character of string."""
if len(string) == 0:
raise BuildException("Error locking root account for %s:%s" %
(app.id, build.versionName), p.output)
- p = FDroidPopen(['sudo', 'SUDO_FORCE_REMOVE=yes', 'apt-get', '-y', 'purge', 'sudo'])
+ p = FDroidPopen(['sudo', 'SUDO_FORCE_REMOVE=yes', 'dpkg', '--purge', 'sudo'])
if p.returncode != 0:
raise BuildException("Error removing sudo for %s:%s" %
(app.id, build.versionName), p.output)
if server:
# When using server mode, still keep a local cache of the repo, by
# grabbing the source now.
- vcs.gotorevision(build.commit)
+ vcs.gotorevision(build.commit, refresh)
build_server(app, build, vcs, build_dir, output_dir, log_dir, force)
else:
options = None
config = None
buildserverid = None
+starttime = _get_build_timestamp()
def main():
# Read all app and srclib metadata
pkgs = common.read_pkg_args(options.appid, True)
- allapps = metadata.read_metadata(not options.onserver, pkgs, sort_by_time=True)
+ allapps = metadata.read_metadata(not options.onserver, pkgs, options.refresh, sort_by_time=True)
apps = common.read_app_args(options.appid, allapps, True)
for appid, app in list(apps.items()):
# Build applications...
failed_apps = {}
build_succeeded = []
+ max_apps_per_run = 10
for appid, app in apps.items():
+ max_apps_per_run -= 1
+ if max_apps_per_run < 1:
+ break
first = True
for build in app.builds:
wikilog = None
+ build_starttime = _get_build_timestamp()
tools_version_log = ''
if not options.onserver:
tools_version_log = get_android_tools_version_log(build.ndk_path())
f.write('versionCode: %s\nversionName: %s\ncommit: %s\n' %
(build.versionCode, build.versionName, build.commit))
f.write('Build completed at '
- + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + '\n')
+ + _get_build_timestamp() + '\n')
f.write('\n' + tools_version_log + '\n')
f.write(str(e))
logging.error("Could not build app %s: %s" % (appid, e))
newpage = site.Pages[lastbuildpage]
with open(os.path.join('tmp', 'fdroidserverid')) as fp:
fdroidserverid = fp.read().rstrip()
- txt = "* build completed at " + time.strftime("%Y-%m-%d %H:%M:%SZ", time.gmtime()) + '\n' \
+ txt = "* build session started at " + starttime + '\n' \
+ + "* this build started at " + build_starttime + '\n' \
+ + "* this build completed at " + _get_build_timestamp() + '\n' \
+ '* fdroidserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \
+ fdroidserverid + ' ' + fdroidserverid + ']\n\n'
if options.onserver: