- Timestamp:
- 2013-06-12T18:43:04+12:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
other-projects/nightly-tasks/diffcol/trunk/diffcol/gdbdiff.pm
r27579 r27604 32 32 sub test_gdb 33 33 { 34 my ($full_modeldb, $full_testdb ) = @_;34 my ($full_modeldb, $full_testdb,$strColName) = @_; 35 35 36 36 37 37 # print "Now is testing database\n"; 38 38 39 my $model_cmd = "db2txt $full_modeldb 2>&1"; 40 my $test_cmd = "db2txt $full_testdb 2>&1"; 39 # need to sort text output of both test and model col database files, to normalise them for the comparison 40 # the -sort option to db2txt was added specifically to support diffcol 41 my $model_cmd = "db2txt -sort $full_modeldb 2>&1"; 42 my $test_cmd = "db2txt -sort $full_testdb 2>&1"; 41 43 42 44 my $model_text = readin_gdb($model_cmd); 43 45 my $test_text = readin_gdb($test_cmd); 46 47 48 # filter out the fields that can be ignored in the two database files 49 my $ignore_line_re = "\n<(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate)>([^\n])*"; 50 $model_text =~ s/$ignore_line_re//g; 51 $test_text =~ s/$ignore_line_re//g; 52 53 54 # ignore absolute path prefixes in modelcol and testcol (necessary for archiveinf-doc and -src.gdb files) 55 56 # Remember the original model col on SVN could have been built anywhere, 57 # and in the gdb files, absolute paths are stored to the collection location. 58 # Crop these paths to the collect/<colname> point. 59 60 # Entries are of the form [Entry] or <Entry>. In order to do a sensible diff, 61 # need to remove the prefix to the collect/colname folder in any (absolute) path that occurs in Entry 62 # E.g. [/full/path/collect/colname/import/file.ext] should become [collect/colname/import/file.ext] 63 # Better regex is of the form /BEGIN((?:(?!BEGIN).)*)END/, see http://docstore.mik.ua/orelly/perl/cookbook/ch06_16.htm 64 65 $model_text =~ s@^([^\\//]*).*(\\|/)(collect(\\|/)$strColName)(.*)$@$1$3$5@mg; 66 $test_text =~ s@^([^\\//]*).*(\\|/)(collect(\\|/)$strColName)(.*)$@$1$3$5@mg; 67 68 44 69 my $report_type = "OldStyle"; # Can not change this type. 45 70 my $diff_gdb = diff \$model_text, \$test_text, { STYLE => $report_type }; 46 71 72 # leaving the ignore regex as it used to be in the following, in case it helps with single line comparisons 47 73 $diff_gdb = &diffutil::GenerateOutput($diff_gdb,"^<(lastmodified|lastmodifieddate|oailastmodified|oailastmodifieddate)>.*"); 48 74
Note:
See TracChangeset
for help on using the changeset viewer.