xref: /OK3568_Linux_fs/yocto/meta-rockchip/classes/auto-patch.bbclass (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1# Copyright (C) 2019, Fuzhou Rockchip Electronics Co., Ltd
2# Released under the MIT license (see COPYING.MIT for the terms)
3
4CURDIR := "${THISDIR}/"
5PATCHPATH ?= "${@d.getVar('CURDIR') + d.getVar('BPN') + '_' + d.getVar('PV')}"
6
7python () {
8    dir = d.getVar('PATCHPATH') or ''
9    if not os.path.isdir(dir):
10        return
11
12    bb.parse.mark_dependency(d, dir)
13
14    files = os.listdir(dir)
15    files.sort()
16    for file in files:
17        if file.endswith('.patch'):
18            d.appendVar('SRC_URI', ' file://' + dir + '/' + file)
19            bb.debug(2, 'Adding patch: ' + file + ' for ' + dir)
20}
21