]> code.ossystems Code Review - openembedded-core.git/commitdiff
package_manager: RpmPM: Fix scriptlet for rpm 4
authorJean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Fri, 10 Apr 2015 13:15:29 +0000 (15:15 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 15 May 2015 17:12:06 +0000 (18:12 +0100)
Path of rpm post install script is different between rpm 4 and 5

(From OE-Core master rev: a880669f767532ce3c39eb160fa9deb9fce29677)

Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oe/package_manager.py

index ed0c9a7d3d0dfb3eabce9df52cf69c1e12ef8967..0460415699e5ff5d06e759e87af66b507ea0a70b 100644 (file)
@@ -937,8 +937,10 @@ class RpmPM(PackageManager):
         #
         if self.rpm_version == 4:
             scriptletcmd = "$2 $3 $4\n"
+            scriptpath = "$3"
         else:
             scriptletcmd = "$2 $1/$3 $4\n"
+            scriptpath = "$1/$3"
 
         SCRIPTLET_FORMAT = "#!/bin/bash\n" \
             "\n" \
@@ -956,10 +958,10 @@ class RpmPM(PackageManager):
             "    mkdir -p $1/etc/rpm-postinsts\n" \
             "    num=100\n" \
             "    while [ -e $1/etc/rpm-postinsts/${num}-* ]; do num=$((num + 1)); done\n" \
-            "    name=`head -1 $1/$3 | cut -d\' \' -f 2`\n" \
+            "    name=`head -1 " + scriptpath + " | cut -d\' \' -f 2`\n" \
             '    echo "#!$2" > $1/etc/rpm-postinsts/${num}-${name}\n' \
             '    echo "# Arg: $4" >> $1/etc/rpm-postinsts/${num}-${name}\n' \
-            "    cat $1/$3 >> $1/etc/rpm-postinsts/${num}-${name}\n" \
+            "    cat " + scriptpath + " >> $1/etc/rpm-postinsts/${num}-${name}\n" \
             "    chmod +x $1/etc/rpm-postinsts/${num}-${name}\n" \
             "  else\n" \
             '    echo "Error: pre/post remove scriptlet failed"\n' \