summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2019-12-03 14:42:51 +0800
committerGitHub <[email protected]>2019-12-03 14:42:51 +0800
commit3e4ca8f5c05c297eface6fbff664f7aa991f6719 (patch)
tree623d10f0ff8c6e94dcdd32b27dadce12ca31520a
parent1db0db6a90a231423e03c79d0f09b7bdd4bd7099 (diff)
parent54ba9a0faf46957c3da37366119e0dab52fc02cc (diff)
Merge pull request #633 from OpportunityLiu/dev
fix typo
-rw-r--r--core/src/xmake/semver/select.c16
-rwxr-xr-xtests/modules/semver/test.lua2
-rw-r--r--xmake/actions/build/statistics.lua4
-rw-r--r--xmake/actions/require/impl/action/test.lua2
-rw-r--r--xmake/actions/require/impl/package.lua8
-rw-r--r--xmake/actions/update/xmake.lua2
-rw-r--r--xmake/core/base/option.lua4
-rw-r--r--xmake/modules/private/action/update/fetch_version.lua4
8 files changed, 21 insertions, 21 deletions
diff --git a/core/src/xmake/semver/select.c b/core/src/xmake/semver/select.c
index 8eac1f3ee..eb412119b 100644
--- a/core/src/xmake/semver/select.c
+++ b/core/src/xmake/semver/select.c
@@ -108,7 +108,7 @@ static tb_bool_t xm_semver_select_from_branches(lua_State* lua, tb_int_t fromidx
// no matches
return tb_false;
}
-static tb_bool_t xm_semver_select_lastest_from_versions_tags(lua_State* lua, tb_int_t fromidx, semver_t* semver, semvers_t* matches)
+static tb_bool_t xm_semver_select_latest_from_versions_tags(lua_State* lua, tb_int_t fromidx, semver_t* semver, semvers_t* matches)
{
// clear matches
semvers_pclear(matches);
@@ -157,7 +157,7 @@ static tb_bool_t xm_semver_select_lastest_from_versions_tags(lua_State* lua, tb_
/* select version
*
- * local versioninfo, errors = semver.select(">=1.5.0 <1.6", {"1.5.0", "1.5.1"}, {"v1.5.0", ..}, {"lastest", "dev"})
+ * local versioninfo, errors = semver.select(">=1.5.0 <1.6", {"1.5.0", "1.5.1"}, {"v1.5.0", ..}, {"latest", "dev"})
*/
tb_int_t xm_semver_select(lua_State* lua)
{
@@ -206,18 +206,18 @@ tb_int_t xm_semver_select(lua_State* lua)
break;
}
- // select the lastest version from the tags and versions if be lastest
- if (!tb_strcmp(range_str, "lastest"))
+ // select the latest version from the tags and versions if be latest
+ if (!tb_strcmp(range_str, "latest"))
{
- // attempt to select lastest version from the versions list
- if (xm_semver_select_lastest_from_versions_tags(lua, 2, &semver, &matches))
+ // attempt to select latest version from the versions list
+ if (xm_semver_select_latest_from_versions_tags(lua, 2, &semver, &matches))
{
ok = tb_true;
break;
}
- // attempt to select lastest version from the tags list
- if (xm_semver_select_lastest_from_versions_tags(lua, 3, &semver, &matches))
+ // attempt to select latest version from the tags list
+ if (xm_semver_select_latest_from_versions_tags(lua, 3, &semver, &matches))
{
ok = tb_true;
break;
diff --git a/tests/modules/semver/test.lua b/tests/modules/semver/test.lua
index 332285df8..3a7049c9a 100755
--- a/tests/modules/semver/test.lua
+++ b/tests/modules/semver/test.lua
@@ -28,7 +28,7 @@ function test_semver_select(t)
, {"master", "dev"})
_check_semver_select(t, {"1.5.1", "versions"}
- , "lastest"
+ , "latest"
, {"1.4.0", "1.5.0", "1.5.1"})
end
diff --git a/xmake/actions/build/statistics.lua b/xmake/actions/build/statistics.lua
index 571aca06d..5fe56a414 100644
--- a/xmake/actions/build/statistics.lua
+++ b/xmake/actions/build/statistics.lua
@@ -135,8 +135,8 @@ function main()
}
end
- -- fetch the lastest version
- local versionfile = path.join(os.tmpdir(), "lastest_version")
+ -- fetch the latest version
+ local versionfile = path.join(os.tmpdir(), "latest_version")
if not os.isfile(versionfile) then
local fetchinfo = try { function () return fetch_version() end }
if fetchinfo then
diff --git a/xmake/actions/require/impl/action/test.lua b/xmake/actions/require/impl/action/test.lua
index 72177a994..40b275cdc 100644
--- a/xmake/actions/require/impl/action/test.lua
+++ b/xmake/actions/require/impl/action/test.lua
@@ -34,7 +34,7 @@ function main(package)
}
-- enter the test directory
- local testdir = path.join(os.tmpdir(), "pkgtest", package:name(), package:version_str() or "lastest")
+ local testdir = path.join(os.tmpdir(), "pkgtest", package:name(), package:version_str() or "latest")
if os.isdir(testdir) then
os.tryrm(testdir)
end
diff --git a/xmake/actions/require/impl/package.lua b/xmake/actions/require/impl/package.lua
index d1ef9c6c3..eb6431b88 100644
--- a/xmake/actions/require/impl/package.lua
+++ b/xmake/actions/require/impl/package.lua
@@ -68,13 +68,13 @@ function _parse_require(require_str, requires_extra, parentinfo)
--
-- e.g.
--
- -- lastest
+ -- latest
-- >=1.5.1 <1.6.0
-- master || >1.4
-- ~1.2.3
-- ^1.1
--
- local version = "lastest"
+ local version = "latest"
if #splitinfo > 1 then
version = table.concat(table.slice(splitinfo, 2), " ")
end
@@ -233,10 +233,10 @@ function _select_package_version(package, requireinfo)
local source = nil
local version = nil
local require_version = requireinfo.version
- if #package:versions() > 0 and (require_version == "lastest" or require_version:find('.', 1, true)) then -- select version?
+ if #package:versions() > 0 and (require_version == "latest" or require_version:find('.', 1, true)) then -- select version?
version, source = semver.select(require_version, package:versions())
elseif has_giturl then -- select branch?
- version, source = require_version ~= "lastest" and require_version or "master", "branches"
+ version, source = require_version ~= "latest" and require_version or "master", "branches"
else
raise("package(%s %s): not found!", package:name(), require_version)
end
diff --git a/xmake/actions/update/xmake.lua b/xmake/actions/update/xmake.lua
index ae7f1a58f..6b9998b04 100644
--- a/xmake/actions/update/xmake.lua
+++ b/xmake/actions/update/xmake.lua
@@ -44,7 +44,7 @@ task("update")
, {nil, "xmakever", "v", nil, "The given xmake version, or a git source (and branch). ",
"e.g.",
" from official source: ",
- " lastest, ~2.2.3, dev, master",
+ " latest, ~2.2.3, dev, master",
" from custom source:",
" https://github.com/xmake-io/xmake",
" github:xmake-io/xmake#~2.2.3",
diff --git a/xmake/core/base/option.lua b/xmake/core/base/option.lua
index 1aa4a825c..029a252af 100644
--- a/xmake/core/base/option.lua
+++ b/xmake/core/base/option.lua
@@ -803,8 +803,8 @@ end
-- show update tips
function option.show_update_tips()
- -- show lastest version
- local versionfile = path.join(os.tmpdir(), "lastest_version")
+ -- show latest version
+ local versionfile = path.join(os.tmpdir(), "latest_version")
if os.isfile(versionfile) then
local versioninfo = io.load(versionfile)
if versioninfo and versioninfo.version and semver.compare(versioninfo.version, xmake._VERSION_SHORT) > 0 then
diff --git a/xmake/modules/private/action/update/fetch_version.lua b/xmake/modules/private/action/update/fetch_version.lua
index 4ddf304c7..a667c903a 100644
--- a/xmake/modules/private/action/update/fetch_version.lua
+++ b/xmake/modules/private/action/update/fetch_version.lua
@@ -38,7 +38,7 @@ local official_sources =
function main(xmakever)
-- init xmakever
- xmakever = xmakever or "lastest"
+ xmakever = xmakever or "latest"
-- parse url and commit
local commitish = nil
@@ -64,7 +64,7 @@ function main(xmakever)
else
urls = official_sources
end
- commitish = (commitish and #commitish > 0) and commitish or "lastest"
+ commitish = (commitish and #commitish > 0) and commitish or "latest"
-- sort urls
if #urls > 1 then