From b7e3a9836f2b4dc7fa034506fbef863ff519de69 Mon Sep 17 00:00:00 2001 From: ruki Date: Wed, 12 Jun 2019 22:57:12 +0800 Subject: support local package for repo --- xmake/actions/require/impl/action/download.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua index 15a5d3570..797af48b4 100644 --- a/xmake/actions/require/impl/action/download.lua +++ b/xmake/actions/require/impl/action/download.lua @@ -104,8 +104,12 @@ function _download(package, url, sourcedir, url_alias, url_excludes) -- attempt to remove package file first os.tryrm(packagefile) - -- download package file - http.download(url, packagefile) + -- download or copy package file + if os.isfile(url) then + os.cp(url, packagefile) + else + http.download(url, packagefile) + end -- check hash if sourcehash and sourcehash ~= hash.sha256(packagefile) then -- cgit v1.3.1