source: stable/0.7/prepare_new_release @ 2839

Last change on this file since 2839 was 2839, checked in by stefan, 8 years ago

merge r2838 from trunk

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