Skip to content

Commit b7fd1a7

Browse files
committed
fix dep local
1 parent 2eb8fa8 commit b7fd1a7

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

tarantoolapp/commands/dep.lua

+9-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ local function printf(f, ...)
1212
print(string.format('[%s] ' .. f, cfg.name, ...))
1313
end
1414

15+
local function raisef(f, ...)
16+
error(string.format('[%s] ' .. f, cfg.name, ...))
17+
end
18+
1519
local function errorf(f, ...)
1620
print(string.format('[%s] ' .. f, cfg.name, ...))
1721
os.exit(1)
@@ -39,7 +43,7 @@ local function ensure_rocksservers(path)
3943
end
4044
local data = f:read(f:stat().size)
4145
f:close()
42-
if data:match('rocks%.tarantool%.org') and data:match('rocks%.moonscript%.org') then
46+
if data:match('rocks%.tarantool%.org') and (data:match('rocks%.moonscript%.org') or data:match('luarocks%.org')) then
4347
printf('Already have proper rocks servers')
4448
return
4549
end
@@ -54,7 +58,7 @@ local function ensure_rocksservers(path)
5458
if not fh then
5559
errorf("Failed to open file %s: %s", path, errno.strerror())
5660
end
57-
fh:write('\nrocks_servers = {[[http://rocks.tarantool.org/]], [[https://rocks.moonscript.org]]}\n')
61+
fh:write('\nrocks_servers = {[[http://rocks.tarantool.org]], [[https://luarocks.org]]}\n')
5862
fh:close()
5963
end
6064

@@ -64,7 +68,7 @@ local function execute(cmd)
6468
printf("%s...", raw_cmd)
6569
local res = os.execute('exec ' .. raw_cmd)
6670
if res ~= 0 then
67-
errorf('%s failed', raw_cmd)
71+
raisef('%s failed', raw_cmd)
6872
end
6973
return res
7074
end
@@ -109,6 +113,7 @@ end
109113
local function argparse(argparser, cmd)
110114
cmd:option('-m --meta-file', 'path to meta.yaml file')
111115
:default('./meta.yaml')
116+
:convert(fio.abspath)
112117
cmd:option('-t --tree', 'path to directory that will hold the dependencies')
113118
:default('.rocks')
114119
:convert(fio.abspath)
@@ -125,10 +130,9 @@ local function run(args)
125130

126131
assert(args.meta_file ~= '', 'meta file is required')
127132

128-
args.meta_file = fio.abspath(args.meta_file)
129133
local meta_file = fio.open(args.meta_file)
130134
if meta_file == nil then
131-
errorf('Meta file %s does not exist', args.meta_file)
135+
util.errorf('Couldn\'t open %s: %s', args.meta_file, errno.strerror())
132136
end
133137
local metatext = meta_file:read(meta_file:stat().size)
134138
local tree = fio.abspath(args.tree)

0 commit comments

Comments
 (0)