From a615b01477abff9e6ead74af856e2f47cb68ac91 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 20 2011 03:43:30 +0000 Subject: Update render_getActions.sh: - Add `--architecture' option. - Remove common options. They are already interpreted by cli_doParseArgumentsCommon function. - Rename `--identity' option to `--render' option. Since we have `locale' functionality to handle files under trunk/Locales, `manuals' functionality to handle files under trunk/Manuals, it is acceptable to have an `identity' functionality that handles files under trunk/Identity directory structure for the sake of consistency. - Remove Manuals from posible using of pre-rendition configuration scripts. - Add cli_commitRepoChanges before and after function evaluation. --- diff --git a/Scripts/Bash/Functions/Render/render_getActions.sh b/Scripts/Bash/Functions/Render/render_getActions.sh index 463f595..05d0436 100644 --- a/Scripts/Bash/Functions/Render/render_getActions.sh +++ b/Scripts/Bash/Functions/Render/render_getActions.sh @@ -30,7 +30,7 @@ function render_getActions { local ARGSS="" # Define long options we want to support. - local ARGSL="identity:,translation:,filter:,copy:,to:,quiet,yes" + local ARGSL="render:,release:,architecture:,copy:,to:" # Parse arguments using getopt(1) command parser. cli_doParseArguments @@ -44,23 +44,14 @@ function render_getActions { case "$1" in - --identity ) - - # Redefine action value. - ACTIONVAL="$2" + --render ) # Redefine action name. ACTIONNAM="${FUNCNAM}_doIdentity" - # Rotate positional parameters - shift 2 - ;; - - --filter ) + # Redefine action value. + ACTIONVAL="$2" - # Redefine filter (regular expression) flag. - FLAG_FILTER="$2" - # Rotate positional parameters shift 2 ;; @@ -77,31 +68,43 @@ function render_getActions { shift 2 ;; - --to ) + --release ) - # Redefine target value flag. - FLAG_TO="$2" + # Redefine release number flag. + FLAG_RELEASE="$2" + + # Verify release number flag. + if [[ ! $FLAG_RELEASE =~ $(cli_getPathComponent '--release-pattern') ]];then + cli_printMessage "`gettext "The release number provided is not supported."`" 'AsErrorLine' + cli_printMessage "$(caller)" 'AsToKnowMoreLine' + fi # Rotate positional parameters shift 2 ;; - --quiet ) + --architecture ) + + # Redefine architecture flag. + FLAG_ARCHITECTURE="$2" - # Redefine quiet flag. - FLAG_QUIET='true' + # Verify architecture flag. + if [[ ! $FLAG_ARCHITECTURE =~ $(cli_getPathComponent '--architecture-pattern') ]];then + cli_printMessage "`gettext "The architecture provided is not supported."`" 'AsErrorLine' + cli_printMessage "$(caller)" 'AsToKnowMoreLine' + fi # Rotate positional parameters - shift 1 + shift 2 ;; - --yes ) - - # Redefine answer flag. - FLAG_YES='true' + --to ) + + # Redefine target value flag. + FLAG_TO="$2" # Rotate positional parameters - shift 1 + shift 2 ;; * ) @@ -115,20 +118,31 @@ function render_getActions { # copy. cli_checkRepoDirSource - # Redefine pre-rendition configuration directory. Pre-rendition + # Define pre-rendition configuration directory. Pre-rendition # configuration directory is where we store render.conf.sh - # scripts. The render.conf.sh scripts define how each artwork is - # rendered. + # scripts. The render.conf.sh script defines how each identity + # content is rendered. local ARTCONF=$(echo "$ACTIONVAL" \ - | sed -r -e 's!/(Identity|Manuals)!/Scripts/Bash/Functions/Render/Config/\1!' \ + | sed -r -e 's!/(Identity)!/Scripts/Bash/Functions/Render/Config/\1!' \ -e "s!Motifs/$(cli_getPathComponent '--theme')/?!!") + # Check directory of pre-rendition configuration script. + cli_checkFiles "$ARTCONF" 'd' + + # Syncronize changes between the working copy and the central + # repository to bring down changes. + cli_commitRepoChanges + # Execute action name. if [[ $ACTIONNAM =~ "^${FUNCNAM}_[A-Za-z]+$" ]];then eval $ACTIONNAM else - cli_printMessage "`eval_gettext "A valid action is required."`" 'AsErrorLine' + cli_printMessage "`gettext "A valid action is required."`" 'AsErrorLine' cli_printMessage "$(caller)" 'AsToKnowMoreLine' fi + # Syncronize changes between the working copy and the central + # repository to commit up changes. + cli_commitRepoChanges + }