blob: e656c08e843f674f4d70d92d1088dfa5c72d37db [file] [log] [blame]
david_williams51256372010-04-20 21:04:25 +00001#!/usr/bin/env bash
david_williamsf618ce42006-11-19 18:46:17 +00002
david_williams3b23c6f2010-08-28 02:02:50 +00003
4# remember to leave no slashes on filename in source command,
5# (the commonVariations.shsource file, that is)
6# so that users path is used to find it (first)
7if [ -z $BUILD_INITIALIZED ]
8then
9 source commonVariations.shsource
10 source ${RELENG_CONTROL}/commonComputedVariables.shsource
11fi
12
david_williams53f9de12008-01-02 19:31:06 +000013# it is assumed we are executing this in RELENG_CONTROL or the parent of RELENG_CONTROL
david_williams2e0afe02008-01-02 04:11:40 +000014RELENG_CONTROL=releng.control
15
david_williams53f9de12008-01-02 19:31:06 +000016# This script file is to help get builds started "fresh", when
david_williams2e0afe02008-01-02 04:11:40 +000017# the ${RELENG_CONTROL} directory already exists on local file system.
david_williams53f9de12008-01-02 19:31:06 +000018# While it is in the cvs repository in ${RELENG_CONTROL}, it is
david_williams42f9b242006-11-27 18:45:14 +000019# meant to be executed from the parent directory
david_williams53f9de12008-01-02 19:31:06 +000020# of ${RELENG_CONTROL} on the file system.
david_williamsf618ce42006-11-19 18:46:17 +000021
22# export is used, instead of checkout, just to avoid the CVS directories and since this code
23# for a local build, there should never be a need to check it back in to CVS.
david_williamsf618ce42006-11-19 18:46:17 +000024
david_williamsc3f40892007-12-14 22:24:08 +000025
david_williams53f9de12008-01-02 19:31:06 +000026if [ ! -e ${RELENG_CONTROL} ]
david_williamsc3f40892007-12-14 22:24:08 +000027then
david_williams53f9de12008-01-02 19:31:06 +000028 cd ..
29 if [ ! -e ${RELENG_CONTROL} ]
david_williamsc3f40892007-12-14 22:24:08 +000030 then
david_williams2e0afe02008-01-02 04:11:40 +000031 echo "${RELENG_CONTROL} does not exist as sub directory";
david_williams3a8ba3d2007-12-14 22:49:29 +000032 exit 1;
david_williamsc3f40892007-12-14 22:24:08 +000033 fi
34fi
35
david_williamscb255fc2010-04-25 16:42:28 +000036if [ -e ${RELENG_CONTROL}/cc.pid ]
37then
38 echo;
39 echo " PID file exists. Please stop CC first";
40 echo;
41 exit 2;
42fi
43
david_williams2e0afe02008-01-02 04:11:40 +000044echo
david_williamsd4b1fd32008-01-02 04:16:52 +000045echo " saving serialized CC state ..."
david_williams2e0afe02008-01-02 04:11:40 +000046cp ${RELENG_CONTROL}/*.ser . >/dev/null 2>/dev/null
david_williamsf618ce42006-11-19 18:46:17 +000047
david_williamsd4b1fd32008-01-02 04:16:52 +000048echo " removing all of ${RELENG_CONTROL} ..."
david_williams2e0afe02008-01-02 04:11:40 +000049rm -fr ${RELENG_CONTROL}/*
50rm -fr ${RELENG_CONTROL}/.project
david_williamscb53ae62008-01-02 19:46:33 +000051rm -fr ${RELENG_CONTROL}/.settings
david_williams2e0afe02008-01-02 04:11:40 +000052mkdir -p ${RELENG_CONTROL}
david_williamsf618ce42006-11-19 18:46:17 +000053
david_williamscb255fc2010-04-25 16:42:28 +000054# if running remotely, may want to use ext, and committer id, to avoid
55# out of synch data from pserver shadow
56if [ -z ${BUILD_CVS_READ_PROTOCOL} ]
57then
58 BUILD_CVS_READ_PROTOCOL=pserver
59fi
david_williamsf618ce42006-11-19 18:46:17 +000060
david_williamscb255fc2010-04-25 16:42:28 +000061if [ -z ${BUILD_CVS_READ_USER} ]
62then
63 BUILD_CVS_READ_USER=anonymous
64fi
65
66# This CONTROLTAG controls _only_ the version of releng.control that is fetched by build administrator
67# It may, for example, contain a version of cc_config.xml where it, in turn, specifies
david_williams0874d312011-06-23 02:16:47 +000068# other branches to do non standard builds to use for tests (HEAD is the standard, production value)
69#CONTROLTAG=<exampleID>_tempTestBranch
david_williamscb255fc2010-04-25 16:42:28 +000070CONTROLTAG=HEAD
david_williams3b23c6f2010-08-28 02:02:50 +000071echo " checking out $CONTROLTAG of ${RELENG_CONTROL} from cvs "
72echo " using :${BUILD_CVS_READ_PROTOCOL}:${BUILD_CVS_READ_USER}@dev.eclipse.org: "
david_williamscb255fc2010-04-25 16:42:28 +000073cvs -Q -f -d :${BUILD_CVS_READ_PROTOCOL}:${BUILD_CVS_READ_USER}@dev.eclipse.org:/cvsroot/webtools export -d ${RELENG_CONTROL} -r $CONTROLTAG webtools.releng/${RELENG_CONTROL}
74
75echo " restoring serialized CC state ..."
david_williams2e0afe02008-01-02 04:11:40 +000076mv *.ser ${RELENG_CONTROL} >/dev/null 2>/dev/null
david_williamsf618ce42006-11-19 18:46:17 +000077
david_williamseceb39b2008-01-02 04:21:44 +000078echo " making sure releng control files are executable and have proper EOL ..."
david_williams2e0afe02008-01-02 04:11:40 +000079dos2unix ${RELENG_CONTROL}/*.sh* ${RELENG_CONTROL}/*.properties ${RELENG_CONTROL}/*.xml >/dev/null 2>>/dev/null
80chmod +x ${RELENG_CONTROL}/*.sh > /dev/null
david_williams53f9de12008-01-02 19:31:06 +000081echo
david_williamsf618ce42006-11-19 18:46:17 +000082