All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] package_manager: RpmPM: Fix scriptlet for rpm 4
@ 2015-04-10 13:15 Jean-Benoit MARTIN
  0 siblings, 0 replies; only message in thread
From: Jean-Benoit MARTIN @ 2015-04-10 13:15 UTC (permalink / raw)
  To: openembedded-core

Path of rpm post install script is different between rpm 4 and 5

Signed-off-by: Jean-Benoit MARTIN <jean-benoit.martin@open.eurogiciel.org>
---
 meta/lib/oe/package_manager.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index ed0c9a7..0460415 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -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' \
-- 
1.8.4.5



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-04-10 13:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-10 13:15 [PATCH] package_manager: RpmPM: Fix scriptlet for rpm 4 Jean-Benoit MARTIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.