40 } |
40 } |
41 print ">>> Testing for diff\n"; |
41 print ">>> Testing for diff\n"; |
42 my $diff_test = "diff --version"; |
42 my $diff_test = "diff --version"; |
43 my $devnull = File::Spec->devnull(); |
43 my $devnull = File::Spec->devnull(); |
44 print ">>> Executing: $diff_test\n"; |
44 print ">>> Executing: $diff_test\n"; |
45 my $rc = system($diff_test > $devnull); |
45 my $rc = system("$diff_test > $devnull") >> 8; |
46 die "*** Error: can't execute the diff tool ***", if ($rc); |
46 die "*** Error: can't execute the diff tool: $rc ***", if ($rc); |
47 $baseline_dir = abs_path($baseline_dir); |
47 $baseline_dir = abs_path($baseline_dir); |
48 perl_run("get_upstream.pl $baseline_dir") and die $!; |
48 perl_run("get_upstream.pl $baseline_dir") and die $!; |
49 set_epocroot(); |
49 my $epocroot = get_epocroot(); |
50 my $epocroot = $ENV{'EPOCROOT'}; |
50 my $build_pkg_dir = get_pkg_dir(); |
51 my $build_pkg_dir = File::Spec->catfile("$epocroot","build"); |
|
52 $baseline_dir = File::Spec->catfile("$baseline_dir","build"); |
51 $baseline_dir = File::Spec->catfile("$baseline_dir","build"); |
53 my $host_platform_dir = get_hostplatform_dir(); |
52 my $host_platform_dir = get_hostplatform_dir(); |
54 push(@excludes,"*$host_platform_dir*"); |
53 push(@excludes,"*$host_platform_dir*"); |
55 foreach my $exclude (@excludes) { |
54 foreach my $exclude (@excludes) { |
56 $exclude = "-x '$exclude'"; |
55 $exclude = "-x '$exclude'"; |
57 } |
56 } |
58 my $diff_cmd; |
57 my $diff_cmd; |
59 if (!$diff_out) { |
58 if (!$diff_out) { |
60 my $baseline_rev = get_baseline(); |
59 my $baseline_rev = get_baseline(); |
61 $diff_out = File::Spec->catfile("$epocroot","build","cross-plat-dev-utils", |
60 $diff_out = File::Spec->catfile("$build_pkg_dir","cross-plat-dev-utils", |
62 "patch-files","diffs","patch-$baseline_rev.patch"); |
61 "patch-files","diffs","patch-$baseline_rev.patch"); |
63 } |
62 } |
64 open DIFF,">$diff_out" or die $!; |
63 open DIFF,">$diff_out" or die $!; |
65 print DIFF "## diff generated by diff_upstream.pl\n"; |
64 print DIFF "## diff generated by diff_upstream.pl\n"; |
66 close DIFF; |
65 close DIFF; |