diff options
author | unknown <patg@krsna.patg.net> | 2004-06-15 23:05:12 -0700 |
---|---|---|
committer | unknown <patg@krsna.patg.net> | 2004-06-15 23:05:12 -0700 |
commit | e4042c25ef4c7162046e953198dfd56bc80db1f8 (patch) | |
tree | c12888ca0a136379b523ce30a2590c2b9466664b /Build-tools | |
parent | 518c9236257783740efef6db6423fbb73fdff936 (diff) | |
download | mariadb-git-e4042c25ef4c7162046e953198dfd56bc80db1f8.tar.gz |
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
Diffstat (limited to 'Build-tools')
-rwxr-xr-x | Build-tools/mysql-copyright | 31 | ||||
-rwxr-xr-x | Build-tools/mysql-copyright-2 | 1 |
2 files changed, 16 insertions, 16 deletions
diff --git a/Build-tools/mysql-copyright b/Build-tools/mysql-copyright index 1906675d470..f3a2a2960ea 100755 --- a/Build-tools/mysql-copyright +++ b/Build-tools/mysql-copyright @@ -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"`; } } diff --git a/Build-tools/mysql-copyright-2 b/Build-tools/mysql-copyright-2 index e946ed217d1..a1a870526da 100755 --- a/Build-tools/mysql-copyright-2 +++ b/Build-tools/mysql-copyright-2 @@ -89,6 +89,7 @@ sub add_copyright elsif ($ARGV =~ /\.c$/ || $ARGV =~ /\.cc$/ || $ARGV =~ /\.h$/ || + $ARGV =~ /\.cpp$/ || $ARGV =~ /\.yy$/) { $start_copyright="/* "; |