[meta-cgl] pacemaker: improve reproducibility

Submitted by mingli.yu@windriver.com on Sept. 24, 2020, 7:50 a.m. | Patch ID: 176756

Details

Message ID 20200924075009.10961-1-mingli.yu@windriver.com
State New
Headers show

Commit Message

mingli.yu@windriver.com Sept. 24, 2020, 7:50 a.m.
From: Mingli Yu <mingli.yu@windriver.com>

Remove the build path info from the files such as crm_master,
crm_report and etc to improve reproducibility.

Signed-off-by: Mingli Yu <mingli.yu@windriver.com>
---
 .../recipes-cgl/pacemaker/pacemaker_2.0.3.bb  | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

Patch hide | download patch | download mbox

diff --git a/meta-cgl-common/recipes-cgl/pacemaker/pacemaker_2.0.3.bb b/meta-cgl-common/recipes-cgl/pacemaker/pacemaker_2.0.3.bb
index 56f3bc4..8576f18 100644
--- a/meta-cgl-common/recipes-cgl/pacemaker/pacemaker_2.0.3.bb
+++ b/meta-cgl-common/recipes-cgl/pacemaker/pacemaker_2.0.3.bb
@@ -51,6 +51,18 @@  EXTRA_OECONF += "STAGING_INCDIR=${STAGING_INCDIR} \
 CACHED_CONFIGUREVARS += " \
     ac_cv_path_BASH_PATH=/bin/bash \
 "
+do_configure_prepend() {
+    # remove buildpath
+    placeh="abs_top_builddir abs_top_srcdir"
+    for ph in $placeh
+    do
+        srcdirs=$(grep -Rn $ph ${S}/* | awk -F: '{print $1}' | uniq)
+        for srcdir in $srcdirs
+        do
+            sed -i "s/${ph}/${ph}_placeholder/g" $srcdir
+        done
+    done
+}
 
 do_install_append() {
     install -d ${D}${sysconfdir}/default
@@ -66,6 +78,13 @@  do_install_append() {
 
     rm -rf ${D}${localstatedir}/lib/heartbeat
     rm -rf ${D}${localstatedir}/run
+
+    # remove buildpath
+    tempdirs=$(grep -Rn ${RECIPE_SYSROOT_NATIVE} ${D}/* | awk -F: '{print $1}' | uniq)
+    for temdir in $tempdirs
+    do
+        sed -i "s:${RECIPE_SYSROOT_NATIVE}::g" $temdir
+    done
 }
 
 PACKAGES_prepend = "${PN}-cli-utils ${PN}-libs ${PN}-cluster-libs ${PN}-remote "