[yocto] do pkg_postinst() scripts need to start with "#!/bin/sh -e"?

Robert P. J. Day rpjday at crashcourse.ca
Fri Jan 9 05:42:35 PST 2015


On Fri, 9 Jan 2015, Robert P. J. Day wrote:

>
>   more manual pedantry -- dev manual, section 5.3.16, suggests:
>
>  A post-installation function has the following structure:
>
>      pkg_postinst_PACKAGENAME() {
>      #!/bin/sh -e
>      # Commands to carry out
>      }
>
> except that every example of a pkg_postinst() script i've ever seen
> does not contain that initial hash-bang line, so the manual should
> at least be reworded to be consistent with the code base.

  i take it back, i just ran across this example in base-passwd.bb:

pkg_postinst_${PN}-update () {
#!/bin/sh
if [ -n "$D" ]; then
        exit 0
fi
${sbindir}/update-passwd
}

which (naturally) doesn't use the "-e" option :-). anyway, what does
one suggest for consistency across the manual and code base?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================



More information about the yocto mailing list