Commit 3b34ea8c authored by patg@krsna.patg.net's avatar patg@krsna.patg.net

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)
parent 3af839f4
...@@ -79,7 +79,7 @@ sub main ...@@ -79,7 +79,7 @@ sub main
$newdistname .= $suffix if $win_flag; $newdistname .= $suffix if $win_flag;
} }
# find out the extract path (should be same as distname!) # 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 # remove slash from the end
$destdir= substr($destdir, 0, -1); $destdir= substr($destdir, 0, -1);
...@@ -111,6 +111,7 @@ sub main ...@@ -111,6 +111,7 @@ sub main
chdir("$destdir"); chdir("$destdir");
unlink ("configure") or die "Can't delete $destdir/configure: $!\n"; 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"; open(CONFIGURE,"<configure.in") or die "$! Unable to open configure.in to read from!\n";
local $/;
undef $/; undef $/;
my $configure = <CONFIGURE>; my $configure = <CONFIGURE>;
close(CONFIGURE); close(CONFIGURE);
...@@ -150,13 +151,6 @@ sub main ...@@ -150,13 +151,6 @@ sub main
print "$! Unable to delete $dir!\n"; 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); exit(0);
} }
...@@ -165,14 +159,17 @@ sub main ...@@ -165,14 +159,17 @@ sub main
#### mysqld and MySQL client programs have a usage printed with --help. #### mysqld and MySQL client programs have a usage printed with --help.
#### This usage includes a copyright, which needs to be modified #### This usage includes a copyright, which needs to be modified
#### ####
sub fix_usage_copyright sub fix_usage_copyright
{ {
my @Cfiles = `find . -type f -name \"*.c*\"`; my $findlist = `find . -type f -name \"*.c*\"`;
foreach my $Cfile (@Cfiles) my @files = split("\n", $findlist);
my $cwd = getcwd();
foreach my $file (@files)
{ {
chop $Cfile; next if ! -f $file;
`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; 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 ...@@ -182,12 +179,14 @@ sub fix_usage_copyright
sub add_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) foreach my $file (@files)
{ {
chop $file;
next if ! -f $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"`; `$WD/Build-tools/mysql-copyright-2 "$file"`;
} }
} }
......
...@@ -89,6 +89,7 @@ sub add_copyright ...@@ -89,6 +89,7 @@ sub add_copyright
elsif ($ARGV =~ /\.c$/ || elsif ($ARGV =~ /\.c$/ ||
$ARGV =~ /\.cc$/ || $ARGV =~ /\.cc$/ ||
$ARGV =~ /\.h$/ || $ARGV =~ /\.h$/ ||
$ARGV =~ /\.cpp$/ ||
$ARGV =~ /\.yy$/) $ARGV =~ /\.yy$/)
{ {
$start_copyright="/* "; $start_copyright="/* ";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment