summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-06-02 14:38:13 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-06-06 06:48:42 +0200
commite1257d4fe907d23c946d2cd7d6529821a3891889 (patch)
treebf9eda9fc76ee7efb5432aa48e55ce4277f5d3b2
parent4.12/powerpc: Revert the PowerPC to the default and binutils-2.28. (diff)
downloadrtems-source-builder-e1257d4fe907d23c946d2cd7d6529821a3891889.tar.bz2
sb: Create hopefully more valid file names
-rw-r--r--source-builder/sb/download.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index 4bba7de..dd7880d 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -26,6 +26,7 @@ from __future__ import print_function
import hashlib
import os
+import re
import stat
import sys
try:
@@ -180,12 +181,9 @@ def _http_parser(source, pathkey, config, opts):
raise error.general('gitweb.cgi path missing p or h: %s' % (url))
source['file'] = '%s-%s.patch' % (p, h)
#
- # Check the source file name for any extra request query data and remove if
- # found. Some hosts do not like file names containing them.
+ # Wipe out everything special in the file name.
#
- if '?' in source['file']:
- qmark = source['file'].find('?')
- source['file'] = source['file'][:qmark]
+ source['file'] = re.sub(r'[^a-zA-Z0-9.\-]+', '-', source['file'])
#
# Check local path
#