Changeset 4f72b95 in rtems-source-builder


Ignore:
Timestamp:
03/01/17 07:18:07 (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
4c5eb89
Parents:
08f7099
git-author:
Sebastian Huber <sebastian.huber@…> (03/01/17 07:18:07)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/01/17 07:21:01)
Message:

sb: Bail out only if hash definitions conflict

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source-builder/sb/sources.py

    r08f7099 r4f72b95  
    9898    _map = 'hashes'
    9999    _file = macros.expand(args[1])
    100     if _file in macros.map_keys(_map):
    101         error('hash already set: %s' % (args[1]))
    102         return
    103     macros.create_map(_map)
    104     macros.set_write_map(_map)
    105     macros.define(_file, '%s %s' % (args[0], args[2]))
    106     macros.unset_write_map()
     100    new_value = '%s %s' % (args[0], args[2])
     101    existing_value = get_hash(_file, macros)
     102    if existing_value is not None:
     103        if existing_value != new_value:
     104            error('conflicting hash definitions for: %s' % (args[1]))
     105            return
     106    else:
     107        macros.create_map(_map)
     108        macros.set_write_map(_map)
     109        macros.define(_file, new_value)
     110        macros.unset_write_map()
    107111    return None
    108112
Note: See TracChangeset for help on using the changeset viewer.