mirror of https://github.com/BOINC/boinc.git
moved release.inc, removed branch, added link, changed git args
This commit is contained in:
parent
0c6fe9164f
commit
237375a6b9
|
@ -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();
|
||||
|
|
|
@ -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 (<a href=https://github.com/BOINC/boinc/commit/$git_commit>$git_commit)</a>)<br>";
|
||||
}
|
||||
|
||||
if ($j->db_revision) {
|
||||
|
|
|
@ -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 = '''<?php
|
||||
|
||||
global $git_commit;
|
||||
global $server_version;
|
||||
$git_commit = {commit}
|
||||
$git_branch = {branch}
|
||||
$server_version = {version}
|
||||
|
||||
\?>
|
||||
'''.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:
|
||||
|
|
Loading…
Reference in New Issue