mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-18 02:06:49 +08:00
Add build-packages (work in progress), new-copyright-year, and deb and rpm config files.
This commit is contained in:
28
util/new-copyright-year
Executable file
28
util/new-copyright-year
Executable file
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
|
||||
eval {
|
||||
my ($year, $copyright) = @ARGV;
|
||||
my ($years) = $copyright =~ m/(\S+) Percona Inc./;
|
||||
my ($first_year, $last_year) = split /-/, $years;
|
||||
|
||||
my $new_copyright;
|
||||
if ( $first_year && $last_year ) {
|
||||
$new_copyright = "$first_year-$year Percona Inc."
|
||||
}
|
||||
elsif ( $first_year < $year ) {
|
||||
$new_copyright = "$first_year-$year Percona Inc."
|
||||
}
|
||||
else {
|
||||
$new_copyright = "$first_year Percona Inc."
|
||||
}
|
||||
|
||||
$copyright =~ s/\S+ Percona Inc./$new_copyright/;
|
||||
print $copyright;
|
||||
};
|
||||
die $EVAL_ERROR if $EVAL_ERROR;
|
||||
|
||||
exit 0;
|
||||
Reference in New Issue
Block a user