diff options
| author | ruki <[email protected]> | 2018-10-29 23:59:08 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2018-10-29 17:54:51 +0800 |
| commit | 3482c270e2d95680d7aebda29cc11b2eb5009dfc (patch) | |
| tree | 2d331c336d43087153ad2afdf103eb65713f897a /xmake/actions/require/impl/action | |
| parent | bc3459d5969a9f8956c2387f04bd6519650532ad (diff) | |
support package revision
Diffstat (limited to 'xmake/actions/require/impl/action')
| -rw-r--r-- | xmake/actions/require/impl/action/download.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/xmake/actions/require/impl/action/download.lua b/xmake/actions/require/impl/action/download.lua index 6fc0d5f3c..3c93e0bdf 100644 --- a/xmake/actions/require/impl/action/download.lua +++ b/xmake/actions/require/impl/action/download.lua @@ -44,7 +44,7 @@ function _emptychars() end -- checkout codes from git -function _checkout(package, url, sourcedir) +function _checkout(package, url, sourcedir, url_alias) -- use previous source directory if exists local packagedir = path.join(sourcedir, package:name()) @@ -65,14 +65,14 @@ function _checkout(package, url, sourcedir) -- only shadow clone this branch git.clone(url, {depth = 1, branch = package:version_str(), outputdir = packagedir}) - -- download package from tags or versions? + -- download package from revision, tag or version? else -- clone whole history and tags git.clone(url, {outputdir = packagedir}) -- attempt to checkout the given version - git.checkout(package:version_str(), {repodir = packagedir}) + git.checkout(package:revision(url_alias) or package:version_str(), {repodir = packagedir}) end -- move to source directory @@ -180,7 +180,7 @@ function main(package) -- download package local sourcedir = "source" if git.checkurl(url) then - _checkout(package, url, sourcedir) + _checkout(package, url, sourcedir, url_alias) else _download(package, url, sourcedir, url_alias, url_excludes) end |
