'apply the list of patches, in order'

def apply_patches(self, local_patches):

    builddir = self.build_dir
    os.chdir(builddir)
    if (not local_patches):
        return None
    for (spec, local, md5sum) in local_patches:
        if (local.endswith('.bz2') or local.endswith('.gz')):
            ref = spec
        else:
            ref = utils.force_copy(local, self.results_dir)
            ref = self.job.relative_path(ref)
        patch_id = ('%s    %s    %s' % (spec, ref, md5sum))
        log = (('PATCH:    ' + patch_id) + '\n')
        print log
        utils.cat_file_to_cmd(local, 'patch    -p1    >    /dev/null')
        self.logfile.write(log)
        self.applied_patches.append(patch_id)
