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.

(From OE-Core rev: aea47c77d69407b2e62f151cabba35293d179f0c)

Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Laurentiu Palcu 2013-06-05 12:16:50 +03:00 committed by Richard Purdie
parent e4a136a6bd
commit 75070d7032
1 changed files with 10 additions and 6 deletions

View File

@ -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