diff options
| author | ruki <[email protected]> | 2020-10-06 00:23:39 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2020-10-06 00:23:39 +0800 |
| commit | 155fe172fbb2c182e69c3c22b6f031d785ca905a (patch) | |
| tree | 67d3d631fcbf22307c8262414b7ab6b591a61561 | |
| parent | 86856b6dffc39c1da5e5b639bd77d4a160c92048 (diff) | |
fix package revision
| -rw-r--r-- | xmake/core/package/package.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 87e4b87b1..a0be1ab59 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -241,7 +241,11 @@ end -- get revision(commit, tag, branch) of the url_alias@version_str, only for git url function _instance:revision(url_alias) - return self:sourcehash(url_alias) + local revision = self:sourcehash(url_alias) + if revision and #revision <= 40 then + -- it will be sha256 of tar/gz file, not commit number if longer than 40 characters + return revision + end end -- get the package kind, binary or nil(library) |
