diff options
| author | V1K1NGbg <victor@ilchev.com> | 2024-08-06 12:39:50 +0300 |
|---|---|---|
| committer | V1K1NGbg <victor@ilchev.com> | 2024-08-06 12:39:50 +0300 |
| commit | 4e40d895c233a90ca5cf7676375f17cb827f250a (patch) | |
| tree | 3b3d0e625b28eb2041a43357c3bc1dccc2dae7b6 /src | |
| parent | b9a6f9e6cb2b0f32e8a42db59025cbfba3e4c94d (diff) | |
| download | luarocks-4e40d895c233a90ca5cf7676375f17cb827f250a.tar.gz luarocks-4e40d895c233a90ca5cf7676375f17cb827f250a.tar.bz2 luarocks-4e40d895c233a90ca5cf7676375f17cb827f250a.zip | |
fix almost all redeclerations
Diffstat (limited to 'src')
28 files changed, 115 insertions, 116 deletions
diff --git a/src/luarocks/core/cfg.d.tl b/src/luarocks/core/cfg.d.tl index bbb070f2..b8501924 100644 --- a/src/luarocks/core/cfg.d.tl +++ b/src/luarocks/core/cfg.d.tl | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | local type rockspec = require("luarocks.core.types.rockspec") | 1 | local type r = require("luarocks.core.types.rockspec") |
| 2 | local type Rockspec = rockspec.Rockspec | 2 | local type Rockspec = r.Rockspec |
| 3 | local type Variables = rockspec.Variables | 3 | local type Variables = r.Variables |
| 4 | local type tree = require("luarocks.core.types.tree") | 4 | local type t = require("luarocks.core.types.tree") |
| 5 | local type Tree = tree.Tree | 5 | local type Tree = t.Tree |
| 6 | 6 | ||
| 7 | local record cfg | 7 | local record cfg |
| 8 | detect_sysconfdir: function(): string | 8 | detect_sysconfdir: function(): string |
diff --git a/src/luarocks/core/manif.tl b/src/luarocks/core/manif.tl index 742e64b7..7ef018db 100644 --- a/src/luarocks/core/manif.tl +++ b/src/luarocks/core/manif.tl | |||
| @@ -1,4 +1,7 @@ | |||
| 1 | 1 | ||
| 2 | --- Core functions for querying manifest files. | ||
| 3 | local record manif | ||
| 4 | end | ||
| 2 | 5 | ||
| 3 | local persist = require("luarocks.core.persist") | 6 | local persist = require("luarocks.core.persist") |
| 4 | local cfg = require("luarocks.core.cfg") | 7 | local cfg = require("luarocks.core.cfg") |
| @@ -7,20 +10,17 @@ local util = require("luarocks.core.util") | |||
| 7 | local vers = require("luarocks.core.vers") | 10 | local vers = require("luarocks.core.vers") |
| 8 | local path = require("luarocks.core.path") | 11 | local path = require("luarocks.core.path") |
| 9 | 12 | ||
| 10 | local type tree = require("luarocks.core.types.tree") | 13 | -------------------------------------------------------------------------------- |
| 11 | local type Tree = tree.Tree | ||
| 12 | 14 | ||
| 13 | --- Core functions for querying manifest files. | 15 | local type t = require("luarocks.core.types.tree") |
| 14 | local record manif | 16 | local type Tree = t.Tree |
| 15 | end | ||
| 16 | 17 | ||
| 17 | -------------------------------------------------------------------------------- | 18 | local type q = require("luarocks.core.types.query") |
| 18 | local type query = require("luarocks.core.types.query") | 19 | local type Query = q.Query |
| 19 | local type Query = query.Query | ||
| 20 | 20 | ||
| 21 | local type manifest = require("luarocks.core.types.manifest") | 21 | local type m = require("luarocks.core.types.manifest") |
| 22 | local type Manifest = manifest.Manifest | 22 | local type Manifest = m.Manifest |
| 23 | local type Tree_manifest = manifest.Tree_manifest | 23 | local type Tree_manifest = m.Tree_manifest |
| 24 | 24 | ||
| 25 | 25 | ||
| 26 | 26 | ||
diff --git a/src/luarocks/core/path.tl b/src/luarocks/core/path.tl index 563a36ef..37421445 100644 --- a/src/luarocks/core/path.tl +++ b/src/luarocks/core/path.tl | |||
| @@ -5,8 +5,8 @@ end | |||
| 5 | local cfg = require("luarocks.core.cfg") | 5 | local cfg = require("luarocks.core.cfg") |
| 6 | local dir = require("luarocks.core.dir") | 6 | local dir = require("luarocks.core.dir") |
| 7 | 7 | ||
| 8 | local type tree = require("luarocks.core.types.tree") | 8 | local type t = require("luarocks.core.types.tree") |
| 9 | local type Tree = tree.Tree | 9 | local type Tree = t.Tree |
| 10 | 10 | ||
| 11 | local dir_sep = package.config:sub(1, 1) | 11 | local dir_sep = package.config:sub(1, 1) |
| 12 | -------------------------------------------------------------------------------- | 12 | -------------------------------------------------------------------------------- |
diff --git a/src/luarocks/core/types/manifest.d.tl b/src/luarocks/core/types/manifest.d.tl index f24869b9..de1319d4 100644 --- a/src/luarocks/core/types/manifest.d.tl +++ b/src/luarocks/core/types/manifest.d.tl | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | local type query = require("luarocks.core.types.query") | 1 | local type q = require("luarocks.core.types.query") |
| 2 | local type Query = query.Query | 2 | local type Query = q.Query |
| 3 | 3 | ||
| 4 | local type tree = require("luarocks.core.types.tree") | 4 | local type t = require("luarocks.core.types.tree") |
| 5 | local type Tree = tree.Tree | 5 | local type Tree = t.Tree |
| 6 | 6 | ||
| 7 | local record manifest | 7 | local record manifest |
| 8 | record Manifest | 8 | record Manifest |
diff --git a/src/luarocks/core/types/query.d.tl b/src/luarocks/core/types/query.d.tl index e1ef21b6..b23579af 100644 --- a/src/luarocks/core/types/query.d.tl +++ b/src/luarocks/core/types/query.d.tl | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | local type version = require("luarocks.core.types.version") | 1 | local type v = require("luarocks.core.types.version") |
| 2 | local type Constraint = version.Constraint | 2 | local type Constraint = v.Constraint |
| 3 | 3 | ||
| 4 | local record query | 4 | local record query |
| 5 | record Query | 5 | record Query |
diff --git a/src/luarocks/core/types/rockspec.d.tl b/src/luarocks/core/types/rockspec.d.tl index 027cefb4..04dbcd82 100644 --- a/src/luarocks/core/types/rockspec.d.tl +++ b/src/luarocks/core/types/rockspec.d.tl | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | local type query = require("luarocks.core.types.query") | 1 | local type q = require("luarocks.core.types.query") |
| 2 | local type Query = query.Query | 2 | local type Query = q.Query |
| 3 | 3 | ||
| 4 | local record rockspec | 4 | local record rockspec |
| 5 | record Description | 5 | record Description |
diff --git a/src/luarocks/core/util.tl b/src/luarocks/core/util.tl index 56c0072e..ede0e75f 100644 --- a/src/luarocks/core/util.tl +++ b/src/luarocks/core/util.tl | |||
| @@ -4,9 +4,9 @@ end | |||
| 4 | 4 | ||
| 5 | -------------------------------------------------------------------------------- | 5 | -------------------------------------------------------------------------------- |
| 6 | 6 | ||
| 7 | local type ordering = require("luarocks.core.types.ordering") | 7 | local type o = require("luarocks.core.types.ordering") |
| 8 | local type Ordering = ordering.Ordering | 8 | local type Ordering = o.Ordering |
| 9 | local type SortBy = ordering.SortBy | 9 | local type SortBy = o.SortBy |
| 10 | 10 | ||
| 11 | local dir_sep = package.config:sub(1, 1) | 11 | local dir_sep = package.config:sub(1, 1) |
| 12 | 12 | ||
diff --git a/src/luarocks/core/vers.tl b/src/luarocks/core/vers.tl index ab1c6c5b..f7ecdb98 100644 --- a/src/luarocks/core/vers.tl +++ b/src/luarocks/core/vers.tl | |||
| @@ -2,9 +2,9 @@ local record vers | |||
| 2 | end | 2 | end |
| 3 | 3 | ||
| 4 | local util = require("luarocks.core.util") | 4 | local util = require("luarocks.core.util") |
| 5 | local type version = require("luarocks.core.types.version") | 5 | local type v = require("luarocks.core.types.version") |
| 6 | local type Version = version.Version | 6 | local type Version = v.Version |
| 7 | local type Constraint = version.Constraint | 7 | local type Constraint = v.Constraint |
| 8 | -------------------------------------------------------------------------------- | 8 | -------------------------------------------------------------------------------- |
| 9 | 9 | ||
| 10 | local deltas: {string: integer} = { | 10 | local deltas: {string: integer} = { |
diff --git a/src/luarocks/deps.tl b/src/luarocks/deps.tl index cf552ef8..104be1b9 100644 --- a/src/luarocks/deps.tl +++ b/src/luarocks/deps.tl | |||
| @@ -13,16 +13,17 @@ local vers = require("luarocks.core.vers") | |||
| 13 | local queries = require("luarocks.queries") | 13 | local queries = require("luarocks.queries") |
| 14 | local deplocks = require("luarocks.deplocks") | 14 | local deplocks = require("luarocks.deplocks") |
| 15 | 15 | ||
| 16 | local type rockspec = require("luarocks.core.types.rockspec") | 16 | local type r = require("luarocks.core.types.rockspec") |
| 17 | local type Rockspec = rockspec.Rockspec | 17 | local type Rockspec = r.Rockspec |
| 18 | 18 | ||
| 19 | local type tree = require("luarocks.core.types.tree") | 19 | local type t = require("luarocks.core.types.tree") |
| 20 | local type Tree = tree.Tree | 20 | local type Tree = t.Tree |
| 21 | 21 | ||
| 22 | local core = require("luarocks.core.manif") | 22 | local type q = require("luarocks.core.types.query") |
| 23 | local type DependencyVersion = core.DependencyVersion | 23 | local type Query = q.Query |
| 24 | local type version = require("luarocks.core.types.version") | 24 | |
| 25 | local type Version = version.Version | 25 | local type v = require("luarocks.core.types.version") |
| 26 | local type Version = v.Version | ||
| 26 | 27 | ||
| 27 | --- Generate a function that matches dep queries against the manifest, | 28 | --- Generate a function that matches dep queries against the manifest, |
| 28 | -- taking into account rocks_provided, the list of versions to skip, | 29 | -- taking into account rocks_provided, the list of versions to skip, |
| @@ -41,9 +42,9 @@ local type Version = version.Version | |||
| 41 | -- * map of versions to locations | 42 | -- * map of versions to locations |
| 42 | -- * version matched via lockfile if any | 43 | -- * version matched via lockfile if any |
| 43 | -- * true if rock matched via rocks_provided | 44 | -- * true if rock matched via rocks_provided |
| 44 | local function prepare_get_versions(deps_mode: string, rocks_provided: {string : string}, depskey: string, skip_set?): function(DependencyVersion): {string}, {string: string | Tree}, string, boolean | 45 | local function prepare_get_versions(deps_mode: string, rocks_provided: {string : string}, depskey: string, skip_set?): function(Query): {string}, {string: string | Tree}, string, boolean |
| 45 | 46 | ||
| 46 | return function(dep: DependencyVersion): {string}, {string: string | Tree}, string, boolean | 47 | return function(dep: Query): {string}, {string: string | Tree}, string, boolean |
| 47 | local versions, locations: {string}, {string: string | Tree} | 48 | local versions, locations: {string}, {string: string | Tree} |
| 48 | local provided = rocks_provided[dep.name] | 49 | local provided = rocks_provided[dep.name] |
| 49 | if provided then | 50 | if provided then |
| @@ -83,8 +84,8 @@ end | |||
| 83 | -- 2. nil | 84 | -- 2. nil |
| 84 | -- 3. either 'dep' or an alternative query to be used | 85 | -- 3. either 'dep' or an alternative query to be used |
| 85 | -- 4. false | 86 | -- 4. false |
| 86 | local function match_dep(dep: DependencyVersion, | 87 | local function match_dep(dep: Query, |
| 87 | get_versions: function(DependencyVersion): {string}, {string: string | Tree}, string, boolean): string, string | Tree, DependencyVersion, boolean | 88 | get_versions: function(Query): {string}, {string: string | Tree}, string, boolean): string, string | Tree, Query, boolean |
| 88 | 89 | ||
| 89 | local versions, locations, lockversion, provided = get_versions(dep) | 90 | local versions, locations, lockversion, provided = get_versions(dep) |
| 90 | 91 | ||
| @@ -112,8 +113,8 @@ local function match_dep(dep: DependencyVersion, | |||
| 112 | return latest_vstring, locations[latest_vstring], dep, provided | 113 | return latest_vstring, locations[latest_vstring], dep, provided |
| 113 | end | 114 | end |
| 114 | 115 | ||
| 115 | local function match_all_deps(dependencies: {DependencyVersion}, | 116 | local function match_all_deps(dependencies: {Query}, |
| 116 | get_versions: function(DependencyVersion): {string}, {string: string | Tree}, string, boolean): {DependencyVersion: any}, {string}, {string} | 117 | get_versions: function(Query): {string}, {string: string | Tree}, string, boolean): {Query: any}, {string}, {string} |
| 117 | 118 | ||
| 118 | local matched, missing, no_upgrade = {}, {}, {} | 119 | local matched, missing, no_upgrade = {}, {}, {} |
| 119 | 120 | ||
diff --git a/src/luarocks/fetch.tl b/src/luarocks/fetch.tl index 321d4f4e..6612b253 100644 --- a/src/luarocks/fetch.tl +++ b/src/luarocks/fetch.tl | |||
| @@ -16,8 +16,8 @@ local cfg = require("luarocks.core.cfg") | |||
| 16 | 16 | ||
| 17 | local type Fetch = fetch.Fetch | 17 | local type Fetch = fetch.Fetch |
| 18 | local type Lock = fs.Lock --! | 18 | local type Lock = fs.Lock --! |
| 19 | local type rockspec = require("luarocks.core.types.rockspec") | 19 | local type r = require("luarocks.core.types.rockspec") |
| 20 | local type Rockspec = rockspec.Rockspec | 20 | local type Rockspec = r.Rockspec |
| 21 | 21 | ||
| 22 | 22 | ||
| 23 | local function ensure_trailing_slash(url: string): string | 23 | local function ensure_trailing_slash(url: string): string |
diff --git a/src/luarocks/fetch/cvs.tl b/src/luarocks/fetch/cvs.tl index f40d0991..a2f67dcf 100644 --- a/src/luarocks/fetch/cvs.tl +++ b/src/luarocks/fetch/cvs.tl | |||
| @@ -7,8 +7,8 @@ local fs = require("luarocks.fs") | |||
| 7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
| 8 | local util = require("luarocks.util") | 8 | local util = require("luarocks.util") |
| 9 | 9 | ||
| 10 | local type rockspec = require("luarocks.core.types.rockspec") | 10 | local type r = require("luarocks.core.types.rockspec") |
| 11 | local type Rockspec = rockspec.Rockspec | 11 | local type Rockspec = r.Rockspec |
| 12 | 12 | ||
| 13 | --- Download sources for building a rock, using CVS. | 13 | --- Download sources for building a rock, using CVS. |
| 14 | -- @param rockspec table: The rockspec table | 14 | -- @param rockspec table: The rockspec table |
diff --git a/src/luarocks/fetch/git.tl b/src/luarocks/fetch/git.tl index 1a4438c9..466c4039 100644 --- a/src/luarocks/fetch/git.tl +++ b/src/luarocks/fetch/git.tl | |||
| @@ -9,10 +9,10 @@ local dir = require("luarocks.dir") | |||
| 9 | local vers = require("luarocks.core.vers") | 9 | local vers = require("luarocks.core.vers") |
| 10 | local util = require("luarocks.util") | 10 | local util = require("luarocks.util") |
| 11 | 11 | ||
| 12 | local type rockspec = require("luarocks.core.types.rockspec") | 12 | local type r = require("luarocks.core.types.rockspec") |
| 13 | local type Rockspec = rockspec.Rockspec | 13 | local type Rockspec = r.Rockspec |
| 14 | local type version = require("luarocks.core.types.version") | 14 | local type v = require("luarocks.core.types.version") |
| 15 | local type Version = version.Version | 15 | local type Version = v.Version |
| 16 | 16 | ||
| 17 | local cached_git_version: Version | 17 | local cached_git_version: Version |
| 18 | 18 | ||
diff --git a/src/luarocks/fetch/git_file.tl b/src/luarocks/fetch/git_file.tl index 858e67a3..06ada30b 100644 --- a/src/luarocks/fetch/git_file.tl +++ b/src/luarocks/fetch/git_file.tl | |||
| @@ -5,8 +5,8 @@ end | |||
| 5 | 5 | ||
| 6 | local git = require("luarocks.fetch.git") | 6 | local git = require("luarocks.fetch.git") |
| 7 | 7 | ||
| 8 | local type rockspec = require("luarocks.core.types.rockspec") | 8 | local type r = require("luarocks.core.types.rockspec") |
| 9 | local type Rockspec = rockspec.Rockspec | 9 | local type Rockspec = r.Rockspec |
| 10 | 10 | ||
| 11 | --- Fetch sources for building a rock from a local Git repository. | 11 | --- Fetch sources for building a rock from a local Git repository. |
| 12 | -- @param rockspec table: The rockspec table | 12 | -- @param rockspec table: The rockspec table |
diff --git a/src/luarocks/fetch/git_http.tl b/src/luarocks/fetch/git_http.tl index a7b3d692..ecf23763 100644 --- a/src/luarocks/fetch/git_http.tl +++ b/src/luarocks/fetch/git_http.tl | |||
| @@ -12,8 +12,8 @@ end | |||
| 12 | 12 | ||
| 13 | local git = require("luarocks.fetch.git") | 13 | local git = require("luarocks.fetch.git") |
| 14 | 14 | ||
| 15 | local type rockspec = require("luarocks.core.types.rockspec") | 15 | local type r = require("luarocks.core.types.rockspec") |
| 16 | local type Rockspec = rockspec.Rockspec | 16 | local type Rockspec = r.Rockspec |
| 17 | 17 | ||
| 18 | --- Fetch sources for building a rock from a local Git repository. | 18 | --- Fetch sources for building a rock from a local Git repository. |
| 19 | -- @param rockspec table: The rockspec table | 19 | -- @param rockspec table: The rockspec table |
diff --git a/src/luarocks/fetch/git_ssh.tl b/src/luarocks/fetch/git_ssh.tl index 65954353..0d6f9742 100644 --- a/src/luarocks/fetch/git_ssh.tl +++ b/src/luarocks/fetch/git_ssh.tl | |||
| @@ -12,8 +12,8 @@ end | |||
| 12 | 12 | ||
| 13 | local git = require("luarocks.fetch.git") | 13 | local git = require("luarocks.fetch.git") |
| 14 | 14 | ||
| 15 | local type rockspec = require("luarocks.core.types.rockspec") | 15 | local type r = require("luarocks.core.types.rockspec") |
| 16 | local type Rockspec = rockspec.Rockspec | 16 | local type Rockspec = r.Rockspec |
| 17 | 17 | ||
| 18 | --- Fetch sources for building a rock from a local Git repository. | 18 | --- Fetch sources for building a rock from a local Git repository. |
| 19 | -- @param rockspec table: The rockspec table | 19 | -- @param rockspec table: The rockspec table |
diff --git a/src/luarocks/fetch/hg.tl b/src/luarocks/fetch/hg.tl index 0fbf5601..cbdcdc86 100644 --- a/src/luarocks/fetch/hg.tl +++ b/src/luarocks/fetch/hg.tl | |||
| @@ -7,8 +7,8 @@ local fs = require("luarocks.fs") | |||
| 7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
| 8 | local util = require("luarocks.util") | 8 | local util = require("luarocks.util") |
| 9 | 9 | ||
| 10 | local type rockspec = require("luarocks.core.types.rockspec") | 10 | local type r = require("luarocks.core.types.rockspec") |
| 11 | local type Rockspec = rockspec.Rockspec | 11 | local type Rockspec = r.Rockspec |
| 12 | 12 | ||
| 13 | --- Download sources for building a rock, using hg. | 13 | --- Download sources for building a rock, using hg. |
| 14 | -- @param rockspec table: The rockspec table | 14 | -- @param rockspec table: The rockspec table |
diff --git a/src/luarocks/fetch/hg_http.tl b/src/luarocks/fetch/hg_http.tl index f526d2d5..218543cd 100644 --- a/src/luarocks/fetch/hg_http.tl +++ b/src/luarocks/fetch/hg_http.tl | |||
| @@ -10,8 +10,8 @@ end | |||
| 10 | 10 | ||
| 11 | local hg = require("luarocks.fetch.hg") | 11 | local hg = require("luarocks.fetch.hg") |
| 12 | 12 | ||
| 13 | local type rockspec = require("luarocks.core.types.rockspec") | 13 | local type r = require("luarocks.core.types.rockspec") |
| 14 | local type Rockspec = rockspec.Rockspec | 14 | local type Rockspec = r.Rockspec |
| 15 | 15 | ||
| 16 | --- Download sources for building a rock, using hg over http. | 16 | --- Download sources for building a rock, using hg over http. |
| 17 | -- @param rockspec table: The rockspec table | 17 | -- @param rockspec table: The rockspec table |
diff --git a/src/luarocks/fetch/sscm.tl b/src/luarocks/fetch/sscm.tl index ad5a615e..fd9b2ef5 100644 --- a/src/luarocks/fetch/sscm.tl +++ b/src/luarocks/fetch/sscm.tl | |||
| @@ -6,8 +6,8 @@ end | |||
| 6 | local fs = require("luarocks.fs") | 6 | local fs = require("luarocks.fs") |
| 7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
| 8 | 8 | ||
| 9 | local type rockspec = require("luarocks.core.types.rockspec") | 9 | local type r = require("luarocks.core.types.rockspec") |
| 10 | local type Rockspec = rockspec.Rockspec | 10 | local type Rockspec = r.Rockspec |
| 11 | 11 | ||
| 12 | --- Download sources via Surround SCM Server for building a rock. | 12 | --- Download sources via Surround SCM Server for building a rock. |
| 13 | -- @param rockspec table: The rockspec table | 13 | -- @param rockspec table: The rockspec table |
diff --git a/src/luarocks/fetch/svn.tl b/src/luarocks/fetch/svn.tl index df3cdde9..3db136e9 100644 --- a/src/luarocks/fetch/svn.tl +++ b/src/luarocks/fetch/svn.tl | |||
| @@ -7,8 +7,8 @@ local fs = require("luarocks.fs") | |||
| 7 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
| 8 | local util = require("luarocks.util") | 8 | local util = require("luarocks.util") |
| 9 | 9 | ||
| 10 | local type rockspec = require("luarocks.core.types.rockspec") | 10 | local type r = require("luarocks.core.types.rockspec") |
| 11 | local type Rockspec = rockspec.Rockspec | 11 | local type Rockspec = r.Rockspec |
| 12 | 12 | ||
| 13 | --- Download sources for building a rock, using Subversion. | 13 | --- Download sources for building a rock, using Subversion. |
| 14 | -- @param rockspec table: The rockspec table | 14 | -- @param rockspec table: The rockspec table |
diff --git a/src/luarocks/manif.tl b/src/luarocks/manif.tl index f1963150..7a003021 100644 --- a/src/luarocks/manif.tl +++ b/src/luarocks/manif.tl | |||
| @@ -9,9 +9,9 @@ local record manif | |||
| 9 | rock_manifest_cache: {string: RockManifest} | 9 | rock_manifest_cache: {string: RockManifest} |
| 10 | end | 10 | end |
| 11 | 11 | ||
| 12 | local type rockmanifest = require("luarocks.core.types.rockmanifest") | 12 | local type rm = require("luarocks.core.types.rockmanifest") |
| 13 | local type RockManifest = rockmanifest.RockManifest | 13 | local type RockManifest = rm.RockManifest |
| 14 | local type Entry = rockmanifest.RockManifest.Entry | 14 | local type Entry = rm.RockManifest.Entry |
| 15 | 15 | ||
| 16 | local core = require("luarocks.core.manif") | 16 | local core = require("luarocks.core.manif") |
| 17 | local persist = require("luarocks.persist") | 17 | local persist = require("luarocks.persist") |
| @@ -24,13 +24,13 @@ local util = require("luarocks.util") | |||
| 24 | local queries = require("luarocks.queries") | 24 | local queries = require("luarocks.queries") |
| 25 | local type_manifest = require("luarocks.type.manifest") | 25 | local type_manifest = require("luarocks.type.manifest") |
| 26 | 26 | ||
| 27 | local type tree = require("luarocks.core.types.tree") | 27 | local type t = require("luarocks.core.types.tree") |
| 28 | local type Tree = tree.Tree | 28 | local type Tree = t.Tree |
| 29 | local type m = require("luarocks.core.types.manifest") | 29 | local type m = require("luarocks.core.types.manifest") |
| 30 | local type Manifest = m.Manifest | 30 | local type Manifest = m.Manifest |
| 31 | local type Tree_manifest = m .Tree_manifest | 31 | local type Tree_manifest = m.Tree_manifest |
| 32 | local type query = require("luarocks.core.types.query") | 32 | local type q = require("luarocks.core.types.query") |
| 33 | local type Query = query.Query | 33 | local type Query = q.Query |
| 34 | 34 | ||
| 35 | manif.cache_manifest = core.cache_manifest | 35 | manif.cache_manifest = core.cache_manifest |
| 36 | manif.load_rocks_tree_manifests = core.load_rocks_tree_manifests | 36 | manif.load_rocks_tree_manifests = core.load_rocks_tree_manifests |
diff --git a/src/luarocks/path.tl b/src/luarocks/path.tl index 1dc77e86..908b5952 100644 --- a/src/luarocks/path.tl +++ b/src/luarocks/path.tl | |||
| @@ -8,8 +8,8 @@ local core = require("luarocks.core.path") | |||
| 8 | local dir = require("luarocks.dir") | 8 | local dir = require("luarocks.dir") |
| 9 | local util = require("luarocks.core.util") | 9 | local util = require("luarocks.core.util") |
| 10 | 10 | ||
| 11 | local type tree = require("luarocks.core.types.tree") | 11 | local type t = require("luarocks.core.types.tree") |
| 12 | local type Tree = tree.Tree | 12 | local type Tree = t.Tree |
| 13 | 13 | ||
| 14 | local record path | 14 | local record path |
| 15 | rocks_dir: function(string | Tree): string | 15 | rocks_dir: function(string | Tree): string |
diff --git a/src/luarocks/queries.tl b/src/luarocks/queries.tl index dec57585..bed7612c 100644 --- a/src/luarocks/queries.tl +++ b/src/luarocks/queries.tl | |||
| @@ -6,22 +6,23 @@ local vers = require("luarocks.core.vers") | |||
| 6 | local util = require("luarocks.util") | 6 | local util = require("luarocks.util") |
| 7 | local cfg = require("luarocks.core.cfg") | 7 | local cfg = require("luarocks.core.cfg") |
| 8 | 8 | ||
| 9 | local type query = require("luarocks.core.types.query") | 9 | local type q = require("luarocks.core.types.query") |
| 10 | local type version = require("luarocks.core.types.version") | 10 | local type Query = q.Query |
| 11 | local type Query = query.Query | 11 | |
| 12 | local type Version = version.Version | 12 | local type v = require("luarocks.core.types.version") |
| 13 | local type Constraint = version.Constraint | 13 | local type Version = v.Version |
| 14 | local type Constraint = v.Constraint | ||
| 14 | 15 | ||
| 15 | local query_mt: metatable<Query> = {} | 16 | local query_mt: metatable<Query> = {} |
| 16 | 17 | ||
| 17 | query_mt.__index = query.Query | 18 | query_mt.__index = q.Query |
| 18 | 19 | ||
| 19 | function query.Query.type(): string --? remove later | 20 | function q.Query.type(): string --? remove later |
| 20 | return "query" | 21 | return "query" |
| 21 | end | 22 | end |
| 22 | 23 | ||
| 23 | -- Fallback default value for the `arch` field, if not explicitly set. | 24 | -- Fallback default value for the `arch` field, if not explicitly set. |
| 24 | query.Query.arch = { | 25 | q.Query.arch = { |
| 25 | src = true, | 26 | src = true, |
| 26 | all = true, | 27 | all = true, |
| 27 | rockspec = true, | 28 | rockspec = true, |
| @@ -30,7 +31,7 @@ query.Query.arch = { | |||
| 30 | } | 31 | } |
| 31 | 32 | ||
| 32 | -- Fallback default value for the `substring` field, if not explicitly set. | 33 | -- Fallback default value for the `substring` field, if not explicitly set. |
| 33 | query.Query.substring = false | 34 | q.Query.substring = false |
| 34 | 35 | ||
| 35 | --- Convert the arch field of a query table to table format. | 36 | --- Convert the arch field of a query table to table format. |
| 36 | -- @param input string, table or nil | 37 | -- @param input string, table or nil |
| @@ -75,7 +76,7 @@ function queries.new(name: string, namespace?: string, version?: string, substri | |||
| 75 | table.insert(self.constraints, { op = operator, version = vers.parse_version(version)}) | 76 | table.insert(self.constraints, { op = operator, version = vers.parse_version(version)}) |
| 76 | end | 77 | end |
| 77 | 78 | ||
| 78 | query.Query.arch[cfg.arch] = true | 79 | q.Query.arch[cfg.arch] = true |
| 79 | return setmetatable(self, query_mt) | 80 | return setmetatable(self, query_mt) |
| 80 | end | 81 | end |
| 81 | 82 | ||
| @@ -179,13 +180,13 @@ do | |||
| 179 | constraints = constraints, | 180 | constraints = constraints, |
| 180 | } | 181 | } |
| 181 | 182 | ||
| 182 | query.Query.arch[cfg.arch] = true | 183 | q.Query.arch[cfg.arch] = true |
| 183 | return setmetatable(self, query_mt) | 184 | return setmetatable(self, query_mt) |
| 184 | end | 185 | end |
| 185 | end | 186 | end |
| 186 | 187 | ||
| 187 | function queries.from_persisted_table(tbl: Query): Query | 188 | function queries.from_persisted_table(tbl: Query): Query |
| 188 | query.Query.arch[cfg.arch] = true | 189 | q.Query.arch[cfg.arch] = true |
| 189 | return setmetatable(tbl, query_mt) | 190 | return setmetatable(tbl, query_mt) |
| 190 | end | 191 | end |
| 191 | 192 | ||
diff --git a/src/luarocks/results.tl b/src/luarocks/results.tl index 99f70ec4..cbe6704d 100644 --- a/src/luarocks/results.tl +++ b/src/luarocks/results.tl | |||
| @@ -10,10 +10,10 @@ end | |||
| 10 | 10 | ||
| 11 | local vers = require("luarocks.core.vers") | 11 | local vers = require("luarocks.core.vers") |
| 12 | local util = require("luarocks.util") | 12 | local util = require("luarocks.util") |
| 13 | local type query = require("luarocks.core.types.query") | 13 | local type q = require("luarocks.core.types.query") |
| 14 | local type Query = q.Query | ||
| 14 | 15 | ||
| 15 | local type Results = results.Results | 16 | local type Results = results.Results |
| 16 | local type Query = query.Query | ||
| 17 | 17 | ||
| 18 | local result_mt: metatable<Results> = {} | 18 | local result_mt: metatable<Results> = {} |
| 19 | 19 | ||
diff --git a/src/luarocks/rockspecs.tl b/src/luarocks/rockspecs.tl index 175428c4..3ea6c147 100644 --- a/src/luarocks/rockspecs.tl +++ b/src/luarocks/rockspecs.tl | |||
| @@ -9,15 +9,12 @@ local type_rockspec = require("luarocks.type.rockspec") | |||
| 9 | local util = require("luarocks.util") | 9 | local util = require("luarocks.util") |
| 10 | local vers = require("luarocks.core.vers") | 10 | local vers = require("luarocks.core.vers") |
| 11 | 11 | ||
| 12 | local type rockspec = require("luarocks.core.types.rockspec") | 12 | local type r = require("luarocks.core.types.rockspec") |
| 13 | local type Rockspec = rockspec.Rockspec | 13 | local type Rockspec = r.Rockspec |
| 14 | local type Variables = r.Variables | ||
| 14 | 15 | ||
| 15 | -- local type Query = require("luarocks.core.types.query").Query --TEAL BUG #778 | 16 | local type q = require("luarocks.core.types.query") |
| 16 | 17 | local type Query = q.Query | |
| 17 | local type query = require("luarocks.core.types.query") | ||
| 18 | local type Query = query.Query | ||
| 19 | |||
| 20 | local type Variables = rockspec.Variables | ||
| 21 | 18 | ||
| 22 | local vendored_build_type_set: {string: boolean} = { | 19 | local vendored_build_type_set: {string: boolean} = { |
| 23 | ["builtin"] = true, | 20 | ["builtin"] = true, |
| @@ -30,9 +27,9 @@ local vendored_build_type_set: {string: boolean} = { | |||
| 30 | 27 | ||
| 31 | local rockspec_mt: metatable<Rockspec> = {} | 28 | local rockspec_mt: metatable<Rockspec> = {} |
| 32 | 29 | ||
| 33 | rockspec_mt.__index = rockspec.Rockspec | 30 | rockspec_mt.__index = r.Rockspec |
| 34 | 31 | ||
| 35 | function rockspec.Rockspec.type(): string | 32 | function r.Rockspec.type(): string |
| 36 | return "rockspec" | 33 | return "rockspec" |
| 37 | end | 34 | end |
| 38 | 35 | ||
diff --git a/src/luarocks/test.tl b/src/luarocks/test.tl index ec2b0ada..56bc8c74 100644 --- a/src/luarocks/test.tl +++ b/src/luarocks/test.tl | |||
| @@ -5,9 +5,9 @@ local fetch = require("luarocks.fetch") | |||
| 5 | local deps = require("luarocks.deps") | 5 | local deps = require("luarocks.deps") |
| 6 | local util = require("luarocks.util") | 6 | local util = require("luarocks.util") |
| 7 | 7 | ||
| 8 | local type rockspec = require("luarocks.core.types.rockspec") | 8 | local type r = require("luarocks.core.types.rockspec") |
| 9 | local type Rockspec = rockspec.Rockspec | 9 | local type Rockspec = r.Rockspec |
| 10 | local type Test = rockspec.Test | 10 | local type Test = r.Test |
| 11 | 11 | ||
| 12 | local test_types = { | 12 | local test_types = { |
| 13 | "busted", | 13 | "busted", |
diff --git a/src/luarocks/type/manifest.tl b/src/luarocks/type/manifest.tl index 3114b82a..2f9a8a5d 100644 --- a/src/luarocks/type/manifest.tl +++ b/src/luarocks/type/manifest.tl | |||
| @@ -1,8 +1,8 @@ | |||
| 1 | local record type_manifest | 1 | local record type_manifest |
| 2 | end | 2 | end |
| 3 | 3 | ||
| 4 | local type manifest = require("luarocks.core.types.manifest") | 4 | local type m = require("luarocks.core.types.manifest") |
| 5 | local type Manifest = manifest.Manifest | 5 | local type Manifest = m.Manifest |
| 6 | 6 | ||
| 7 | local type_check = require("luarocks.type_check") | 7 | local type_check = require("luarocks.type_check") |
| 8 | 8 | ||
diff --git a/src/luarocks/type/rockspec.tl b/src/luarocks/type/rockspec.tl index 014dc4d3..8458c6f7 100644 --- a/src/luarocks/type/rockspec.tl +++ b/src/luarocks/type/rockspec.tl | |||
| @@ -3,11 +3,11 @@ local record type_rockspec | |||
| 3 | rockspec_format: string | 3 | rockspec_format: string |
| 4 | end | 4 | end |
| 5 | 5 | ||
| 6 | local type ordering = require("luarocks.core.types.ordering") | 6 | local type o = require("luarocks.core.types.ordering") |
| 7 | local type Ordering = ordering.Ordering | 7 | local type Ordering = o.Ordering |
| 8 | 8 | ||
| 9 | local type rockspec = require("luarocks.core.types.rockspec") | 9 | local type r = require("luarocks.core.types.rockspec") |
| 10 | local type Rockspec = rockspec.Rockspec | 10 | local type Rockspec = r.Rockspec |
| 11 | 11 | ||
| 12 | local type_check = require("luarocks.type_check") | 12 | local type_check = require("luarocks.type_check") |
| 13 | 13 | ||
diff --git a/src/luarocks/util.tl b/src/luarocks/util.tl index 4b4fd3bd..9e940f8c 100644 --- a/src/luarocks/util.tl +++ b/src/luarocks/util.tl | |||
| @@ -7,9 +7,9 @@ | |||
| 7 | local core = require("luarocks.core.util") | 7 | local core = require("luarocks.core.util") |
| 8 | local cfg = require("luarocks.core.cfg") | 8 | local cfg = require("luarocks.core.cfg") |
| 9 | 9 | ||
| 10 | local type ordering = require("luarocks.core.types.ordering") | 10 | local type o = require("luarocks.core.types.ordering") |
| 11 | local type Ordering = ordering.Ordering | 11 | local type Ordering = o.Ordering |
| 12 | local type SortBy = ordering.SortBy | 12 | local type SortBy = o.SortBy |
| 13 | 13 | ||
| 14 | local record util | 14 | local record util |
| 15 | cleanup_path: function(string, string, string, boolean): string | 15 | cleanup_path: function(string, string, string, boolean): string |
| @@ -51,8 +51,8 @@ util.keys = core.keys | |||
| 51 | util.matchquote = core.matchquote | 51 | util.matchquote = core.matchquote |
| 52 | 52 | ||
| 53 | local type Fn = util.Fn | 53 | local type Fn = util.Fn |
| 54 | local type rockspec = require("luarocks.core.types.rockspec") | 54 | local type r = require("luarocks.core.types.rockspec") |
| 55 | local type Rockspec = rockspec.Rockspec | 55 | local type Rockspec = r.Rockspec |
| 56 | local type Parser = util.Parser | 56 | local type Parser = util.Parser |
| 57 | 57 | ||
| 58 | 58 | ||
