summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2013-06-05 12:16:50 +0300
committerSaul Wold <sgw@linux.intel.com>2013-06-10 14:51:29 -0700
commitaea47c77d69407b2e62f151cabba35293d179f0c (patch)
treeb6dbb3993fc4d09d4859ee2b63d7e7bb9bf7aea1
parent1ba44302f522a42535c9ad7d2fcccc06ba4c20b3 (diff)
downloadopenembedded-core-aea47c77d69407b2e62f151cabba35293d179f0c.tar.gz
openembedded-core-aea47c77d69407b2e62f151cabba35293d179f0c.tar.bz2
openembedded-core-aea47c77d69407b2e62f151cabba35293d179f0c.zip
package_rpm.bbclass: handle pre/post remove scriptlets
Currently the scriptlet_wrapper is designed to handle only pre/post install scriptlets. This patch will slightly change the wrapper script to handle also pre/post remove scriptlets when we want to remove packages from the final image. Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com>
-rw-r--r--meta/classes/package_rpm.bbclass16
1 files changed, 10 insertions, 6 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass
index 648327f41d..c654cdb5e8 100644
--- a/meta/classes/package_rpm.bbclass
+++ b/meta/classes/package_rpm.bbclass
@@ -382,12 +382,16 @@ export NATIVE_ROOT=${STAGING_DIR_NATIVE}
\$2 \$1/\$3 \$4
if [ \$? -ne 0 ]; then
- mkdir -p \$1/etc/rpm-postinsts
- name=\`head -1 \$1/\$3 | cut -d' ' -f 2\`
- echo "#!\$2" > \$1/etc/rpm-postinsts/\${name}
- echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${name}
- cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${name}
- chmod +x \$1/etc/rpm-postinsts/\${name}
+ if [ \$4 -eq 1 ]; then
+ mkdir -p \$1/etc/rpm-postinsts
+ name=\`head -1 \$1/\$3 | cut -d' ' -f 2\`
+ echo "#!\$2" > \$1/etc/rpm-postinsts/\${name}
+ echo "# Arg: \$4" >> \$1/etc/rpm-postinsts/\${name}
+ cat \$1/\$3 >> \$1/etc/rpm-postinsts/\${name}
+ chmod +x \$1/etc/rpm-postinsts/\${name}
+ else
+ echo "Error: pre/post remove scriptlet failed"
+ fi
fi
EOF