semantic version support in admin
This commit is contained in:
@@ -30,7 +30,7 @@ update:
|
|||||||
echo "remember that pymysql was tweaked"
|
echo "remember that pymysql was tweaked"
|
||||||
src:
|
src:
|
||||||
### Use semantic versioning
|
### Use semantic versioning
|
||||||
echo 'Version 2.3.2-alpha.1+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
echo 'Version 2.4.1-alpha.1+timestamp.'`date +%Y.%m.%d.%H.%M.%S` > VERSION
|
||||||
### rm -f all junk files
|
### rm -f all junk files
|
||||||
make clean
|
make clean
|
||||||
### clean up baisc apps
|
### clean up baisc apps
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
Version 2.3.2-alpha.1+timestamp.2012.12.20.15.39.20
|
Version 2.4.1-alpha.1+timestamp.2012.12.20.15.47.02
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<!-- VERSION -->
|
<!-- VERSION -->
|
||||||
{{if is_manager():}}
|
{{if is_manager():}}
|
||||||
<div class="box">
|
<div class="box">
|
||||||
<h3>{{=T("Version %s.%s.%s (%s) %s", myversion)}}</h3>
|
<h3>{{=T("Version %s.%s.%s %s (%s)", myversion)}}</h3>
|
||||||
{{if session.check_version:}}
|
{{if session.check_version:}}
|
||||||
<p id="check_version">
|
<p id="check_version">
|
||||||
{{=T('Checking for upgrades...')}}
|
{{=T('Checking for upgrades...')}}
|
||||||
|
|||||||
+4
-5
@@ -67,11 +67,10 @@ def parse_legacy(version="Version 1.99.0 (2011-09-19 08:23:26)"):
|
|||||||
return (a, b, c, pre_release, build)
|
return (a, b, c, pre_release, build)
|
||||||
|
|
||||||
def parse_version(version):
|
def parse_version(version):
|
||||||
items = parse_semantic(version)
|
version_tuple = parse_semantic(version)
|
||||||
if not items:
|
if not version_tuple:
|
||||||
items = parse_legacy(version)
|
version_tuple = parse_legacy(version)
|
||||||
(a, b, c, pre_release, build) = items
|
return version_tuple
|
||||||
return (a, b, c, build, pre_release) # build, pre_releas intentionally reversed
|
|
||||||
|
|
||||||
def read_file(filename, mode='r'):
|
def read_file(filename, mode='r'):
|
||||||
"returns content from filename, making sure to close the file explicitly on exit."
|
"returns content from filename, making sure to close the file explicitly on exit."
|
||||||
|
|||||||
+4
-3
@@ -101,13 +101,14 @@ requests = 0 # gc timer
|
|||||||
# pattern used to validate client address
|
# pattern used to validate client address
|
||||||
regex_client = re.compile('[\w\-:]+(\.[\w\-]+)*\.?') # ## to account for IPV6
|
regex_client = re.compile('[\w\-:]+(\.[\w\-]+)*\.?') # ## to account for IPV6
|
||||||
|
|
||||||
try:
|
#try:
|
||||||
|
if 1:
|
||||||
version_info = open(pjoin(global_settings.gluon_parent, 'VERSION'), 'r')
|
version_info = open(pjoin(global_settings.gluon_parent, 'VERSION'), 'r')
|
||||||
raw_version_string = version_info.read().strip()
|
raw_version_string = version_info.read().strip()
|
||||||
version_info.close()
|
version_info.close()
|
||||||
global_settings.web2py_version = parse_version(raw_version_string)
|
global_settings.web2py_version = parse_version(raw_version_string)
|
||||||
except:
|
#except:
|
||||||
raise RuntimeError("Cannot determine web2py version")
|
# raise RuntimeError("Cannot determine web2py version")
|
||||||
|
|
||||||
web2py_version = global_settings.web2py_version
|
web2py_version = global_settings.web2py_version
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user