Changeset 1556
- Timestamp:
- Jun 2, 2010 6:52:07 PM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/set_externals
r1369 r1556 7 7 # It is part of the BuildTools project in COIN-OR (www.coin-or.org) 8 8 # 9 # # $Id: prepare_new_release 1302 2009-06-07 18:17:53Z stefan$9 # $Id$ 10 10 # 11 # This script is based on prepare_new_release, which is authored by 12 # Author: Andreas Waechter IBM 2007-06-21 13 # Modified: Lou Hafer SFU 2008-01-20 14 # 15 # The modifications to set_externals were made by 16 # Ted Ralphs Lehigh University 2009-07-07 17 # 11 12 # Adapted from prepare_new_release by Ted Ralphs, Lehigh Univ., 2009-07-07 13 # Modified: Lou Hafer SFU 2010-06-02 18 14 19 15 #set -x -v 20 16 set -e 21 17 22 determine_release () 23 { 24 drtmp_stableBranch=`echo $1 | sed -e 's|.*/stable/||'` 25 drtmp_baseURL=`echo $1 | sed -e 's|/stable/[0-9.]*||'` 26 drtmp_returnVal= 18 # Know thy self. If there are no '/' chars in the command name, we're running 19 # in the currrent directory. Otherwise, strip the command name, leaving the 20 # prefix. Coin-functions is expected to live in the same directory. 27 21 28 # List the existing releases and screen for releases matching stableBranch. 22 if expr "$0" : '.*/.*' >/dev/null 2>&1 ; then 23 cmdDir=`echo $0 | sed -e 's,\(.*\)/[^/]*,\1,'` 24 else 25 cmdDir='.' 26 fi 27 if test -r $cmdDir/coin-functions ; then 28 . $cmdDir/coin-functions 29 else 30 echo "Cannot find utility functions file coin-functions; exiting." 31 fi 29 32 30 drtmp_svnlst=`svn list $drtmp_baseURL/releases/`31 32 drtmp_release_vers=33 for drtmp_i in $drtmp_svnlst ; do34 case $drtmp_i in35 $drtmp_stableBranch.*)36 drtmp_i=`echo $drtmp_i | sed -e 's|/$||'`37 drtmp_release_vers="$drtmp_release_vers $drtmp_i";;38 esac;39 done40 41 # Are there any existing releases? If not, and the user didn't ask for the42 # next release, we have an error.43 44 if test -z "$drtmp_release_vers" ; then45 if test $2 = 1 ; then46 drtmp_returnVal="$drtmp_stableBranch.0"47 else48 drtmp_returnVal="Error"49 fi50 else51 52 # There are releases. If we don't have one after the loop, we're confused.53 54 drtmp_new_rel=-1000055 for drtmp_i in $drtmp_release_vers; do56 drtmp_rel=`echo $drtmp_i | sed -e "s|^$drtmp_stableBranch.||"`57 if test $drtmp_rel -gt $drtmp_new_rel; then58 drtmp_new_rel=$drtmp_rel59 fi60 done61 62 if test $drtmp_new_rel = -10000; then63 drtmp_new_rel="Error"64 elif test $2 = 1 ; then65 drtmp_new_rel=`expr $drtmp_new_rel + 1`66 fi67 drtmp_returnVal="$drtmp_stableBranch.$drtmp_new_rel"68 fi69 70 echo $drtmp_returnVal71 }72 33 73 34 printHelp=0 74 35 exitValue=0 75 Dependencies=36 depFile= 76 37 77 38 if test "$#" -eq 0; then … … 88 49 -*) echo "$0: unrecognised command line switch '"$1"'." 89 50 printHelp=1 90 exitValue= -151 exitValue=1 91 52 ;; 92 *) Dependencies=$153 *) depFile=$1 93 54 ;; 94 55 esac … … 97 58 fi 98 59 99 # End of parameter parsing. We have a stable URL to work with. Tell the 100 # user what we've seen. 101 102 # Find out the most recent release (if any) for the stable branch. List the 103 # existing releases and screen for releases matching stableBranch. The new 104 # release should be one greater than any existing release, or 0 if the stable 105 # branch has no releases. 60 # Find the most recent release for each stable external. Allow for the 61 # possibility that a stable branch has no associated release. 106 62 107 63 if test $printHelp = 0 && test $exitValue = 0; then 108 if test -r $ Dependencies; then64 if test -r $depFile; then 109 65 110 66 rm -f Externals.releases 111 67 112 68 echo '' 113 echo '===> C reating new externals file with pointers to releases...'69 echo '===> Converting stable externals to releases ...' 114 70 echo '' 115 71 116 72 ext_name= 117 73 ext_url= 118 for i in `cat $ Dependencies`; do74 for i in `cat $depFile`; do 119 75 if test "$ext_name" = ""; then 120 76 ext_name="$i" 121 77 else 122 78 ext_url=$i 123 if (echo $ext_name | grep -E '^#' >/dev/null); then124 echo "Skip $ext_name."79 if expr "$ext_name" : '#.*' >/dev/null 2>&1 ; then 80 echo "Skipping $ext_name." 125 81 ext_name= 126 82 continue 127 83 fi 128 if (echo $ext_url | grep -E 'trunk|stable/|releases/' >/dev/null); then 129 :; 130 else 84 extType=`extractTypeFromURL $ext_url` 85 if test "$extType" = invalid ; then 131 86 echo '' 132 echo "The external URL $ext_url is notvalid. Exiting."87 echo "The external URL $ext_url appears to be invalid. Exiting." 133 88 echo '' 134 exit -289 exit 3 135 90 fi 136 91 137 ext_base_front=`echo $ext_url | sed -e 's|/stable/.*||'` 138 ext_proj=`echo $ext_base_front | sed -e 's|.*/\([^/]*\)|\1|'` 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" 98 echo "Keeping $ext_url" 99 else 100 # Normal (not BuildTools/ThirdParty/Data) need a project name 101 # ThirdParty URLs include BuildTools ; both named for emphasis 102 case $ext_rel_url in 103 *BuildTools* | *ThirdParty* | *Data* ) ;; 104 *) ext_proj=`extractProjFromURL $ext_rel_url` 105 ext_rel_url=${ext_rel_url}${ext_proj} 106 ;; 107 esac 108 echo "Replacing $ext_url with $ext_rel_url" 109 ext_url=$ext_rel_url 110 fi 111 else 112 echo "Keeping $ext_url" 113 fi 139 114 140 if expr "$ext_url" : '.*releases/.*' 2>&1 >/dev/null ; then 141 echo "Using specified release for $ext_name." 142 ext_rel_url=$ext_url 143 elif expr "$ext_url" : '.*trunk.*' 2>&1 >/dev/null; then 144 echo "Using specified trunk for $ext_name." 145 ext_rel_url=$ext_url 146 else 147 ext_stable=`echo $ext_url | sed -e 's|\(.*/stable/[0-9\.]*\).*|\1|'` 148 ext_base_end=`echo $ext_url | sed -e 's|.*/stable/[0-9\.]*||'` 149 150 echo "Determining release for $ext_name:" 151 ext_latest=`determine_release $ext_stable 0` 152 153 if test "$ext_base_end" = ""; then 154 ext_rel_url=$ext_base_front/releases/$ext_latest 155 else 156 ext_rel_url=$ext_base_front/releases/$ext_latest$ext_base_end 157 fi 158 fi 159 160 echo " $ext_rel_url" 161 echo "$ext_name $ext_rel_url" >>Externals.releases 115 echo "$ext_name $ext_url" >>Externals.releases 162 116 ext_name= 163 117 fi … … 168 122 echo '' 169 123 170 svn pset svn:externals -F Externals.releases . 124 svn propset svn:externals -F Externals.releases . 125 svn propget svn:externals . 171 126 172 127 rm Externals.releases 173 128 174 else # if test -r Dependencies129 else # if test -r depFile 175 130 echo "" 176 131 echo "Dependency file does not exist or is unspecified..." 177 132 echo "" 178 133 printHelp=1 179 exitvalue= -2134 exitvalue=2 180 135 fi 181 136 fi
Note: See TracChangeset
for help on using the changeset viewer.