#!/bin/sh

step_profile=/usr/share/install2/installer-steps
step_dir=/usr/share/install2/steps
step_convert=/usr/share/alterator-menu/desktop.awk

#turn off auto expansion
set -f

. alterator-sh-functions

print_entry()
{
    while read weight uri help icon name;do
	printf '("%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 -- |
			    awk -f "$step_convert" -v lang="$in_language"|
			    print_entry
			echo ')'
			;;
		*)
			echo '#f'
			;;
	esac
}

message_loop
