Commit dbc43627 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm repack common: implement is_abs_path()

parent edd8e5ad
...@@ -31,6 +31,10 @@ subst() ...@@ -31,6 +31,10 @@ subst()
} }
fi fi
is_abs_path()
{
echo "$1" | grep -q "^/"
}
# Remove file from the file system and from spec # Remove file from the file system and from spec
# Usage: remove_file <path_to_file> # Usage: remove_file <path_to_file>
...@@ -146,7 +150,7 @@ install_file() ...@@ -146,7 +150,7 @@ install_file()
if is_url "$src" ; then if is_url "$src" ; then
epm tool eget -O "$BUILDROOT$dest" "$src" || fatal "Can't download $src to install to $dest" epm tool eget -O "$BUILDROOT$dest" "$src" || fatal "Can't download $src to install to $dest"
elif echo "$src" | grep -q "^/" ; then elif is_abs_path "$src" ; then
cp "$BUILDROOT/$src" "$BUILDROOT/$dest" || return cp "$BUILDROOT/$src" "$BUILDROOT/$dest" || return
else else
cp "$src" "$BUILDROOT/$dest" || return cp "$src" "$BUILDROOT/$dest" || return
......
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