#!/usr/bin/perl
# $Id: mkargs.pl,v 1.4 2002/11/29 20:23:34 mdk Exp $

open(CL, @ARGV[0]);
while (<CL>){
    s/\s*#.*$//;
    next if /^\s*$/;

    if (/^(\w+):\s*([\w\-\+]+).*$/) {
	my ($key, $value) = ($1, $2);
	$value =~ s/\s*$//;
	my $expr = '$' . $key . ' = $value';
	eval $expr;
    }
}
close(CL);

if (($COPY eq "OTHER") or ($COPY eq "COM-PERM")) {
    if (($STAT eq "Suspend")    or
	($STAT eq "Prohibited") or
	($STAT eq "Unreachable")) {
	$restrict_dist = 1;
    }
} elsif ($COPY eq "NO-COM") {
    $restrict_dist = 1;
}

print " RESTRICT-DIST=yes" if $restrict_dist;
print " KIND=" . $KIND if $KIND;
print " ATRB=" . $ATRB if $ATRB;
print " ITEM=" . $ITEM if $ITEM;
print " COPY=" . $COPY if $COPY;
print " STAT=" . $STAT if $STAT;
