source: trunk/prepare_new_release @ 2840

Last change on this file since 2840 was 2840, checked in by stefan, 6 years ago

revert r2838, breaks things for */* projects

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 24.9 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 2840 2013-07-30 21:27:10Z 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 . -name 'configure.ac'`
421
422if test -n "$bak_files" ; then
423  for i in $bak_files; do
424    cp $i $i.bak
425  done
426
427# Take the attitude that [] around parameters in AC_INIT is optional,
428# it's the commas that count. This does make for a surpassing ugly regular
429# expression.  A comma in the version string will cause a spectacular failure.
430# In AC_COIN_PROJECTDIR_INIT, take the attitude that there is one parameter
431# with the PMs choosen project name which is preserved and we only add a
432# libtool version number afterwards.
433
434  echo ''
435  echo "===> Updating version numbers in configure.ac files ..."
436  for i in $bak_files; do
437    sed -e "s|AC_INIT\(.*\),\(\[*\)[^],]*\(\]*\),\(.*\)|AC_INIT\1,\2$newVer\3,\4|" $i > bla
438    mv bla $i
439    sed -e "s|AC_COIN_PROJECTDIR_INIT(\(.*\))|AC_COIN_PROJECTDIR_INIT\(\1,$newLTCurrent:$newLTRevision:$newLTAge\)|" $i > bla
440    mv bla $i
441    svn diff $i
442  done
443else
444  echo "    ... none to process."
445fi
446
447# Find config_proj_default.h. If there's a definition for PROJ_VERSION, adjust it and
448# add config_proj_default.h.bak to the list of files to be restored.
449
450stableProjUC=`echo $stableProj | tr '[a-z]' '[A-Z]'`
451configFileLoc=`find . -name .svn -prune -o -name 'config_*_default.h' -print`
452if test -n "$configFileLoc" ; then
453  versionSym=${stableProjUC}_VERSION
454  echo ''
455  echo "===> Updating $versionSym in $configFileLoc (if present)"
456  echo ''
457  mv $configFileLoc $configFileLoc.bak
458  bak_files="$bak_files $configFileLoc"
459  sed -e "s/# *define $versionSym .*\$/#define $versionSym \"$newVer\"/" \
460    -e "s/# *define ${versionSym}_MAJOR .*\$/#define ${versionSym}_MAJOR $majVer/" \
461    -e "s/# *define ${versionSym}_MINOR .*\$/#define ${versionSym}_MINOR $minVer/" \
462    -e "s/# *define ${versionSym}_RELEASE .*\$/#define ${versionSym}_RELEASE $newRel/" \
463    <$configFileLoc.bak >$configFileLoc
464  svn diff $configFileLoc
465fi
466
467# The Dependencies file in a stable branch should contain only stable
468# and release references (trunk is flagged as an error below). The overall
469# algorithm is to convert svn:externals to use releases but leave Dependencies
470# with stables. In practice, this is accomplished by backing up Dependencies,
471# using Dependencies to assemble and set svn:externals, and finally restoring
472# Dependencies from the backup after all else is done.
473
474# Look for a file specifying externals. Preferably Dependencies, but check for
475# Externals just in case this is an unconverted project.
476
477srcDepFile=
478for file in Dependencies Externals ; do
479  if test -r $file ; then
480    srcDepFile=$file
481    break
482  fi
483done
484
485# Now generate the proper externals for the release.  Each line in a
486# Dependencies file has the format <ext_name> <ext_url>.  Normally, each
487# <ext_url> should be a stable branch.  References to stable branches will be
488# converted to references to releases unless the reference is to a project
489# in the stableExternals list (in which case it'll be converted at the very
490# end). References to releases are not changed. References to trunk are an
491# error. Failure to find a release for an external not in the stableExternals
492# list is an error. Save the existing externals and srcDepFile, as we'll
493# probably change both.
494
495if test -n "$srcDepFile" ; then
496
497  svn propget svn:externals . > .Externals.original
498  bak_files="$bak_files $srcDepFile"
499  cp $srcDepFile $srcDepFile.bak
500
501  echo ''
502  echo "===> Checking externals in $srcDepFile ..."
503  echo ''
504
505# Because we're working directly from command output, the regular expression
506# must check for lines.
507
508  ourBTURL=`svn propget svn:externals . | \
509            sed -n -e 's/^BuildTools *https:\([^ ]*\)$/https:\1/p'`
510  if test -z "$ourBTURL" ; then
511    ourBTURL=none
512  fi
513  echo "Our BuildTools...:    $ourBTURL"
514
515  rm -f Dependencies
516  ext_name=
517  ext_url=
518  buildtoolsMismatch=0
519  for i in `cat $srcDepFile.bak`; do
520    if test "$ext_name" = ""; then
521      ext_name="$i"
522    else
523      ext_url=$i
524      if expr "$ext_name" : '#.*' 2>&1 >/dev/null ; then
525        echo "    $ext_name $ext_url ==> skipped"
526        ext_name=
527        continue
528      fi
529      ext_urltype=`extractTypeFromURL $ext_url`
530      ext_proj=`extractProjFromURL $ext_url`
531
532# See if this external should be dropped.
533
534      if expr "$exciseExternals" : '.*'$ext_proj'.*' 2>&1 > /dev/null ; then
535        echo "    $ext_name $ext_url ==> excised"
536        ext_name=
537        continue
538      fi
539
540# External must be a stable or a release.
541
542      if test $ext_urltype != stable && test $ext_urltype != release ; then
543        echo ''
544        echo "===> The external URL $ext_url is not a stable branch or release. Exiting."
545        echo ''
546        exit 2
547      fi
548
549      ext_isNormal=`isNormalURL $ext_url`
550
551# Convert stable branches to releases unless listed in stableExternals.
552# Existing releases are unchanged.
553
554      if test $ext_urltype = stable ; then
555        if expr "$stableExternals" : '.*'"$ext_proj"'.*' 2>&1 >/dev/null ; then
556          echo "    $ext_name $ext_url unchanged"
557          ext_rel_url=$ext_url
558        else
559          ext_majVer=`extractMajorFromURL $ext_url`
560          ext_minVer=`extractMinorFromURL $ext_url`
561          ext_rel_url=`bestRelease $ext_url $ext_majVer $ext_minVer`
562          if test -z "$ext_rel_url" ; then
563            echo ''
564            echo "===> No release for $ext_url. Exiting."
565            echo ''
566            exit 2
567          fi
568          # Normal (not BuildTools/ThirdParty/Data) need a directory name,
569          # and it may differ from the project name. Carefully preserve it.
570          if test $ext_isNormal = yes ; then
571            ext_tail=`extractTailFromExt $ext_url`
572            ext_rel_url=${ext_rel_url}${ext_tail}
573          fi
574          echo "    $ext_name $ext_url ==> $ext_rel_url"
575        fi
576      else
577        ext_rel_url=$ext_url
578        echo "    $ext_name $ext_url ==> unchanged"
579      fi
580
581# Get the BuildTools URL for the external and compare to the BuildTools URL
582# for the source, assuming we have one and the external has one. We only need
583# to do this for normal URLs, and we need to strip the tail.
584
585      if test $ext_isNormal = yes &&
586         test $ext_proj != BuildTools && test $ourBTURL != none ; then
587        ext_rel_url_notail=`echo $ext_rel_url | sed -e 's,/[^/]*$,,'`
588        extBTURL=`svn propget svn:externals $ext_rel_url_notail`
589        extBTURL=`echo $extBTURL | \
590          sed -n -e 's/^BuildTools *https:\([^ ]*\) *$/https:\1/p'`
591        if test -n "$extBTURL" ; then
592          testResult=`compareURLVersions "$ourBTURL" "$extBTURL"`
593          if test $testResult = no ; then
594            if test $ignoreBuildToolsMismatch = all || \
595               expr "$mismatchBTExternals" : '.*'$ext_proj'.*' 2>&1 >/dev/null ; then
596              echo "    WARNING: BuildTools mismatch: $ext_url_notail uses $extBTURL"
597            else
598              buildtoolsMismatch=1
599              echo "    ERROR: BuildTools mismatch: $ext_url_notail uses $extBTURL"
600            fi
601          fi
602        fi
603      fi
604      echo "$ext_name  $ext_rel_url" >>Dependencies
605      ext_name=
606      echo ''
607    fi
608  done
609
610# If we have a BuildTools mismatch, exit.
611
612  if test $buildtoolsMismatch = 1 ; then
613    echo "Exiting due to BuildTools mismatches; use -i to ignore."
614    exit 2
615  fi
616
617# Try to check out the externals. Try three times before failing.
618  echo ''
619  echo '===> Updating svn:externals property and checking out externals ...'
620  echo ''
621
622  svn propset svn:externals -F Dependencies .
623  svn update ||
624  { echo "Retry 1 ... " ; svn update ; } ||
625  { echo "Retry 2 ... " ; svn update ; } ||
626  { echo "Checkout of externals failed. Aborting." ; exit 3 ; }
627
628  if test -d ThirdParty ; then
629    echo ''
630    echo '===> Downloading ThirdParty code ...'
631    echo ''
632
633    ext_name=
634    ext_url=
635    for i in `svn propget svn:externals .` ; do
636      if test -z "$ext_name" ; then
637        ext_name="$i"
638      else
639        ext_url=$i
640        if expr "$ext_name" : 'ThirdParty/.*' 2>&1 >/dev/null ; then
641          cd $ext_name
642          ext_proj=`extractProjFromURL $ext_url`
643          getScript=get.$ext_proj
644          if test -x "$getScript" ; then
645            ./$getScript -patch
646          fi
647          cd $coDir
648        fi
649        ext_name=
650      fi
651    done
652  fi
653fi
654
655# Finally! Done processing externals. If this is a ThirdParty project, we
656# still have to run the get script, if there is one.
657
658isThirdPartyWithoutGet=no
659if test $isThirdParty = yes ; then
660  if test -x get.$stableProj ; then
661    echo ''
662    echo '===> Downloading third party code ...'
663    echo ''
664    ./get.$stableProj
665  else
666    isThirdPartyWithoutGet=yes
667  fi
668fi
669
670# Don't run run_autotools for BuildTools!
671
672if test $isBuildTools = no ; then
673  echo ''
674  echo '===> Running BuildTools/run_autotools ...'
675  echo ''
676  if test $isThirdParty = yes || test $isData = yes ; then
677    cd ../..
678    ./BuildTools/run_autotools
679    cd "$coDir"
680  elif test $isNormal = yes ; then
681    ./BuildTools/run_autotools
682  fi
683fi
684
685# Let's see if it works. We only run tests for normal projects. DO NOT turn
686# on --enable-maintainer-mode in the initial configure command. At the least,
687# it's not needed. At the worst, as of 100526, it'll undo all the careful
688# work above to set externals.
689
690if test $isNormal = yes && test $isThirdPartyWithoutGet = no; then
691  (set -e
692   echo ''
693   echo '===> Creating build directory and running the configuration script...'
694   echo ''
695   mkdir build
696   cd build
697   cmd="$coDir/configure -C"
698   echo $cmd
699   eval $cmd
700   echo ''
701   echo '===> Compiling code...'
702   echo ''
703   cmd='make install'
704   echo $cmd
705   eval $cmd
706   echo ''
707   echo '===> Running the unit test...'
708   echo ''
709   echo '*******************************************************************************'
710   echo '***                                                                         ***'
711   echo '***                       BEGIN OUTPUT OF MAKE TEST                         ***'
712   echo '***                                                                         ***'
713   echo '*******************************************************************************'
714   echo ''
715   cmd='make test'
716   echo $cmd
717   eval $cmd
718   echo ''
719   echo '*******************************************************************************'
720   echo '***                                                                         ***'
721   echo '***                        END OUTPUT OF MAKE TEST                          ***'
722   echo '***                                                                         ***'
723   echo '*******************************************************************************'
724  )
725  if test $? != 0; then
726    echo ''
727    echo 'Error during build or test'
728    echo ''
729    exit 3
730  fi
731  echo ''
732  echo '===> ALL TESTS PASSED'
733fi
734
735echo ''
736if test $isNormal = yes && test $isThirdPartyWithoutGet = no; then
737  echo 'Please review the output above, particularly the one of make test.'
738else
739  echo 'Please review the output above.'
740fi
741echo ''
742
743# Do we need to plug in nonexistent releases for circular dependencies tested
744# with the stable versions? If so, generate a new Dependencies. This is the
745# only reason stable references should appear in the externals for a release,
746# so we don't need to check further before removing them.
747
748if test -n "$stableExternals" ; then
749  echo "===> Grooming externals to remove stable externals used for testing ..."
750  mv Dependencies Dependencies.temp.$$
751  ext_name=
752  ext_url=
753  for i in `cat Dependencies.temp.$$`; do
754    if test "$ext_name" = ""; then
755      ext_name="$i"
756    else
757      ext_url=$i
758      ext_urltype=`extractTypeFromURL $ext_url`
759      ext_proj=`extractProjFromURL $ext_url`
760      if test $ext_urltype = stable ; then
761        ext_rel_url=$ext_url
762        ext_majVer=`extractMajorFromURL $ext_url`
763        ext_minVer=`extractMinorFromURL $ext_url`
764        ext_rel_url=`echo $ext_url | sed -e 's,/stable/,/releases/,'`
765        ext_rel_url=`replaceVersionInURL $ext_rel_url $ext_majVer $ext_minVer 0`
766        echo "    $ext_name $ext_url ==> $ext_rel_url"
767      else
768        ext_rel_url=$ext_url
769      fi
770      echo "$ext_name  $ext_rel_url" >>Dependencies
771      ext_name=
772    fi
773  done
774  rm -f Dependencies.temp.$$
775  svn propset -F Dependencies svn:externals .
776  echo ''
777fi
778
779# If we had a Dependencies file to begin with, it contained references to
780# stable branches, and perhaps releases. This is the set of dependencies that
781# we want to commit in Dependencies, so reload $srcDepFile.bak into
782# Dependencies, now that we have svn:externals set to releases.
783
784if test -n "$srcDepFile" ; then
785  cp $srcDepFile.bak Dependencies
786fi
787
788if test -r Dependencies ; then
789  echo 'Also, please confirm the externals are correct:'
790  svn propget svn:externals
791fi
792
793echo ''
794echo 'After reviewing the output above, you can create a new release by going into'
795echo 'the directory'
796echo ''
797echo "          $startDir"
798echo ''
799echo "and run the commit_new_release script"
800
801cd $topBuildDir
802
803cat >.new_release_data <<EOF
804coinURL=$coinURL
805startDir=$startDir
806topBuildDir=$topBuildDir
807coDir=$coDir
808releaseURL=$releaseURL
809stableURL=$stableURL
810newVer=$newVer
811bak_files="$bak_files"
812EOF
Note: See TracBrowser for help on using the repository browser.