update_source.sh revision 69
69N/A#! /bin/sh
69N/A# CDDL HEADER START
69N/A#
69N/A# The contents of this file are subject to the terms of the
69N/A# Common Development and Distribution License (the "License").
69N/A# You may not use this file except in compliance with the License.
69N/A#
69N/A# See LICENSE.txt included in this distribution for the specific
69N/A# language governing permissions and limitations under the License.
69N/A#
69N/A# When distributing Covered Code, include this CDDL HEADER in each
69N/A# file and include the License file at LICENSE.txt.
69N/A# If applicable, add the following below this CDDL HEADER, with the
69N/A# fields enclosed by brackets "[]" replaced with your own identifying
69N/A# information: Portions Copyright [yyyy] [name of copyright owner]
69N/A#
69N/A# CDDL HEADER END
69N/A#
69N/A# Copyright 2007 Sun Microsystems, Inc. All rights reserved.
69N/A# Use is subject to license terms.
69N/A
69N/Acd ${SRC_ROOT}
69N/Afor f in *
69N/Ado
69N/A if [ -d ${f}/.svn -a -n "${SUBVERSION}" ]
69N/A then
69N/A echo "Update source in ${f} (Subversion)"
69N/A cd ${f}
69N/A ${SUBVERSION} -q up
69N/A if [ $? -ne 0 ]
69N/A then
69N/A error="true"
69N/A fi
69N/A cd ..
69N/A elif [ -d ${f}/CVS -a -n "${CVS}" ]
69N/A then
69N/A echo "Update source in ${f} (CVS)"
69N/A cd ${f}
69N/A ${CVS} -q up
69N/A if [ $? -ne 0 ]
69N/A then
69N/A error="true"
69N/A fi
69N/A cd ..
69N/A elif [ -d ${f}/.hg -a -n "${MERCURIAL}" ]
69N/A then
69N/A echo "Update source in ${f} (Mercurial)"
69N/A cd ${f}
69N/A ${MERCURIAL} pull
69N/A if [ $? -ne 0 ]
69N/A then
69N/A error="true"
69N/A else
69N/A ${MERCURIAL} update
69N/A if [ $? -ne 0 ]
69N/A then
69N/A error="true"
69N/A fi
69N/A fi
69N/A cd ..
69N/A fi
69N/Adone
69N/A
69N/Aif [ "${error}" = "true" ]
69N/Athen
69N/A exit 1
69N/Afi
69N/A
69N/Aexit 0