diff options
Diffstat (limited to 'scripts/patch-gimp')
-rw-r--r-- | scripts/patch-gimp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/scripts/patch-gimp b/scripts/patch-gimp new file mode 100644 index 0000000..6b719a2 --- /dev/null +++ b/scripts/patch-gimp @@ -0,0 +1,25 @@ +#!/usr/bin/perl + +# Strip out stuff that doesn't belong in the Gimp distribution. + +foreach $file (@ARGV) { + $output = ""; + $do_output = 1; + $tmpfile = "$file.tmp"; + open INPUT, $file or die "Can't open $file: $!\n"; + while (<>) { + if (/@-@-@-@-@ NO-GIMP @-@-@-@-@/) { + $do_output = 0; + } elsif (/@-@-@-@-@ YES-GIMP @-@-@-@-@/) { + $do_output = 1; + } elsif ($do_output) { + $output .= $_; + } + } + close INPUT; + open OUTPUT, ">$tmpfile" or die "Can't open $tmpfile: $!\n"; + print OUTPUT $output or die "Can't write to $tmpfile: $!\n"; + close OUTPUT or die "Can't close $tmpfile: $!\n"; + rename $tmpfile, $file or die "Can't rename $tmpfile to $file: $!\n"; +} + |