diff options
author | Alexandre Oliva <lxoliva@fsfla.org> | 2018-03-02 04:30:30 +0000 |
---|---|---|
committer | Alexandre Oliva <lxoliva@fsfla.org> | 2018-03-02 04:30:30 +0000 |
commit | 37ba32949736d2596648f1f0369240d8fd0d761b (patch) | |
tree | 8f9dae0bb95842811001de01fd44fd9eced4a8e2 /freed-ora/tags/f27/4.15.7-300.fc27.gnu/remove-binary-diff.pl | |
parent | e80dbe14c7a17d2cd0d3eaf0a63e8b9a9eb127b8 (diff) | |
download | linux-libre-raptor-37ba32949736d2596648f1f0369240d8fd0d761b.tar.gz linux-libre-raptor-37ba32949736d2596648f1f0369240d8fd0d761b.zip |
tag 4.15.7-300.fc27.gnu
Diffstat (limited to 'freed-ora/tags/f27/4.15.7-300.fc27.gnu/remove-binary-diff.pl')
-rwxr-xr-x | freed-ora/tags/f27/4.15.7-300.fc27.gnu/remove-binary-diff.pl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/freed-ora/tags/f27/4.15.7-300.fc27.gnu/remove-binary-diff.pl b/freed-ora/tags/f27/4.15.7-300.fc27.gnu/remove-binary-diff.pl new file mode 100755 index 000000000..56dfe5744 --- /dev/null +++ b/freed-ora/tags/f27/4.15.7-300.fc27.gnu/remove-binary-diff.pl @@ -0,0 +1,35 @@ +#!/usr/bin/perl -w +# A script to remove those terrible binary diffs from the patches which +# screw up everything and rain on my parade. + +use strict; + +my @args=@ARGV; +my @current_patch; +my $is_binary = 0; +my $cnt = 0; + +while(my $row = <>) { + # diff marks the start of a new file to check + if ($row =~ /^diff -.*?(\S+)$/) { + if (!$is_binary) { + foreach my $line (@current_patch) { + print $line; + } + } + $is_binary = 0; + @current_patch = (); +# Leave these alone, they do no harm. -lxoliva +# } elsif ($row =~ /Binary files (.)* differ$/) { +# $is_binary = 1; + } elsif ($row =~ /GIT binary patch/) { + $is_binary = 1; + } + push (@current_patch, $row); +} + +if (!$is_binary) { + foreach my $line (@current_patch) { + print $line; + } +} |