mirror of
https://git.rtems.org/rtems-source-builder
synced 2024-10-09 07:15:10 +08:00
sb: Create hopefully more valid file names
This commit is contained in:
parent
6b8dbdfde3
commit
e1257d4fe9
@ -26,6 +26,7 @@ from __future__ import print_function
|
|||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import stat
|
import stat
|
||||||
import sys
|
import sys
|
||||||
try:
|
try:
|
||||||
@ -180,12 +181,9 @@ def _http_parser(source, pathkey, config, opts):
|
|||||||
raise error.general('gitweb.cgi path missing p or h: %s' % (url))
|
raise error.general('gitweb.cgi path missing p or h: %s' % (url))
|
||||||
source['file'] = '%s-%s.patch' % (p, h)
|
source['file'] = '%s-%s.patch' % (p, h)
|
||||||
#
|
#
|
||||||
# Check the source file name for any extra request query data and remove if
|
# Wipe out everything special in the file name.
|
||||||
# found. Some hosts do not like file names containing them.
|
|
||||||
#
|
#
|
||||||
if '?' in source['file']:
|
source['file'] = re.sub(r'[^a-zA-Z0-9.\-]+', '-', source['file'])
|
||||||
qmark = source['file'].find('?')
|
|
||||||
source['file'] = source['file'][:qmark]
|
|
||||||
#
|
#
|
||||||
# Check local path
|
# Check local path
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user