changeset 548:1bfc7b9c9b8d

Merge jdk7u8-b01
author andrew
date Mon, 06 Aug 2012 14:20:23 +0100
parents 7e0976a9c562 d7a94c8cbbbf
children d2607b1bfb20
files .hgtags
diffstat 4 files changed, 267 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Wed Jul 25 18:23:57 2012 +0100
+++ b/.hgtags	Mon Aug 06 14:20:23 2012 +0100
@@ -201,3 +201,4 @@
 9c41f7b1460b106d18676899d24b6ea07de5a369 jdk7u6-b18
 56291720b5e578046bc02761dcad2a575f99fd8e jdk7u6-b19
 e79fa743fe5a801db4acc7a7daa68f581423e5d3 jdk7u6-b20
+1ab3edf5061fdde3a6f6510373a92444445af710 jdk7u8-b01
--- a/get_source.sh	Wed Jul 25 18:23:57 2012 +0100
+++ b/get_source.sh	Mon Aug 06 14:20:23 2012 +0100
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
 #
 
 # Get clones of all nested repositories
-sh ./make/scripts/hgforest.sh clone
+sh ./make/scripts/hgforest.sh clone $*
 
 # Update all existing repositories to the latest sources
 sh ./make/scripts/hgforest.sh pull -u
--- a/make/scripts/hgforest.sh	Wed Jul 25 18:23:57 2012 +0100
+++ b/make/scripts/hgforest.sh	Mon Aug 06 14:20:23 2012 +0100
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 #
-# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 #
 # This code is free software; you can redistribute it and/or modify it
@@ -24,6 +24,8 @@
 #
 
 # Shell script for a fast parallel forest command
+command="$1"
+pull_extra_base="$2"
 
 tmp=/tmp/forest.$$
 rm -f -r ${tmp}
@@ -35,40 +37,58 @@
 
 # Only look in specific locations for possible forests (avoids long searches)
 pull_default=""
-if [ "$1" = "clone" -o "$1" = "fclone" ] ; then
+repos=""
+repos_extra=""
+if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
   subrepos="corba jaxp jaxws langtools jdk hotspot"
   if [ -f .hg/hgrc ] ; then
     pull_default=`hg paths default`
+    if [ "${pull_default}" = "" ] ; then
+      echo "ERROR: Need initial clone with 'hg paths default' defined"
+      exit 1
+    fi
   fi
   if [ "${pull_default}" = "" ] ; then
-    echo "ERROR: Need initial clone with 'hg paths default' defined"
+    echo "ERROR: Need initial repository to use this script"
     exit 1
   fi
-  repos=""
   for i in ${subrepos} ; do
     if [ ! -f ${i}/.hg/hgrc ] ; then
       repos="${repos} ${i}"
     fi
   done
+  if [ "${pull_extra_base}" != "" ] ; then
+    subrepos_extra="jdk/src/closed jdk/make/closed jdk/test/closed hotspot/src/closed hotspot/test/closed deploy install sponsors pubs"
+    pull_default_tail=`echo ${pull_default} | sed -e 's@^.*://[^/]*/\(.*\)@\1@'`
+    pull_extra="${pull_extra_base}/${pull_default_tail}"
+    for i in ${subrepos_extra} ; do
+      if [ ! -f ${i}/.hg/hgrc ] ; then
+        repos_extra="${repos_extra} ${i}"
+      fi
+    done
+  fi
   at_a_time=2
+  # Any repos to deal with?
+  if [ "${repos}" = "" -a "${repos_extra}" = "" ] ; then
+    echo "No repositories to clone."
+    exit
+  fi
 else
   hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
   # Derive repository names from the .hg directory locations
-  repos=""
   for i in ${hgdirs} ; do
     repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"
   done
   at_a_time=8
+  # Any repos to deal with?
+  if [ "${repos}" = "" ] ; then
+    echo "No repositories to process."
+    exit
+  fi
 fi
 
-# Any repos to deal with?
-if [ "${repos}" = "" ] ; then
-  echo "No repositories to process."
-  exit
-fi
-
-# Echo out what repositories we will process
-echo "# Repos: ${repos}"
+# Echo out what repositories we will clone
+echo "# Repos: ${repos} ${repos_extra}"
 
 # Run the supplied command on all repos in parallel, save output until end
 n=0
