diff --git a/html/user/get_project_config.php b/html/user/get_project_config.php index 2fb20cdb67..37f8a3d3be 100644 --- a/html/user/get_project_config.php +++ b/html/user/get_project_config.php @@ -18,8 +18,8 @@ require_once("../inc/util.inc"); require_once("../inc/xml.inc"); -if(file_exists('../inc/release.inc')) - include '../inc/release.inc'; +if(file_exists('../../release.inc')) + include '../../release.inc'; BoincDb::get(true); xml_header(); diff --git a/html/user/server_status.php b/html/user/server_status.php index 1770a8ccdb..d4586afff3 100644 --- a/html/user/server_status.php +++ b/html/user/server_status.php @@ -30,8 +30,8 @@ require_once("../inc/cache.inc"); require_once("../inc/util.inc"); require_once("../inc/xml.inc"); require_once("../inc/boinc_db.inc"); -if(file_exists('../inc/release.inc')) - include '../inc/release.inc'; +if(file_exists('../../release.inc')) + include '../../release.inc'; if (!defined('STATUS_PAGE_TTL')) { define('STATUS_PAGE_TTL', 3600); @@ -186,8 +186,11 @@ function show_status_html($x) { } end_table(); + global $server_version; + global $git_commit; + if ( isset($server_version) && isset($git_commit) ) { - echo "Server version: $server_version ($git_commit)\n"; + echo "Server version: $server_version ($git_commit))
"; } if ($j->db_revision) { diff --git a/py/Boinc/setup_project.py b/py/Boinc/setup_project.py index f226790049..d322822773 100644 --- a/py/Boinc/setup_project.py +++ b/py/Boinc/setup_project.py @@ -341,25 +341,24 @@ def install_boinc_files(dest_dir, install_web_files, install_server_files): os.system("rm -f "+dir('html/languages/translations/*')) install_glob(srcdir('html/languages/translations/*.po'), dir('html/languages/translations/')) try: - os.remove(srcdir('html/inc/release.inc')) + os.remove(os.path.join(dest_dir, 'release.inc')) except OSError: pass try: s = subprocess.Popen(["git", "rev-parse", "HEAD"], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')) commit = s.stdout.read()[:7] - s = subprocess.Popen(["git", "branch"], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')) - branch = s.stdout.read().split('*')[1].split('\n')[0].strip() - s = subprocess.Popen(["git", "tag", "-l", "--points-at", "HEAD"], stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')) + s = subprocess.Popen(["git", "describe", "--match", "server_release/*", "--tags", "--exact", "HEAD"], + stdout=subprocess.PIPE, stderr=open(os.devnull, 'w')) version = s.stdout.read().split("/")[-1].strip() content = ''' -'''.format(commit=commit, branch=branch, version=version) - f = open(srcdir('html/inc/release.inc'), 'w') +'''.format(commit=commit, version=version) + f = open(os.path.join(dest_dir, 'release.inc'), 'w') f.write(content) f.close() except Exception, e: