/hg/release/icedtea7-forest-2.5: 9 new changesets

andrew at icedtea.classpath.org andrew at icedtea.classpath.org
Fri Apr 4 17:49:53 UTC 2014


changeset afdbcacfcce1 in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=afdbcacfcce1
author: ohrstrom
date: Tue Dec 18 09:57:01 2012 +0100

	8004145: New improved hgforest.sh, ctrl-c now properly terminates mercurial processes.
	Reviewed-by: ohair, erikj


changeset 2e5732f7cdf1 in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=2e5732f7cdf1
author: chegar
date: Wed Feb 06 11:36:19 2013 +0000

	8007625: race with nested repos in /common/bin/hgforest.sh
	Reviewed-by: dholmes, ohair, ohrstrom


changeset ad4c61f9eb86 in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=ad4c61f9eb86
author: mduigou
date: Mon Apr 01 21:11:51 2013 -0700

	8011178: improve common/bin/hgforest.sh python detection (MacOS)
	Reviewed-by: ohair


changeset aafad7f15b4d in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=aafad7f15b4d
author: mduigou
date: Tue Apr 02 14:56:19 2013 -0700

	8011342: hgforest.sh : 'python --version' not supported on older python
	Reviewed-by: wetmore


changeset 1e51d1050d1f in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=1e51d1050d1f
author: mduigou
date: Wed Apr 03 16:26:10 2013 -0700

	8011350: hgforest.sh uses non-POSIX sh features that may fail with some shells
	Reviewed-by: tbell, katleman, dholmes


changeset 8578688aff3a in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=8578688aff3a
author: mduigou
date: Tue Sep 03 15:23:16 2013 -0700

	8024200: handle hg wrapper with space after #!
	Reviewed-by: tbell


changeset 5bc2f659e556 in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=5bc2f659e556
author: mduigou
date: Fri Oct 11 15:20:13 2013 -0700

	8025796: hgforest.sh could trigger unbuffered output from hg without complicated machinations
	Reviewed-by: mduigou
	Contributed-by: Dmitry Samersoff <dmitry.samersoff at oracle.com>


changeset b9841b80cde0 in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=b9841b80cde0
author: aph
date: Fri Apr 04 18:34:37 2014 +0100

	Red Hat local: Fix for repo with path statting with / .


changeset 689ad92d390d in /hg/release/icedtea7-forest-2.5
details: http://icedtea.classpath.org/hg/release/icedtea7-forest-2.5?cmd=changeset;node=689ad92d390d
author: andrew
date: Fri Apr 04 18:44:40 2014 +0100

	Remove unused hgforest script


diffstat:

 common/bin/hgforest.sh   |  190 +++++++++++++++++++++++++++++++++++++++++++++++
 get_source.sh            |    4 +-
 make/scripts/hgforest.sh |  144 -----------------------------------
 3 files changed, 192 insertions(+), 146 deletions(-)

diffs (356 lines):

diff -r 4a0c67d14672 -r 689ad92d390d common/bin/hgforest.sh
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/common/bin/hgforest.sh	Fri Apr 04 18:44:40 2014 +0100
@@ -0,0 +1,190 @@
+#!/bin/sh
+
+#
+# Copyright (c) 2009, 2013, 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="$2"
+
+if [ "" = "$command" ] ; then
+  echo No command to hg supplied!
+  exit 1
+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=""
+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 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 at ./@@' -e 's@/@_ at 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="${pull_base}/${i}"
+        # pull_newrepo="`echo ${pull_base}/${i} | sed -e 's@\([^:]/\)//*@\1 at 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
+        (PYTHONUNBUFFERED=true hg clone ${pull_newrepo} ${i}; echo "$?" > ${tmp}/${repopidfile}.pid.rc )&
+      else
+        echo "cd ${i} && hg $*"
+        cd ${i} && (PYTHONUNBUFFERED=true hg "$@"; 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" ] ; then
+      echo "WARNING: ${rc} exited abnormally."
+      ec=1
+    fi
+  done
+fi
+exit ${ec}
diff -r 4a0c67d14672 -r 689ad92d390d get_source.sh
--- a/get_source.sh	Wed Apr 02 20:04:15 2014 +0100
+++ b/get_source.sh	Fri Apr 04 18:44:40 2014 +0100
@@ -26,8 +26,8 @@
 #
 
 # Get clones of all nested repositories
-sh ./make/scripts/hgforest.sh clone $*
+sh ./common/bin/hgforest.sh clone "$@" || exit 1
 
 # Update all existing repositories to the latest sources
-sh ./make/scripts/hgforest.sh pull -u
+sh ./common/bin/hgforest.sh pull -u
 
diff -r 4a0c67d14672 -r 689ad92d390d make/scripts/hgforest.sh
--- a/make/scripts/hgforest.sh	Wed Apr 02 20:04:15 2014 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,144 +0,0 @@
-#!/bin/sh
-
-#
-# 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="$2"
-
-tmp=/tmp/forest.$$
-rm -f -r ${tmp}
-mkdir -p ${tmp}
-
-# Remove tmp area on A. B. Normal termination
-trap 'rm -f -r ${tmp}' KILL
-trap 'rm -f -r ${tmp}' EXIT
-
-# Only look in specific locations for possible forests (avoids long searches)
-pull_default=""
-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 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
-    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
-  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
-
-# 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
-for i in ${repos} ; do
-  echo "Starting on ${i}"
-  n=`expr ${n} '+' 1`
-  (
-    (
-      if [ "${command}" = "clone" -o "${command}" = "fclone" ] ; then
-        pull_newrepo="`echo ${pull_default}/${i} | sed -e 's@\([^:]/\)//*@\1 at g'`"
-        cline="hg clone ${pull_newrepo} ${i}"
-        echo "# ${cline}"
-        ( eval "${cline}" )
-      else
-        cline="hg $*"
-        echo "# cd ${i} && ${cline}"
-        ( cd ${i} && eval "${cline}" )
-      fi
-      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
-
-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 at 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}
-
-# Terminate with exit 0 all the time (hard to know when to say "failed")
-exit 0
-


More information about the distro-pkg-dev mailing list