#!/usr/local/bin/perl5 -w
#
$initdir = $ARGV[0];
$finaldir = $ARGV[1];
$extra = $ARGV[2];
$i=3;
while(defined($ARGV[$i]))	{
	$target = $finaldir . '/addon/foil' . ($ARGV[$i]+$extra) .'.addoninfo';
	die "Target file $target exists already\n" if( -e $target );
	$com = "cp ${initdir}/addon/foil${ARGV[$i]}.addoninfo $target";
	system($com);
	$i++;
}
