summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-06-12 22:57:12 +0800
committerruki <[email protected]>2019-06-12 11:43:13 +0800
commitb7e3a9836f2b4dc7fa034506fbef863ff519de69 (patch)
tree4b297ed745e0d302ec1772fa0b509532ee60f06a
parent9b8c78dadd744584c64ec892c822333744a04392 (diff)
support local package for repo
-rw-r--r--xmake/actions/require/impl/action/download.lua8
1 files 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