diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2018-01-29 14:01:33 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-30 11:50:12 +0000 |
commit | a2b7260f791e4b1ce79aa58a366fd0e5b505c8aa (patch) | |
tree | c23163f58646645d0c53c483d9e7801b26e9b054 /meta/classes | |
parent | 7bc55b29609765904af9f330600229e96cc044cf (diff) | |
download | poky-a2b7260f791e4b1ce79aa58a366fd0e5b505c8aa.tar.gz |
package_rpm.bbclass: run pre/post installation scriptlets using sh -e
This allows catching errors in the scriptlets which would otherwise
go unnoticed, e.g. this sequence:
====
bogus_command
proper_command
====
would work just fine. Note that this patch needs all of the preceding
patches, as otherwise running failing scriptlets with -e would defer
them to first boot, instead of properly reporting failure and aborting
the package installation.
(From OE-Core rev: 3cd8a55d5298ce9cc176e402fdb727abb26a1a4c)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/package_rpm.bbclass | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/package_rpm.bbclass b/meta/classes/package_rpm.bbclass index af64ef62c5..e26b2ad662 100644 --- a/meta/classes/package_rpm.bbclass +++ b/meta/classes/package_rpm.bbclass | |||
@@ -470,12 +470,12 @@ python write_specfile () { | |||
470 | 470 | ||
471 | # Now process scriptlets | 471 | # Now process scriptlets |
472 | if splitrpreinst: | 472 | if splitrpreinst: |
473 | spec_scriptlets_bottom.append('%%pre -n %s' % splitname) | 473 | spec_scriptlets_bottom.append('%%pre -n %s -p "/bin/sh -e"' % splitname) |
474 | spec_scriptlets_bottom.append('# %s - preinst' % splitname) | 474 | spec_scriptlets_bottom.append('# %s - preinst' % splitname) |
475 | spec_scriptlets_bottom.append(splitrpreinst) | 475 | spec_scriptlets_bottom.append(splitrpreinst) |
476 | spec_scriptlets_bottom.append('') | 476 | spec_scriptlets_bottom.append('') |
477 | if splitrpostinst: | 477 | if splitrpostinst: |
478 | spec_scriptlets_bottom.append('%%post -n %s' % splitname) | 478 | spec_scriptlets_bottom.append('%%post -n %s -p "/bin/sh -e"' % splitname) |
479 | spec_scriptlets_bottom.append('# %s - postinst' % splitname) | 479 | spec_scriptlets_bottom.append('# %s - postinst' % splitname) |
480 | spec_scriptlets_bottom.append(splitrpostinst) | 480 | spec_scriptlets_bottom.append(splitrpostinst) |
481 | spec_scriptlets_bottom.append('') | 481 | spec_scriptlets_bottom.append('') |
@@ -564,12 +564,12 @@ python write_specfile () { | |||
564 | spec_preamble_top.append('') | 564 | spec_preamble_top.append('') |
565 | 565 | ||
566 | if srcrpreinst: | 566 | if srcrpreinst: |
567 | spec_scriptlets_top.append('%pre') | 567 | spec_scriptlets_top.append('%pre -p "/bin/sh -e"') |
568 | spec_scriptlets_top.append('# %s - preinst' % srcname) | 568 | spec_scriptlets_top.append('# %s - preinst' % srcname) |
569 | spec_scriptlets_top.append(srcrpreinst) | 569 | spec_scriptlets_top.append(srcrpreinst) |
570 | spec_scriptlets_top.append('') | 570 | spec_scriptlets_top.append('') |
571 | if srcrpostinst: | 571 | if srcrpostinst: |
572 | spec_scriptlets_top.append('%post') | 572 | spec_scriptlets_top.append('%post -p "/bin/sh -e"') |
573 | spec_scriptlets_top.append('# %s - postinst' % srcname) | 573 | spec_scriptlets_top.append('# %s - postinst' % srcname) |
574 | spec_scriptlets_top.append(srcrpostinst) | 574 | spec_scriptlets_top.append(srcrpostinst) |
575 | spec_scriptlets_top.append('') | 575 | spec_scriptlets_top.append('') |