diff options
Diffstat (limited to 'source-builder/sb/download.py')
-rw-r--r-- | source-builder/sb/download.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py index 410edeb..0201675 100644 --- a/source-builder/sb/download.py +++ b/source-builder/sb/download.py @@ -85,6 +85,8 @@ def _hash_check(file_, absfile, macros, remove = True): hash = hash.split() if len(hash) != 2: raise error.internal('invalid hash format: %s' % (file_)) + if hash[0] == 'NO-HASH': + return not failed try: hashlib_algorithms = hashlib.algorithms except: @@ -132,9 +134,7 @@ def _hash_check(file_, absfile, macros, remove = True): if hasher is not None: del hasher else: - if version.released(): - raise error.general('%s: no hash found in released RSB' % (file_)) - log.warning('%s: no hash found' % (file_)) + raise error.general('%s: no hash found' % (file_)) return not failed def _local_path(source, pathkey, config): @@ -191,7 +191,7 @@ def _http_parser(source, pathkey, config, opts): # # Wipe out everything special in the file name. # - source['file'] = re.sub(r'[^a-zA-Z0-9.\-]+', '-', source['file']) + source['file'] = re.sub(r'[^a-zA-Z0-9.\-_]+', '-', source['file']) max_file_len = 127 if len(source['file']) > max_file_len: raise error.general('file name length is greater than %i (maybe use --rsb-file=FILE option): %s' % \ @@ -481,7 +481,8 @@ def _git_downloader(url, local, config, opts): else: repo.clean(['-f', '-d']) repo.reset('--hard') - repo.checkout('master') + default_branch = repo.default_branch() + repo.checkout(default_branch) for a in us[1:]: _as = a.split('=') if _as[0] == 'branch' or _as[0] == 'checkout': |