Revert "Revert "oran-shell-release: release image for F""
[pti/rtp.git] / meta-starlingx / meta-stx-distro / classes / stx-metadata.bbclass
1 # This class is intended to help apply the patches and install
2 # config files fetched from stx git repo defined in STX_REPO so to
3 # avoid maintaining a local copy in the recipe's metadata.
4 #
5 # This adds dependency on stx-${STX_REPO}-source which
6 # fetches the stx source code and is used as a shared work
7 # directory, and the search path of patches and config files
8 # for the recipe will be added in FILESEXTRAPATHS so the
9 # patches will be found and applied in do_patch, and STX_METADATA_PATH
10 # can be used to locate config files to be installed.
11 #
12 # Please set the following variables correctly after inherit
13 # this bbclass:
14 # - STX_REPO: the StarlingX repo name, default is 'integ'
15 # - STX_SUBPATH: the subpath for the patches in the work-shard
16 #                directory of stx-${STX_REPO}-source
17 # - SRC_URI_STX: the patch list in stx-${STX_REPO}-source
18 #
19 # e.g.
20 # STX_REPO = "integ"
21 # STX_SUBPATH = "config/puppet-modules/openstack/${BP}/centos/patches"
22 # SRC_URI_STX = "file://0001-Remove-log_dir-from-conf-files.patch"
23
24 STX_REPO ?= "integ"
25 STX_SUBPATH ?= ""
26 SRC_URI_STX ?= ""
27
28 STX_METADATA_PATH = "${TMPDIR}/work-shared/stx-${STX_REPO}-source/git/${STX_SUBPATH}"
29 FILESEXTRAPATHS_prepend = "${STX_METADATA_PATH}:"
30
31 do_patch[depends] += "stx-${STX_REPO}-source:do_patch"
32
33 do_patch_prepend() {
34     bb.build.exec_func('add_stx_patch', d)
35 }
36
37 python add_stx_patch() {
38     src_uri = d.getVar('SRC_URI', False)
39     src_uri_stx = d.getVar('SRC_URI_STX', False)
40     d.setVar('SRC_URI', src_uri_stx + " " + src_uri)
41 }