Skip to content

Commit

Permalink
fix invalid path
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Aug 27, 2024
1 parent 0783a48 commit 688514b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions xmake/core/package/package.lua
Original file line number Diff line number Diff line change
Expand Up @@ -783,8 +783,8 @@ function _instance:cachedir()
--
local name = self:displayname():lower():gsub("::", "_"):gsub("#", "_")
local version_str = self:version_str()
if self:is_thirdparty() then
-- strip `>= <=`
-- strip invalid characters on windows, e.g. `>= <=`
if is_host("windows") then
version_str = version_str:gsub("[>=<]", "")
end
if self:is_local() then
Expand Down Expand Up @@ -812,8 +812,8 @@ function _instance:installdir(...)
end
local version_str = self:version_str()
if version_str then
if self:is_thirdparty() then
-- strip `>= <=`
-- strip invalid characters on windows, e.g. `>= <=`
if is_host("windows") then
version_str = version_str:gsub("[>=<]", "")
end
installdir = path.join(installdir, version_str)
Expand Down

4 comments on commit 688514b

@star-hengxing
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error: @programdir\core\main.lua:329: @programdir\core\package\package.lua:787: global 'is_host' is not callable (a nil value)
stack traceback:
    [@programdir\core\package\package.lua:787]: in function 'cachedir'
    [@programdir\modules\private\action\require\impl\package.lua:1003]: in function '_load_package'
    [@programdir\modules\private\action\require\impl\package.lua:1073]: in function '_load_packages'
    [@programdir\modules\private\action\require\impl\package.lua:1377]: in function 'load_packages'
    [@programdir\modules\private\action\require\check.lua:43]:
    [@programdir\actions\require\main.lua:127]:

@waruqi
Copy link
Member Author

@waruqi waruqi commented on 688514b Aug 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修复了

@q962
Copy link

@q962 q962 commented on 688514b Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

并未彻底解决问题。

遇到 zlib 1.1.2 || >=1.2.11 <1.3.01.2.* 这种写法路径中还是会包含非法字符:| *

@waruqi
Copy link
Member Author

@waruqi waruqi commented on 688514b Aug 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

再试试

Please sign in to comment.