Skip to content

Instantly share code, notes, and snippets.

@ktlim ktlim/copyfix.pl
Last active Oct 29, 2015

Embed
What would you like to do?
Change in-file notices to new, shorter form.
#!/usr/bin/perl -i.bak
$skipping = 0;
while (<>) {
if ($skipping == 0 && /^(.+) Copyright /) {
print "$1 See the COPYRIGHT and LICENSE files in the top-level directory of this\n";
print "$1 package for notices and licensing terms.\n";
$skipping = 1;
}
elsif ($skipping == 1) {
if (/ see .*LegalNotices/) {
$skipping = 2;
}
}
else {
print;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.