From ed0ef35cbcfd18ca2aaae716596506acd35b0333 Mon Sep 17 00:00:00 2001 From: ruki Date: Tue, 28 Aug 2018 23:48:09 +0800 Subject: remove load package from url --- xmake/core/package/package.lua | 28 ---------------------- .../modules/import/core/package/package.lua | 13 ---------- 2 files changed, 41 deletions(-) (limited to 'xmake/core') diff --git a/xmake/core/package/package.lua b/xmake/core/package/package.lua index 4a7a3ea18..52b4e374f 100644 --- a/xmake/core/package/package.lua +++ b/xmake/core/package/package.lua @@ -443,34 +443,6 @@ function package.cachedir() return path.join(global.directory(), "cache", "packages") end --- load the package from the package url -function package.load_from_url(packagename, packageurl) - - -- make a temporary package file - local packagefile = os.tmpfile() .. ".lua" - - -- make package description - local packagedata = string.format([[ - package("%s") - set_urls("%s") - ]], packagename, packageurl) - - -- write a temporary package description to file - local ok, errors = io.writefile(packagefile, packagedata) - if not ok then - return nil, errors - end - - -- load package instance - local instance, errors = package.load_from_repository(packagename, false, nil, packagefile) - - -- remove the package file - os.rm(packagefile) - - -- ok? - return instance, errors -end - -- load the package from the system directories function package.load_from_system(packagename) diff --git a/xmake/core/sandbox/modules/import/core/package/package.lua b/xmake/core/sandbox/modules/import/core/package/package.lua index 39da91a3f..4b292207e 100644 --- a/xmake/core/sandbox/modules/import/core/package/package.lua +++ b/xmake/core/sandbox/modules/import/core/package/package.lua @@ -79,18 +79,5 @@ function sandbox_core_package_package.load_from_repository(packagename, repo, pa return instance end --- load the package from the package url -function sandbox_core_package_package.load_from_url(packagename, packageurl) - - -- load package instance - local instance, errors = package.load_from_url(packagename, packageurl) - if not instance then - raise(errors) - end - - -- ok - return instance -end - -- return module return sandbox_core_package_package -- cgit v1.3.1