make/scripts/hgforest.sh

Print this page




  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # Shell script for a fast parallel forest command
  27 
  28 tmp=/tmp/forest.$$
  29 rm -f -r ${tmp}
  30 mkdir -p ${tmp}
  31 
  32 # Remove tmp area on A. B. Normal termination
  33 trap 'rm -f -r ${tmp}' KILL
  34 trap 'rm -f -r ${tmp}' EXIT
  35 
  36 # Only look in specific locations for possible forests (avoids long searches)
  37 pull_default=""
  38 if [ "$1" = "clone" -o "$1" = "fclone" ] ; then
  39   subrepos="corba jaxp jaxws langtools jdk hotspot"
  40   if [ -f .hg/hgrc ] ; then
  41     pull_default=`hg paths default`
  42   fi
  43   if [ "${pull_default}" = "" ] ; then
  44     echo "ERROR: Need initial clone with 'hg paths default' defined"
  45     exit 1
  46   fi
  47   repos=""
  48   for i in ${subrepos} ; do
  49     if [ ! -f ${i}/.hg/hgrc ] ; then
  50       repos="${repos} ${i}"
  51     fi
  52   done
  53   at_a_time=2
  54 else
  55   hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
  56   # Derive repository names from the .hg directory locations
  57   repos=""
  58   for i in ${hgdirs} ; do
  59     repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"




  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any
  23 # questions.
  24 #
  25 
  26 # Shell script for a fast parallel forest command
  27 
  28 tmp=/tmp/forest.$$
  29 rm -f -r ${tmp}
  30 mkdir -p ${tmp}
  31 
  32 # Remove tmp area on A. B. Normal termination
  33 trap 'rm -f -r ${tmp}' KILL
  34 trap 'rm -f -r ${tmp}' EXIT
  35 
  36 # Only look in specific locations for possible forests (avoids long searches)
  37 pull_default=""
  38 if [ "$1" = "clone" -o "$1" = "fclone" ] ; then
  39   subrepos="bdb corba jaxp jaxws langtools jdk hotspot"
  40   if [ -f .hg/hgrc ] ; then
  41     pull_default=`hg paths default`
  42   fi
  43   if [ "${pull_default}" = "" ] ; then
  44     echo "ERROR: Need initial clone with 'hg paths default' defined"
  45     exit 1
  46   fi
  47   repos=""
  48   for i in ${subrepos} ; do
  49     if [ ! -f ${i}/.hg/hgrc ] ; then
  50       repos="${repos} ${i}"
  51     fi
  52   done
  53   at_a_time=2
  54 else
  55   hgdirs=`ls -d ./.hg ./*/.hg ./*/*/.hg ./*/*/*/.hg ./*/*/*/*/.hg 2>/dev/null`
  56   # Derive repository names from the .hg directory locations
  57   repos=""
  58   for i in ${hgdirs} ; do
  59     repos="${repos} `echo ${i} | sed -e 's@/.hg$@@'`"