#! /bin/bash #------------------------------------------------------------------------------ # check-parameters.sh - this script checks the given parameters for # mktarball.sh # # Creation : 2007-12-20 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. #------------------------------------------------------------------------------ # ----------------------------------------------------------------------------- # checkParameters # ----------------------------------------------------------------------------- checkParameters () { # ------------------ # is $package given? if ! ${packageGiven} then echo "You have to enter at least one package name as the last parameter" echo "" showUsage return ${NO_PACKAGE_GIVEN} # ---------------------------------- # is the state of the package given? elif [ ${setStable} == false -a ${setTesting} == false -a ${setBugfix} == false -a ${setTaged} == false ] then if ! ${quietMode} then echo "You did not gave one of the params '--stable', '--testing', '--bugfix' or" echo "'--tag'. So ignoring the package state and create the package right out" echo "of the trunk. Creation and checkout of tag and bugfix branch is disabled too." fi ignorePackageState=true createBugfixBranch=false checkoutBugfixBranch=false checkoutBugfixBranchParam='' createTag=false checkoutTag=false checkoutTagParam='--no-checkout' fi # -------------------------------------------------------------------------------- # if a testing or bugfix release ist created, then no bugfix branch can be created # ${setStable} is false if a testing or bugfix should be created if [ ${setStable} == false -a ${createBugfixBranch} == true ] then echo "Bugfix branches can only be created for stable releases." echo "Disabling bugfix branch creation." createBugfixBranch=false checkoutBugfixBranch=false checkoutBugfixBranchParam='' fi # ---------------------------------------------------------------------- # if a version out of a tag should be created, then no new tag is needed if [ $setTaged == true -a $createTag == true ] then echo "You cannot create a package out of a tag and create a new tag!" echo "Disabling create tag and checkout tag." createTag=false checkoutTag=false fi # ------------------------------------------------------ # If version should _not_ be updated, disable everything # depending on the version number if ! ${updateVersion} then createTag=false checkoutTag=false createBugfixBranch=false checkoutBugfixBranch=false myecho "Parameter '--update-version-number' not given, so creation and checkout of bugfix branch and tag is disabled." fi # --------------------------------------------------------------------- # If a build out of a tag or a bugfix branch should be done and if a # version number is given (which means the build should _not_ build the # latest version), then the target number is required too. if [ ${setBugfix} == true -o ${setTaged} == true ] then if [ ${versionToSetGiven} == true -a ${targetToBuildGiven} == false ] || [ ${versionToSetGiven} == false -a ${targetToBuildGiven} == true ] then echo "" echo "!!! If you want to build a package out of a tag or a branch which is not the" echo " latest version, you must specify the version and the build target! See" echo " parameters '--version' and '--target'." echo "" return ${WRONG_PARAMETER} fi fi return 0 }