source: other-projects/nightly-tasks/diffcol/trunk/diffcol/cfgdiff.pm@ 36808

Last change on this file since 36808 was 36808, checked in by anupama, 20 months ago

We used to run diffcol as a nightly task only for GS2. Commit 36655 was the first stage of getting diffcol to work for GS3, but skipped a lot of important code branches (like comparing the index\text\j/gdb files) in order to fix up the easier parts of the code. Now that I think the remainder of the diffcol scripts have been got to work with diffcol for GS3, where the index\text\flatdb files are compared and diffcol works for them, I can commit the important changes as well as commented out debugging statements made to the diffcol scripts that get the full diffcol code to work for GS3 diffcol. I will recommit again after removing the debugging statements. And I still need to do a full local diffcol run again, as well as testing if diffcol still works after locally undoing my sort field changes to some GS3 model cols (the recent commits to Tudor, Word-PDF, Images-GPS and Multimedia collections) to see if Dr Bainbridge's PERL_HASH_SEED env var addition fixes all of those collections diffcol failures, making the extra sorting redundant. In that case, I will recommit those model collections after updating their col configurations to not do the extra sorting.

File size: 1.4 KB
Line 
1package cfgdiff;
2
3BEGIN {
4 die "GSDLHOME not set\n" unless defined $ENV{'GSDLHOME'};
5 die "GSDLOS not set\n" unless defined $ENV{'GSDLOS'};
6 unshift (@INC, "$ENV{'GSDLHOME'}/perllib");
7 unshift (@INC, "$ENV{'GSDLHOME'}/perllib/cpan");
8}
9
10use util;
11use diffutil;
12use Text::Diff;
13
14sub test_cfg
15{
16 my ($full_modelcfg,$full_testcfg,$cfg_file) = @_;
17
18 my $cfg_result = diff $full_modelcfg, $full_testcfg, { STYLE => "OldStyle" };
19
20
21 if($cfg_file eq "build.cfg")
22 {
23 my @temp_array = split (" ",$cfg_result);
24 my @r_array = grep {/\d+/} @temp_array;
25
26 if ($cfg_result eq "")
27 {
28 return "";
29 # return "Difference Report: These two collections are identical";
30 }
31 elsif ($r_array[1] > $r_array[2] && $temp_array[2] eq "builddate" && $temp_array[6] eq "builddate")
32 {
33 return "Difference Report: Using newer collection as model collection";
34 }
35 elsif ($r_array[1] < $r_array[2] && $temp_array[2] eq "builddate" && $temp_array[6] eq "builddate")
36 {
37 return "";
38 }
39 else
40 {
41 $cfg_result = &diffutil::GenerateOutput($cfg_result,"");
42 return $cfg_result;
43 }
44 }
45 elsif($cfg_file eq "collect.cfg")
46 {
47
48 $cfg_result = &diffutil::GenerateOutput($cfg_result,"");
49 if ($cfg_result eq "")
50 {
51 return "";
52 }
53 else
54 {
55 return "Difference Report:\n$cfg_result";
56 }
57 }
58 else
59 {
60 die "Error occour in cfgdiff::testcfg!!\n";
61 }
62}
63
641;
Note: See TracBrowser for help on using the repository browser.