Commits

Anonymous committed b5c6b5a

renamed directory and added forwarding README

Comments (0)

Files changed (6)

+AdoptOpenJDK Readme
+===================
+
+Please go to http://betterrev.org for full information

scripts/bb_get_source.sh

+#!/bin/sh
+
+#
+# Copyright (c) 2013, London Java Community Company 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.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# 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.
+#
+
+# Update all existing repositories to the latest sources from $1
+cd ..
+
+sh ./adopt/hgforest.sh pull $1

scripts/bb_push_source.sh

+#!/bin/sh
+
+set -eu
+
+#
+# Copyright (c) 2013, London Java Community Company 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.  Oracle designates this
+# particular file as subject to the "Classpath" exception as provided
+# by Oracle in the LICENSE file that accompanied this code.
+#
+# 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.
+#
+
+# Update the $1 remote repositories
+sh ./adopt/hgforest.sh push $1

scripts/generate_webrev.sh

+#!/bin/sh
+
+set -eu
+
+if [ $# -ne "3" ]
+then
+    echo "Usage: $0 <repository> <remote> <result_loc>"
+    exit 1
+fi
+
+repository=$1
+remote=$2
+result_loc=$3
+top=jdk8
+repotmp="$repository-tmp"
+
+cd "$top/$repository"
+commit=`hg log | head -n 1 | cut -d' ' -f 4 | cut -d ':' -f 2`
+echo "Revert to $commit later"
+
+echo "Pull the changeset in"
+hg pull $remote
+hg update
+
+echo "Making the webrev"
+cd ..
+rm -rf $repotmp
+hg clone -r "$commit" $repository $repotmp 
+cd $repository
+ksh ../make/scripts/webrev.ksh
+mv webrev $result_loc
+
+echo "Revert the change locally by re-cloning the repository"
+cd ..
+rm -rf $repotmp
+mv $repository $repotmp
+hg clone -r "$commit" $repotmp $repository
+rm -rf $repotmp
+

scripts/hgforest.sh

+#!/bin/sh
+
+#
+# Copyright (c) 2013, London Java Community Company 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
+# 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.
+#
+
+# Shell script for a fast parallel forest command
+command="$1"
+pull_extra_base=""
+
+# Take a bitbucket user parameter
+user="$2"
+cd jdk8
+
+# Python always buffers stdout significantly, thus we will not see any output from hg clone jdk,
+# until a lot of time has passed! By passing -u to python, we get incremental updates
+# on stdout. Much nicer.
+whichhg="`which hg`"
+
+if [ "${whichhg}" = "" ] ; then
+  echo Cannot find hg!
+  exit 1
+fi
+
+if [ "" = "$user" ] ; then
+  echo Defaulting to adoptopenjdk user
+  user="adoptopenjdk"
+fi
+
+if [ "" = "$command" ] ; then
+  echo No command to hg supplied!
+  exit 1
+fi
+
+has_hash_bang="`head -n 1 "${whichhg}" | cut -b 1-2`"
+python=""
+bpython=""
+
+if [ "#!" = "$has_hash_bang" ] ; then
+   python="`head -n 1 ${whichhg} | cut -b 3-`"
+   bpython="`basename "$python"`"
+fi
+
+if [ "python" = "$bpython" -a -x "$python" ] ; then
+  hg="${python} -u ${whichhg}"
+else
+  echo Cannot find python from hg launcher. Running plain hg, which probably has buffered stdout.
+  hg="hg"
+fi
+
+# Clean out the temporary directory that stores the pid files.
+tmp=/tmp/forest.$$
+rm -f -r ${tmp}
+mkdir -p ${tmp}
+
+safe_interrupt () {
+  if [ -d ${tmp} ]; then
+    if [ "`ls ${tmp}/*.pid`" != "" ]; then
+      echo "Waiting for processes ( `cat ${tmp}/*.pid | tr '\n' ' '`) to terminate nicely!"
+      sleep 1
+      # Pipe stderr to dev/null to silence kill, that complains when trying to kill
+      # a subprocess that has already exited.
+      kill -TERM `cat ${tmp}/*.pid | tr '\n' ' '` 2> /dev/null
+      wait
+      echo Interrupt complete!
+    fi
+  fi
+  rm -f -r ${tmp}
+  exit 1
+}
+
+nice_exit () {
+  if [ -d ${tmp} ]; then
+    if [ "`ls ${tmp}`" != "" ]; then
+      wait
+    fi
+  fi
+  rm -f -r ${tmp}
+}
+
+trap 'safe_interrupt' INT QUIT
+trap 'nice_exit' EXIT
+
+# Only look in specific locations for possible forests (avoids long searches)
+pull_default="ssh://hg@bitbucket.org/$user/jdk8"
+repos=""
+repos_extra=""
+if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
+  subrepos="corba jaxp jaxws langtools jdk hotspot nashorn"
+  #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 repository to use this script"
+    exit 1
+  fi
+  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/make/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
+    exit
+  fi
+else
+  hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
+  # Derive repository names from the .hg directory locations
+  for i in ${hgdirs} ; do
+    repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"
+  done
+  for i in ${repos} ; do
+    if [ -h ${i}/.hg/store/lock -o -f ${i}/.hg/store/lock ] ; then
+      locked="${i} ${locked}"
+    fi
+  done
+  at_a_time=8
+  # Any repos to deal with?
+  if [ "${repos}" = "" ] ; then
+    echo "No repositories to process."
+    exit
+  fi
+  if [ "${locked}" != "" ] ; then
+    echo "These repositories are locked: ${locked}"
+    exit
+  fi
+fi
+
+# Echo out what repositories we do a command on.
+echo "# Repositories: ${repos} ${repos_extra}"
+echo
+
+# Run the supplied command on all repos in parallel.
+n=0
+for i in ${repos} ${repos_extra} ; do
+  n=`expr ${n} '+' 1`
+  repopidfile=`echo ${i} | sed -e 's@./@@' -e 's@/@_@g'`
+  reponame=`echo ${i} | sed -e :a -e 's/^.\{1,20\}$/ &/;ta'`
+  pull_base="${pull_default}"
+  for j in $repos_extra ; do
+      if [ "$i" = "$j" ] ; then
+          pull_base="${pull_extra}"
+      fi
+  done
+  (
+    (
+      if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
+        pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1@g'`"
+        echo ${hg} clone ${pull_newrepo} ${i}
+        path="`dirname ${i}`"
+        if [ "${path}" != "." ] ; then
+          times=0
+          while [ ! -d "${path}" ]   ## nested repo, ensure containing dir exists
+          do
+            times=`expr ${times} '+' 1`
+            if [ `expr ${times} '%' 10` -eq 0 ] ; then
+              echo ${path} still not created, waiting...
+            fi
+            sleep 5
+          done
+        fi
+        (${hg} clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
+      else
+        # ./langtools -> langtools
+        repo=`echo $i | sed 's/^\.\///'`
+        # produce ssh://hg@bitbucket.org/$user/jdk8-langtools
+        if [ "." = "$repo" ] ; then
+            dest="$pull_base"
+        else
+            dest="$pull_base-$repo"
+        fi
+        echo "cd ${i} && ${hg} $command $dest"
+        cd ${i} && (${hg} "$command" "$dest"; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
+      fi
+      echo $! > ${tmp}/${repopidfile}.pid
+    ) 2>&1 | sed -e "s@^@${reponame}:   @") &
+
+  if [ `expr ${n} '%' ${at_a_time}` -eq 0 ] ; then
+    sleep 2
+    echo Waiting 5 secs before spawning next background command.
+    sleep 3
+  fi
+done
+# Wait for all hg commands to complete
+wait
+
+# Terminate with exit 0 only if all subprocesses were successful
+ec=0
+if [ -d ${tmp} ]; then
+  for rc in ${tmp}/*.pid.rc ; do
+    exit_code=`cat ${rc} | tr -d ' \n\r'`
+    if [ "${exit_code}" != "0" ] && [ "${exit_code} ${command}" != "1 push" ] ; then
+      echo "WARNING: ${rc} exited abnormally."
+      ec=1
+    fi
+  done
+fi
+exit ${ec}

scripts/merge-source.sh

+#!/bin/sh
+
+set -eu
+
+if [ $# -ne "3" ]
+then
+    echo "Usage: $0 <repository> <remote> <result_loc>"
+    exit 1
+fi
+
+repository=$1
+remote=$2
+result_loc=$3
+top=jdk8
+repotmp="$repository-tmp"
+
+cd "$top/$repository"
+commit=`hg log | head -n 1 | cut -d' ' -f 4 | cut -d ':' -f 2`
+echo "Revert to $commit later"
+
+echo "Pull the changeset in"
+hg pull $remote
+hg update
+
+echo "Making the webrev"
+cd ..
+rm -rf $repotmp
+hg clone -r "$commit" $repository $repotmp 
+cd $repository
+ksh ../make/scripts/webrev.ksh
+mv webrev $result_loc
+
+echo "Revert the change locally by re-cloning the repository"
+cd ..
+rm -rf $repotmp
+mv $repository $repotmp
+hg clone -r "$commit" $repotmp $repository
+rm -rf $repotmp
+