From 155fe172fbb2c182e69c3c22b6f031d785ca905a Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 6 Oct 2020 00:23:39 +0800 Subject: fix package revision --- xmake/core/package/package.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- cgit v1.3.1