From a07bc4c9e0be86b4edee78b9a7ef924eb9e2faaf Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Tue, 13 Apr 2021 16:01:56 -0300 Subject: fix: don't propagate invalid exitcode in download errors --- src/luarocks/cmd/build.lua | 12 ++++++------ src/luarocks/download.lua | 4 +++- 2 files changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/luarocks/cmd/build.lua b/src/luarocks/cmd/build.lua index 6ad76b6e..002c7232 100644 --- a/src/luarocks/cmd/build.lua +++ b/src/luarocks/cmd/build.lua @@ -94,9 +94,9 @@ local function do_build(name, namespace, version, opts) end if url:match("%.rockspec$") then - local rockspec, err, errcode = fetch.load_rockspec(url, nil, opts.verify) + local rockspec, err = fetch.load_rockspec(url, nil, opts.verify) if not rockspec then - return nil, err, errcode + return nil, err end return build.build_rockspec(rockspec, opts) end @@ -138,11 +138,11 @@ function cmd_build.command(args) if args.pack_binary_rock then return pack.pack_binary_rock(args.rock, args.namespace, args.version, args.sign, function() - local name, version, errcode = do_build(args.rock, args.namespace, args.version, opts) + local name, version = do_build(args.rock, args.namespace, args.version, opts) if name and args.no_doc then util.remove_doc_dir(name, version) end - return name, version, errcode + return name, version end) end @@ -151,9 +151,9 @@ function cmd_build.command(args) return nil, err, cmd.errorcodes.PERMISSIONDENIED end - local name, version, errcode = do_build(args.rock, args.namespace, args.version, opts) + local name, version = do_build(args.rock, args.namespace, args.version, opts) if not name then - return nil, version, errcode + return nil, version end if args.no_doc then diff --git a/src/luarocks/download.lua b/src/luarocks/download.lua index 1246e498..07a2a65f 100644 --- a/src/luarocks/download.lua +++ b/src/luarocks/download.lua @@ -18,7 +18,9 @@ local function get_file(filename) return nil, err end else - return fetch.fetch_url(filename) + -- discard third result + local ok, err = fetch.fetch_url(filename) + return ok, err end end -- cgit v1.2.3-55-g6feb