Diff for /embedaddon/rsync/packaging/patch-update between versions 1.1.1.2 and 1.1.1.3

version 1.1.1.2, 2013/10/14 07:51:14 version 1.1.1.3, 2016/11/01 09:54:32
Line 23  my $make_gen_cmd = 'make -f prepare-source.mak conf && Line 23  my $make_gen_cmd = 'make -f prepare-source.mak conf &&
 );  );
 &usage if $help_opt;  &usage if $help_opt;
   
   $ENV{GIT_MERGE_AUTOEDIT} = 'no';
   
 if (defined $incl_generated_files) {  if (defined $incl_generated_files) {
     $patches_dir = $incl_generated_files if $incl_generated_files ne '';      $patches_dir = $incl_generated_files if $incl_generated_files ne '';
     $incl_generated_files = 1;      $incl_generated_files = 1;
Line 45  while (<PIPE>) { Line 47  while (<PIPE>) {
 close PIPE;  close PIPE;
 die "Unable to determine commit hash for master branch: $master_branch\n" unless defined $master_commit;  die "Unable to determine commit hash for master branch: $master_branch\n" unless defined $master_commit;
   
 my @extra_files;  
 open(IN, '<', 'Makefile.in') or die "Couldn't open Makefile.in: $!\n";  
 while (<IN>) {  
     if (s/^GENFILES=//) {  
         while (s/\\$//) {  
             $_ .= <IN>;  
         }  
         @extra_files = split(' ', $_);  
         last;  
     }  
 }  
 close IN;  
   
 if ($incl_generated_files) {  if ($incl_generated_files) {
       my @extra_files = get_extra_files();
     die "'$tmp_dir' must not exist in the current directory.\n" if -e $tmp_dir;      die "'$tmp_dir' must not exist in the current directory.\n" if -e $tmp_dir;
     mkdir($tmp_dir, 0700) or die "Unable to mkdir($tmp_dir): $!\n";      mkdir($tmp_dir, 0700) or die "Unable to mkdir($tmp_dir): $!\n";
     system "$make_gen_cmd && rsync -a @extra_files $tmp_dir/master/" and exit 1;      system "$make_gen_cmd && rsync -a @extra_files $tmp_dir/master/" and exit 1;
Line 171  sub update_patch Line 161  sub update_patch
     open(OUT, '>', "$patches_dir/$patch.diff") or die $!;      open(OUT, '>', "$patches_dir/$patch.diff") or die $!;
     print OUT $description{$patch}, "\nbased-on: $based_on\n";      print OUT $description{$patch}, "\nbased-on: $based_on\n";
   
       my @extra_files;
     if ($incl_generated_files) {      if ($incl_generated_files) {
           @extra_files = get_extra_files();
         system "$make_gen_cmd && rsync -a @extra_files $tmp_dir/$patch/" and exit 1;          system "$make_gen_cmd && rsync -a @extra_files $tmp_dir/$patch/" and exit 1;
     }      }
     $last_touch = time;      $last_touch = time;
Line 196  sub update_patch Line 188  sub update_patch
         } else {          } else {
             ($parent_dir) = $parent =~ m{([^/]+)$};              ($parent_dir) = $parent =~ m{([^/]+)$};
         }          }
        open(PIPE, '-|', 'diff', '-up', "$tmp_dir/$parent_dir", "$tmp_dir/$patch") or die $!;        open(PIPE, '-|', 'diff', '-Nurp', "$tmp_dir/$parent_dir", "$tmp_dir/$patch") or die $!;
         while (<PIPE>) {          while (<PIPE>) {
            s#^(diff -up) $tmp_dir/[^/]+/(.*?) $tmp_dir/[^/]+/(.*)#$1 a/$2 b/$3#o;            s#^(diff -Nurp) $tmp_dir/[^/]+/(.*?) $tmp_dir/[^/]+/(.*)#$1 a/$2 b/$3#o;
             s#^\Q---\E $tmp_dir/[^/]+/([^\t]+)\t.*#--- a/$1#o;              s#^\Q---\E $tmp_dir/[^/]+/([^\t]+)\t.*#--- a/$1#o;
             s#^\Q+++\E $tmp_dir/[^/]+/([^\t]+)\t.*#+++ b/$1#o;              s#^\Q+++\E $tmp_dir/[^/]+/([^\t]+)\t.*#+++ b/$1#o;
             print OUT $_;              print OUT $_;
         }          }
         close PIPE;          close PIPE;
           unlink @extra_files;
     }      }
   
     close OUT;      close OUT;
Line 212  sub update_patch Line 205  sub update_patch
 }  }
   
 exit;  exit;
   
   sub get_extra_files
   {
       my @extras;
   
       open(IN, '<', 'Makefile.in') or die "Couldn't open Makefile.in: $!\n";
       while (<IN>) {
           if (s/^GENFILES=//) {
               while (s/\\$//) {
                   $_ .= <IN>;
               }
               @extras = split(' ', $_);
               last;
           }
       }
       close IN;
   
       return @extras;
   }
   
 sub usage  sub usage
 {  {

Removed from v.1.1.1.2  
changed lines
  Added in v.1.1.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>