Commit bc85a420 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gita add rewrite, add two arg support for add repo

parent 57a21fb3
...@@ -157,28 +157,25 @@ if [ "$1" = "add" ] ; then ...@@ -157,28 +157,25 @@ if [ "$1" = "add" ] ; then
TASK="$(get_last)" TASK="$(get_last)"
ADDCMD="$2" ADDCMD="$2"
shift 2 shift 2
else
fatal "don't support $1 $2 command"
fi fi
# allow package list for $ADDCMDLIST commands [ -n "$1" ] || fatal "no packages"
if [ -n "$ADDCMD" ] ; then
PACKAGELIST='' while [ -n "$1" ] ; do
while [ -n "$1" ] ; do PACKAGE="$1"
PACKAGELIST="$PACKAGELIST $1" [ "$ADDCMD" = "repo" ] && PACKAGE="$1 $2" && shift
shift shift
done ST="$(get_subtask $TASK $PACKAGE)"
if [ -n "$ST" ] ; then
[ -n "$PACKAGELIST" ] || fatal "no packages" info "$PACKAGE already present in the task $TASK as subtask $ST, replacing ..."
for PACKAGE in $PACKAGELIST ; do docmd ssh $GEARHOST task delsub $TASK $ST
ST="$(get_subtask $TASK $PACKAGE)" [ -n "$SUBTASK" ] || SUBTASK="$ST"
if [ -n "$ST" ] ; then fi
info "$PACKAGE already present in the task $TASK as subtask $ST, replacing ..." docmd ssh $GEARHOST task add $TASK $SUBTASK $ADDCMD $PACKAGE
docmd ssh $GEARHOST task delsub $TASK $ST done
[ -n "$SUBTASK" ] || SUBTASK="$ST" exit
fi
docmd ssh $GEARHOST task add $TASK $SUBTASK $ADDCMD $PACKAGE
done
exit
fi
fi fi
if [ "$1" = "show" ] ; then if [ "$1" = "show" ] ; 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