mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Support a common verion number for all commands.
This commit is contained in:
parent
69e593825e
commit
efb6688be0
@ -31,18 +31,21 @@ import sys
|
|||||||
import urllib2
|
import urllib2
|
||||||
import urlparse
|
import urlparse
|
||||||
|
|
||||||
import check
|
try:
|
||||||
import config
|
import check
|
||||||
import defaults
|
import config
|
||||||
import error
|
import defaults
|
||||||
import execute
|
import error
|
||||||
import log
|
import execute
|
||||||
import path
|
import log
|
||||||
|
import path
|
||||||
#
|
import version
|
||||||
# Version of Sourcer Builder Build.
|
except KeyboardInterrupt:
|
||||||
#
|
print 'abort: user terminated'
|
||||||
version = '0.1'
|
sys.exit(1)
|
||||||
|
except:
|
||||||
|
print 'error: unknown application load error'
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def _notice(opts, text):
|
def _notice(opts, text):
|
||||||
if not opts.quiet() and not log.default.has_stdout():
|
if not opts.quiet() and not log.default.has_stdout():
|
||||||
@ -515,7 +518,7 @@ def run(args):
|
|||||||
optargs = { '--list-configs': 'List available configurations' }
|
optargs = { '--list-configs': 'List available configurations' }
|
||||||
opts, _defaults = defaults.load(args, optargs)
|
opts, _defaults = defaults.load(args, optargs)
|
||||||
log.default = log.log(opts.logfiles())
|
log.default = log.log(opts.logfiles())
|
||||||
_notice(opts, 'RTEMS Source Builder, Package Builder v%s' % (version))
|
_notice(opts, 'RTEMS Source Builder, Package Builder v%s' % (version.str()))
|
||||||
if not check.host_setup(opts, _defaults):
|
if not check.host_setup(opts, _defaults):
|
||||||
if not opts.force():
|
if not opts.force():
|
||||||
raise error.general('host build environment is not set up' +
|
raise error.general('host build environment is not set up' +
|
||||||
|
@ -28,11 +28,7 @@ import error
|
|||||||
import execute
|
import execute
|
||||||
import log
|
import log
|
||||||
import path
|
import path
|
||||||
|
import version
|
||||||
#
|
|
||||||
# Version of Sourcer Builder Check.
|
|
||||||
#
|
|
||||||
version = '0.1'
|
|
||||||
|
|
||||||
def _notice(opts, text):
|
def _notice(opts, text):
|
||||||
if not opts.quiet() and log.default and not log.default.has_stdout():
|
if not opts.quiet() and log.default and not log.default.has_stdout():
|
||||||
@ -140,10 +136,11 @@ def run():
|
|||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
_opts, _defaults = defaults.load(args = sys.argv)
|
_opts, _defaults = defaults.load(args = sys.argv)
|
||||||
|
_notice(_opts, 'RTEMS Source Builder - Check, v%s' % (version.str()))
|
||||||
if host_setup(_opts, _defaults):
|
if host_setup(_opts, _defaults):
|
||||||
print 'RTEMS Source Builder environment is ok'
|
print 'Environment is ok'
|
||||||
else:
|
else:
|
||||||
print 'RTEMS Source Builder environment is not correctly set up'
|
print 'Environment is not correctly set up'
|
||||||
except error.general, gerr:
|
except error.general, gerr:
|
||||||
print gerr
|
print gerr
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -37,6 +37,7 @@ try:
|
|||||||
import log
|
import log
|
||||||
import path
|
import path
|
||||||
import setbuilder
|
import setbuilder
|
||||||
|
import version
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print 'user terminated'
|
print 'user terminated'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -44,11 +45,6 @@ except:
|
|||||||
print 'error: unknown application load error'
|
print 'error: unknown application load error'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
#
|
|
||||||
# Version of Sourcer Builder Build.
|
|
||||||
#
|
|
||||||
version = '0.1'
|
|
||||||
|
|
||||||
def _notice(opts, text):
|
def _notice(opts, text):
|
||||||
if not opts.quiet() and not log.default.has_stdout():
|
if not opts.quiet() and not log.default.has_stdout():
|
||||||
print text
|
print text
|
||||||
@ -371,7 +367,7 @@ def run(args):
|
|||||||
log.default = log.log(opts.logfiles())
|
log.default = log.log(opts.logfiles())
|
||||||
if opts.get_arg('--output') and len(opts.params()) > 1:
|
if opts.get_arg('--output') and len(opts.params()) > 1:
|
||||||
raise error.general('--output can only be used with a single config')
|
raise error.general('--output can only be used with a single config')
|
||||||
print 'RTEMS Source Builder, Reporter v%s' % (version)
|
print 'RTEMS Source Builder, Reporter v%s' % (version.str())
|
||||||
if not check.host_setup(opts, _defaults):
|
if not check.host_setup(opts, _defaults):
|
||||||
_notice(opts, 'warning: forcing build with known host setup problems')
|
_notice(opts, 'warning: forcing build with known host setup problems')
|
||||||
configs = build.get_configs(opts, _defaults)
|
configs = build.get_configs(opts, _defaults)
|
||||||
|
@ -38,6 +38,7 @@ try:
|
|||||||
import log
|
import log
|
||||||
import path
|
import path
|
||||||
import reports
|
import reports
|
||||||
|
import vrrsion
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print 'abort: user terminated'
|
print 'abort: user terminated'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
@ -45,11 +46,6 @@ except:
|
|||||||
print 'error: unknown application load error'
|
print 'error: unknown application load error'
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
#
|
|
||||||
# Version of RTEMS Source Builder Set Builder.
|
|
||||||
#
|
|
||||||
version = '0.1'
|
|
||||||
|
|
||||||
def _trace(opts, text):
|
def _trace(opts, text):
|
||||||
if opts.trace():
|
if opts.trace():
|
||||||
print text
|
print text
|
||||||
@ -366,7 +362,7 @@ def run():
|
|||||||
'--pkg-tar-files': 'Create package tar files' }
|
'--pkg-tar-files': 'Create package tar files' }
|
||||||
opts, _defaults = defaults.load(sys.argv, optargs)
|
opts, _defaults = defaults.load(sys.argv, optargs)
|
||||||
log.default = log.log(opts.logfiles())
|
log.default = log.log(opts.logfiles())
|
||||||
_notice(opts, 'RTEMS Source Builder - Set Builder, v%s' % (version))
|
_notice(opts, 'RTEMS Source Builder - Set Builder, v%s' % (version.str()))
|
||||||
if not check.host_setup(opts, _defaults):
|
if not check.host_setup(opts, _defaults):
|
||||||
raise error.general('host build environment is not set up correctly')
|
raise error.general('host build environment is not set up correctly')
|
||||||
configs = build.get_configs(opts, _defaults)
|
configs = build.get_configs(opts, _defaults)
|
||||||
|
37
source-builder/sb/version.py
Normal file
37
source-builder/sb/version.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
#
|
||||||
|
# RTEMS Tools Project (http://www.rtems.org/)
|
||||||
|
# Copyright 2010-2013 Chris Johns (chrisj@rtems.org)
|
||||||
|
# All rights reserved.
|
||||||
|
#
|
||||||
|
# This file is part of the RTEMS Tools package in 'rtems-tools'.
|
||||||
|
#
|
||||||
|
# Permission to use, copy, modify, and/or distribute this software for any
|
||||||
|
# purpose with or without fee is hereby granted, provided that the above
|
||||||
|
# copyright notice and this permission notice appear in all copies.
|
||||||
|
#
|
||||||
|
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||||
|
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||||
|
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||||
|
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||||
|
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||||
|
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||||
|
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
|
|
||||||
|
#
|
||||||
|
# Manage paths locally. The internally the path is in Unix or shell format and
|
||||||
|
# we convert to the native format when performing operations at the Python
|
||||||
|
# level. This allows macro expansion to work.
|
||||||
|
#
|
||||||
|
|
||||||
|
major = 0
|
||||||
|
minor = 2
|
||||||
|
revision = 0
|
||||||
|
|
||||||
|
def str():
|
||||||
|
return '%d.%d.%d'% (major, minor, revision)
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
print 'major = %d' % (major)
|
||||||
|
print 'minor = %d' % (minor)
|
||||||
|
print 'revision = %d' % (revision)
|
||||||
|
print 'Version: %s' % (str())
|
Loading…
x
Reference in New Issue
Block a user