pengutronix / genimage

tool to generate multiple filesystem and flash images from a tree
GNU General Public License v2.0
305 stars 110 forks source link

util: systemp(): use shell defined in SHELL rather than /bin/sh #161

Closed marckleinebudde closed 3 years ago

marckleinebudde commented 3 years ago

This patch changes systemp() to use the shell defined in the environment variable SHELL rather then hard coded /bin/sh, so that the called programs can use shell functions exported in the calling shell. Use "/bin/sh" as a fall back.

Signed-off-by: Marc Kleine-Budde mkl@pengutronix.de

michaelolbrich commented 3 years ago

Much better, thanks.

tq-schifferm commented 3 years ago

When developing on genimage, SHELL points at the current shell of the developer - which may not be POSIX-compatible at all (for example I use zsh, which causes most distchecks to fail).

I don't know what systemp() is used for exactly, but it seems using a "clean" POSIX shell that doesn't mess with the environment (i.e. /bin/sh) would be the more robust choice.

michaelolbrich commented 3 years ago

Good point. Making it possible to overwrite the shell is still useful. So maybe a different environment variable? GENIMAGE_SHELL maybe?

@marckleinebudde what do you think?