#! /bin/bash #---------------------------------------------------------------------------- # request-params-for-package-checkout.sh # # Creation : 2008-08-17 starwarsfan # Last Update: $Id$ # # Copyright (c) 2001-2009 the eisfair team, team(at)eisfair(dot)org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. #---------------------------------------------------------------------------- # =========================================================================== # Ask for all necessary parameters to call checkout-package script requestParamsForPackageCheckout () { if [ -z "${choosenPackageToWorkOn}" ] then choosePackageToWorkOn rtc=$? if [ ${rtc} -eq ${EXECUTION_ABORTED_ON_REQUEST} ] then return elif [ ${rtc} -ne 0 ] then echo "Error during package selection." echo "Aborting..." return fi fi packageName=${choosenPackageToWorkOn} local leaveFunction=false versionNumber='LATEST' echo "" echo "You want to checkout package '${packageName}' from section '${sectionName}'" echo "or update your local working copy" echo "" echo "What do you want to check out / update?" choice2="The main development line (the 'trunk')" choice3="A bugfix branch (a folder inside of 'branches')" choice4="A tag" PS3="Your choice: " select userInput in "${msgAbortOperation}" "${choice2}" "${choice3}" "${choice4}" do case ${userInput} in "${msgAbortOperation}") leaveFunction=true break ;; "${choice2}") version='' break ;; "${choice3}") echo "" echo -n "Updating list of available branches: " updateFile --not-recursive ../../${branchesDir}/${sectionName}/${packageName} echo "Done" echo "" echo "These are the available branches. To select a branch type one of the given numbers: " # select userInput in "${msgAbortOperation}" `svn ls ../../${tagsDir}/${sectionName}/${packageName} | sed "s#_# #g" | sed "s#/\\$##g" | sed "s#^#\"#g" | sed "s#\\$#\"#g"` select userInput in "${msgAbortOperation}" "${msgUseLatest}" `svn ls ../../${branchesDir}/${sectionName}/${packageName}` do case ${userInput} in "${msgAbortOperation}" ) leaveFunction=true break 2 ;; "${msgUseLatest}" ) versionToCheckout="LATEST" targetToCheckout='' break ;; *) versionToCheckout=`echo ${userInput} | cut -d "_" -f1` targetToCheckout=`echo ${userInput} | cut -d "_" -f2` majorToCheckout=`echo ${versionToCheckout} | cut -d "." -f1` minorToCheckout=`echo ${versionToCheckout} | cut -d "." -f2` echo "Checkout version ${majorToCheckout}.${minorToCheckout}, target ${targetToCheckout}" break ;; esac echo "Please choose the number of one of the entries above! " done version="--bugfix ${majorToCheckout}.${minorToCheckout}" target="--target ${targetToCheckout}" break ;; "${choice4}") echo "" echo -n "Updating list of available tags: " updateFile --not-recursive ../../${tagsDir}/${sectionName}/${packageName} echo "Done" echo "" echo "These are the available tags. To select a tag type one of the given numbers: " # select userInput in "${msgAbortOperation}" `svn ls ../../${tagsDir}/${sectionName}/${packageName} | sed "s#_# #g" | sed "s#/\\$##g" | sed "s#^#\"#g" | sed "s#\\$#\"#g"` select userInput in "${msgAbortOperation}" "${msgUseLatestTesting}" "${msgUseLatestStable}" `svn ls ../../${tagsDir}/${sectionName}/${packageName}` do case ${userInput} in "${msgAbortOperation}" ) leaveFunction=true break 2 ;; "${msgUseLatestTesting}" ) versionToCheckout="LATEST-TESTING" targetToCheckout='' break ;; "${msgUseLatestStable}" ) versionToCheckout="LATEST-STABLE" targetToCheckout='' break ;; *) versionToCheckout=`echo ${userInput} | cut -d "_" -f1` targetToCheckout=`echo ${userInput} | cut -d "_" -f2` echo "Checkout version ${versionToCheckout}, target ${targetToCheckout}" break ;; esac echo "Please choose the number of one of the entries above! " done version="--tag ${versionToCheckout}" target="--target ${targetToCheckout}" break ;; *) echo "Please enter a number from 1 to 4: " ;; esac done if ! ${leaveFunction} then echo "" echo "" echo "=============================================================================" myecho "" myecho "Invoking '${scriptCheckoutPackage} ${version} ${target} ${packageName}'" ${scriptCheckoutPackage} ${version} ${target} ${packageName} handleError "${scriptCheckoutPackage}" $? fi }