Commit f556b5d7 authored by Vitaly Lipatov's avatar Vitaly Lipatov

copy: allow package list

parent 82bfa826
...@@ -103,17 +103,28 @@ if [ "$1" = "quota" ] ; then ...@@ -103,17 +103,28 @@ if [ "$1" = "quota" ] ; then
fi fi
if [ "$1" = "copy" ] ; then if [ "$1" = "copy" ] ; then
shift shift
PACKAGE="$1" PACKAGELIST=''
shift while [ -n "$1" ] ; do
shift # to [ "$1" = "to" ] && break
TARGET="$1" PACKAGELIST="$PACKAGELIST $1"
shift shift
FROMSTR='' done
[ "$1" = "from" ] && FROMSTR="$1 $2"
[ "$1" = "to" ] || fatal "missed 'to' in your command"
shift # to
TARGET="$1"
shift
FROMSTR=''
[ "$1" = "from" ] && FROMSTR="$1 $2"
[ -n "$PACKAGELIST" ] || fatal "no packages"
docmd ssh $GEARHOST task new $TARGET docmd ssh $GEARHOST task new $TARGET
TASK="$(get_last)" TASK="$(get_last)"
docmd ssh $GEARHOST task add $TASK copy $PACKAGE $FROMSTR for PACKAGE in $PACKAGELIST ; do
docmd ssh $GEARHOST task add $TASK copy $PACKAGE $FROMSTR
done
docmd ssh $GEARHOST task run $TASK docmd ssh $GEARHOST task run $TASK
exit exit
fi fi
......
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