Skip to content

Conversation

@ptrcnull
Copy link

@ptrcnull ptrcnull commented Aug 4, 2022

as lddtree uses /bin/sh as its hashbang, it cannot use bashisms

i'm not really happy about the long option workaround, but couldn't find a better way to still support it (used in alpine's mkinitfs and who knows where, cannot remove)

as for the indent - posix says "For other conversion specifiers, the behavior is undefined." when the precision argument is 0, so we should avoid that

as lddtree uses /bin/sh as its hashbang, it cannot use bashisms
@ptrcnull
Copy link
Author

ptrcnull commented Aug 4, 2022

one other workaround, one that works with spaces in the arguments is:

case "$@" in *"--no-auto-root"*)
	local args=""
	for arg; do
		if [ "$arg" = "--no-auto-root" ]; then
			args="$args -N"
		else
			args="$args '$arg'"
		fi
	done
	eval set -- $args
	;;
esac

but that introduces eval instead..

@ncopa
Copy link
Owner

ncopa commented Jan 19, 2023

I fixed this differently. thanks!

@ncopa ncopa closed this Jan 19, 2023
@ptrcnull
Copy link
Author

thanks! that's indeed better than what i came up with

@ptrcnull ptrcnull deleted the posix-sh branch January 19, 2023 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants