Commit 4ccd1106 authored by Vitaly Lipatov's avatar Vitaly Lipatov

get_tardir_from_rules: add copy support

parent 0272c87d
......@@ -48,7 +48,8 @@ get_tardir_from_rules()
{
# TODO: use get_gear_rules only once
local tar="$1"
local packname="$(basename "$2" .$tar)"
local tarname="$2"
local packname="$(basename "$tarname" .$tar)"
local dir
assert_var tar packname
# firstly try get dir by name=
......@@ -57,6 +58,10 @@ get_tardir_from_rules()
if [ -z "$dir" ] ; then
dir=$(print_gear_rules | grep "$tar *:" | grep -v "name=" | sed -e "s|$tar *: *||g" | sed -e "s| .*||g" | head -n1)
fi
# if copy, check for file equal
if [ "$tarname" = "copy" ] && [ "$tarname" != "$dir" ] ; then
return 1
fi
if [ -z "$dir" ] ; then
# fatal "no $tar rules found in $(get_gear_rules) between
......
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