Commit a0b1fb81 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm sf: fix download for local path

parent 7f331f5f
...@@ -73,8 +73,10 @@ compress_file_inplace() ...@@ -73,8 +73,10 @@ compress_file_inplace()
# result: will set FILE # result: will set FILE
download_alt_contents_index() download_alt_contents_index()
{ {
local URL="$1"
local TD="$2" local TD="$2"
local OFILE="$TD/$(basename "$1")" local OFILE="$TD/$(basename "$URL")"
local DONE=$(echo $OFILE*) local DONE=$(echo $OFILE*)
# TODO: check if too old # TODO: check if too old
if [ -r "$DONE" ] ; then if [ -r "$DONE" ] ; then
...@@ -83,11 +85,12 @@ download_alt_contents_index() ...@@ -83,11 +85,12 @@ download_alt_contents_index()
mkdir -p "$TD" mkdir -p "$TD"
if echo "$1" | grep -q "/" ; then if echo "$URL" | grep -q "^file:/" ; then
# TODO: separate URL=$(echo "$URL" | sed -e "s|^file:||")
cp -fv "$1" "$OFILE" || { touch $OFILE.failed ; return 1; } [ -s "$URL" ] || { touch $OFILE.failed ; return 1; }
ln -s "$URL" "$OFILE" || { touch $OFILE.failed ; return 1; }
else else
docmd eget -O "$OFILE" "$1" || { touch $OFILE.failed ; return 1; } docmd eget -O "$OFILE" "$URL" || { rm -fv $OFILE ; touch $OFILE.failed ; return 1; }
fi fi
compress_file_inplace "$OFILE" compress_file_inplace "$OFILE"
......
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