mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
Change the CVS download path to include the module and tag/date.
This commit is contained in:
parent
1a3c484619
commit
c65b9eb7ec
@ -6,6 +6,15 @@
|
||||
|
||||
%include %{_configdir}/checks.cfg
|
||||
|
||||
#
|
||||
# Select Snapshot Macro Maps
|
||||
#
|
||||
%select gdb-snapshot
|
||||
%select expat-snapshot
|
||||
|
||||
#
|
||||
# The description.
|
||||
#
|
||||
Name: %{_target}-gdb-%{gdb_version}-%{release}
|
||||
Summary: GDB v%{gdb_version} for target %{_target} on host %{_host}
|
||||
Version: %{gdb_version}
|
||||
@ -33,8 +42,9 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
||||
# Prepare the source code.
|
||||
#
|
||||
%prep
|
||||
source_dir_0="gdb-%{gdb_version}"
|
||||
%setup -q -c -n %{name}-%{version}
|
||||
cd gdb-%{gdb_version}
|
||||
cd ${source_dir_0}
|
||||
%{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
|
||||
%{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
|
||||
%{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_opts:-p1}}
|
||||
@ -61,7 +71,7 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
|
||||
LIBS_STATIC="-lexpat"
|
||||
CFLAGS="$SB_OPT_FLAGS" \
|
||||
LIBS="%{_forced_static}" \
|
||||
../gdb-%{gdb_version}/configure \
|
||||
../${source_dir_0}/configure \
|
||||
--build=%{_build} --host=%{_host} \
|
||||
--target=%{_target} \
|
||||
--verbose --disable-nls \
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gdb-snapshot]
|
||||
GDB_Version: none, override, ' gdb-7.6-branch'
|
||||
GDB_Version: none, override, '7.6-branch'
|
||||
Source0: none, override, 'cvs://pserver:anoncvs@sourceware.org/cvs/src?module=gdb?src-prefix=src?tag=gdb_7_6-branch'
|
||||
Patch0: none, undefine, ''
|
||||
|
@ -71,18 +71,40 @@ def _cvs_parser(source, config, opts):
|
||||
us = source['url'].split('?')
|
||||
try:
|
||||
url = us[0]
|
||||
source['file'] = \
|
||||
url[url[6:].index(':') + 7:].replace('/', '_').replace('@', '_').replace('.', '_')
|
||||
source['file'] = url[url[6:].index(':') + 7:]
|
||||
source['cvsroot'] = ':%s:' % (url[6:url[6:].index('/') + 6:])
|
||||
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 _as[0] == 'module':
|
||||
if len(_as) != 2:
|
||||
raise error.general('invalid cvs module: %s' % (a))
|
||||
source['module'] = _as[1]
|
||||
elif _as[0] == 'src-prefix':
|
||||
if len(_as) != 2:
|
||||
raise error.general('invalid cvs src-prefix: %s' % (a))
|
||||
source['src_prefix'] = _as[1]
|
||||
elif _as[0] == 'tag':
|
||||
if len(_as) != 2:
|
||||
raise error.general('invalid cvs tag: %s' % (a))
|
||||
source['tag'] = _as[1]
|
||||
elif _as[0] == 'date':
|
||||
if len(_as) != 2:
|
||||
raise error.general('invalid cvs date: %s' % (a))
|
||||
source['date'] = _as[1]
|
||||
if 'date' in source and 'tag' in source:
|
||||
raise error.general('cvs URL cannot have a date and tag: %s' % (source['url']))
|
||||
# Do here to ensure an ordered path, the URL can include options in any order
|
||||
if 'module' in source:
|
||||
source['file'] += '_%s' % (source['module'])
|
||||
if 'tag' in source:
|
||||
source['file'] += '_%s' % (source['tag'])
|
||||
if 'date' in source:
|
||||
source['file'] += '_%s' % (source['date'])
|
||||
for c in '/@#%.-':
|
||||
source['file'] = source['file'].replace(c, '_')
|
||||
source['local'] = path.join(source['local_prefix'], 'cvs', source['file'])
|
||||
if 'src_prefix' in source:
|
||||
source['symlink'] = path.join(source['local'], source['src_prefix'])
|
||||
else:
|
||||
|
Loading…
x
Reference in New Issue
Block a user