|
|
4c79b5 |
#!/bin/bash
|
|
|
4c79b5 |
#
|
|
|
5792d8 |
# render_getOptions.sh -- This function interprets option parameters
|
|
|
5792d8 |
# passed to `render' functionality and calls actions accordingly.
|
|
|
4c79b5 |
#
|
|
|
3b0984 |
# Copyright (C) 2009, 2010, 2011 The CentOS Artwork SIG
|
|
|
fa95b1 |
#
|
|
|
fa95b1 |
# This program is free software; you can redistribute it and/or modify
|
|
|
fa95b1 |
|
|
|
dcd347 |
|
|
|
dcd347 |
|
|
|
fa95b1 |
#
|
|
|
74a058 |
|
|
|
74a058 |
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# General Public License for more details.
|
|
|
4c79b5 |
#
|
|
|
4c79b5 |
|
|
|
4c79b5 |
# along with this program; if not, write to the Free Software
|
|
|
dcd347 |
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
|
7ac5a5 |
#
|
|
|
4c79b5 |
# ----------------------------------------------------------------------
|
|
|
418249 |
# $Id$
|
|
|
4c79b5 |
# ----------------------------------------------------------------------
|
|
|
4c79b5 |
|
|
|
5792d8 |
function render_getOptions {
|
|
|
4c79b5 |
|
|
|
07c2fe |
|
|
|
15b1d2 |
local ARGSS=""
|
|
|
4c79b5 |
|
|
|
07c2fe |
|
|
|
74b82e |
local ARGSL="filter:,quiet,answer-yes,dont-commit-changes,dont-dirspecific,releasever:,basearch:,post-rendition:,last-rendition:,theme-model:"
|
|
|
4c79b5 |
|
|
|
49237e |
|
|
|
793c4c |
cli_parseArguments
|
|
|
4c79b5 |
|
|
|
49237e |
|
|
|
07c2fe |
eval set -- "$ARGUMENTS"
|
|
|
4c79b5 |
|
|
|
07c2fe |
# Look for options passed through command-line.
|
|
|
07c2fe |
while true; do
|
|
|
4c79b5 |
|
|
|
07c2fe |
case "$1" in
|
|
|
4c79b5 |
|
|
|
49237e |
|
|
|
49237e |
FLAG_FILTER="$2"
|
|
|
49237e |
shift 2
|
|
|
49237e |
|
|
|
49237e |
|
|
|
49237e |
|
|
|
49237e |
FLAG_QUIET="true"
|
|
|
49237e |
FLAG_DONT_COMMIT_CHANGES="true"
|
|
|
49237e |
shift 1
|
|
|
49237e |
|
|
|
49237e |
|
|
|
3ccb0a |
--answer-yes )
|
|
|
3ccb0a |
FLAG_ANSWER="true"
|
|
|
3ccb0a |
shift 1
|
|
|
49237e |
|
|
|
49237e |
|
|
|
49237e |
|
|
|
49237e |
FLAG_DONT_COMMIT_CHANGES="true"
|
|
|
49237e |
shift 1
|
|
|
49237e |
|
|
|
49237e |
|
|
|
74b82e |
|
|
|
74b82e |
FLAG_DONT_DIRSPECIFIC="true"
|
|
|
74b82e |
shift 1
|
|
|
15b1d2 |
|
|
|
15b1d2 |
|
|
|
74b82e |
|
|
|
74b82e |
FLAG_POSTRENDITION="$2"
|
|
|
61bb5b |
shift 2
|
|
|
61bb5b |
|
|
|
61bb5b |
|
|
|
74b82e |
|
|
|
74b82e |
FLAG_LASTRENDITION="$2"
|
|
|
61bb5b |
shift 2
|
|
|
61bb5b |
|
|
|
61bb5b |
|
|
|
774507 |
|
|
|
774507 |
FLAG_BASEARCH="$2"
|
|
|
5440a4 |
if [[ ! $FLAG_BASEARCH =~ $(cli_getPathComponent --architecture-pattern) ]];then
|
|
|
0ff158 |
cli_printMessage "`gettext "The architecture provided is not supported."`" --as-error-line
|
|
|
774507 |
fi
|
|
|
ae711e |
shift 2
|
|
|
ae711e |
|
|
|
ae711e |
|
|
|
74b82e |
|
|
|
74b82e |
FLAG_RELEASEVER="$2"
|
|
|
74b82e |
if [[ ! $FLAG_RELEASEVER =~ $(cli_getPathComponent --release-pattern) ]];then
|
|
|
74b82e |
cli_printMessage "`gettext "The release version provided is not supported."`"
|
|
|
74b82e |
fi
|
|
|
ef0114 |
shift 2
|
|
|
ef0114 |
|
|
|
ef0114 |
|
|
|
ef0114 |
|
|
|
3de909 |
FLAG_THEME_MODEL=$(cli_getRepoName $2 -d)
|
|
|
a615b0 |
shift 2
|
|
|
07c2fe |
|
|
|
4c79b5 |
|
|
|
92df38 |
|
|
|
92df38 |
|
|
|
92df38 |
# in order for processing non-option arguments
|
|
|
92df38 |
|
|
|
92df38 |
|
|
|
92df38 |
|
|
|
92df38 |
|
|
|
92df38 |
|
|
|
92df38 |
|
|
|
92df38 |
|
|
|
92df38 |
shift 1
|
|
|
07c2fe |
break
|
|
|
92df38 |
|
|
|
07c2fe |
esac
|
|
|
07c2fe |
done
|
|
|
07c2fe |
|
|
|
49237e |
|
|
|
793c4c |
cli_parseArgumentsReDef "$@"
|
|
|
a615b0 |
|
|
|
787e6e |
# Verify non-option arguments passed to command-line. If there
|
|
|
787e6e |
|
|
|
787e6e |
|
|
|
787e6e |
if [[ $ARGUMENTS == '' ]];then
|
|
|
787e6e |
ARGUMENTS=${PWD}
|
|
|
787e6e |
fi
|
|
|
787e6e |
|
|
|
4c79b5 |
}
|