Skip to contentSkip to conversation

component_meta: Adding component_meta bbclass

PATCH New Mahesh Radhakrishnan 1 participant 1 message Jul 6, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 component_meta: Adding component_meta bbclass

---
 classes/component_meta.bbclass | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 classes/component_meta.bbclass
classes/component_meta.bbclass new file +29 -0
new file mode 100644
index 0000000..f2dc754
@@ -0,0 +1,29 @@
+CM_NAME ?= ""
+CM_VERSION ?= ""
+CM_ROOT_DIR ?= ""
+CM_BINARY ?= ""
+CM_DESCRIPTION ?= ""
+
+do_component_meta() {
+    if [ ! -d "${DEPLOY_DIR_IMAGE}" ]
+    then
+        mkdir -p ${DEPLOY_DIR_IMAGE}    
+    fi
+
+    if [ ! -e "${DEPLOY_DIR_IMAGE}/.components_meta" ]
+    then
+        touch ${DEPLOY_DIR_IMAGE}/.components_meta
+    fi
+
+    # Check if component is already documented in .components_meta
+    if ! grep -q "${CM_ROOT_DIR}" ${DEPLOY_DIR_IMAGE}/.components_meta
+    then
+        # Add component meta information
+        echo "${CM_NAME}|${CM_VERSION}|${CM_ROOT_DIR}|${CM_BINARY}|${CM_DESCRIPTION}" >> \
+            ${DEPLOY_DIR_IMAGE}/.components_meta
+    fi
+}
+
+do_component_meta[lockfiles] = "${DEPLOY_DIR_IMAGE}/component_meta.lock"
+
+addtask do_component_meta after do_install before do_package
Signature · 1 line
1.9.1