@@ -514,6 +514,12 @@ def ensure_iterable_license_specs(specs):
514514TUPLE_OF_STRINGS = (tuple , as_hashable ({'elem_types' : [str ]}))
515515LIST_OF_STRINGS = (list , as_hashable ({'elem_types' : [str ]}))
516516STRING_OR_TUPLE_LIST = (list , as_hashable ({'elem_types' : [str , TUPLE_OF_STRINGS ]}))
517+ STRING_DICT = (dict , as_hashable (
518+ {
519+ 'elem_types' : [str ],
520+ 'key_types' : [str ],
521+ }
522+ ))
517523SANITY_CHECK_PATHS_DICT = (dict , as_hashable ({
518524 'elem_types' : {
519525 'files' : [STRING_OR_TUPLE_LIST ],
@@ -522,17 +528,16 @@ def ensure_iterable_license_specs(specs):
522528 'opt_keys' : [],
523529 'req_keys' : ['files' , 'dirs' ],
524530}))
525- CHECKSUM = (list , as_hashable ({'elem_types' : [str , TUPLE_OF_STRINGS ]}))
526- DICT_CHECKSUM = (dict , as_hashable (
527- {
528- 'elem_types' : [str , CHECKSUM ],
529- 'key_types' : [str ],
530- }
531- ))
532- CHECKSUMS = (list , as_hashable ({'elem_types' : [CHECKSUM , DICT_CHECKSUM ]}))
533-
534- CHECKABLE_TYPES = [CHECKSUM , CHECKSUMS , DEPENDENCIES , DEPENDENCY_DICT , DICT_CHECKSUM , LIST_OF_STRINGS ,
535- SANITY_CHECK_PATHS_DICT , STRING_OR_TUPLE_LIST , TOOLCHAIN_DICT , TUPLE_OF_STRINGS ]
531+ # checksums is a list of checksums, one entry per file (source/patch)
532+ # each entry can be:
533+ # a single checksum value (string)
534+ # a single checksum value of a specified type (2-tuple, 1st element is checksum type, 2nd element is checksum)
535+ # a list of checksums (of different types) as string values, which should *all* be valid
536+ # a dictionary with a mapping from filename to checksum value
537+ CHECKSUMS = (list , as_hashable ({'elem_types' : [str , tuple , LIST_OF_STRINGS , STRING_DICT ]}))
538+
539+ CHECKABLE_TYPES = [CHECKSUMS , DEPENDENCIES , DEPENDENCY_DICT , LIST_OF_STRINGS ,
540+ SANITY_CHECK_PATHS_DICT , STRING_DICT , STRING_OR_TUPLE_LIST , TOOLCHAIN_DICT , TUPLE_OF_STRINGS ]
536541
537542# easy types, that can be verified with isinstance
538543EASY_TYPES = [basestring , bool , dict , int , list , str , tuple ]
0 commit comments