#!/bin/sh

step_profile=/usr/share/install2/installer-steps
step_dir=/usr/share/install2/steps

#turn off auto expansion
set -f

. alterator-sh-functions

print_step()
{
    while read uri help icon name;do
	printf '(name "%s" label "%s" help "%s" icon "%s")' "$uri" "$name" "$help" "$icon"
    done
}

on_message()
{
	case "$in_action" in
		list)
			echo '('
			sed "s|.*|$step_dir/&.desktop|" <"$step_profile" |
			    xargs -r cat -- |
			    alterator-dump-desktop \
				-v lang="$in_language" \
				-v out="X-Alterator-URI;X-Alterator-Help;Icon;Name" \
				-v def="/notfound;notfound;altlinux;" |
			    print_step
			echo ')'
			;;
		*)
			echo '#f'
			;;
	esac
}

message_loop
