mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Add support for atch paths.
This commit is contained in:
parent
3cb08b5230
commit
ec26725433
11
sb/build.py
11
sb/build.py
@ -125,6 +125,8 @@ class build:
|
|||||||
_notice(self.opts, 'warning: cannot make directory: %s' % (mkpath))
|
_notice(self.opts, 'warning: cannot make directory: %s' % (mkpath))
|
||||||
|
|
||||||
def get_file(self, url, local):
|
def get_file(self, url, local):
|
||||||
|
if local is None:
|
||||||
|
raise error.general('source/patch path invalid')
|
||||||
if not path.isdir(path.dirname(local)):
|
if not path.isdir(path.dirname(local)):
|
||||||
if not self.opts.force():
|
if not self.opts.force():
|
||||||
raise error.general('source path not found: %s; (--force to create)' \
|
raise error.general('source path not found: %s; (--force to create)' \
|
||||||
@ -200,7 +202,12 @@ class build:
|
|||||||
#
|
#
|
||||||
# Get the file. Checks the local source directory first.
|
# Get the file. Checks the local source directory first.
|
||||||
#
|
#
|
||||||
source['local'] = path.join(self.config.abspath(pathkey), source['file'])
|
source['local'] = None
|
||||||
|
for p in self.config.define(pathkey).split(':'):
|
||||||
|
local = path.join(path.abspath(p), source['file'])
|
||||||
|
if source['local'] is None or path.exists(local):
|
||||||
|
source['local'] = local
|
||||||
|
break
|
||||||
#
|
#
|
||||||
# Is the file compressed ?
|
# Is the file compressed ?
|
||||||
#
|
#
|
||||||
@ -260,7 +267,7 @@ class build:
|
|||||||
#
|
#
|
||||||
# If not in the source builder package check the source directory.
|
# If not in the source builder package check the source directory.
|
||||||
#
|
#
|
||||||
if not path.isfile(patch['local']):
|
if not path.exists(patch['local']):
|
||||||
patch = self.parse_url(url, '_sourcedir')
|
patch = self.parse_url(url, '_sourcedir')
|
||||||
self.get_file(patch['url'], patch['local'])
|
self.get_file(patch['url'], patch['local'])
|
||||||
if 'compressed' in patch:
|
if 'compressed' in patch:
|
||||||
|
@ -63,7 +63,7 @@ defaults = {
|
|||||||
'_configdir': ('dir', 'optional', '%{_topdir}/config:%{_sbdir}/config'),
|
'_configdir': ('dir', 'optional', '%{_topdir}/config:%{_sbdir}/config'),
|
||||||
'_tardir': ('dir', 'optional', '%{_topdir}/tar'),
|
'_tardir': ('dir', 'optional', '%{_topdir}/tar'),
|
||||||
'_sourcedir': ('dir', 'optional', '%{_topdir}/sources'),
|
'_sourcedir': ('dir', 'optional', '%{_topdir}/sources'),
|
||||||
'_patchdir': ('dir', 'required', '%{_sbdir}/patches'),
|
'_patchdir': ('dir', 'optional', '%{_topdir}/patches:%{_sbdir}/patches'),
|
||||||
'_builddir': ('dir', 'optional', '%{_topdir}/build/%{name}-%{version}-%{release}'),
|
'_builddir': ('dir', 'optional', '%{_topdir}/build/%{name}-%{version}-%{release}'),
|
||||||
'_docdir': ('dir', 'none', '%{_defaultdocdir}'),
|
'_docdir': ('dir', 'none', '%{_defaultdocdir}'),
|
||||||
'_tmppath': ('dir', 'none', '%{_topdir}/build/tmp'),
|
'_tmppath': ('dir', 'none', '%{_topdir}/build/tmp'),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user