david_williams | 5125637 | 2010-04-20 21:04:25 +0000 | [diff] [blame] | 1 | #!/usr/bin/env bash |
david_williams | f618ce4 | 2006-11-19 18:46:17 +0000 | [diff] [blame] | 2 | |
david_williams | 3b23c6f | 2010-08-28 02:02:50 +0000 | [diff] [blame] | 3 | |
| 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) |
| 7 | if [ -z $BUILD_INITIALIZED ] |
| 8 | then |
| 9 | source commonVariations.shsource |
| 10 | source ${RELENG_CONTROL}/commonComputedVariables.shsource |
| 11 | fi |
| 12 | |
david_williams | 53f9de1 | 2008-01-02 19:31:06 +0000 | [diff] [blame] | 13 | # it is assumed we are executing this in RELENG_CONTROL or the parent of RELENG_CONTROL |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 14 | RELENG_CONTROL=releng.control |
| 15 | |
david_williams | 53f9de1 | 2008-01-02 19:31:06 +0000 | [diff] [blame] | 16 | # This script file is to help get builds started "fresh", when |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 17 | # the ${RELENG_CONTROL} directory already exists on local file system. |
david_williams | 53f9de1 | 2008-01-02 19:31:06 +0000 | [diff] [blame] | 18 | # While it is in the cvs repository in ${RELENG_CONTROL}, it is |
david_williams | 42f9b24 | 2006-11-27 18:45:14 +0000 | [diff] [blame] | 19 | # meant to be executed from the parent directory |
david_williams | 53f9de1 | 2008-01-02 19:31:06 +0000 | [diff] [blame] | 20 | # of ${RELENG_CONTROL} on the file system. |
david_williams | f618ce4 | 2006-11-19 18:46:17 +0000 | [diff] [blame] | 21 | |
| 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_williams | f618ce4 | 2006-11-19 18:46:17 +0000 | [diff] [blame] | 24 | |
david_williams | c3f4089 | 2007-12-14 22:24:08 +0000 | [diff] [blame] | 25 | |
david_williams | 53f9de1 | 2008-01-02 19:31:06 +0000 | [diff] [blame] | 26 | if [ ! -e ${RELENG_CONTROL} ] |
david_williams | c3f4089 | 2007-12-14 22:24:08 +0000 | [diff] [blame] | 27 | then |
david_williams | 53f9de1 | 2008-01-02 19:31:06 +0000 | [diff] [blame] | 28 | cd .. |
| 29 | if [ ! -e ${RELENG_CONTROL} ] |
david_williams | c3f4089 | 2007-12-14 22:24:08 +0000 | [diff] [blame] | 30 | then |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 31 | echo "${RELENG_CONTROL} does not exist as sub directory"; |
david_williams | 3a8ba3d | 2007-12-14 22:49:29 +0000 | [diff] [blame] | 32 | exit 1; |
david_williams | c3f4089 | 2007-12-14 22:24:08 +0000 | [diff] [blame] | 33 | fi |
| 34 | fi |
| 35 | |
david_williams | cb255fc | 2010-04-25 16:42:28 +0000 | [diff] [blame] | 36 | if [ -e ${RELENG_CONTROL}/cc.pid ] |
| 37 | then |
| 38 | echo; |
| 39 | echo " PID file exists. Please stop CC first"; |
| 40 | echo; |
| 41 | exit 2; |
| 42 | fi |
| 43 | |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 44 | echo |
david_williams | d4b1fd3 | 2008-01-02 04:16:52 +0000 | [diff] [blame] | 45 | echo " saving serialized CC state ..." |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 46 | cp ${RELENG_CONTROL}/*.ser . >/dev/null 2>/dev/null |
david_williams | f618ce4 | 2006-11-19 18:46:17 +0000 | [diff] [blame] | 47 | |
david_williams | d4b1fd3 | 2008-01-02 04:16:52 +0000 | [diff] [blame] | 48 | echo " removing all of ${RELENG_CONTROL} ..." |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 49 | rm -fr ${RELENG_CONTROL}/* |
| 50 | rm -fr ${RELENG_CONTROL}/.project |
david_williams | cb53ae6 | 2008-01-02 19:46:33 +0000 | [diff] [blame] | 51 | rm -fr ${RELENG_CONTROL}/.settings |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 52 | mkdir -p ${RELENG_CONTROL} |
david_williams | f618ce4 | 2006-11-19 18:46:17 +0000 | [diff] [blame] | 53 | |
david_williams | cb255fc | 2010-04-25 16:42:28 +0000 | [diff] [blame] | 54 | # if running remotely, may want to use ext, and committer id, to avoid |
| 55 | # out of synch data from pserver shadow |
| 56 | if [ -z ${BUILD_CVS_READ_PROTOCOL} ] |
| 57 | then |
| 58 | BUILD_CVS_READ_PROTOCOL=pserver |
| 59 | fi |
david_williams | f618ce4 | 2006-11-19 18:46:17 +0000 | [diff] [blame] | 60 | |
david_williams | cb255fc | 2010-04-25 16:42:28 +0000 | [diff] [blame] | 61 | if [ -z ${BUILD_CVS_READ_USER} ] |
| 62 | then |
| 63 | BUILD_CVS_READ_USER=anonymous |
| 64 | fi |
| 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_williams | 0874d31 | 2011-06-23 02:16:47 +0000 | [diff] [blame] | 68 | # other branches to do non standard builds to use for tests (HEAD is the standard, production value) |
| 69 | #CONTROLTAG=<exampleID>_tempTestBranch |
david_williams | cb255fc | 2010-04-25 16:42:28 +0000 | [diff] [blame] | 70 | CONTROLTAG=HEAD |
david_williams | 3b23c6f | 2010-08-28 02:02:50 +0000 | [diff] [blame] | 71 | echo " checking out $CONTROLTAG of ${RELENG_CONTROL} from cvs " |
| 72 | echo " using :${BUILD_CVS_READ_PROTOCOL}:${BUILD_CVS_READ_USER}@dev.eclipse.org: " |
david_williams | cb255fc | 2010-04-25 16:42:28 +0000 | [diff] [blame] | 73 | cvs -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 | |
| 75 | echo " restoring serialized CC state ..." |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 76 | mv *.ser ${RELENG_CONTROL} >/dev/null 2>/dev/null |
david_williams | f618ce4 | 2006-11-19 18:46:17 +0000 | [diff] [blame] | 77 | |
david_williams | eceb39b | 2008-01-02 04:21:44 +0000 | [diff] [blame] | 78 | echo " making sure releng control files are executable and have proper EOL ..." |
david_williams | 2e0afe0 | 2008-01-02 04:11:40 +0000 | [diff] [blame] | 79 | dos2unix ${RELENG_CONTROL}/*.sh* ${RELENG_CONTROL}/*.properties ${RELENG_CONTROL}/*.xml >/dev/null 2>>/dev/null |
| 80 | chmod +x ${RELENG_CONTROL}/*.sh > /dev/null |
david_williams | 53f9de1 | 2008-01-02 19:31:06 +0000 | [diff] [blame] | 81 | echo |
david_williams | f618ce4 | 2006-11-19 18:46:17 +0000 | [diff] [blame] | 82 | |