Home Home > GIT Browse > SLE12-SP5
summaryrefslogtreecommitdiff
blob: 33bb6f272fecfebbd79072a62f48061ef348aebb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/perl -w
use strict;

my $one = shift;
my $two = shift;

sub convert($$) {
	my $in = shift;
	my $out = shift;
	open(IN, "<$in") || die "cannot open '$in'";

	while (<IN>) {
		s/^[[ 0-9s]*\] //;
		last if (/^\+ make .*all CONFIG_DEBUG_SECTION_MISMATCH/);
	}

	my @lines;
	my $start = 1;
	while (<IN>) {
		s/^[[ 0-9s]*\] //;
		next if ($start && /^\+/);
		$start = 0;
		last if (/^\+/);
		s/2\.6\.[0-9]+(\.[0-9]+)?//g;
		s/3\.[0-9]+(\.[0-9]+)?//g;
		s@/home/abuild/rpmbuild/@@g;
		s@/usr/src/packages/@@g;
		s/^CRC [0-9a-z]+$//g;
		s/^System is [0-9]+ kB$//g;
		s/^Root device is .*//g;
		if (/^(.+)(  (CC|LD|UNROLL) .*)$/) {
			push @lines, "$1\n";
			push @lines, "$2\n";
		} else {
			push @lines, $_;
		}
	}
	close IN;

	open(OUT, ">", $out) || die "cannot open '$out'";
	map { print OUT } sort @lines;
	close OUT;
}

convert($one, "/tmp/one.$$");
convert($two, "/tmp/two.$$");

system "diff -u -w -b -B /tmp/one.$$ /tmp/two.$$";

unlink "/tmp/one.$$";
unlink "/tmp/two.$$";

1;