mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 03:52:35 +01:00
mysql-copyright:
* added 'local $/' to keep from undef-ing $/ (the newline setting) for the whole script * removed the target dir removal (target dir is not a temp dir!) * use split to create filelist (cleaner way than using chomp!) * removed use of chomp because it caused some file names to be mangled * print out which file is being processed if verbose mysql-copyright-2: * added cpp to list of files to be processed (for windows archives) Build-tools/mysql-copyright-2: * added cpp to list of files to be processed (for windows archives) Build-tools/mysql-copyright: * added 'local $/' to keep from undef-ing $/ (the newline setting) for the whole script * removed the target dir removal (target dir is not a temp dir!) * use split to create filelist (cleaner way than using chomp!) * removed use of chomp because it caused some file names to be mangled * print out which file is being processed if verbose
This commit is contained in:
parent
518c923625
commit
e4042c25ef
2 changed files with 16 additions and 16 deletions
|
@ -79,7 +79,7 @@ sub main
|
|||
$newdistname .= $suffix if $win_flag;
|
||||
}
|
||||
# find out the extract path (should be same as distname!)
|
||||
chomp($destdir= `tar ztf ../$distfile | head -1`);
|
||||
chomp($destdir = `tar ztf ../$distfile | head -1`);
|
||||
# remove slash from the end
|
||||
$destdir= substr($destdir, 0, -1);
|
||||
|
||||
|
@ -111,6 +111,7 @@ sub main
|
|||
chdir("$destdir");
|
||||
unlink ("configure") or die "Can't delete $destdir/configure: $!\n";
|
||||
open(CONFIGURE,"<configure.in") or die "$! Unable to open configure.in to read from!\n";
|
||||
local $/;
|
||||
undef $/;
|
||||
my $configure = <CONFIGURE>;
|
||||
close(CONFIGURE);
|
||||
|
@ -150,13 +151,6 @@ sub main
|
|||
print "$! Unable to delete $dir!\n";
|
||||
}
|
||||
}
|
||||
if (-e $opt_target) {
|
||||
print "Trying to delete $opt_target\n" if $opt_verbose;
|
||||
if ( system("rm -rf $opt_target")) {
|
||||
print "$! Unable to delete $opt_target!\n";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
exit(0);
|
||||
}
|
||||
|
@ -165,14 +159,17 @@ sub main
|
|||
#### mysqld and MySQL client programs have a usage printed with --help.
|
||||
#### This usage includes a copyright, which needs to be modified
|
||||
####
|
||||
|
||||
sub fix_usage_copyright
|
||||
{
|
||||
my @Cfiles = `find . -type f -name \"*.c*\"`;
|
||||
foreach my $Cfile (@Cfiles)
|
||||
my $findlist = `find . -type f -name \"*.c*\"`;
|
||||
my @files = split("\n", $findlist);
|
||||
my $cwd = getcwd();
|
||||
|
||||
foreach my $file (@files)
|
||||
{
|
||||
chop $Cfile;
|
||||
`replace "This is free software," "This is commercial software," "and you are welcome to modify and redistribute it under the GPL license" "please see the file MySQLEULA.txt for details" -- "$Cfile"` if -f $Cfile;
|
||||
next if ! -f $file;
|
||||
print "processing file $file in cwd $cwd\n" if $opt_verbose;
|
||||
`replace "This is free software," "This is commercial software," "and you are welcome to modify and redistribute it under the GPL license" "please see the file MySQLEULA.txt for details" -- "$file"` ;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -182,12 +179,14 @@ sub fix_usage_copyright
|
|||
|
||||
sub add_copyright
|
||||
{
|
||||
my @files = `find . -type f -name "*"`;
|
||||
my $findlist = `find . -type f -name "*"`;
|
||||
my @files = split("\n", $findlist);
|
||||
my $cwd = getcwd();
|
||||
|
||||
foreach my $file (@files)
|
||||
{
|
||||
chop $file;
|
||||
next if ! -f $file;
|
||||
next if -B $file;
|
||||
print "processing file $file in cwd $cwd\n" if $opt_verbose;
|
||||
`$WD/Build-tools/mysql-copyright-2 "$file"`;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,6 +89,7 @@ sub add_copyright
|
|||
elsif ($ARGV =~ /\.c$/ ||
|
||||
$ARGV =~ /\.cc$/ ||
|
||||
$ARGV =~ /\.h$/ ||
|
||||
$ARGV =~ /\.cpp$/ ||
|
||||
$ARGV =~ /\.yy$/)
|
||||
{
|
||||
$start_copyright="/* ";
|
||||
|
|
Loading…
Reference in a new issue