[opensuse-packaging] RPM scriptlets -e argument confusion
Hello, http://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets reads ----------------------------------------------------------------------- ... rpm in its default configuration does not at the moment execute shell scriptlets with the -e argument ... ----------------------------------------------------------------------- Therefore this test scriptlet should work: ----------------------------------------------------------------------- %pre # Test if RPM executes shell scriptlets without the -e argument # (i.e. do not exit if a command exits with a non-zero status). # Without the -e argument it would not exit at the next command... cat doesnotexist 1>/dev/null 2>/tmp/testRPMpre.stderr # ...and therefore it would run this command: echo "RPM pre scriptlet runs without -e" 1>/tmp/testRPMpre.stdout ----------------------------------------------------------------------- But a package with such a scriptlet fails during build with: ----------------------------------------------------------------------- running 06-check-installtest ... testing for pre/postinstall scripts that are not idempotent preinstall script of <package>.rpm failed ----------------------------------------------------------------------- The reason is that the post-build-checks RPM in the build system contains a usr/lib/build/checks/06-check-installtest script which runs each RPM scriptlet with explicit -e argument setting via ----------------------------------------------------------------------- SCRIPT_ARG=-e ... chroot $BUILD_ROOT sh $SCRIPT_ARG /.build_patchrpmcheck_scr ... ----------------------------------------------------------------------- where /.build_patchrpmcheck_scr is a copy of the RPM scriptlet. With "#!BuildIgnore: post-build-checks" I enforced to skip all post build checks to get the package built. And now - surprise! - surprise! - I can install the built package without an error using plain "rpm" which shows that rpm does not use the -e argument - at least not the rpm on my workstation. I wonder why then the post build checks use the -e argument? I would expect that the post build checks emulate what rpm does (i.e. what happens on the user's system who installs it) and not exaggerate.
From my point of view using the -e argument for the post build checks does not provide better RPM scriplets.
It only enforces packagers to add dumb "|| true" to all statements: ----------------------------------------------------------------------- %pre do_crap || true do_more_crap || true mess_up_everything || true ----------------------------------------------------------------------- Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Fri, Oct 07, 2011 at 11:54:19AM +0200, Johannes Meixner wrote:
And now - surprise! - surprise! - I can install the built package without an error using plain "rpm" which shows that rpm does not use the -e argument - at least not the rpm on my workstation.
I wonder why then the post build checks use the -e argument?
To catch mistakes in the scriptlets.
I would expect that the post build checks emulate what rpm does (i.e. what happens on the user's system who installs it) and not exaggerate.
No, it uses -e on purpose to force the packagers to write sane scriptlets.
From my point of view using the -e argument for the post build checks does not provide better RPM scriplets.
It only enforces packagers to add dumb "|| true" to all statements: ----------------------------------------------------------------------- %pre do_crap || true do_more_crap || true mess_up_everything || true
Your crap calls should not fail. Please fix do_crap and do_more_crap to return a correct exit code. Cheers, Michael. -- Michael Schroeder mls@suse.de SUSE LINUX Products GmbH, GF Jeff Hawn, HRB 16746 AG Nuernberg main(_){while(_=~getchar())putchar(~_-1/(~(_|32)/13*2-11)*13);} -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
You should have read http://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets before. Kind Regards Johannes Meixner -- SUSE LINUX Products GmbH -- Maxfeldstrasse 5 -- 90409 Nuernberg -- Germany HRB 16746 (AG Nuernberg) GF: Jeff Hawn, Jennifer Guild, Felix Imendoerffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Fri, Oct 07, 2011 at 01:30:54PM +0200, Johannes Meixner wrote:
You should have read http://en.opensuse.org/openSUSE:Packaging_scriptlet_snippets before.
Sorry, I thought you wanted answers to your questions. M. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (2)
-
Johannes Meixner
-
Michael Schroeder