Subversion Repositories DevTools

Rev

Rev 263 | Rev 279 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 263 Rev 267
Line 627... Line 627...
627
                #
627
                #
628
                #   MD5 digest the files that are being merged
628
                #   MD5 digest the files that are being merged
629
                #   Ignore version_*.h files as these are generated
629
                #   Ignore version_*.h files as these are generated
630
                #   and may contain different dates and line endings
630
                #   and may contain different dates and line endings
631
                #
631
                #
-
 
632
                #   Don't put the files into 'binmode'
-
 
633
                #   Need to handle some level of Unix/DOS file endings
-
 
634
                #
-
 
635
                #
632
                my $msg = "Merge Skip File";
636
                my $msg = "Merge Skip File";
633
                unless ( $target =~ m~/version[^/]*\.h$~ )
637
                unless ( $target =~ m~/version[^/]*\.h$~ )
634
                {
638
                {
635
                    $msg = "Merge Test File";
639
                    $msg = "Merge Test File";
636
                    #
640
                    #
637
                    #   Compare the two files with an MD5
641
                    #   Compare the two files with an MD5
638
                    #
642
                    #
639
                    local *FILE;
643
                    local *FILE;
640
                    open(FILE, $target) or Error ("Can't open '$target': $!");
644
                    open(FILE, $target) or Error ("Can't open '$target': $!");
641
                    binmode(FILE);
645
                    binmode FILE, ':crlf';
642
                    my $target_md5 = Digest::MD5->new->addfile(*FILE)->hexdigest;
646
                    my $target_md5 = Digest::MD5->new->addfile(*FILE)->hexdigest;
643
                    close FILE;
647
                    close FILE;
644
 
648
 
645
                    open(FILE, $item) or Error ("Can't open '$item': $!");
649
                    open(FILE, $item) or Error ("Can't open '$item': $!");
646
                    binmode(FILE);
650
                    binmode FILE, ':crlf';
647
                    my $source_md5 = Digest::MD5->new->addfile(*FILE)->hexdigest;
651
                    my $source_md5 = Digest::MD5->new->addfile(*FILE)->hexdigest;
648
                    close FILE;
652
                    close FILE;
649
 
653
 
650
                    unless ( $source_md5 eq $target_md5 )
654
                    unless ( $source_md5 eq $target_md5 )
651
                    {
655
                    {