summaryrefslogtreecommitdiffstats
path: root/needs-checking/split-patch
diff options
context:
space:
mode:
authorMartin Quinson <mquinson@debian.org>2003-01-21 09:49:29 +0000
committerMartin Quinson <mquinson@debian.org>2003-01-21 09:49:29 +0000
commit02dc4a5f8c1979e9a23f7b6851f693d29b640c4d (patch)
tree2f397f5df89f4529b89fd0e7a021238d0f290007 /needs-checking/split-patch
parent4d11e99bfc25e0261111d202a3a2afdf97daea5c (diff)
downloadquilt-02dc4a5f8c1979e9a23f7b6851f693d29b640c4d.tar.gz
Version 0.11, from Andreas Gruenbacher
Diffstat (limited to 'needs-checking/split-patch')
-rwxr-xr-xneeds-checking/split-patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/needs-checking/split-patch b/needs-checking/split-patch
new file mode 100755
index 0000000..08ce431
--- /dev/null
+++ b/needs-checking/split-patch
@@ -0,0 +1,29 @@
+#!/usr/bin/perl -w
+$out = "";
+while (<>) {
+ next if (/^Only/);
+ next if (/^Binary/);
+ if (/^diff/ || /^Index/) {
+ if ($out) {
+ close OUT;
+ }
+ (@out) = split(' ', $_);
+ shift(@out) if (/^diff/);
+ $out = pop(@out);
+ $out =~ s:/*usr/:/:;
+ $out =~ s:/*src/:/:;
+ $out =~ s:^/*linux[^/]*::;
+ $out =~ s:\(w\)::;
+ next if ($out eq "");
+ $out = "/var/tmp/patches/$out";
+ $dir = $out;
+ $dir =~ s:/[^/]*$::;
+ print STDERR "$out\n";
+ system("mkdir -p $dir");
+ open(OUT, ">$out") || die("cannot open $out");
+ }
+ if ($out) {
+ print OUT $_;
+ }
+}
+