#!/usr/bin/perl
use strict;

=head1 NAME
ck_sync_tmpl.pl - Check for synchronicity between the template directories

=head1 SYNOPSIS

ck_sync_tmpl.pl template_dir_1 template_dir_2



=cut

my ($dir1, $dir2);
show_usage() if (@ARGV != 2);

($dir1, $dir2) = @ARGV[0,1];
show_usage() unless (-d $dir1 and -d $dir2);

unless (-d $dir1 and -d $dir2)

for my $file (`find . -type f -ctime -90|grep -v CVS`) {
    chomp $file;
    if (-f $file) {
	$that = readfile($file); 
	if (! -f "../consol/$file") {
	    print "../consol/$file no existe!\n";
	    next;
	}
	$this = readfile("../consol/$file");
	print "$file:\n"; 
	while ($this =~ s/\<TMPL_(VAR|IF|LOOP|UNLESS) NAME=\"?([^>\"]+)\"?>//i) {
	    $tipo = $1;
	    $elem=$2;
	    if ($that =~ /$elem/i) {
	    } else {
		print "*** $tipo $elem no\n";
	    }
	}
    }
}

sub readfile {

}

sub show_usage {
    exit 1;
}
