
# $Id: edmakexite,v 1.9 1997/09/05 08:52:36 svein Exp $

BEGIN {
  printed = 0;
  binline = 0;
  dirline = 0;
}

/^case "\$XITE_HOSTTYPE" in/, /^esac/ {
        if (binline != 0) {
                print;
                next;
        }

        if ( substr($1, 1, length($1)-1) == xite_hosttype ) {
                binline=NR;
                print;
                next;
        }

        if ($1 == "*)" && binline == 0) {
                print "    " xite_hosttype ")";
                print "        except=" "\"" exceptions "\";;";
		print;
		next;
        }
}

/if test -d "\$sub" -a "\$sub" != "CVS"/, /then/ {
	if (dirline != 0) {
		print;
		next;
	}

	if ( substr($4, 2, length($4)-2) == xite_hosttype ) {
		dirline=NR;
		print;
		next;
	}

	if ($2 == "then" && dirline == 0) {
		ORS = "";
		print "                            -a \"$sub\" != \"";
		ORS = "\n";
		print xite_hosttype "\"" " \\";
		print;
		next;
	}
}

{
	if ( $1 == "XITE_HOME=" && NF == 1) {
		print "\t" $1 home;
		printed = 1;
	}

	if (! printed) print $0;
	else printed = 0;
}


