Radix cross Linux Toolchains

Toolchains for all supported by Radix cross Linux devices

65 Commits   2 Branches   12 Tags
#!/usr/bin/perl

use FindBin;
use lib $FindBin::Bin;

use strict;
use warnings FATAL => 'all';
use _kxLab;

my $filename = shift or die "Error: Need a patch file";
my $arg2 = shift;
my $depmode = 0;
my $dir = ".";
if( defined( $arg2 ) )
{
  if( $arg2 eq "-dep-" )
  {
    $depmode = 1;
  }
  else
  {
    $dir = $arg2;
  }
}

open( PATCH, "<$filename" ) or die "Error: Could not open patch file: $filename: $!";
while( <PATCH> )
{
  next if /^#/;
  if (/(\S+)\s*(.*)/)
  {
    if( $depmode )
    {
      print "$1 ";
    }
    else
    {
      my $arg = $2 || "-p0";
      print "=== Applying $1 ===\n";
      _kxLab::system( "patch -d $dir $arg < $1" );
    }
  }
}
close PATCH;
if( $depmode )
{
  print "$filename\n";
}