From 7649f31d5243fff8d2f407d33baa346e04c8c539 Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Feb 18 2011 23:16:23 +0000 Subject: Update cli_getPathComponents.sh. Do not combine release pattern inside architecture pattern. Keep them separated one another so they can be used individually without confussion. --- diff --git a/Scripts/Bash/Functions/cli_getPathComponent.sh b/Scripts/Bash/Functions/cli_getPathComponent.sh index 5d715cc..6d0d078 100755 --- a/Scripts/Bash/Functions/cli_getPathComponent.sh +++ b/Scripts/Bash/Functions/cli_getPathComponent.sh @@ -51,8 +51,9 @@ function cli_getPathComponent { # Define release pattern. PATTERN[0]="(([[:digit:]]+)(\.([[:digit:]]+)){,1})" - # Define architecture pattern. - PATTERN[1]="^.+/${PATTERN[0]}/(i386|x86_64)/.*$" + # Define architecture pattern. Make it match the architectures the + # CentOS distribution is able to be installed on. + PATTERN[1]="(i386|x86_64)" # Define theme pattern for trunk, branches, and tags directory # structures. @@ -185,15 +186,15 @@ function cli_getPathComponent { case "$OPTION" in '--release' ) - echo "$LOCATION" | sed -r "s!.+/${PATTERN[0]}/.*!\1!" + echo "$LOCATION" | sed -r "s!.+/${PATTERN[0]}/?!\1!" ;; '--release-major' ) - echo "$LOCATION" | sed -r "s!.+/${PATTERN[0]}/.*!\2!" + echo "$LOCATION" | sed -r "s!.+/${PATTERN[0]}/?!\2!" ;; '--release-minor' ) - echo "$LOCATION" | sed -r "s!.+/${PATTERN[0]}/.*!\4!" + echo "$LOCATION" | sed -r "s!.+/${PATTERN[0]}/?!\4!" ;; '--release-pattern' ) @@ -201,7 +202,7 @@ function cli_getPathComponent { ;; '--architecture' ) - echo "$LOCATION" | sed -r "s!${PATTERN[1]}!\5!" + echo "$LOCATION" | sed -r "s!${PATTERN[1]}!\1!" ;; '--architecture-pattern' )