Changeset 1841


Ignore:
Timestamp:
Nov 20, 2010 2:11:12 PM (9 years ago)
Author:
lou
Message:

Add option to suppress conversion from stable to release for specified
projects.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/set_externals

    r1593 r1841  
    3636depFile=
    3737
     38# stableExternals specifies externals which we do not want to convert to
     39# releases, for whatever reason.
     40
     41stableExternals=
     42
    3843if test "$#" -eq 0; then
    3944  printHelp=1
     
    4651    case "$1" in
    4752      -h* | --h*) printHelp=1 ;;
    48            
     53      -s* | --s*)
     54           if expr "$1" : '.*-s.*=.*' 2>&1 >/dev/null ; then
     55             stableExternals=`echo $1 | sed -n -e 's/[^=]*=\(.*\)/\1/p'`
     56           else
     57             shift
     58             stableExternals=$1
     59           fi
     60           ;;
    4961       -*) echo "$0: unrecognised command line switch '"$1"'."
    5062           printHelp=1
     
    5971
    6072# Find the most recent release for each stable external. Allow for the
    61 # possibility that a stable branch has no associated release.
     73# possibility that a stable branch has no associated release, or that the
     74# user has asked to keep the stable external.
    6275
    6376if test $printHelp = 0 && test $exitValue = 0; then
     
    8295          continue
    8396        fi                                   
    84         extType=`extractTypeFromURL $ext_url`
    85         if test "$extType" = invalid ; then
    86           echo ''
    87           echo "The external URL $ext_url appears to be invalid. Exiting."
    88           echo ''
    89           exit 3
    90         fi
     97        if expr "$stableExternals" : '.*'"$ext_name"'.*' 2>&1 >/dev/null ; then
     98          echo "    $ext_name $ext_url unchanged"
     99        else
     100          extType=`extractTypeFromURL $ext_url`
     101          if test "$extType" = invalid ; then
     102            echo ''
     103            echo "The external URL $ext_url appears to be invalid. Exiting."
     104            echo ''
     105            exit 3
     106          fi
    91107
    92         if test "$extType" = stable ; then
    93           ext_majVer=`extractMajorFromURL $ext_url`
    94           ext_minVer=`extractMinorFromURL $ext_url`
    95           ext_rel_url=`bestRelease $ext_url $ext_majVer $ext_minVer`
    96           if test -z "$ext_rel_url" ; then
    97             echo "There is no release for $ext_url"
     108          if test "$extType" = stable ; then
     109            ext_majVer=`extractMajorFromURL $ext_url`
     110            ext_minVer=`extractMinorFromURL $ext_url`
     111            ext_rel_url=`bestRelease $ext_url $ext_majVer $ext_minVer`
     112            if test -z "$ext_rel_url" ; then
     113              echo "There is no release for $ext_url"
     114              echo "Keeping $ext_url"
     115            else
     116              # Normal (not BuildTools/ThirdParty/Data) need a directory name,
     117              # and it may differ from the project name. Carefully preserve it.
     118              # ThirdParty URLs include BuildTools ; both named for emphasis
     119              case $ext_rel_url in
     120                */BuildTools/* | */ThirdParty/* | */Data/* ) ;;
     121                *) ext_tail=`extractTailFromExt $ext_url`
     122                   ext_rel_url=${ext_rel_url}${ext_tail}
     123                   ;;
     124              esac
     125              echo "Replacing $ext_url with $ext_rel_url"
     126              ext_url=$ext_rel_url
     127            fi
     128          else
    98129            echo "Keeping $ext_url"
    99           else
    100             # Normal (not BuildTools/ThirdParty/Data) need a directory name,
    101             # and it may differ from the project name. Carefully preserve it.
    102             # ThirdParty URLs include BuildTools ; both named for emphasis
    103             case $ext_rel_url in
    104               */BuildTools/* | */ThirdParty/* | */Data/* ) ;;
    105               *) ext_tail=`extractTailFromExt $ext_url`
    106                  ext_rel_url=${ext_rel_url}${ext_tail}
    107                  ;;
    108             esac
    109             echo "Replacing $ext_url with $ext_rel_url"
    110             ext_url=$ext_rel_url
    111130          fi
    112         else
    113           echo "Keeping $ext_url"
    114131        fi
    115132
     
    141158Usage: set_externals <Dependency File>
    142159
     160Options:
     161  -s <projectlist>      Suppress conversion from stable to release for the
     162                        listed externals (comma-separated list of project
     163                        names, e.g., -s Osi,Cbc).
     164
    143165This script takes as input a dependency file containing a list of stable
    144166versions of COIN projects on separate lines in the form
     
    146168 <name> <URL of stable version>
    147169
    148 Recommended practice is to keep this list in a file called "Dependencies" in
    149 the project's root directory. A temporary file called "Externals.releases" in
    150 the same form, but with the URL of each stable version replaced by the URL of
    151 the latest associated release is produced. From this file, the script will
    152 set the svn:externals variable. It does not do an update or commit the
    153 change. After the script runs, do an update and test build, then commit the
    154 change if you are happy.
     170Recommended practice is to keep the set of stable externals in a file
     171called "Dependencies" in the project's root directory. A temporary file
     172called "Externals.releases" in the same form, but with the URL of each
     173stable version replaced by the URL of the latest associated release is
     174produced. From this file, the script will set the svn:externals variable. It
     175does not do an update or commit the change. After the script runs, do an
     176update and test build, then commit the change if you are happy.
    155177
    156178EOF
Note: See TracChangeset for help on using the changeset viewer.