Skip to content

Commit

Permalink
wheel.mk: Do not re-download file if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
th0ma7 committed Jan 7, 2022
1 parent c4d441d commit 5c17b89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions mk/spksrc.wheel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,14 @@ download_wheel:
query+=" | select(.packagetype==\"sdist\")" ; \
query+=" | select((.filename|test(\"-$${requirement##*=}.tar.gz\")) or (.filename|test(\"-$${requirement##*=}.zip\"))) | .url'" ; \
localFile=$$(basename $$(eval $${query} 2>/dev/null) 2</dev/null) ; \
if [ "$${localFile}" != "" ]; then \
if [ "$${localFile}" = "" ]; then \
echo "ERROR: Invalid package name [$${requirement%%=*}]" ; \
elif [ -s $(DISTRIB_DIR)/$${localFile} ]; then \
echo "INFO: File already exists [$${localFile}]" ; \
else \
echo "wget --secure-protocol=TLSv1_2 -nv -O $(DISTRIB_DIR)/$${localFile}.part -nc $$(eval $${query})" ; \
wget --secure-protocol=TLSv1_2 -nv -O $(DISTRIB_DIR)/$${localFile}.part -nc $$(eval $${query}) ; \
mv $(DISTRIB_DIR)/$${localFile}.part $(DISTRIB_DIR)/$${localFile} ; \
else \
echo "ERROR: Invalid package name [$${requirement%%=*}]" ; \
fi ; \
done < <(grep -v -e "^\#" -e "^\$$" $$wheel) || true ; \
fi ; \
Expand Down

0 comments on commit 5c17b89

Please sign in to comment.