[oe-commits] [openembedded-core] 18/24: meta/lib/oe/package_manager.py: deprecate 'exit 1' as a way to defer to first boot

git at git.openembedded.org git at git.openembedded.org
Mon Jan 29 23:09:42 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit d12cf56e9ff2a4f13dfbef9290ea5647b52b3f6d
Author: Alexander Kanavin <alexander.kanavin at linux.intel.com>
AuthorDate: Mon Jan 29 14:01:32 2018 +0200

    meta/lib/oe/package_manager.py: deprecate 'exit 1' as a way to defer to first boot
    
    'exit 1' is not optimal for two reasons:
    
    1) Code is hard to read; it is not obvious that it means 'defer what follows to first boot'.
    2) Worse, this hides actual errors in the scriptlets; there is no difference between scriptlet
    failing because it's intended to be run on target and scriptlet failing because there's a bug or
    a regression somewhere.
    
    The new, supported way is to place the code that has to run on target into pkg_postinst_ontarget(),
    or, if a more fine-tuned control is required, call 'postinst-intercepts defer_to_first_boot' from
    pkg_postinst() to explicitly request deferral to first boot.
    
    Signed-off-by: Alexander Kanavin <alexander.kanavin at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 meta/lib/oe/package_manager.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 2a07f0e..f7e0134 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -604,6 +604,9 @@ class RpmPM(PackageManager):
             if line.startswith("Non-fatal POSTIN scriptlet failure in rpm package"):
                 failed_scriptlets_pkgnames[line.split()[-1]] = True
 
+        if len(failed_scriptlets_pkgnames) > 0:
+            bb.warn("Intentionally failing postinstall scriptlets of %s to defer them to first boot is deprecated. Please place them into pkg_postinst_ontarget_${PN} ()." %(list(failed_scriptlets_pkgnames.keys())))
+            bb.warn("If deferring to first boot wasn't the intent, then scriptlet failure may mean an issue in the recipe, or a regression elsewhere.")
         for pkg in failed_scriptlets_pkgnames.keys():
             self.save_rpmpostinst(pkg)
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list