h-c: sort the list of files used for file compare
Sorting the list of files used for file comparisons (MD5 sums and actually diffs) makes the output much easier to deal with, especially for C&CS checkers. It groups all the files in a given directory together so that one can more easily deal with all these files at once. This is useful for comparing differences in particular components, especially ones like BusyBox whose files exist mostly in a single directory and have the same checksums (since they all point to one binary).
This commit is contained in:
		
							parent
							
								
									31e2c78e8c
								
							
						
					
					
						commit
						1208e8b7da
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -188,8 +188,8 @@ foreach my $ii (@orgFiles, @comparedFiles) { | |||
|     if defined $origH{$ii} and defined $comparedH{$ii}; | ||||
| } | ||||
| my(@o, @c); | ||||
| @o = keys %final; | ||||
| @c = keys %final; | ||||
| @o = sort(keys %final); | ||||
| @c = sort(keys %final); | ||||
| 
 | ||||
| my $origFiles2sha1 =  MD5SumFiles($origDir, \@o, $origTempFile); | ||||
| my $comparedFiles2sha1 = MD5SumFiles($comparedDir, \@c, $comparedTempFile); | ||||
|  | @ -212,7 +212,7 @@ system("/bin/echo >> $diffOutputFile 2>&1"); | |||
| system("/bin/echo 'File contents comparisons (diff):' >> $diffOutputFile 2>&1"); | ||||
| 
 | ||||
| if ($DO_DIFF) { | ||||
|   foreach my $file (keys %final) { | ||||
|   foreach my $file (sort(keys %final)) { | ||||
|     if ($origFiles2sha1->{$file} ne $comparedFiles2sha1->{$file}) { | ||||
|       system( | ||||
|              "/usr/bin/diff -u \"$origDir/$file\" \"$comparedDir/$file\" >> $diffOutputFile 2>&1"); | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Denver Gingerich
						Denver Gingerich