summaryrefslogtreecommitdiffstats
path: root/meta/classes/package_rpm.bbclass
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2013-10-04 15:48:19 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-10-07 09:37:32 +0100
commit28eedee1d41c50298c27c7f119a938001f734ce5 (patch)
tree5a65d98cbf29bac178b448f6077ef09eb32a4d10 /meta/classes/package_rpm.bbclass
parenta59aa9eebb638016e481f5a011d7e7ed58d5ee04 (diff)
downloadpoky-28eedee1d41c50298c27c7f119a938001f734ce5.tar.gz
run-postinst: Ensure that the postinsts are ordered
The postinst files were being generated using purely the name of the package, this unfortunately meant the run order would be based on the name of the package and not the order in which it was installed on the filesystem. If package A requires package Z to be fully installed, this causes a problem. Note: rpm - as the rpm based install proceeds the order is defined and captured. so the problem is resolved there. ipk - this unfortunately does not appear to solve the problem for ipk, as the status file is not ordered in any appreciable way. This does not cause any regressions however and sets the stage for a proper fix. deb - this -may- fix the deb install. Early testing indicates at least some ordering to the status file. But it's unclear if it completely resolves the issue. (From OE-Core rev: b5bafccb89f45d7cdd515b4ba45e0152ca7922de) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package_rpm.bbclass')
-rw-r--r--meta/classes/package_rpm.bbclass14
1 files changed, 10 insertions, 4 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 98aa98b03b..36bad09ea1 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -391,6 +391,10 @@ EOF
391 fi 391 fi
392 392
393 # Construct install scriptlet wrapper 393 # Construct install scriptlet wrapper
394 # Scripts need to be ordered when executed, this ensures numeric order
395 # If we ever run into needing more the 899 scripts, we'll have to
396 # change num to start with 1000.
397 #
394 cat << EOF > ${WORKDIR}/scriptlet_wrapper 398 cat << EOF > ${WORKDIR}/scriptlet_wrapper
395#!/bin/bash 399#!/bin/bash
396 400
@@ -406,11 +410,13 @@ export NATIVE_ROOT=${STAGING_DIR_NATIVE}
406if [ \$? -ne 0 ]; then 410if [ \$? -ne 0 ]; then
407 if [ \$4 -eq 1 ]; then 411 if [ \$4 -eq 1 ]; then
408 mkdir -p \$1/etc/rpm-postinsts 412 mkdir -p \$1/etc/rpm-postinsts
413 num=100
414 while [ -e \$1/etc/rpm-postinsts/\${num}-* ]; do num=\$((num + 1)); done
409 name=\`head -1 \$1/\$3 | cut -d' ' -f 2\` 415 name=\`head -1 \$1/\$3 | cut -d' ' -f 2\`
410 echo "#!\$2" > \$1/etc/rpm-postinsts/\${name} 416 echo "#!\$2" > \$1/etc/rpm-postinsts/\${num}-\${name}
411 echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${name} 417 echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${num}-\${name}
412 cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${name} 418 cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${num}-\${name}
413 chmod +x \$1/etc/rpm-postinsts/\${name} 419 chmod +x \$1/etc/rpm-postinsts/\${num}-\${name}
414 else 420 else
415 echo "Error: pre/post remove scriptlet failed" 421 echo "Error: pre/post remove scriptlet failed"
416 fi 422 fi