Browse Source

Show commit hash when running from GitHub sources

pull/1637/head
Safihre 5 years ago
parent
commit
9a7385789e
  1. 11
      SABnzbd.py
  2. 2
      interfaces/Config/templates/config.tmpl
  3. 1
      sabnzbd/version.py

11
SABnzbd.py

@ -1129,8 +1129,17 @@ def main():
if no_file_log:
logging.info("Console logging only")
# Start SABnzbd
logging.info("--------------------------------")
logging.info("%s-%s (rev=%s)", sabnzbd.MY_NAME, sabnzbd.__version__, sabnzbd.__baseline__)
logging.info("%s-%s", sabnzbd.MY_NAME, sabnzbd.__version__)
# See if we can get version from git when running an unknown revision
if sabnzbd.__baseline__ == "unknown":
try:
sabnzbd.__baseline__ = sabnzbd.misc.run_command(["git", "rev-parse", "--short", "HEAD"]).strip()
except:
pass
logging.info("Commit: %s", sabnzbd.__baseline__)
logging.info("Full executable path = %s", sabnzbd.MY_FULLNAME)
if sabnzbd.WIN32:
suffix = ""

2
interfaces/Config/templates/config.tmpl

@ -9,7 +9,7 @@
<tbody>
<tr>
<th scope="row">$T('version'): </th>
<td>$version [$build]</td>
<td>$version [<a href="https://github.com/sabnzbd/sabnzbd/commit/$build" target="_blank">$build</a>]</td>
</tr>
<tr>
<th scope="row">$T('uptime'): </th>

1
sabnzbd/version.py

@ -1,5 +1,6 @@
# This file will be patched by setup.py
# The __version__ should be set to the branch name
# Leave __baseline__ set to unknown to enable setting commit-hash
# (e.g. "develop" or "1.2.x")
# You MUST use double quotes (so " and not ')

Loading…
Cancel
Save