source: trunk/prepare_new_release @ 2357

Last change on this file since 2357 was 2289, checked in by stefan, 9 years ago

as in chgset 2243 for prepare_new_release, update update of version info in config header in prepare_new_stable

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 24.4 KB
Line 
1#!/bin/sh
2
3# Copyright (C) 2007  International Business Machines.
4# All Rights Reserved.
5# This file is distributed under the Eclipse Public License.
6# It is part of the BuildTools project in COIN-OR (www.coin-or.org)
7#
8# $Id: prepare_new_release 2289 2011-06-18 11:04:55Z stefan $
9#
10# Author: Andreas Waechter     IBM      2007-06-21
11# Modified: Lou Hafer          SFU      2008-01-20
12#       Accommodate simultaneous creation of releases with circular
13#       dependencies.
14# Modified: Ted Ralphs         Lehigh University 2009-07-10
15#       Set libtool version info automatically
16# Modified: Lou Hafer          SFU      2010-06-02
17#       Adapt to new script architecture pioneered in *_new_stable; major
18#       rewrite.
19# Modified: Lou Hafer          SFU      2011-03-14
20#       Change handling of externals so the svn:externals is left pointing to
21#       releases but Dependencies is left pointing to stable branches.
22
23#set -x -v
24set -e
25
26# You can think of this script as having two sections: parameter parsing and
27# validation, followed by generation of the release candidate. See the help
28# message for a good description of the actions taken to generate the release
29# candidate.
30
31# Know thy self. If there are no '/' chars in the command name, we're running
32# in the currrent directory. Otherwise, strip the command name, leaving the
33# prefix.  Coin-functions is expected to live in the same directory.
34
35if expr "$0" : '.*/.*' >/dev/null 2>&1 ; then
36  cmdDir=`echo $0 | sed -e 's,\(.*\)/[^/]*,\1,'`
37else
38  cmdDir='.'
39fi
40cmdDir=`cd $cmdDir ; pwd`
41if test -r $cmdDir/coin-functions ; then
42  . $cmdDir/coin-functions
43else
44  echo "Cannot find utility functions file coin-functions; exiting."
45fi
46
47# Note that plain sh does not accept negative exit values
48
49exitValue=0
50
51# Specify the COIN URL base for convenience.
52
53coinURL="https://projects.coin-or.org/svn"
54
55# Begin parameter processing.
56
57printHelp=0
58ignoreBuildToolsMismatch=no
59mismatchBTExternals=
60suppressCheckout=0
61
62# stableURL will be the stable branch that is the parent for the release we
63# are building. We'll need to be able to distinguish ThirdParty and Data
64# builds, and BuildTools itself; they require special handling. If a project
65# is not BuildTools, ThirdParty, or Data, it's `normal'.
66# SV: I think also ThirdParty projects should be treated as 'normal', so I changed that.
67
68stableURL=
69isThirdParty=no
70isData=no
71isBuildTools=no
72isNormal=yes
73
74# cmdBTURL is required when stableURL specifies a ThirdParty or Data
75# project --- we'll need to assemble a temporary package while creating the
76# release candidate.
77
78cmdBTURL=
79
80# stableExternals specifies externals for which we are doing simultaneous
81# releases. We will use the stable branch of the external while preparing
82# and testing this release candidate, changing svn:externals to specify a
83# (nonexistent) release of the external at the last moment.
84
85stableExternals=
86
87# exciseExternals specifies externals that should be removed when creating the
88# new release.
89
90exciseExternals=
91
92# We need at least one parameter.
93
94if test "$#" -eq 0; then
95  printHelp=1
96else
97
98# Process the parameters. A parameter without an opening `-' is assumed to be
99# the spec for the stable branch.
100
101  while test $# -gt 0 && test $exitValue = 0 && test $printHelp = 0 ; do
102    case "$1" in
103      -h* | --h*) printHelp=1 ;;
104      -i* | --i*)
105           if expr "$1" : '.*-i.*=.*' 2>&1 >/dev/null ; then
106             mismatchBTExternals=`echo $1 | sed -n -e 's/[^=]*=\(.*\)/\1/p'`
107           else
108             shift
109             mismatchBTExternals=$1
110           fi
111           if test "x$mismatchBTExternals" = "xall" ; then
112             ignoreBuildToolsMismatch=all
113           else
114             ignoreBuildToolsMismatch=partial
115           fi
116           ;;
117      -p* | --p*) suppressCheckout=1 ;;
118      -s* | --s*)
119           if expr "$1" : '.*-s.*=.*' 2>&1 >/dev/null ; then
120             stableExternals=`echo $1 | sed -n -e 's/[^=]*=\(.*\)/\1/p'`
121           else
122             shift
123             stableExternals=$1
124           fi
125           ;;
126      -x* | --x*)
127           if expr "$1" : '.*-x.*=.*' 2>&1 >/dev/null ; then
128             exciseExternals=`echo $1 | sed -n -e 's/[^=]*=\(.*\)/\1/p'`
129           else
130             shift
131             exciseExternals=$1
132           fi
133           ;;
134       -b* | --b*)
135           if expr "$1" : '.*-b.*=.*' 2>&1 >/dev/null ; then
136             cmdBTURL=`echo $1 | sed -n -e 's/[^=]*=\(.*\)/\1/p'`
137           else
138             shift
139             cmdBTURL=$1
140           fi
141           if expr "$cmdBTURL" : '.*BuildTools.*' 2>&1 >/dev/null ; then
142             case $cmdBTURL in
143               http*) ;;
144                   *) cmdBTURL=${coinURL}/$cmdBTURL
145                      ;;
146             esac
147           else
148             echo ''
149             echo "URL $cmdBTURL does not point to BuildTools."
150             echo ''
151             printHelp=1
152             exitValue=3
153            fi
154           ;;
155           
156       -*) echo "$0: unrecognised command line switch '"$1"'."
157           printHelp=1
158           exitValue=1
159           ;;
160        *) stableURL=$1
161           if expr "$stableURL" : '.*/stable/.*' 2>&1 >/dev/null ; then
162             case $stableURL in
163               http*) ;;
164               BuildTools/ThirdParty/* )
165                 stableURL=${coinURL}/$stableURL
166                 ;;
167               ThirdParty/* )
168                 stableURL=${coinURL}/BuildTools/$stableURL
169                 ;;
170               CoinAll/* )
171                 stableURL=${coinURL}/CoinBinary/$stableURL
172                 ;;
173               *) stableURL=${coinURL}/$stableURL
174                 ;;
175             esac
176           else
177             echo ''
178             echo "URL $stableURL does not specify a stable release."
179             echo ''
180             printHelp=1
181             exitValue=2
182           fi
183           ;;
184    esac
185    shift
186  done
187
188# Consistency checks: Make sure that the stable URL exists. If we're building
189# a ThirdParty or Data release, we need a BuildTools URL.
190
191  if test $printHelp = 0 && test $exitValue = 0 ; then
192    if svn list $stableURL 2>&1 >/dev/null ; then
193      :
194    else
195      echo "Stable URL $stableURL does not seem to exist."
196      printHelp=1
197      exitValue=5
198    fi
199  fi
200  if test $printHelp = 0 && test $exitValue = 0 ; then
201    case $stableURL in
202      *ThirdParty/* )
203        isThirdParty=yes
204        ;;
205      *Data/* )
206        isData=yes
207        isNormal=no
208        ;;
209      *BuildTools/* )
210        isBuildTools=yes
211        isNormal=no
212        ;;
213      *)
214        ;;
215    esac
216    if test $isThirdParty = yes || test $isData = yes ; then
217      if test -z $cmdBTURL ; then
218        echo "You must provide a BuildTools URL to build a ThirdParty or Data project."
219        printHelp=1
220        exitValue=4
221      else
222        if svn list $cmdBTURL 2>&1 >/dev/null ; then
223          :
224        else
225          echo "BuildTools URL $cmdBTURL does not seem to exist."
226          printHelp=1
227          exitValue=6
228        fi
229      fi
230    fi
231  fi
232fi  # if "$#" .eq 0
233
234if test $printHelp = 1 ; then
235  cat <<EOF
236Usage: prepare_new_release <stableVer> [options]
237
238COIN standard practice is to generate periodic releases by taking a snapshot
239of the stable branch of the project.  You can use this script to prepare
240a new release based on the specified stable branch.
241
242<stableVer> specifies the stable branch of your project to be used to
243create the new release.  You can specify the entire URL, or you just enter
244what comes after "https://projects.coin-or.org/svn".  A typical example is
245
246  prepare_new_release Ipopt/stable/3.3
247
248Options:
249  -b <BuildToolsURL>    URL for BuildTools; required to generate a release
250                        for a ThirdParty or Data project.
251  -i <projectlist>      Ignore BuildTools version mismatches for the listed
252                        externals (comma-separated list of project names,
253                        e.g., -i Osi,Cbc). '-i all' ignores all mismatches.
254  -p                    Suppress checkout (useful for testing)
255  -s <projectlist>      Suppress conversion from stable to release for the
256                        listed externals (comma-separated list of project
257                        names).
258  -x <projectlist>      Remove the listed projects from the list of externals
259                        (comma-separated list of project names).
260
261This script will do the following:
262
263  - Automatically determine the next release number (X.Y.0 if this is the
264    first release for stable/X.Y, otherwise one greater than any existing
265    release)
266  - Check out a clean copy of the specified stable branch, without externals
267  - Make sure that the svn:externals property points to releases, with the
268    exception of projects in the list specified with -s.
269  - Create a new package configure.ac file with the release version number
270    specified in the AC_INIT macro.
271  - Use the "get.*" scripts to download any ThirdParty code.
272  - Execute run_autotools to update configure, Makefile.in, etc., to reflect
273    the most recent release of BuildTools.
274  - Run the configure script, compile the code, and run the unit test.
275  - Replace stable externals for projects specified with -s with the
276    appropriate (yet to be committed) release.
277
278If there is any error during these tasks the script will stop and you should
279examine the output.
280
281If the script completes without error, examine the output, particularly the
282output of the unit test ('make test') and the set of externals specified in
283the Dependencies file.
284
285This script does not make any changes to the repository.  If you want to
286commit the new release, run the "commit_new_release" script, as described
287at the end of the output.
288
289EOF
290fi
291
292if test $exitValue != 0 || test $printHelp = 1 ; then
293  exit $exitValue
294fi
295
296# End of parameter parsing. We have a stable URL to work with.  Tell the
297# user what we've seen.
298
299stableURL=`echo $stableURL | sed -e 's|/$||'`
300stableProj=`extractProjFromURL $stableURL`
301majVer=`extractMajorFromURL $stableURL`
302minVer=`extractMinorFromURL $stableURL`
303stableVer=$majVer.$minVer
304echo "Stable URL..........: $stableURL"
305echo "Stable project......: $stableProj"
306echo "Stable branch.......: $stableVer"
307if test -n "$stableExternals" ; then
308  echo "Stable externals....: $stableExternals."
309fi
310
311# Find out the most recent release (if any) for the stable branch, then
312# construct the revision number of the new release. If there are existing
313# releases, it's a matter of bumping the revision number and inserting the
314# new revision in the URL. Otherwise, we know the new revision is 0 and we
315# can simply tweak the stable URL.
316
317releaseURL=`bestRelease $stableURL $majVer $minVer | sed -e 's|/$||'`
318if test -n "$releaseURL" ; then
319  curRel=`extractReleaseFromURL $releaseURL`
320  existingURL=$releaseURL
321  newRel=`expr $curRel + 1`
322else
323  curRel=-1
324  releaseURL=`echo $stableURL | sed -e s/stable/releases/`
325  existingURL="none"
326  newRel=0
327fi
328newVer=$majVer.$minVer.$newRel
329releaseURL=`replaceVersionInURL $releaseURL $majVer $minVer $newRel`
330
331echo "Top release URL.....: $existingURL"
332echo "New release URL.....: $releaseURL"
333
334# Relevant only if we're building ThirdParty or Data
335
336if test $isThirdParty = yes || test $isData = yes ; then
337  echo "BuildTools URL......: $cmdBTURL"
338fi
339
340# We need a libtool version number only for normal projects
341
342if test $isNormal = yes ; then
343  newLTCurrent=`calcLibtoolCurrent $stableURL $majVer $minVer`
344  newLTRevision=$newRel
345  newLTAge=`calcLibtoolAge $stableURL $majVer $minVer`
346  newLTAge=`expr $newLTAge - 1`
347  newLTVer=${newLTCurrent}:${newLTRevision}:${newLTAge}
348  echo "Libtool version.....: $newLTVer"
349fi
350
351# Now decide where to build and check out code. If the stable project name
352# contains a '/', strip it out to make the build and checkout directories.
353
354topBuildDir=`echo $stableProj | sed -e 's|.*/\([^/]*\)$|\1|'`
355topBuildDir="${topBuildDir}-${newVer}"
356if test $isThirdParty = yes; then
357  coDir=$topBuildDir/Thirdparty/$stableProj
358elif test $isData = yes; then
359  coDir=$topBuildDir/Data/$stableProj
360else
361  coDir=$topBuildDir
362fi
363echo "Build directory.....: $topBuildDir"
364echo "Checkout directory..: $coDir"
365
366# Check out the stable branch that'll be the base of the new release. No
367# externals at this point. Creating a release of a ThirdParty or Data project
368# requires a bit of work, as we need to assemble a temporary package with a
369# BuildTools external.
370
371echo ''
372echo "===> Checking out stable release $stableVer without externals..."
373echo ''
374
375rm -rf $topBuildDir
376cmd="svn co --ignore-externals $stableURL $coDir"
377if test $suppressCheckout = 1 ; then
378  echo "Pretending to do: $cmd"
379else
380  rm -rf $topBuildDir
381  echo $cmd
382  eval $cmd
383fi
384
385if test $isThirdParty = yes || test $isData = yes; then
386  echo ''
387  echo '===> Checking out BuildTools (Data or ThirdParty) ...'
388  echo ''
389  cmd="svn co $cmdBTURL $topBuildDir/BuildTools"
390  if test $suppressCheckout = 1 ; then
391    echo "Pretending to do: $cmd"
392  else
393    echo $cmd
394    eval $cmd
395  fi
396fi
397
398startDir=`pwd`
399coDir=`cd $coDir; pwd`
400topBuildDir=`cd $topBuildDir; pwd`
401
402cd $coDir
403
404# Find configure.ac files for the package and project and update the version.
405# We have no externals or third-party code at this point, so there will be
406# two files for a normal project, one for a ThirdParty or Data project, and
407# none for BuildTools.
408
409echo ''
410echo "===> Checking for configure.ac files ..."
411bak_files=`find . -name 'configure.ac'`
412
413if test -n "$bak_files" ; then
414  for i in $bak_files; do
415    cp $i $i.bak
416  done
417
418# Take the attitude that [] around parameters in AC_INIT is optional,
419# it's the commas that count. This does make for a surpassing ugly regular
420# expression.  A comma in the version string will cause a spectacular failure.
421# In AC_COIN_PROJECTDIR_INIT, take the attitude that the existing parameters
422# don't matter, we know what the release parameters should be.
423
424  echo ''
425  echo "===> Updating version numbers in configure.ac files ..."
426  for i in $bak_files; do
427    sed -e "s|AC_INIT\(.*\),\(\[*\)[^],]*\(\]*\),\(.*\)|AC_INIT\1,\2$newVer\3,\4|" $i > bla
428    mv bla $i
429    lastComponent=`echo $stableProj | sed -e 's|.*/\([^/][^/]*\)|\1|'`
430    sed -e "s|AC_COIN_PROJECTDIR_INIT(.*)|AC_COIN_PROJECTDIR_INIT\($lastComponent,$newLTCurrent:$newLTRevision:$newLTAge\)|" $i > bla
431    mv bla $i
432    svn diff $i
433  done
434else
435  echo "    ... none to process."
436fi
437
438# Find config_proj_default.h. If there's a definition for PROJ_VERSION, adjust it and
439# add config_proj_default.h.bak to the list of files to be restored.
440
441stableProjUC=`echo $stableProj | tr '[a-z]' '[A-Z]'`
442configFileLoc=`find . -name .svn -prune -o -name 'config_*_default.h' -print`
443if test -n "$configFileLoc" ; then
444  versionSym=${stableProjUC}_VERSION
445  echo ''
446  echo "===> Updating $versionSym in $configFileLoc (if present)"
447  echo ''
448  mv $configFileLoc $configFileLoc.bak
449  bak_files="$bak_files $configFileLoc"
450  sed -e "s/# *define $versionSym .*\$/#define $versionSym \"$newVer\"/" \
451    -e "s/# *define ${versionSym}_MAJOR .*\$/#define ${versionSym}_MAJOR $majVer/" \
452    -e "s/# *define ${versionSym}_MINOR .*\$/#define ${versionSym}_MINOR $minVer/" \
453    -e "s/# *define ${versionSym}_RELEASE .*\$/#define ${versionSym}_RELEASE $newRel/" \
454    <$configFileLoc.bak >$configFileLoc
455  svn diff $configFileLoc
456fi
457
458# The Dependencies file in a stable branch should contain only stable
459# and release references (trunk is flagged as an error below). The overall
460# algorithm is to convert svn:externals to use releases but leave Dependencies
461# with stables. In practice, this is accomplished by backing up Dependencies,
462# using Dependencies to assemble and set svn:externals, and finally restoring
463# Dependencies from the backup after all else is done.
464
465# Look for a file specifying externals. Preferably Dependencies, but check for
466# Externals just in case this is an unconverted project.
467
468srcDepFile=
469for file in Dependencies Externals ; do
470  if test -r $file ; then
471    srcDepFile=$file
472    break
473  fi
474done
475
476# Now generate the proper externals for the release.  Each line in a
477# Dependencies file has the format <ext_name> <ext_url>.  Normally, each
478# <ext_url> should be a stable branch.  References to stable branches will be
479# converted to references to releases unless the reference is to a project
480# in the stableExternals list (in which case it'll be converted at the very
481# end). References to releases are not changed. References to trunk are an
482# error. Failure to find a release for an external not in the stableExternals
483# list is an error. Save the existing externals and srcDepFile, as we'll
484# probably change both.
485
486if test -n "$srcDepFile" ; then
487
488  svn propget svn:externals . > .Externals.original
489  bak_files="$bak_files $srcDepFile"
490  cp $srcDepFile $srcDepFile.bak
491
492  echo ''
493  echo "===> Checking externals in $srcDepFile ..."
494  echo ''
495
496# Because we're working directly from command output, the regular expression
497# must check for lines.
498
499  ourBTURL=`svn propget svn:externals . | \
500            sed -n -e 's/^BuildTools *https:\([^ ]*\)$/https:\1/p'`
501  if test -z "$ourBTURL" ; then
502    ourBTURL=none
503  fi
504  echo "Our BuildTools...:    $ourBTURL"
505
506  rm -f Dependencies
507  ext_name=
508  ext_url=
509  buildtoolsMismatch=0
510  for i in `cat $srcDepFile.bak`; do
511    if test "$ext_name" = ""; then
512      ext_name="$i"
513    else
514      ext_url=$i
515      if expr "$ext_name" : '#.*' 2>&1 >/dev/null ; then
516        echo "    $ext_name $ext_url ==> skipped"
517        ext_name=
518        continue
519      fi
520      ext_urltype=`extractTypeFromURL $ext_url`
521      ext_proj=`extractProjFromURL $ext_url`
522
523# See if this external should be dropped.
524
525      if expr "$exciseExternals" : '.*'$ext_proj'.*' 2>&1 > /dev/null ; then
526        echo "    $ext_name $ext_url ==> excised"
527        ext_name=
528        continue
529      fi
530
531# External must be a stable or a release.
532
533      if test $ext_urltype != stable && test $ext_urltype != release ; then
534        echo ''
535        echo "===> The external URL $ext_url is not a stable branch or release. Exiting."
536        echo ''
537        exit 2
538      fi
539
540      ext_isNormal=`isNormalURL $ext_url`
541
542# Convert stable branches to releases unless listed in stableExternals.
543# Existing releases are unchanged.
544
545      if test $ext_urltype = stable ; then
546        if expr "$stableExternals" : '.*'"$ext_proj"'.*' 2>&1 >/dev/null ; then
547          echo "    $ext_name $ext_url unchanged"
548          ext_rel_url=$ext_url
549        else
550          ext_majVer=`extractMajorFromURL $ext_url`
551          ext_minVer=`extractMinorFromURL $ext_url`
552          ext_rel_url=`bestRelease $ext_url $ext_majVer $ext_minVer`
553          if test -z "$ext_rel_url" ; then
554            echo ''
555            echo "===> No release for $ext_url. Exiting."
556            echo ''
557            exit 2
558          fi
559          # Normal (not BuildTools/ThirdParty/Data) need a directory name,
560          # and it may differ from the project name. Carefully preserve it.
561          if test $ext_isNormal = yes ; then
562            ext_tail=`extractTailFromExt $ext_url`
563            ext_rel_url=${ext_rel_url}${ext_tail}
564          fi
565          echo "    $ext_name $ext_url ==> $ext_rel_url"
566        fi
567      else
568        ext_rel_url=$ext_url
569        echo "    $ext_name $ext_url ==> unchanged"
570      fi
571
572# Get the BuildTools URL for the external and compare to the BuildTools URL
573# for the source, assuming we have one and the external has one. We only need
574# to do this for normal URLs, and we need to strip the tail.
575
576      if test $ext_isNormal = yes &&
577         test $ext_proj != BuildTools && test $ourBTURL != none ; then
578        ext_rel_url_notail=`echo $ext_rel_url | sed -e 's,/[^/]*$,,'`
579        extBTURL=`svn propget svn:externals $ext_rel_url_notail`
580        extBTURL=`echo $extBTURL | \
581          sed -n -e 's/^BuildTools *https:\([^ ]*\) *$/https:\1/p'`
582        if test -n "$extBTURL" ; then
583          testResult=`compareURLVersions "$ourBTURL" "$extBTURL"`
584          if test $testResult = no ; then
585            if test $ignoreBuildToolsMismatch = all || \
586               expr "$mismatchBTExternals" : '.*'$ext_proj'.*' 2>&1 >/dev/null ; then
587              echo "    WARNING: BuildTools mismatch: $ext_url_notail uses $extBTURL"
588            else
589              buildtoolsMismatch=1
590              echo "    ERROR: BuildTools mismatch: $ext_url_notail uses $extBTURL"
591            fi
592          fi
593        fi
594      fi
595      echo "$ext_name  $ext_rel_url" >>Dependencies
596      ext_name=
597      echo ''
598    fi
599  done
600
601# If we have a BuildTools mismatch, exit.
602
603  if test $buildtoolsMismatch = 1 ; then
604    echo "Exiting due to BuildTools mismatches; use -i to ignore."
605    exit 2
606  fi
607
608# Try to check out the externals. Try three times before failing.
609  echo ''
610  echo '===> Updating svn:externals property and checking out externals ...'
611  echo ''
612
613  svn propset svn:externals -F Dependencies .
614  svn update ||
615  { echo "Retry 1 ... " ; svn update ; } ||
616  { echo "Retry 2 ... " ; svn update ; } ||
617  { echo "Checkout of externals failed. Aborting." ; exit 3 ; }
618
619  if test -d ThirdParty ; then
620    echo ''
621    echo '===> Downloading ThirdParty code ...'
622    echo ''
623
624    ext_name=
625    ext_url=
626    for i in `svn propget svn:externals .` ; do
627      if test -z "$ext_name" ; then
628        ext_name="$i"
629      else
630        ext_url=$i
631        if expr "$ext_name" : 'ThirdParty/.*' 2>&1 >/dev/null ; then
632          cd $ext_name
633          ext_proj=`extractProjFromURL $ext_url`
634          getScript=get.$ext_proj
635          if test -x "$getScript" ; then
636            ./$getScript -patch
637          fi
638          cd $coDir
639        fi
640        ext_name=
641      fi
642    done
643  fi
644fi
645
646# Finally! Done processing externals. If this is a ThirdParty project, we
647# still have to run the get script.
648
649if test $isThirdParty = yes ; then
650  if test -x get.$stableProj ; then
651    echo ''
652    echo '===> Downloading third party code ...'
653    echo ''
654    ./get.$stableProj
655  fi
656fi
657
658# Don't run run_autotools for BuildTools!
659
660if test $isBuildTools = no ; then
661  echo ''
662  echo '===> Running BuildTools/run_autotools ...'
663  echo ''
664  if test $isThirdParty = yes || test $isData = yes ; then
665    cd ../..
666    ./BuildTools/run_autotools
667    cd "$coDir"
668  elif test $isNormal = yes ; then
669    ./BuildTools/run_autotools
670  fi
671fi
672
673# Let's see if it works. We only run tests for normal projects. DO NOT turn
674# on --enable-maintainer-mode in the initial configure command. At the least,
675# it's not needed. At the worst, as of 100526, it'll undo all the careful
676# work above to set externals.
677
678if test $isNormal = yes ; then
679  (set -e
680   echo ''
681   echo '===> Creating build directory and running the configuration script...'
682   echo ''
683   mkdir build
684   cd build
685   cmd="$coDir/configure -C"
686   echo $cmd
687   eval $cmd
688   echo ''
689   echo '===> Compiling code...'
690   echo ''
691   cmd='make install'
692   echo $cmd
693   eval $cmd
694   echo ''
695   echo '===> Running the unit test...'
696   echo ''
697   echo '*******************************************************************************'
698   echo '***                                                                         ***'
699   echo '***                       BEGIN OUTPUT OF MAKE TEST                         ***'
700   echo '***                                                                         ***'
701   echo '*******************************************************************************'
702   echo ''
703   cmd='make test'
704   echo $cmd
705   eval $cmd
706   echo ''
707   echo '*******************************************************************************'
708   echo '***                                                                         ***'
709   echo '***                        END OUTPUT OF MAKE TEST                          ***'
710   echo '***                                                                         ***'
711   echo '*******************************************************************************'
712  )
713  if test $? != 0; then
714    echo ''
715    echo 'Error during build or test'
716    echo ''
717    exit 3
718  fi
719  echo ''
720  echo '===> ALL TESTS PASSED'
721fi
722
723echo ''
724if test $isNormal = yes ; then
725  echo 'Please review the output above, particularly the one of make test.'
726else
727  echo 'Please review the output above.'
728fi
729echo ''
730
731# Do we need to plug in nonexistent releases for circular dependencies tested
732# with the stable versions? If so, generate a new Dependencies. This is the
733# only reason stable references should appear in the externals for a release,
734# so we don't need to check further before removing them.
735
736if test -n "$stableExternals" ; then
737  echo "===> Grooming externals to remove stable externals used for testing ..."
738  mv Dependencies Dependencies.temp.$$
739  ext_name=
740  ext_url=
741  for i in `cat Dependencies.temp.$$`; do
742    if test "$ext_name" = ""; then
743      ext_name="$i"
744    else
745      ext_url=$i
746      ext_urltype=`extractTypeFromURL $ext_url`
747      ext_proj=`extractProjFromURL $ext_url`
748      if test $ext_urltype = stable ; then
749        ext_rel_url=$ext_url
750        ext_majVer=`extractMajorFromURL $ext_url`
751        ext_minVer=`extractMinorFromURL $ext_url`
752        ext_rel_url=`echo $ext_url | sed -e 's,/stable/,/releases/,'`
753        ext_rel_url=`replaceVersionInURL $ext_rel_url $ext_majVer $ext_minVer 0`
754        echo "    $ext_name $ext_url ==> $ext_rel_url"
755      else
756        ext_rel_url=$ext_url
757      fi
758      echo "$ext_name  $ext_rel_url" >>Dependencies
759      ext_name=
760    fi
761  done
762  rm -f Dependencies.temp.$$
763  svn propset -F Dependencies svn:externals .
764  echo ''
765fi
766
767# If we had a Dependencies file to begin with, it contained references to
768# stable branches, and perhaps releases. This is the set of dependencies that
769# we want to commit in Dependencies, so reload $srcDepFile.bak into
770# Dependencies, now that we have svn:externals set to releases.
771
772if test -n "$srcDepFile" ; then
773  cp $srcDepFile.bak Dependencies
774fi
775
776if test -r Dependencies ; then
777  echo 'Also, please confirm the externals are correct:'
778  svn propget svn:externals
779fi
780
781echo ''
782echo 'After reviewing the output above, you can create a new release by going into'
783echo 'the directory'
784echo ''
785echo "          $startDir"
786echo ''
787echo "and run the commit_new_release script"
788
789cd $topBuildDir
790
791cat >.new_release_data <<EOF
792coinURL=$coinURL
793startDir=$startDir
794topBuildDir=$topBuildDir
795coDir=$coDir
796releaseURL=$releaseURL
797stableURL=$stableURL
798newVer=$newVer
799bak_files="$bak_files"
800EOF
Note: See TracBrowser for help on using the repository browser.