mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Fixes for CVS to work. Add RTEMS build for sparc/sis.
This commit is contained in:
@@ -131,7 +131,7 @@ class build:
|
||||
source = download.parse_url(url, '_sourcedir', self.config, self.opts)
|
||||
download.get_file(source['url'], source['local'], self.opts, self.config)
|
||||
if 'symlink' in source:
|
||||
source['script'] = '%%{__ln_s} %s ${source_dir_%d}' % (source['local'], source_tag)
|
||||
source['script'] = '%%{__ln_s} %s ${source_dir_%d}' % (source['symlink'], source_tag)
|
||||
elif 'compressed' in source:
|
||||
source['script'] = source['compressed'] + ' ' + \
|
||||
source['local'] + ' | %{__tar_extract} -'
|
||||
|
@@ -32,6 +32,16 @@ import path
|
||||
class repo:
|
||||
"""An object to manage a cvs repo."""
|
||||
|
||||
def __init__(self, _path, opts, macros = None, prefix = None):
|
||||
self.path = _path
|
||||
self.opts = opts
|
||||
self.prefix = prefix
|
||||
if macros is None:
|
||||
self.macros = opts.defaults
|
||||
else:
|
||||
self.macros = macros
|
||||
self.cvs = self.macros.expand('%{__cvs}')
|
||||
|
||||
def _cvs_exit_code(self, cmd, ec, output):
|
||||
if ec:
|
||||
log.output(output)
|
||||
@@ -53,9 +63,10 @@ class repo:
|
||||
def _run(self, args, check = False, cwd = None):
|
||||
e = execute.capture_execution()
|
||||
if cwd is None:
|
||||
if not path.exists(self.path):
|
||||
raise error.general('cvs path needs to exist: %s' % (self.path))
|
||||
cwd = self.path
|
||||
_path = path.join(self.path, self.prefix)
|
||||
if not path.exists(_path):
|
||||
raise error.general('cvs path needs to exist: %s' % (_path))
|
||||
cwd = _path
|
||||
cmd = [self.cvs, '-q'] + args
|
||||
log.output('cmd: (%s) %s' % (str(cwd), ' '.join(cmd)))
|
||||
exit_code, proc, output = e.spawn(cmd, cwd = cwd)
|
||||
@@ -64,16 +75,6 @@ class repo:
|
||||
self._cvs_exit_code(cmd, exit_code, output)
|
||||
return exit_code, output
|
||||
|
||||
def __init__(self, _path, opts, macros = None, prefix = None):
|
||||
self.path = _path
|
||||
self.opts = opts
|
||||
self.prefix = prefix
|
||||
if macros is None:
|
||||
self.macros = opts.defaults
|
||||
else:
|
||||
self.macros = macros
|
||||
self.cvs = self.macros.expand('%{__cvs}')
|
||||
|
||||
def cvs_version(self):
|
||||
ec, output = self._run(['--version'], True)
|
||||
lines = output.split('\n')
|
||||
@@ -98,7 +99,7 @@ class repo:
|
||||
ec, output = self._run(cmd, check = True)
|
||||
|
||||
def update(self):
|
||||
ec, output = self._run(['up'])
|
||||
ec, output = self._run(['up'], check = True)
|
||||
|
||||
def reset(self):
|
||||
ec, output = self._run(['up', '-C'], check = True)
|
||||
|
@@ -77,8 +77,14 @@ def _cvs_parser(source, config, opts):
|
||||
except:
|
||||
raise error.general('invalid cvs path: %s' % (source['url']))
|
||||
source['local'] = path.join(source['local_prefix'], 'cvs', source['file'])
|
||||
for a in us[1:]:
|
||||
_as = a.split('=')
|
||||
if _as[0] == 'src-prefix':
|
||||
if len(_as) != 2:
|
||||
raise error.general('invalid cvs src-prefix: %s' % (a))
|
||||
source['src_prefix'] = _as[1]
|
||||
if 'src_prefix' in source:
|
||||
source['symlink'] = path.join(source['local'])
|
||||
source['symlink'] = path.join(source['local'], source['src_prefix'])
|
||||
else:
|
||||
source['symlink'] = source['local']
|
||||
|
||||
@@ -225,14 +231,14 @@ def _cvs_downloader(url, local, config, opts):
|
||||
date = _as[1]
|
||||
repo = cvs.repo(local, opts, config.macros, src_prefix)
|
||||
if not repo.valid():
|
||||
log.notice('cvs: checkout: %s -> %s' % (us[0], rlp))
|
||||
if not path.isdir(local):
|
||||
log.notice('Creating source directory: %s' % \
|
||||
(os.path.relpath(path.host(local))))
|
||||
log.output('making dir: %s' % (path.host(path.dirname(local))))
|
||||
if not opts.dry_run():
|
||||
path.mkdir(local)
|
||||
repo.checkout(':%s' % (us[0][6:]), module, tag, date)
|
||||
log.notice('cvs: checkout: %s -> %s' % (us[0], rlp))
|
||||
if not opts.dry_run():
|
||||
repo.checkout(':%s' % (us[0][6:]), module, tag, date)
|
||||
for a in us[1:]:
|
||||
_as = a.split('=')
|
||||
if _as[0] == 'update':
|
||||
|
Reference in New Issue
Block a user