| #!/bin/bash |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| function cli_getPathComponent { |
| |
| |
| local ARGSS='' |
| |
| |
| local ARGSL='release,release-major,release-minor,release-pattern,architecture,architecture-pattern,motif,motif-name,motif-release,motif-pattern' |
| |
| |
| |
| local ARGUMENTS='' |
| |
| |
| local RELEASE="(([[:digit:]]+)(\.([[:digit:]]+)){,1})" |
| |
| |
| |
| local ARCHITECTURE="(i386|x86_64)" |
| |
| |
| local THEME_MOTIF="Identity/Images/Themes/(([[:alnum:]]+)/(${RELEASE}))" |
| |
| |
| cli_parseArgumentsReDef "$@" |
| |
| |
| cli_parseArguments |
| |
| |
| eval set -- "$ARGUMENTS" |
| |
| |
| local LOCATION=$(echo $@ | sed -r 's!^.*--[[:space:]](.+)$!\1!') |
| |
| |
| while true;do |
| |
| case "$1" in |
| |
| --release ) |
| echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\1!" |
| shift 1 |
| break |
| ;; |
| |
| --release-major ) |
| echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\2!" |
| shift 1 |
| break |
| ;; |
| |
| --release-minor ) |
| echo "$LOCATION" | egrep "${RELEASE}" | sed -r "s!.*/${RELEASE}/.*!\4!" |
| shift 1 |
| break |
| ;; |
| |
| --release-pattern ) |
| echo "${RELEASE}" |
| shift 1 |
| break |
| ;; |
| |
| --architecture ) |
| echo "$LOCATION" | egrep "${ARCHITECTURE}" | sed -r "s!${ARCHITECTURE}!\1!" |
| shift 1 |
| break |
| ;; |
| |
| --architecture-pattern ) |
| echo "${ARCHITECTURE}" |
| shift 1 |
| break |
| ;; |
| |
| --motif ) |
| echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\1!" |
| shift 1 |
| break |
| ;; |
| |
| --motif-name ) |
| echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\2!" |
| shift 1 |
| break |
| ;; |
| |
| --motif-release ) |
| echo "$LOCATION" | egrep "${THEME_MOTIF}" | sed -r "s!.*${THEME_MOTIF}.*!\3!" |
| shift 1 |
| break |
| ;; |
| |
| --motif-pattern ) |
| echo "${THEME_MOTIF}" |
| shift 1 |
| break |
| ;; |
| |
| esac |
| |
| done |
| } |