On 6/17/20 5:50 PM, Andreas Müller wrote:
On Wed, Jun 17, 2020 at 10:10 AM Changqing Li
<changqing...@windriver.com> wrote:
From: Changqing Li <changqing...@windriver.com>

fix error during post uninstall:
%postun(shared-mime-info-data-2.0-r0.4.corei7_64): execv(/bin/sh) pid 78
+ '[' 0 = 0 ']'
+ set -e
+ '[' x '!=' x ']'
+ echo 'Updating MIME database... this may take a while.'
Updating MIME database... this may take a while.
+ update-mime-database /usr/share/mime
Directory '/usr/share/mime/packages' does not exist!
%postun(shared-mime-info-data-2.0-r0.4.corei7_64): waitpid(78) rc 78 status 100
warning: %postun(shared-mime-info-data-2.0-r0.4.corei7_64) scriptlet failed, 
exit status 1

when run post uninstall scriptlet, /usr/share/mime/packages has been
removed during unintall, while update-mime-database need to use
/usr/share/mime/packages/freedesktop.org.xml

correct by change postrm to prerm

Signed-off-by: Changqing Li <changqing...@windriver.com>
---
  meta/classes/mime.bbclass | 14 +++++++-------
  1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/meta/classes/mime.bbclass b/meta/classes/mime.bbclass
index c9072adf3b..a0943b4476 100644
--- a/meta/classes/mime.bbclass
+++ b/meta/classes/mime.bbclass
@@ -17,7 +17,7 @@ else
  fi
  }

-mime_postrm() {
+mime_prerm() {
  if [ "x$D" != "x" ]; then
         $INTERCEPT_DIR/postinst_intercept update_mime_database ${PKG} \
                 mlprefix=${MLPREFIX} \
@@ -42,17 +42,17 @@ python populate_packages_append () {
                      mimes_types_found = True
                      break
          if mimes_types_found:
-            bb.note("adding mime postinst and postrm scripts to %s" % pkg)
+            bb.note("adding mime postinst and prerm scripts to %s" % pkg)
              postinst = d.getVar('pkg_postinst_%s' % pkg)
              if not postinst:
                  postinst = '#!/bin/sh\n'
              postinst += d.getVar('mime_postinst')
              d.setVar('pkg_postinst_%s' % pkg, postinst)
-            postrm = d.getVar('pkg_postrm_%s' % pkg)
-            if not postrm:
-                postrm = '#!/bin/sh\n'
-            postrm += d.getVar('mime_postrm')
-            d.setVar('pkg_postrm_%s' % pkg, postrm)
+            prerm = d.getVar('pkg_prerm_%s' % pkg)
+            if not prerm:
+                prerm = '#!/bin/sh\n'
+            prerm += d.getVar('mime_prerm')
+            d.setVar('pkg_prerm_%s' % pkg, prerm)
              if pkg != 'shared-mime-info-data':
                  bb.note("adding shared-mime-info-data dependency to %s" % pkg)
                  d.appendVar('RDEPENDS_' + pkg, " " + 
d.getVar('MLPREFIX')+"shared-mime-info-data")
--
2.17.1

If I understand this correctly

* The error pops up once the LAST package with files  in
/usr/share/mime/packages is removed. If not something else is wrong
* This is not a fix but a workaround leaving mime db inconsistent with
entries removed later.

Andreas
Thanks.  this fix is not correct, I have send a V2.
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#139615): 
https://lists.openembedded.org/g/openembedded-core/message/139615
Mute This Topic: https://lists.openembedded.org/mt/74933440/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to