new* helpers can read from stdin

Did you know that new* helpers can read from stdin? Well, now you know! So instead of writing to a temporary file you can install your inline text straight to the destination:

src_install() {
  # old code
  cat <<-EOF >"${T}"/mywrapper || die
    exec do-something --with-some-argument
  dobin "${T}"/mywrapper

  # replacement
  newbin - mywrapper <<-EOF
    exec do-something --with-some-argument

3 Replies to “new* helpers can read from stdin”

  1. Does that include `newmenu` from the desktop eclass for example? Or is it just limited to the default set of helpers?

    1. I haven’t tested it but I don’t see why not. As long as they are implemented on top of newins without too much trickery inside, it should work just fine.

Leave a Reply to François Cancel reply

Your email address will not be published. Required fields are marked *