@@ -77,8 +97,9 @@
   n=`expr ${n} '+' 1`
   (
     (
-      if [ "$1" = "clone" -o "$1" = "fclone" ] ; then
-        cline="hg $* ${pull_default}/${i} ${i}"
+      if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
+        pull_newrepo="`echo ${pull_default}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
+        cline="hg clone ${pull_newrepo} ${i}"
         echo "# ${cline}"
         ( eval "${cline}" )
       else
@@ -92,10 +113,29 @@
     sleep 5
   fi
 done
-
 # Wait for all hg commands to complete
 wait
 
+if [ "${repos_extra}" != "" ] ; then
+  for i in ${repos_extra} ; do
+    echo "Starting on ${i}"
+    n=`expr ${n} '+' 1`
+    (
+      (
+          pull_newextrarepo="`echo ${pull_extra}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
+          cline="hg clone ${pull_newextrarepo} ${i}"
+          echo "# ${cline}"
+          ( eval "${cline}" )
+        echo "# exit code $?"
+      ) > ${tmp}/repo.${n} 2>&1 ; cat ${tmp}/repo.${n} ) &
+    if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
+      sleep 5
+    fi
+  done
+  # Wait for all hg commands to complete
+  wait
+fi
+
 # Cleanup
 rm -f -r ${tmp}
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/make/scripts/normalizer.pl	Mon Aug 06 14:20:23 2012 +0100
@@ -0,0 +1,208 @@
+#!/usr/bin/perl
+
+#
+# Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# This code is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License version 2 only, as
+# published by the Free Software Foundation.
+#
+# This code is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# version 2 for more details (a copy is included in the LICENSE file that
+# accompanied this code).
+#
+# You should have received a copy of the GNU General Public License version
+# 2 along with this work; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+# or visit www.oracle.com if you need additional information or have any
+# questions.
+#
+
+#
+# Parses java files:
+#   1. Removes from the end of lines spaces and TABs
+#   2. Replaces TABs by spaces
+#   3. Replaces all NewLine separators by Unix NewLine separators
+#   4. Makes one and only one empty line at the end of each file
+
+if ($#ARGV < 0) {
+    &usage;
+    
+    die;
+}
+
+use Cwd 'abs_path';
+
+my @extensions = ("java");
+
+# Read options
+my $dirpos = 0;
+
+while ($dirpos < $#ARGV) {
+    if ($ARGV[$dirpos] eq "-e") {
+        @extensions = split(/,/, $ARGV[$dirpos + 1]);
+    } else {
+        last;
+    }
+
+    $dirpos += 2;
+}
+
+if ($dirpos > $#ARGV) {
+    &usage;
+
+    die;
+}
+
+use Cwd;
+my $currdir = getcwd;
+
+my $allfiles = 0;
+
+my $filecount = 0;
+
+my @tabvalues;
+
+# Init tabvalues
+push (@tabvalues, " ");
+
+for (my $i = 1; $i < 8; $i++) {
+    push(@tabvalues, $tabvalues[$i - 1] . " ");
+}
+
+open(FILELIST, ">$currdir/filelist") or die "Failed while open $currdir/filelist: $!\n";
+
+while ($dirpos <= $#ARGV) {
+    use File::Find;
+
+    find(\&parse_file, abs_path($ARGV[$dirpos]));
+
+    $dirpos += 1;
+}
+
+close(FILELIST);
+
+use Cwd 'chdir';
+chdir $currdir;
+
+print "Checked $allfiles file(s)\n";
+print "Modified $filecount file(s)\n";
+print "See results in the file $currdir/filelist\n";
+
+sub parse_file {
+    my $filename = $File::Find::name;
+
+    # Skip directories
+    return if -d;
+    
+    # Skip SCCS files
+    return if ($filename =~ /\/SCCS\//);
+
+    # Skip files with invalid extensions
+    my $accepted = 0;
+    foreach my $ext (@extensions) {
+        if ($_ =~ /\.$ext$/i) {
+            $accepted = 1;
+
+            last;
+        }
+    }
+    return if ($accepted == 0);
+
+    use File::Basename;
+    my $dirname = dirname($filename);
+
+    use Cwd 'chdir';
+    chdir $dirname;
+
+    open(FILE, $filename) or die "Failed while open $filename: $!\n";
+    
+    # Read file
+    my @content;
+    my $line;
+    my $emptylinescount = 0;
+    my $modified = 0;
+    
+    while ($line = <FILE>) {
+        my $originalline = $line;
+
+        # Process line
+        
+        # Remove from the end of the line spaces and return character
+        while ($line =~ /\s$/) {
+            chop($line);
+        }
+
+        # Replace TABs
+        for (my $i = 0; $i < length($line); $i++) {
+            if (substr($line, $i, 1) =~ /\t/) {
+                $line = substr($line, 0, $i) . $tabvalues[7 - ($i % 8)] . substr($line, $i + 1);
+            }
+        }
+        
+        if (length($line) == 0) {
+            $emptylinescount++;
+        } else {
+            while ($emptylinescount > 0) {
+                push(@content, "");
+                
+                $emptylinescount--;
+            }
+            
+            push(@content, $line);
+        }
+
+        if ($originalline ne ($line . "\n")) {
+            $modified = 1;
+        }
+
+    }
+    
+    $allfiles++;
+    
+    if ($emptylinescount > 0) {
+        $modified = 1;
+    }
+
+    close(FILE);
+    
+    if ($modified != 0) {
+        # Write file
+        open(FILE, ">$filename") or die "Failed while open $filename: $!\n";
+    
+        for (my $i = 0; $i <= $#content; $i++) {
+            print FILE "$content[$i]\n";
+        }
+    
+        close(FILE);
+
+        # Print name from current dir
+        if (index($filename, $currdir) == 0) {
+           print FILELIST substr($filename, length($currdir) + 1);
+        } else {
+           print FILELIST $filename;
+        }
+        print FILELIST "\n";
+
+        $filecount++;
+
+        print "$filename: modified\n";
+    }
+}
+
+sub usage {
+    print "Usage:\n";
+    print "  normalizer.pl [-options] <dir> [dir2 dir3 ...]\n";
+    print "  Available options:\n";
+    print "    -e    comma separated files extensions. By default accepts only java files\n";
+    print "\n";
+    print "Examples:\n";
+    print "  normalizer.pl -e c,cpp,h,hpp .\n";
+}
+
+