[OE-core] [PATCH 4/4] scripts/postinst-intercepts: create separete hooks for multilib

Laurentiu Palcu laurentiu.palcu at intel.com
Thu Apr 25 12:24:00 UTC 2013


When using multilib, the hooks for lib32/lib64 must be different because
the libdir/base_libdir point to different locations. Nothing has to be
done in the postinstalls for this. When a hook is installed, it will be
detected automatically if this is a ML package (from the libXX- package
prefix) and a separate hook will be created.

Signed-off-by: Laurentiu Palcu <laurentiu.palcu at intel.com>
---
 scripts/postinst-intercepts/postinst_intercept |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/scripts/postinst-intercepts/postinst_intercept b/scripts/postinst-intercepts/postinst_intercept
index ed32f27..5969eba 100755
--- a/scripts/postinst-intercepts/postinst_intercept
+++ b/scripts/postinst-intercepts/postinst_intercept
@@ -17,9 +17,27 @@
 
 intercept_script=$INTERCEPT_DIR/$1 && shift
 package_name=$1 && shift
+mlprefix=$(echo $package_name|sed -rn 's/^(lib32|lib64|libx32)-.*/\1/p')
 
+# if the hook we want to install does not exist, then there's nothing we can do
 [ -f "$intercept_script" ] || exit 1
 
+# if the postinstall wanting to install the hook belongs to a multilib package,
+# then we'd better have a separate hook for this because the default ${libdir} and
+# ${base_libdir} will point to the wrong locations
+if [ -n "$mlprefix" ]; then
+	ml_intercept_script=$intercept_script-$mlprefix
+	# if the multilib hook does not exist, create it from the default one
+	if [ ! -f "$ml_intercept_script" ]; then
+		cp $intercept_script $ml_intercept_script
+
+		# clear the ##PKGS: line and the already set variables
+		[ -x "$ml_intercept_script" ] && sed -i -e "2,$(($#+1)) {/.*/d}" -e "/^##PKGS: .*/d" $ml_intercept_script
+	fi
+
+	intercept_script=$ml_intercept_script
+fi
+
 chmod +x "$intercept_script"
 
 pkgs_line="$(cat $intercept_script|grep "##PKGS:")"
-- 
1.7.9.5





More information about the Openembedded-core mailing list