cross-plat-dev-utils/patch_upstream.pl
changeset 6 787612182dd0
parent 2 39c28ec933dd
child 8 b260811257d2
equal deleted inserted replaced
5:301c3edbdaa1 6:787612182dd0
    12 # ../baseline.txt and patch it to be the same as this package.
    12 # ../baseline.txt and patch it to be the same as this package.
    13 
    13 
    14 use strict;
    14 use strict;
    15 use get_baseline;
    15 use get_baseline;
    16 use perl_run;
    16 use perl_run;
    17 use set_epocroot;
    17 use places;
    18 use get_hostplatform_dir;
    18 use get_hostplatform_dir;
    19 use check_os;
    19 use check_os;
    20 use File::Spec;
    20 use File::Spec;
    21 use File::Temp 'tempfile';
    21 use File::Temp 'tempfile';
    22 use Cwd 'abs_path';
    22 use Cwd 'abs_path';
    47 print ">>> Executing: $patch_test\n";
    47 print ">>> Executing: $patch_test\n";
    48 my $rc = system($patch_test);
    48 my $rc = system($patch_test);
    49 die "*** Error: can't execute the patch tool ***", if ($rc);
    49 die "*** Error: can't execute the patch tool ***", if ($rc);
    50 $baseline_dir = abs_path($baseline_dir);
    50 $baseline_dir = abs_path($baseline_dir);
    51 perl_run("get_upstream.pl $baseline_dir") and die $!;
    51 perl_run("get_upstream.pl $baseline_dir") and die $!;
    52 set_epocroot();
    52 my $epocroot = get_epocroot();
    53 my $epocroot = $ENV{'EPOCROOT'};
       
    54 if (!$patch_in) {
    53 if (!$patch_in) {
    55 	my $baseline_rev = get_baseline();
    54 	my $baseline_rev = get_baseline();
    56 	$patch_in = File::Spec->catfile("$epocroot","build","cross-plat-dev-utils",
    55 	$patch_in = File::Spec->catfile(get_pkg_dir(),"cross-plat-dev-utils",
    57 		"patch-files","diffs","patch-$baseline_rev.patch");
    56 		"patch-files","diffs","patch-$baseline_rev.patch");
    58 }
    57 }
    59 die "*** Error: can't find patch file \"$patch_in\" ***", unless ( -f $patch_in);
    58 die "*** Error: can't find patch file \"$patch_in\" ***", unless ( -f $patch_in);
    60 $baseline_dir = File::Spec->catfile("$baseline_dir","build");
    59 $baseline_dir = File::Spec->catfile("$baseline_dir","build");
    61 my $pnum = compute_pnum($patch_in);
    60 my $pnum = compute_pnum($patch_in);