Commit a8e1cd08 authored by Vitaly Lipatov's avatar Vitaly Lipatov

gitask: fix subtask replacement for repo.git=tag format

get_subtask was receiving the full 'repo.git=tag' string instead of just the package name, so it could never find an existing subtask to replace. Extract package name before lookup.
parent 3fb863d1
......@@ -760,7 +760,12 @@ if [ "$1" = "add" ] || [ "$1" = "Add" ] ; then
fi
fi
shift
ST="$(get_subtask $TASK $PACKAGE)"
# Extract package name from repo.git=tag format for subtask lookup
PKGNAME="$PACKAGE"
if rhas "$PKGNAME" "\.git=" ; then
PKGNAME="$(echo "$PKGNAME" | sed 's/\.git=.*//')"
fi
ST="$(get_subtask $TASK $PKGNAME)"
if [ -n "$ST" ] ; then
info "$PACKAGE already present in the task $TASK as subtask $ST, replacing ..."
docmd ssh $GEARHOST task delsub $TASK $ST
......
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