Changeset 1236 for stable


Ignore:
Timestamp:
Feb 21, 2009 2:17:22 PM (11 years ago)
Author:
stefan
Message:

synchronize with trunk rev 1234

Location:
stable/0.5
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • stable/0.5/coin.m4

    r1112 r1236  
    527527# AC_MSG_NOTICE([C++ compiler candidates: $comps])
    528528AC_PROG_CXX([$comps])
    529 if test -z "$CXX" ; then
    530   AC_MSG_ERROR([Failed to find a C++ compiler!])
    531 fi
     529
     530#AC_PROG_CXX sets CXX to g++ if it cannot find a working C++ compiler
     531#thus, we test here whether $CXX is actually working
     532AC_LANG_PUSH(C++)
     533AC_MSG_CHECKING([whether C++ compiler $CXX works]);
     534AC_COMPILE_IFELSE(
     535  [AC_LANG_PROGRAM(, [int i=0;])],
     536  [AC_MSG_RESULT(yes)],
     537  [AC_MSG_RESULT(no)
     538   AC_MSG_ERROR(failed to find a C++ compiler or C++ compiler $CXX does not work)]
     539)
     540AC_LANG_POP(C++)
    532541
    533542# It seems that we need to cleanup something here for the Windows
     
    30943103#check if user provides a MUMPS library (that works)
    30953104AC_LANG_PUSH(C)
     3105SAVE_ADDLIBS="$ADDLIBS"
     3106ADDLIBS="$ADDLIBS $FLIBS"
    30963107AC_COIN_HAS_USER_LIBRARY(mumps, MUMPS, dmumps_c.h, dmumps_c)
     3108ADDLIBS="$SAVE_ADDLIBS"
    30973109AC_LANG_POP(C)
    30983110
  • stable/0.5/commit_new_release

    r799 r1236  
    99#
    1010# Author: Andreas Waechter     IBM      2007-06-21
     11# Modified by: Lou Hafer       SFU      2008-04-17
    1112
    1213#set -x -v
    1314
    1415set -e
     16
     17# Remember what was done during release generation.
    1518
    1619if test -r .new_release_data; then
     
    2225  exit -1;
    2326fi
     27
     28# Commit the release to stable so we can do a repository-side copy to create
     29# the release.
    2430
    2531echo ''
     
    3440eval $cmd
    3541
    36 cmd='svn update'
     42# Update to confirm the commit. Avoid pulling in externals --- if we're doing
     43# circular dependencies, they may not exist. As it stands, the main purpose of
     44# this call is to allow us to easily obtain the current revision. It might be
     45# useful to strengthen this and check that the value is what we're expecting
     46# --- one greater than the revision before commit. `--ignore-externals' could
     47# be made provisional on the existence of circular dependency by passing a
     48# boolean through .new_release_data. This would strengthen the update, in that
     49# the update would confirm existence of the externals.
     50
     51cmd='svn update --ignore-externals'
    3752echo $cmd
    3853eval $cmd
     
    4156echo "Current revision number is: $rev_num"
    4257
     58# Create the release with a repository-side copy.
     59
    4360echo ''
    44 echo "===> Creating new release $new_ver from stable $stable_branch (rev $rev_num)..."
     61echo "===> Creating new release $new_ver from stable $stableBranch (rev $rev_num)..."
    4562echo ''
    4663
    47 new_rel_url=$base_url/releases/$new_ver
    48 cmd="svn copy -m \"creating releases/$new_ver from stable/$stable_branch (rev $rev_num)\" $stable_url $new_rel_url"
     64cmd="svn copy -m \"creating releases/$new_ver from stable/$stableBranch (rev $rev_num)\" $stableURL $releaseURL"
    4965echo $cmd
    5066eval $cmd
     67
     68# And restore the stable branch to it's original condition. Start by reverting
     69# to the original externals.
    5170
    5271if test -r Externals; then
     
    5978fi
    6079
    61 conf_ac_files=`find . -name 'configure.ac' | grep -v -E 'ThirdParty/.*/.*/configure.ac'`
     80# Revert the package id in configure.ac and propagate with run_autotools.  Note
     81# that this does not exclude configure.ac for externals in the normal place.
     82# But since changes to externals are not swept up by the commit, it doesn't
     83# matter. On the other hand, if this whole checkout is a temporary for the
     84# purpose of release generation, I'm not entirely convinced we need to bother
     85# to exclude configure.ac in the actual ThirdParty code base. Comments from
     86# ThirdParty maintainers welcome.
     87
     88conf_ac_files=`find . -name 'configure.ac' | grep -v -E '.*/.*/configure.ac'`
    6289
    6390echo ''
    64 echo "===> Restoring version number (${stable_branch}stable) in configure.ac files"
     91echo "===> Restoring version number (${stableBranch}stable) in configure.ac files"
    6592for i in $conf_ac_files; do
    66   sed -e "s|AC_INIT\(.*\)\[[0-9\.]*\],\(.*\)|AC_INIT\1[${stable_branch}stable],\2|" $i > bla
     93  sed -e "s|AC_INIT\(.*\)\[[0-9\.]*\],\(.*\)|AC_INIT\1[${stableBranch}stable],\2|" $i > bla
    6794  mv bla $i
    6895  svn di $i
     
    73100echo ''
    74101curdir=`pwd`
    75 cd $tmpbas
     102cd $buildBase
    76103BuildTools/run_autotools
    77104cd "$curdir"
     105
     106# Commit the restored stable branch.
    78107
    79108echo ''
     
    81110echo ''
    82111
    83 cmd="svn ci -m \"restoring stable/$stable_branch\""
     112cmd="svn ci -m \"restoring stable/$stableBranch\""
    84113echo $cmd
    85114eval $cmd
    86115
    87116echo ''
    88 echo "Done, new release $new_rel_url created"
     117echo "Done, new release $releaseURL created"
    89118echo ''
    90 echo "You can now delete the directory $tmpbas including subdirectories"
     119echo "You can now delete the directory $buildBase including subdirectories"
    91120
    92121rm .new_release_data
  • stable/0.5/headers/configall_system.h

    • Property svn:eol-style set to native
    • Property svn:keywords set to Author Date Id Revision
  • stable/0.5/headers/configall_system_msc.h

    • Property svn:eol-style set to native
    • Property svn:keywords set to Author Date Id Revision
  • stable/0.5/prepare_new_release

    r1024 r1236  
    99#
    1010# 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.
    1114
    1215#set -x -v
    13 
    1416set -e
    15 echo ''
     17
     18# You can think of this script as having three sections: first, the following
     19# function definition, then parameter parsing and validation, and finally the
     20# actual generation of the release candidate. See the help message for a good
     21# description of the actions taken to generate the release candidate.
     22
     23# Utility function to determine current or next release for a given stable
     24# branch. Call is determine_release(stableURL,next). Replace next with 1 for
     25# the next release, 0 for the current release. This code is needed in three
     26# separate places, so it really deserves to be a function. We can hope that
     27# maintainers will have a reasonably modern version of standard sh.
     28
     29# Data is a real pain in the **** and should be converted to the standard
     30# nomenclature.
     31
     32determine_release ()
     33{
     34  if test $isData = no ; then
     35
     36    drtmp_stableBranch=`echo $1 | sed -e 's|.*/stable/||'`
     37    drtmp_baseURL=`echo $1 | sed -e 's|/stable/[0-9.]*||'`
     38    drtmp_returnVal=
     39
     40    # List the existing releases and screen for releases matching stableBranch.
     41
     42    drtmp_svnlst=`svn list $drtmp_baseURL/releases/`
     43
     44    drtmp_release_vers=
     45    for drtmp_i in $drtmp_svnlst ; do
     46      case $drtmp_i in
     47        $drtmp_stableBranch.*)
     48          drtmp_i=`echo $drtmp_i | sed -e 's|/$||'`
     49          drtmp_release_vers="$drtmp_release_vers $drtmp_i";;
     50      esac;
     51    done
     52
     53    # Are there any existing releases? If not, and the user didn't ask for the
     54    # next release, we have an error.
     55
     56    if test -z "$drtmp_release_vers" ; then
     57      if test $2 = 1 ; then
     58        drtmp_returnVal="$drtmp_stableBranch.0"
     59      else
     60        drtmp_returnVal="Error"
     61      fi
     62    else
     63
     64    # There are releases. If we don't have one after the loop, we're confused.
     65
     66      drtmp_new_rel=-10000
     67      for drtmp_i in $drtmp_release_vers; do
     68        drtmp_rel=`echo $drtmp_i | sed -e "s|^$drtmp_stableBranch.||"`
     69        if test $drtmp_rel -gt $drtmp_new_rel; then
     70          drtmp_new_rel=$drtmp_rel
     71        fi
     72      done
     73
     74      if test $drtmp_new_rel = -10000; then
     75        drtmp_new_rel="Error"
     76      elif test $2 = 1 ; then
     77        drtmp_new_rel=`expr $drtmp_new_rel + 1`
     78      fi
     79      drtmp_returnVal="$drtmp_stableBranch.$drtmp_new_rel"
     80    fi
     81
     82  else  # end normal and ThirdParty, begin Data
     83
     84    drtmp_stableBranch=`echo $1 | sed -e 's|.*/stable/\([0-9.]*\)/.*|\1|'`
     85    drtmp_baseURL=`echo $1 | sed -e 's|\(.*\)/stable/[0-9.]*/.*|\1|'`
     86    drtmp_proj=`echo $1 | sed -e 's|.*/stable/[0-9.]*/||`
     87
     88    # Screen for releases that match the stable branch and contain the project
     89    # of interest. First, check for releases that match the stable branch. If
     90    # there are none, we're release 0 for this stable branch. It's an error if
     91    # there are no releases and the user did not ask for the next release. Sort
     92    # by release number here, while we have newlines in the list from svn.
     93
     94    drtmp_svnlst=`svn list $drtmp_baseURL/releases | sort -nr -t. -k3,3`
     95
     96    drtmp_release_vers=
     97    for drtmp_i in $drtmp_svnlst ; do
     98      case $drtmp_i in
     99        $drtmp_stableBranch.*)
     100          drtmp_i=`echo $drtmp_i | sed -e 's|/$||'`
     101          drtmp_release_vers="$drtmp_release_vers $drtmp_i";;
     102      esac;
     103    done
     104
     105    # Do we have releases that match the stable branch?
     106
     107    if test -z "$drtmp_release_vers" ; then
     108      if test $2 = 1 ; then
     109        drtmp_returnVal="$drtmp_stableBranch.0"
     110      else
     111        drtmp_returnVal="Error"
     112      fi
     113    else
     114
     115    # Releases exist that match stable; do any contain our project? Because
     116    # we presorted by release, we can break here at the first success.
     117
     118      drtmp_svnlst=`echo $drtmp_release_vers`
     119      drtmp_release_vers=
     120      for drtmp_i in $drtmp_svnlst ; do
     121        case $drtmp_i in
     122          $drtmp_stableBranch.*)
     123            drtmp_i=`echo $drtmp_i | sed -e 's|/$||'`
     124            drtmp_projlst=`2>&1 svn list $drtmp_baseURL/releases/$drtmp_i/$drtmp_proj`
     125            if expr "$drtmp_projlst" : '.*non-existent.*' 2>&1 >/dev/null ; then
     126              :
     127            else
     128              drtmp_release_vers="$drtmp_i"
     129              break
     130            fi
     131            ;;
     132        esac;
     133      done
     134
     135      # Are there any existing releases? If no, and the user didn't ask for
     136      # the next release, it's an error. Otherwise, go for release 0 of
     137      # proj in the current stable branch. If there are existing releases,
     138      # return either the current or +1.
     139
     140      if test -z "$drtmp_release_vers" ; then
     141        if test $2 = 0 ; then
     142          drtmp_returnVal="$drtmp_stableBranch.Error"
     143        else
     144          drtmp_returnVal="$drtmp_stableBranch.0"
     145        fi
     146      else
     147        drtmp_new_rel=-10000
     148        for drtmp_i in $drtmp_release_vers; do
     149          drtmp_rel=`echo $drtmp_i | sed -e "s|^$drtmp_stableBranch.||"`
     150          if test $drtmp_rel -gt $drtmp_new_rel; then
     151            drtmp_new_rel=$drtmp_rel
     152          fi
     153        done
     154        drtmp_new_rel=`expr $drtmp_new_rel + 1`
     155        drtmp_returnVal="$drtmp_stableBranch.$drtmp_new_rel"
     156      fi
     157
     158    fi  # for releases matching stable branch
     159
     160  fi    # for normal/Data
     161
     162  echo $drtmp_returnVal
     163}
     164
     165
     166# Specify the COIN URL base for convenience.
     167
     168coinURL="https://projects.coin-or.org/svn"
     169
     170# Begin parameter processing.
     171
     172printHelp=0
     173exitValue=0
     174ignoreBuildToolsMismatch=0
     175
     176# stableURL will be the stable branch that is the parent for the release we
     177# are building. We'll need to be able to distinguish ThirdParty and Data
     178# builds; they require special handling.
     179# buildToolsURL is required when stableURL specifies a ThirdParty or Data
     180# project --- we'll need to assemble a temporary package while creating the
     181# release candidate.
     182
     183stableURL=
     184isThirdParty=no
     185isData=no
     186buildToolsURL=
     187
     188# stableExternals, on the other hand, specifies externals for which we are
     189# doing simultaneous releases. We will use the stable branch of the external
     190# while preparing and testing this release candidate, changing the Externals
     191# file to specify a (nonexistent) release of the external at the last moment.
     192
     193stableExternals=
     194
     195# We need at least one parameter.
    16196
    17197if test "$#" -eq 0; then
     198  printHelp=1
     199else
     200
     201# Process the parameters. A parameter without an opening `-' is assumed to be
     202# the spec for the stable branch.
     203
     204  while test $# -gt 0 && test $exitValue = 0 && test $printHelp = 0 ; do
     205    case "$1" in
     206      -h* | --h*) printHelp=1 ;;
     207      -i* | --i*) ignoreBuildToolsMismatch=1 ;;
     208      -s* | --s*)
     209           if expr "$1" : '.*-s.*=.*' 2>&1 >/dev/null ; then
     210             stableExternals=`echo $1 | sed -n -e 's/[^=]*=\(.*\)/\1/p'`
     211           else
     212             shift
     213             stableExternals=$1
     214           fi
     215           ;;
     216       -b* | --b*)
     217           if expr "$1" : '.*-b.*=.*' 2>&1 >/dev/null ; then
     218             buildToolsURL=`echo $1 | sed -n -e 's/[^=]*=\(.*\)/\1/p'`
     219           else
     220             shift
     221             buildToolsURL=$1
     222           fi
     223           if expr "$buildToolsURL" : '.*BuildTools.*' 2>&1 >/dev/null ; then
     224             case $buildToolsURL in
     225               http*) ;;
     226                   *) buildToolsURL=${coinURL}/$buildToolsURL
     227                      ;;
     228             esac
     229           else
     230             echo ''
     231             echo "URL $buildToolsURL does not point to BuildTools."
     232             echo ''
     233             printHelp=1
     234             exitValue=-3
     235            fi
     236           ;;
     237           
     238       -*) echo "$0: unrecognised command line switch '"$1"'."
     239           printHelp=1
     240           exitValue=-1
     241           ;;
     242        *) stableURL=$1
     243           if expr "$stableURL" : '.*/stable/.*' 2>&1 >/dev/null ; then
     244             case $stableURL in
     245               http*) ;;
     246                   *) stableURL=${coinURL}/$stableURL
     247                      ;;
     248             esac
     249           else
     250             echo ''
     251             echo "URL $stableURL does not specify a stable release."
     252             echo ''
     253             printHelp=1
     254             exitValue=-2
     255           fi
     256           ;;
     257    esac
     258    shift
     259  done
     260
     261# Consistency checks: Make sure that the stable URL exists. If we're building
     262# a ThirdParty or Data release, we need a BuildTools URL.
     263
     264  if test $printHelp = 0 && test $exitValue = 0 ; then
     265    if svn list $stableURL 2>&1 >/dev/null ; then
     266      :
     267    else
     268      echo "Stable URL $stableURL does not seem to exist."
     269      printHelp=1
     270      exitValue=-5
     271    fi
     272  fi
     273  if test $printHelp = 0 && test $exitValue = 0 ; then
     274    case $stableURL in
     275      *ThirdParty/* )
     276        isThirdParty=yes
     277        ;;
     278      *Data/* )
     279        isData=yes
     280        ;;
     281      *)
     282        ;;
     283    esac
     284    if test $isThirdParty = yes || test $isData = yes ; then
     285      if test -z $buildToolsURL ; then
     286        echo "You must provide a BuildTools URL to build a ThirdParty or Data project."
     287        printHelp=1
     288        exitValue=-4
     289      else
     290        if svn list $buildToolsURL 2>&1 >/dev/null ; then
     291          :
     292        else
     293          echo "BuildTools URL $buildToolsURL does not seem to exist."
     294          printHelp=1
     295          exitValue=-6
     296        fi
     297      fi
     298    fi
     299  fi
     300fi
     301
     302if test $printHelp = 1 ; then
    18303  cat <<EOF
    19 Usage: prepare_new_release stable_repos
    20 
    21 stable_repos is the URL for the stable branch of your project, for which
    22 you want to create a new release.  You can specify the entire URL, or you
    23 just enter what comes after "https://projects.coin-or.org/svn".  A typical
    24 example is
     304Usage: prepare_new_release <stableBranch> [options]
     305
     306COIN standard practice is to generate periodic releases by taking a snapshot
     307of the stable branch of the project.  You can use this script to prepare
     308a new release based on the specified stable branch.
     309
     310Stable_branch specifies the stable branch of your project to be used to
     311create the new release.  You can specify the entire URL, or you just enter
     312what comes after "https://projects.coin-or.org/svn".  A typical example is
    25313
    26314  prepare_new_release Ipopt/stable/3.3
    27315
    28 You can use this script to prepare a new release based on the specified
    29 stable branch.
     316Options:
     317  -b <BuildToolsURL>    URL for BuildTools; required to generate a release
     318                        for a ThirdParty or Data project.
     319  -s <projectlist>      Comma-separated list of projects with circular
     320                        dependencies on this project. The stable branch of
     321                        projects in this list will be used while testing, on
     322                        the assumption that simultaneous releases will be
     323                        created as the release candidates are committed.
     324  -i                    Ignore BuildTools version mismatches in externals.
    30325
    31326This script will do the following:
    32327
    33 - automatically determine the next release number
    34 - check out a clean copy of the stable version specified
    35 - update the externals to point to the latest releases in the dependencies
    36   (for the same stable branch as specified in the Externals script)
    37 - update the version number in your configure.ac files
    38 - receive the code for the externals
    39 - use the "get.*" scripts to download ThirdParty code (if there are any)
    40 - rerun the autotools
    41 - check if all dependencies are using the same version of the BuildTools
    42 - run the configure script and compile the code
    43 - run the unit test
     328  - Automatically determine the next release number (X.Y.0 if this is the
     329    first release for stable/X.Y, otherwise one greater than any existing
     330    release)
     331  - Check out a clean copy of the specified stable branch, without externals
     332  - Read the Externals file and create a new Externals file for the release
     333    by converting references to stable branches to references to the most
     334    recent release for that stable branch.
     335  - Create a new package configure.ac file with the release version number
     336    specified in the AC_INIT macro.
     337  - Set the svn:externals property for the release package and check out the
     338    code for the externals.
     339  - Use the "get.*" scripts to download any ThirdParty code.
     340  - Execute run_autotools to update configure, Makefile.in, etc., to reflect
     341    the most recent release of BuildTools.
     342  - Check that all dependencies are using the same version of the BuildTools
     343  - Run the configure script, compile the code, and run the unit test.
     344  - Replace any stable references in Externals (specified with -s) with the
     345    appropriate (yet to be committed) release.
    44346
    45347If there is any error during these tasks the script will stop and you should
    46348examine the output.
    47349
    48 If the script terminates successfully, you could have a look at the output,
    49 particularly at the output of the unit test ('make test') and the
    50 chosen Externals.
    51 
    52 So far, no changes will have been made to the repository.  If you want to
     350If the script completes without error, examine the output, particularly the
     351output of the unit test ('make test') and the set of externals specified in
     352the Externals file.
     353
     354This script does not make any changes to the repository.  If you want to
    53355commit the new release, run the "commit_new_release" script, as described
    54356at the end of the output.
    55357
    56358EOF
    57   exit 0
    58 fi
    59 
    60 stable_url=$1
    61 if (echo $stable_url | grep -E 'stable/' >/dev/null); then :; else
    62   echo ''
    63   echo 'This URL is not for a stable release. Exiting.'
    64   echo ''
    65   exit -2
    66 fi
    67 
    68 case $stable_url in
    69   http*) ;;
    70   *)
    71     stable_url=https://projects.coin-or.org/svn/$stable_url
    72     ;;
    73 esac
    74 
    75 base_url=`echo $stable_url | sed -e 's|/stable/[0-9\.]*||'`
    76 echo "Base URL..........: $base_url"
    77 echo "Stable URL........: $stable_url"
    78 stable_branch=`echo $stable_url | sed -e 's|.*/stable/]*||'`
    79 echo "Stable branch.....: $stable_branch"
    80 
    81 # finding out which releases already exist for that stable branch
    82 echo ''
    83 echo '===> Checking for current releases for this branch...'
    84 tmp=`svn list $base_url/releases/`
    85 release_vers=
    86 for i in $tmp; do
    87   i=`echo $i | sed -e 's|/||g'`
    88   case $i in
    89     $stable_branch.*) release_vers="$release_vers $i";;
    90   esac;
    91 done
    92 
    93 # Determine latest release number
    94 new_rel=-10000
    95 for i in $release_vers; do
    96   echo "     $i"
    97   rel=`echo $i | sed -e "s|^$stable_branch.||"`
    98   if test $rel -gt $new_rel; then
    99     new_rel=$rel
    100   fi
    101 done
    102 
    103 if test $new_rel = -10000; then
    104   new_rel=0
    105 elif test $new_rel = 0; then
    106   new_rel=1
     359fi
     360
     361if test $exitValue != 0 || test $printHelp = 1 ; then
     362  exit $exitValue
     363fi
     364
     365# End of parameter parsing. We have a stable URL to work with.  Tell the
     366# user what we've seen.
     367
     368stableURL=`echo $stableURL | sed -e 's|/$||'`
     369if test $isData = yes ; then
     370  stableProj=`echo $stableURL | sed -n -e 's|.*/[^/]*/stable/[0-9.]*/\(.*\)|\1|p'`
     371  baseURL=`echo $stableURL | sed -e 's|\(.*\)/stable/[0-9.]*/\(.*\)|\1/_BB_/_RR_/\2|'`
     372  stableBranch=`echo $stableURL | sed -e 's|.*/stable/\([0-9.]*\)/.*|\1|'`
    107373else
    108   new_rel=`(expr $new_rel + 1)`
    109 fi
    110 new_ver="$stable_branch.$new_rel"
     374  stableProj=`echo $stableURL | sed -n -e 's|.*/\([^/]*\)/stable/.*|\1|p'`
     375  baseURL=`echo $stableURL | sed -e 's|/stable/[0-9.]*||'`
     376  stableBranch=`echo $stableURL | sed -e 's|.*/stable/||'`
     377fi
     378echo "StableProj: $stableProj"
     379echo "Base URL..........: $baseURL"
     380echo "Stable URL........: $stableURL"
     381echo "Stable branch.....: $stableBranch"
     382if test -n "$stableExternals" ; then
     383  echo "Stable externals..: $stableExternals."
     384fi
     385
     386# Find out the most recent release (if any) for the stable branch. List the
     387# existing releases and screen for releases matching stableBranch. The new
     388# release should be one greater than any existing release, or 0 if the stable
     389# branch has no releases.
     390
     391echo ''
     392echo "===> Checking releases for stable branch $stableBranch ..."
     393
     394new_ver=`determine_release "$stableURL" 1`
    111395
    112396echo ''
    113397echo "New release.......: $new_ver"
    114 
    115 echo ''
    116 echo "===> Checking out stable release $stable_branch without externals..."
    117 echo ''
    118 
    119 case $base_url in
    120   *ThirdParty/* )
    121     is_thirdparty=yes
    122     is_data=no
    123     ;;
    124   *Data )
    125     is_thirdparty=no
    126     is_data=yes
    127     ;;
    128   *)
    129     is_thirdparty=no
    130     is_data=no
    131     ;;
    132 esac
    133 
    134 if test $is_thirdparty = yes || test $is_data = yes; then
    135   buildtoolsurl=$2
    136   if test "$buildtoolsurl" == ""; then
    137     echo ''
    138     echo 'For a ThirdParty project you need to provide a URL for BuildTools'
    139     echo 'as second argument.  Exiting.'
    140     echo ''
    141     exit -3
    142   fi
    143   case $buildtoolsurl in
    144     http*) ;;
    145     *)
    146       buildtoolsurl=https://projects.coin-or.org/svn/$buildtoolsurl
    147       ;;
    148   esac
    149 fi
    150 
    151 tmpbas=tmp_checkout
    152 if test $is_thirdparty = yes; then
    153   tmpcodir=$tmpbas/a/b
    154 elif test $is_data = yes; then
    155   tmpcodir=$tmpbas/a
     398buildBase="${stableProj}-$new_ver"
     399echo "Build directory...: $buildBase"
     400if test $isData = yes ; then
     401  releaseURL=`echo $baseURL | sed -e s/_BB_/releases/ -e s/_RR_/$new_ver/`
    156402else
    157   tmpcodir=$tmpbas
    158 fi
    159 
    160 rm -rf $tmpbas
    161 cmd="svn co --ignore-externals $stable_url $tmpcodir"
     403  releaseURL="$baseURL/releases/$new_ver"
     404fi
     405echo "Release URL.......: $releaseURL"
     406
     407# Check out the stable branch that'll be the base of the new release. No
     408# externals at this point. Creating a release of a ThirdParty or Data project
     409# requires a bit of work, as we need to assemble a temporary package with a
     410# BuildTools external.
     411
     412echo ''
     413echo "===> Checking out stable release $stableBranch without externals..."
     414echo ''
     415
     416if test $isThirdParty = yes; then
     417  coDir=$buildBase/a/b
     418elif test $isData = yes; then
     419  coDir=$buildBase/a/b
     420else
     421  coDir=$buildBase
     422fi
     423echo "Checkout directory: $coDir"
     424
     425rm -rf $buildBase
     426cmd="svn co --ignore-externals $stableURL $coDir"
    162427echo $cmd
    163428eval $cmd
    164429
    165 if test $is_thirdparty = yes || test $is_data = yes; then
     430if test $isThirdParty = yes || test $isData = yes; then
    166431  echo ''
    167432  echo '===> Checking out BuildTools for ThirdParty project...'
    168433  echo ''
    169   cmd="svn co $buildtoolsurl $tmpbas/BuildTools"
     434  cmd="svn co $buildToolsURL $buildBase/BuildTools"
    170435  echo $cmd
    171436  eval $cmd
    172437fi
    173438
    174 tmpcodir=`cd $tmpcodir; pwd`
    175 tmpbas=`cd $tmpbas; pwd`
    176 
    177 cd $tmpcodir
     439coDir=`cd $coDir; pwd`
     440buildBase=`cd $buildBase; pwd`
     441
     442cd $coDir
     443
     444# Find configure.ac files for the package and project and update the version.
     445# We have no externals at this point, so there will be two files for a
     446# standard project, one for a ThirdParty project, and none for a Data project.
    178447
    179448echo ''
     
    191460  svn di $i
    192461done
     462
     463# Now fix up the Externals file, if it exists. References to stable branches
     464# will be converted to references to releases unless the reference is to a
     465# project in the stableExternals list. Each line in an Externals file has the
     466# format <ext_name> <ext_url>. The reference must be to a stable branch.
    193467
    194468if test -r Externals; then
     
    206480    else
    207481      ext_url=$i
    208       if (echo $ext_url | grep -E 'stable/' >/dev/null); then :; else
     482      if (echo $ext_name | grep -E '^#' >/dev/null); then
     483        echo "Skip $ext_name $ext_url."
     484        ext_name=
     485        continue
     486      fi                                   
     487      if (echo $ext_url | grep -E 'stable/|releases/' >/dev/null); then
     488        :;
     489      else
    209490        echo ''
    210         echo "The external URL $ext_url is not for a stable branch. Exiting."
     491        echo "The external URL $ext_url is not a stable branch or release. Exiting."
    211492        echo ''
    212493        exit -2
    213494      fi
    214    
     495
    215496      ext_base_front=`echo $ext_url | sed -e 's|/stable/.*||'`
    216       ext_base_end=`echo $ext_url | sed -e 's|.*/stable/[0-9\.]*||'`
    217       ext_stable_branch=`echo $ext_url | sed -e 's|.*/stable/]*||' -e s"|$ext_base_end||"`
    218 
    219       echo "Determining release replacement for $ext_name:"
    220       tmp=`svn list $ext_base_front/releases/`
    221       ext_release_vers=
    222       for i in $tmp; do
    223         i=`echo $i | sed -e 's|/||g'`
    224         case $i in
    225           $ext_stable_branch.*) ext_release_vers="$ext_release_vers $i";;
    226         esac;
    227       done
    228       # Determine latest release number
    229       ext_latest=-10000
    230       for i in $ext_release_vers; do
    231         rel=`echo $i | sed -e "s|^$ext_stable_branch.||"`
    232         if test $rel -gt $ext_latest; then
    233           ext_latest=$rel
    234         fi
    235       done
    236       if test $ext_latest = -10000; then
    237         echo ''
    238         echo "Error: No release for $ext_name for its stable defined in External"
    239         echo ''
    240         exit -5
    241       fi
    242 
    243       if test "$ext_base_end" = ""; then
    244         ext_rel_url=$ext_base_front/releases/$ext_stable_branch.$ext_latest
     497      ext_proj=`echo $ext_base_front | sed -e 's|.*/\([^/]*\)|\1|'`
     498
     499      if expr "$stableExternals" : '.*'"$ext_proj"'.*' 2>&1 >/dev/null ; then
     500        echo "Using stable reference for $ext_name."
     501        ext_rel_url=$ext_url
     502      elif expr "$ext_url" : '.*releases/.*' 2>&1 >/dev/null ; then
     503        echo "Using specified release for $ext_name."
     504        ext_rel_url=$ext_url
    245505      else
    246         ext_rel_url=$ext_base_front/releases/$ext_stable_branch.$ext_latest$ext_base_end
     506        ext_stable=`echo $ext_url | sed -e 's|\(.*/stable/[0-9\.]*\).*|\1|'`
     507        ext_base_end=`echo $ext_url | sed -e 's|.*/stable/[0-9\.]*||'`
     508
     509        echo "Determining release replacement for $ext_name:"
     510        ext_latest=`determine_release $ext_stable 0`
     511
     512        if test "$ext_base_end" = ""; then
     513          ext_rel_url=$ext_base_front/releases/$ext_latest
     514        else
     515          ext_rel_url=$ext_base_front/releases/$ext_latest$ext_base_end
     516        fi
    247517      fi
    248518
    249519      echo "  $ext_rel_url"
    250       echo "$ext_name  $ext_rel_url" >> Externals.releases
     520      echo "$ext_name  $ext_rel_url" >>Externals.releases
    251521      ext_name=
    252522    fi
    253523  done
    254524
     525  echo ''
    255526  echo '===> Creating backup (.bak) for Externals'
    256527  mv Externals Externals.bak
     
    285556            cd $ext_name
    286557            echo "Running $getfile -patch in `pwd`"
    287 #           mv $getfile $getfile.orig
    288 #           sed -e 's+ftp://+http://+g' $getfile.orig > $getfile
    289 #           chmod +x $getfile
    290558            eval ./$getfile -patch
    291 #           mv $getfile.orig $getfile
    292559            cd "$curdir"
    293560          fi
     
    299566fi # if test -r Externals
    300567
    301 if test $is_thirdparty = yes; then
    302   pkg=`echo $base_url | sed -e 's|.*/||g'`
     568if test $isThirdParty = yes; then
     569  pkg=`echo $baseURL | sed -e 's|.*/||g'`
    303570  if test -r get.$pkg; then
    304571    echo ''
     
    313580echo ''
    314581
    315 if test $is_thirdparty = yes; then
     582if test $isThirdParty = yes; then
    316583  curdir=`pwd`
    317584  cd ../..
    318585  BuildTools/run_autotools
    319586  cd "$curdir"
    320 elif test $is_data = yes; then
     587elif test $isData = yes; then
    321588  curdir=`pwd`
    322   cd ..
     589  cd ../..
    323590  BuildTools/run_autotools
    324591  cd "$curdir"
     
    357624  if test -r problems.ext; then
    358625    echo ''
    359     echo 'PROBLEM DURING CONSITENCY CHECK:'
     626    echo 'PROBLEM DURING CONSISTENCY CHECK:'
    360627    echo ''
    361628    echo 'Please contact the project manager(s) for the following project(s).'
     
    365632    echo ''
    366633    rm -f problems.ext
    367     exit -2
     634    if test $ignoreBuildToolsMismatch = 0 ; then
     635      exit -2
     636    else
     637      echo "Continuing in spite of BuildTools mismatch."
     638    fi
    368639  fi
    369640  rm -f problems.ext
    370641fi # if test -r Externals
    371642
    372 if test $is_thirdparty != yes && test $is_data != yes; then
     643if test $isThirdParty != yes && test $isData != yes; then
    373644  (set -e
    374645   echo ''
     
    377648   mkdir build
    378649   cd build
    379    cmd="$tmpcodir/configure -C --enable-maintainer-mode"
     650   cmd="$coDir/configure -C --enable-maintainer-mode"
    380651   echo $cmd
    381652   eval $cmd
     
    415686echo ''
    416687echo '===> ALL TESTS PASSED'
    417 if test $is_thirdparty != yes && test $is_data != yes; then
     688if test $isThirdParty != yes && test $isData != yes; then
    418689  echo ''
    419690  echo 'Please review the output above, particularly the one of make test'
    420691fi
     692
     693# Do we need to plug in nonexistent releases for circular dependencies tested
     694# with the stable versions? If so, generate a new Externals.release. This is
     695# the only reason stable references should appear in the Externals file for a
     696# release, so we don't need to check further before removing them.
     697
     698if test -n "$stableExternals" ; then
     699  echo "Grooming Externals to remove stable references used for testing."
     700  rm -rf Externals.releases
     701  ext_name=
     702  ext_url=
     703  for i in `cat Externals`; do
     704    if test "$ext_name" = ""; then
     705      ext_name="$i"
     706    else
     707      ext_url=$i
     708      if (echo $ext_url | grep -E 'stable/' >/dev/null); then
     709        echo "Determining release replacement for $ext_name:"
     710        ext_stable=`echo $ext_url | sed -e 's|\(.*/stable/[0-9\.]*\).*|\1|'`
     711        ext_latest=`determine_release $ext_stable 1`
     712        ext_rel_url=`echo $ext_url | sed -e "s|stable/[0-9.]*|releases/$ext_latest|"`
     713        echo "  $ext_rel_url"
     714      else
     715        ext_rel_url=$ext_url
     716      fi
     717      echo "$ext_name  $ext_rel_url" >>Externals.releases
     718      ext_name=
     719    fi
     720  done
     721  mv Externals.releases Externals
     722  svn propset -F Externals svn:externals .
     723fi
     724
     725
    421726if test -r Externals; then
    422727  echo ''
    423   echo 'Also, please check the Externals:'
    424   cat Externals
     728  echo 'Also, please confirm the Externals are correct:'
     729  svn propget svn:externals
    425730fi
    426731
     
    429734echo 'the directory'
    430735echo ''
    431 echo "          $tmpcodir"
     736echo "          $coDir"
    432737echo ''
    433738echo "and run the commit_new_release script"
    434739
    435740cat >.new_release_data <<EOF
    436 tmpcodir=$tmpcodir
    437 tmpbas=$tmpbas
    438 base_url=$base_url
    439 stable_url=$stable_url
     741isData=$isData
     742coDir=$coDir
     743buildBase=$buildBase
     744releaseURL=$releaseURL
     745stableURL=$stableURL
    440746new_ver=$new_ver
    441 stable_branch=$stable_branch
     747stableBranch=$stableBranch
    442748EOF
Note: See TracChangeset for help on using the changeset viewer.