mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-09-11 23:23:27 +02:00
Merge branch 'checkupdates' into 'master'
tighten up checkupdates See merge request fdroid/fdroidserver!474
This commit is contained in:
commit
8215bbbe9a
@ -174,7 +174,7 @@ __complete_publish() {
|
||||
|
||||
__complete_checkupdates() {
|
||||
opts="-v -q"
|
||||
lopts="--verbose --quiet --auto --autoonly --commit --gplay"
|
||||
lopts="--verbose --quiet --auto --autoonly --commit --gplay --allow-dirty"
|
||||
case "${cur}" in
|
||||
-*)
|
||||
__complete_options
|
||||
|
@ -1233,6 +1233,7 @@ def main():
|
||||
txt = "* build session started at " + common.get_wiki_timestamp(start_timestamp) + '\n' \
|
||||
+ "* this build started at " + build_starttime + '\n' \
|
||||
+ "* this build completed at " + common.get_wiki_timestamp() + '\n' \
|
||||
+ common.get_git_describe_link() \
|
||||
+ '* fdroidserverid: [https://gitlab.com/fdroid/fdroidserver/commit/' \
|
||||
+ fdroidserverid + ' ' + fdroidserverid + ']\n\n'
|
||||
if buildserverid:
|
||||
|
@ -535,6 +535,7 @@ def update_wiki(gplaylog, locallog):
|
||||
newpage = site.Pages[wiki_page_path]
|
||||
txt = ''
|
||||
txt += "* command line: <code>" + ' '.join(sys.argv) + "</code>\n"
|
||||
txt += common.get_git_describe_link()
|
||||
txt += "* started at " + common.get_wiki_timestamp(start_timestamp) + '\n'
|
||||
txt += "* completed at " + common.get_wiki_timestamp() + '\n'
|
||||
txt += "\n\n"
|
||||
@ -572,6 +573,8 @@ def main():
|
||||
help=_("Only process apps with auto-updates"))
|
||||
parser.add_argument("--commit", action="store_true", default=False,
|
||||
help=_("Commit changes"))
|
||||
parser.add_argument("--allow-dirty", action="store_true", default=False,
|
||||
help=_("Run on git repo that has uncommitted changes"))
|
||||
parser.add_argument("--gplay", action="store_true", default=False,
|
||||
help=_("Only print differences with the Play Store"))
|
||||
metadata.add_metadata_arguments(parser)
|
||||
@ -580,6 +583,12 @@ def main():
|
||||
|
||||
config = common.read_config(options)
|
||||
|
||||
if not options.allow_dirty:
|
||||
status = subprocess.check_output(['git', 'status', '--porcelain'])
|
||||
if status:
|
||||
logging.error(_('Build metadata git repo has uncommited changes!'))
|
||||
sys.exit(1)
|
||||
|
||||
# Get all apps...
|
||||
allapps = metadata.read_metadata()
|
||||
|
||||
|
@ -3100,3 +3100,21 @@ def get_android_tools_version_log(ndk_path=None):
|
||||
log += '* ' + name + ' (' + version + ')\n'
|
||||
|
||||
return log
|
||||
|
||||
|
||||
def get_git_describe_link():
|
||||
"""Get a link to the current fdroiddata commit, to post to the wiki
|
||||
|
||||
"""
|
||||
try:
|
||||
output = subprocess.check_output(['git', 'describe', '--always', '--dirty', '--abbrev=0'],
|
||||
universal_newlines=True).strip()
|
||||
except subprocess.CalledProcessError:
|
||||
pass
|
||||
if output:
|
||||
commit = output.replace('-dirty', '')
|
||||
return ('* fdroiddata: [https://gitlab.com/fdroid/fdroiddata/commit/{commit} {id}]\n'
|
||||
.format(commit=commit, id=output))
|
||||
else:
|
||||
logging.error(_("'{path}' failed to execute!").format(path='git describe'))
|
||||
return ''
|
||||
|
@ -329,6 +329,7 @@ def update_wiki(apps, sortedids, apks):
|
||||
txt += "* command line: <code>" + ' '.join(sys.argv) + "</code>\n"
|
||||
txt += "* started at " + common.get_wiki_timestamp(start_timestamp) + '\n'
|
||||
txt += "* completed at " + common.get_wiki_timestamp() + '\n'
|
||||
txt += common.get_git_describe_link()
|
||||
txt += "\n\n"
|
||||
txt += common.get_android_tools_version_log()
|
||||
newpage.save(txt, summary='Run log')
|
||||
|
Loading…
Reference in New Issue
Block a user