def patch(self, macros):
     def err(msg):
         raise error.general('%s' % (msg))
     _patches = {}
     for n in sources.get_patch_names(macros, err):
         if 'setup' in sources.get_patch_keys(n, macros, err):
             _patches[n] = \
                 [p for p in sources.get_patches(n, macros, err) if not p.startswith('%setup')]
             _patches[n] = [macros.expand(p.split()[-1]) for p in _patches[n]]
     patches = {}
     for n in _patches:
         patches[n] = [(p, sources.get_hash(path.basename(p).lower(), macros)) for p in _patches[n]]
     return patches
Esempio n. 2
0
 def patch(self, macros):
     def err(msg):
         raise error.general('%s' % (msg))
     _patches = {}
     for n in sources.get_patch_names(macros, err):
         if 'setup' in sources.get_patch_keys(n, macros, err):
             _patches[n] = \
                 [p for p in sources.get_patches(n, macros, err) if not p.startswith('%setup')]
             _patches[n] = [macros.expand(p.split()[-1]) for p in _patches[n]]
     patches = {}
     for n in _patches:
         patches[n] = [(p, sources.get_hash(path.basename(p).lower(), macros)) for p in _patches[n]]
     return patches