my %value = ();
my %link  = ();

sub fixvar
{
    my ($name) = @_;
    my $value = $value {$name};
    die "8: $name\n" unless defined $value;
    $value;
}

print "SITE=https://dev-www.libreoffice.org/src\n";

while (<STDIN>)
{
    s@\s*#.*@@;
    next unless m@\S@;
    die "14: $_\n" unless m@^(export *|)?(\w+) *:= *(\S+)@;
    my ($name, $value) = ($2, $3);
    $value {$name} = $value;

    if ($name =~ m@TARBALL@)
    {
        $name =  &fixvar ($name);
        $name =~ s@\$\((\w+)\)@&fixvar ($1)@geis;
        print "wget -c \$SITE/$name\n";
    }
}
