hime-ime / hime

HIME Input Method Editor
http://hime-ime.github.io
267 stars 48 forks source link

Non-POSIX shell commands in hime-user-setup: pushd, popd #776

Closed hosiet closed 11 months ago

hosiet commented 11 months ago

https://github.com/hime-ime/hime/blob/5177d47ffaa39d3089e77a56bb86ef2507560ac2/scripts/hime-user-setup#L8

https://github.com/hime-ime/hime/blob/5177d47ffaa39d3089e77a56bb86ef2507560ac2/scripts/hime-user-setup#L22

https://github.com/hime-ime/hime/blob/5177d47ffaa39d3089e77a56bb86ef2507560ac2/scripts/hime-user-setup#L37-L38

Command pushd and popd are not available in POSIX-compliant shell. They should not be used when shebang is #!/bin/sh. If you need them, please consider using /bin/bash to execute this script instead.

Downstream bug report: https://bugs.debian.org/985250

/usr/share/hime/script/hime-user-setup uses pushd and popd, but /bin/sh does not provide those commands. In fact, pushd and popd are not needed, because the child process running the script has its own current directory. So pushd should be changed to cd (two occurrences) and popd should be removed (two occurrences).

xatier commented 11 months ago

Thanks for the report.