Commit 44591ea7 authored by James Byrne's avatar James Byrne

[srccommit] Add -c option for component name

Allow the component name to be specified explicitly rather than being
guessed from the repository name. This option is needed by the merge
request acceptance script.
parent e12f8677
...@@ -5,9 +5,10 @@ log_message= ...@@ -5,9 +5,10 @@ log_message=
log_file= log_file=
arm_answer= arm_answer=
rewrite_branch= rewrite_branch=
component_name=
amend= amend=
while getopts ":hynm:F:A:b:a" opt; do while getopts ":hynm:F:c:A:b:a" opt; do
case $opt in case $opt in
h) h)
cat >&2 << EOB cat >&2 << EOB
...@@ -19,8 +20,9 @@ Options are: ...@@ -19,8 +20,9 @@ Options are:
-n do not update VersionNum (or create it if it doesn't exist) (non-interactive mode) -n do not update VersionNum (or create it if it doesn't exist) (non-interactive mode)
-m MESSAGE specifies the log message to be used -m MESSAGE specifies the log message to be used
-F LOGFILE specifies the file containing the log message -F LOGFILE specifies the file containing the log message
-c COMPONENT component name (derived from repository name when not specified)
-A <y|n> automatically create ARM assembler version -A <y|n> automatically create ARM assembler version
-b <branch> don't commit any changes, instead update VersionNum/ASM as though on branch <branch> (for internal use by merge request acceptance script) -b BRANCH don't commit any changes, instead update VersionNum/ASM as though on branch BRANCH (for internal use by merge request acceptance script)
-a amend existing commit -a amend existing commit
EOB EOB
exit 0 exit 0
...@@ -43,6 +45,9 @@ EOB ...@@ -43,6 +45,9 @@ EOB
b) b)
rewrite_branch=$OPTARG rewrite_branch=$OPTARG
;; ;;
c)
component_name=$OPTARG
;;
a) a)
amend=--amend amend=--amend
;; ;;
...@@ -123,9 +128,11 @@ fi ...@@ -123,9 +128,11 @@ fi
generate_files() { generate_files() {
long_date=$(date +"%d %b %Y") long_date=$(date +"%d %b %Y")
short_date=$(date +"%d-%b-%y") short_date=$(date +"%d-%b-%y")
component_name=${repo%/.git-rewrite*} if [ -z "$component_name" ]; then
component_name=$(basename "$component_name") component_name=${repo%/.git-rewrite*}
component_name=${component_name%.git} component_name=$(basename "$component_name")
component_name=${component_name%.git}
fi
major_version_string=$(printf "%d.%02d" "$major_version_int" "$major_version_frac") major_version_string=$(printf "%d.%02d" "$major_version_int" "$major_version_frac")
major_version_number=$((major_version_int*100+major_version_frac)) major_version_number=$((major_version_int*100+major_version_frac))
if [ -n "$minor_version" ]; then if [ -n "$minor_version" ]; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment