diff options
-rw-r--r-- | src/luarocks/fetch/sscm.tl (renamed from src/luarocks/fetch/sscm.lua) | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/luarocks/fetch/sscm.lua b/src/luarocks/fetch/sscm.tl index 32bb2ecc..7c850a4b 100644 --- a/src/luarocks/fetch/sscm.lua +++ b/src/luarocks/fetch/sscm.tl | |||
@@ -1,10 +1,13 @@ | |||
1 | 1 | ||
2 | --- Fetch back-end for retrieving sources from Surround SCM Server | 2 | --- Fetch back-end for retrieving sources from Surround SCM Server |
3 | local sscm = {} | 3 | local record sscm |
4 | end | ||
4 | 5 | ||
5 | local fs = require("luarocks.fs") | 6 | local fs = require("luarocks.fs") |
6 | local dir = require("luarocks.dir") | 7 | local dir = require("luarocks.dir") |
7 | 8 | ||
9 | local type Rockspec = require("luarocks.core.types.rockspec").Rockspec | ||
10 | |||
8 | --- Download sources via Surround SCM Server for building a rock. | 11 | --- Download sources via Surround SCM Server for building a rock. |
9 | -- @param rockspec table: The rockspec table | 12 | -- @param rockspec table: The rockspec table |
10 | -- @param extract boolean: Unused in this module (required for API purposes.) | 13 | -- @param extract boolean: Unused in this module (required for API purposes.) |
@@ -12,9 +15,7 @@ local dir = require("luarocks.dir") | |||
12 | -- @return (string, string) or (nil, string): The absolute pathname of | 15 | -- @return (string, string) or (nil, string): The absolute pathname of |
13 | -- the fetched source tarball and the temporary directory created to | 16 | -- the fetched source tarball and the temporary directory created to |
14 | -- store it; or nil and an error message. | 17 | -- store it; or nil and an error message. |
15 | function sscm.get_sources(rockspec, extract, dest_dir) | 18 | function sscm.get_sources(rockspec: Rockspec, extract: boolean, dest_dir?: string): string, string |
16 | assert(rockspec:type() == "rockspec") | ||
17 | assert(type(dest_dir) == "string" or not dest_dir) | ||
18 | 19 | ||
19 | local sscm_cmd = rockspec.variables.SSCM | 20 | local sscm_cmd = rockspec.variables.SSCM |
20 | local module = rockspec.source.module or dir.base_name(rockspec.source.url) | 21 | local module = rockspec.source.module or dir.base_name(rockspec.source.url) |
@@ -23,7 +24,7 @@ function sscm.get_sources(rockspec, extract, dest_dir) | |||
23 | return nil, "Error retrieving branch and repository from rockspec." | 24 | return nil, "Error retrieving branch and repository from rockspec." |
24 | end | 25 | end |
25 | -- Search for working directory. | 26 | -- Search for working directory. |
26 | local working_dir | 27 | local working_dir: string |
27 | local tmp = io.popen(string.format(sscm_cmd..[[ property "/" -d -b%s -p%s]], branch, repository)) | 28 | local tmp = io.popen(string.format(sscm_cmd..[[ property "/" -d -b%s -p%s]], branch, repository)) |
28 | for line in tmp:lines() do | 29 | for line in tmp:lines() do |
29 | --%c because a chr(13) comes in the end. | 30 | --%c because a chr(13) comes in the end. |