summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-11 00:36:06 +0800
committerruki <[email protected]>2019-05-10 21:36:38 +0800
commit788106769627016f41c510e23212a54039d8bb32 (patch)
treee96cf703c5f0bbd3fe6d67bfa0b69f6ba7f20366
parent22ee7732c80f018cf6f2a2943ec36b2f4fe4dadd (diff)
improve download package
-rw-r--r--xmake/actions/require/impl/action/download.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua
index 1c5d519e5..699d3a063 100644
--- a/xmake/actions/require/impl/action/download.lua
+++ b/xmake/actions/require/impl/action/download.lua
@@ -47,7 +47,7 @@ function _checkout(package, url, sourcedir, url_alias)
-- use previous source directory if exists
local packagedir = path.join(sourcedir, package:name())
- if os.isdir(packagedir) and not option.get("force") then
+ if os.isdir(packagedir) and (not option.get("force") or option.get("shallow")) then
-- clean the previous build files
git.clean({repodir = packagedir, force = true})
@@ -96,7 +96,7 @@ function _download(package, url, sourcedir, url_alias, url_excludes)
-- the package file have been downloaded?
local cached = true
- if option.get("force") or not os.isfile(packagefile) or sourcehash ~= hash.sha256(packagefile) then
+ if (option.get("force") and not option.get("shallow")) or not os.isfile(packagefile) or sourcehash ~= hash.sha256(packagefile) then
-- no cached
cached = false