Skip to content

Commit

Permalink
fix archive
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Apr 10, 2024
1 parent 3270e05 commit bcc361f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ function _download(package, url, sourcedir, opt)
local sourcedir_tmp = sourcedir .. ".tmp"
os.rm(sourcedir_tmp)
local extension = archive.extension(packagefile)

local ok = try {function() archive.extract(packagefile, sourcedir_tmp, {excludes = opt.url_excludes}); return true end}
if ok then
-- move to source directory and we skip it to avoid long path issues on windows if only one root directory
Expand Down
8 changes: 2 additions & 6 deletions xmake/modules/utils/archive/archive.lua
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ function _archive(archivefile, inputfiles, extension, archivers, opt)
}
}
if ok then
return
return true
end
end
raise("cannot archive %s, %s!", path.filename(archivefile), errors or "archivers not found!")
Expand All @@ -319,12 +319,8 @@ end
-- @param options the options, e.g.. {curdir = "/tmp", recurse = true, compress = "fastest|faster|default|better|best", excludes = {"*/dir/*", "dir/*"}}
--
function main(archivefile, inputfiles, opt)

-- init inputfiles
inputfiles = inputfiles or os.curdir()

-- init options
opt = opt or {}
inputfiles = inputfiles or os.curdir()
if opt.recurse == nil then
opt.recurse = true
end
Expand Down
8 changes: 2 additions & 6 deletions xmake/modules/utils/archive/extract.lua
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ function _extract(archivefile, outputdir, extension, extractors, opt)
}
}
if ok then
return
return true
end
end
raise("cannot extract %s, %s!", path.filename(archivefile), errors or "extractors not found!")
Expand All @@ -401,12 +401,8 @@ end
-- @param options the options, e.g.. {excludes = {"*/dir/*", "dir/*"}}
--
function main(archivefile, outputdir, opt)

-- init outputdir
outputdir = outputdir or os.curdir()

-- init options
opt = opt or {}
outputdir = outputdir or os.curdir()

-- init extractors
local extractors
Expand Down

0 comments on commit bcc361f

Please sign in to comment.