Change the CVS download path to include the module and tag/date.

This commit is contained in:
Chris Johns 2013-04-25 15:06:20 +10:00
parent 1a3c484619
commit c65b9eb7ec
3 changed files with 39 additions and 7 deletions

View File

@ -6,6 +6,15 @@
%include %{_configdir}/checks.cfg %include %{_configdir}/checks.cfg
#
# Select Snapshot Macro Maps
#
%select gdb-snapshot
%select expat-snapshot
#
# The description.
#
Name: %{_target}-gdb-%{gdb_version}-%{release} Name: %{_target}-gdb-%{gdb_version}-%{release}
Summary: GDB v%{gdb_version} for target %{_target} on host %{_host} Summary: GDB v%{gdb_version} for target %{_target} on host %{_host}
Version: %{gdb_version} Version: %{gdb_version}
@ -33,8 +42,9 @@ BuildRoot: %{_tmppath}/%{name}-root-%(%{__id_u} -n)
# Prepare the source code. # Prepare the source code.
# #
%prep %prep
source_dir_0="gdb-%{gdb_version}"
%setup -q -c -n %{name}-%{version} %setup -q -c -n %{name}-%{version}
cd gdb-%{gdb_version} cd ${source_dir_0}
%{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}} %{?patch0:%patch0 %{?patch0_opts:%{patch0_opts}}%{!?patch0_opts:-p1}}
%{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}} %{?patch1:%patch1 %{?patch1_opts:%{patch1_opts}}%{!?patch1_opts:-p1}}
%{?patch2:%patch2 %{?patch2_opts:%{patch2_opts}}%{!?patch2_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" LIBS_STATIC="-lexpat"
CFLAGS="$SB_OPT_FLAGS" \ CFLAGS="$SB_OPT_FLAGS" \
LIBS="%{_forced_static}" \ LIBS="%{_forced_static}" \
../gdb-%{gdb_version}/configure \ ../${source_dir_0}/configure \
--build=%{_build} --host=%{_host} \ --build=%{_build} --host=%{_host} \
--target=%{_target} \ --target=%{_target} \
--verbose --disable-nls \ --verbose --disable-nls \

View File

@ -1,4 +1,4 @@
[gdb-snapshot] [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' Source0: none, override, 'cvs://pserver:anoncvs@sourceware.org/cvs/src?module=gdb?src-prefix=src?tag=gdb_7_6-branch'
Patch0: none, undefine, '' Patch0: none, undefine, ''

View File

@ -71,18 +71,40 @@ def _cvs_parser(source, config, opts):
us = source['url'].split('?') us = source['url'].split('?')
try: try:
url = us[0] url = us[0]
source['file'] = \ source['file'] = url[url[6:].index(':') + 7:]
url[url[6:].index(':') + 7:].replace('/', '_').replace('@', '_').replace('.', '_')
source['cvsroot'] = ':%s:' % (url[6:url[6:].index('/') + 6:]) source['cvsroot'] = ':%s:' % (url[6:url[6:].index('/') + 6:])
except: except:
raise error.general('invalid cvs path: %s' % (source['url'])) raise error.general('invalid cvs path: %s' % (source['url']))
source['local'] = path.join(source['local_prefix'], 'cvs', source['file'])
for a in us[1:]: for a in us[1:]:
_as = a.split('=') _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: if len(_as) != 2:
raise error.general('invalid cvs src-prefix: %s' % (a)) raise error.general('invalid cvs src-prefix: %s' % (a))
source['src_prefix'] = _as[1] 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: if 'src_prefix' in source:
source['symlink'] = path.join(source['local'], source['src_prefix']) source['symlink'] = path.join(source['local'], source['src_prefix'])
else: else: