summaryrefslogtreecommitdiff
path: root/xmake/actions/require/impl/action
diff options
context:
space:
mode:
authorruki <[email protected]>2019-05-08 23:27:40 +0800
committerruki <[email protected]>2019-05-08 14:46:04 +0800
commit9841c79a19730ff807367b9d93c4fbaa34d920ad (patch)
treee55aa8a10bc30c7428fbd9be05f179f2c7334765 /xmake/actions/require/impl/action
parent1c147263e7f75806e3011bd370df8230a8e075c6 (diff)
improve package version
Diffstat (limited to 'xmake/actions/require/impl/action')
-rw-r--r--xmake/actions/require/impl/action/download.lua10
1 files changed, 5 insertions, 5 deletions
diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua
index b445156ee..1c5d519e5 100644
--- a/xmake/actions/require/impl/action/download.lua
+++ b/xmake/actions/require/impl/action/download.lua
@@ -60,19 +60,19 @@ function _checkout(package, url, sourcedir, url_alias)
-- download package from branches?
packagedir = path.join(sourcedir .. ".tmp", package:name())
- if package:version_from("branches") then
+ if package:branch() then
-- only shadow clone this branch
- git.clone(url, {depth = 1, branch = package:version_str(), outputdir = packagedir})
+ git.clone(url, {depth = 1, branch = package:branch(), outputdir = packagedir})
- -- download package from revision, tag or version?
+ -- download package from revision or tag?
else
-- clone whole history and tags
git.clone(url, {outputdir = packagedir})
-- attempt to checkout the given version
- git.checkout(package:revision(url_alias) or package:version_str(), {repodir = packagedir})
+ git.checkout(package:revision(url_alias) or package:tag(), {repodir = packagedir})
end
-- move to source directory
@@ -149,7 +149,7 @@ function _urls(package)
table.insert(urls[2], url)
end
end
- if package:version_from("tags", "branches") then
+ if package:gitref() then
return table.join(urls[1], urls[2])
else
return table.join(urls[2], urls[1])