diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2021-08-13 15:12:52 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-13 15:12:52 -0300 |
commit | 5a442c2bd307bd7078eb16c6802323e300d80960 (patch) | |
tree | ac10736ca3520d30638aa0b60c8a942596d19a6d /src | |
parent | cdd821167c702627a6baa0b32b855e484f64b123 (diff) | |
download | luarocks-5a442c2bd307bd7078eb16c6802323e300d80960.tar.gz luarocks-5a442c2bd307bd7078eb16c6802323e300d80960.tar.bz2 luarocks-5a442c2bd307bd7078eb16c6802323e300d80960.zip |
upload: support uploading pre-packaged .src.rock files (#1321)
upload: support uploading pre-packaged .src.rock files
Co-authored-by: daurnimator <quae@daurnimator.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/cmd/upload.lua | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/luarocks/cmd/upload.lua b/src/luarocks/cmd/upload.lua index da51b401..6b84e452 100644 --- a/src/luarocks/cmd/upload.lua +++ b/src/luarocks/cmd/upload.lua | |||
@@ -14,6 +14,8 @@ function upload.add_to_parser(parser) | |||
14 | :summary("Upload a rockspec to the public rocks repository.") | 14 | :summary("Upload a rockspec to the public rocks repository.") |
15 | 15 | ||
16 | cmd:argument("rockspec", "Rockspec for the rock to upload.") | 16 | cmd:argument("rockspec", "Rockspec for the rock to upload.") |
17 | cmd:argument("src-rock", "A corresponding .src.rock file; if not given it will be generated.") | ||
18 | :args("?") | ||
17 | 19 | ||
18 | cmd:flag("--skip-pack", "Do not pack and send source rock.") | 20 | cmd:flag("--skip-pack", "Do not pack and send source rock.") |
19 | cmd:option("--api-key", "Pass an API key. It will be stored for subsequent uses.") | 21 | cmd:option("--api-key", "Pass an API key. It will be stored for subsequent uses.") |
@@ -73,19 +75,22 @@ function upload.command(args) | |||
73 | end | 75 | end |
74 | 76 | ||
75 | local rock_fname | 77 | local rock_fname |
76 | if not args.skip_pack and not is_dev_version(rockspec.version) then | 78 | if args.src_rock then |
79 | rock_fname = args.src_rock | ||
80 | elseif not args.skip_pack and not is_dev_version(rockspec.version) then | ||
77 | util.printout("Packing " .. tostring(rockspec.package)) | 81 | util.printout("Packing " .. tostring(rockspec.package)) |
78 | rock_fname, err = pack.pack_source_rock(args.rockspec) | 82 | rock_fname, err = pack.pack_source_rock(args.rockspec) |
79 | if not rock_fname then | 83 | if not rock_fname then |
80 | return nil, err | 84 | return nil, err |
81 | end | 85 | end |
82 | if args.sign then | 86 | end |
83 | rock_sigfname, err = signing.sign_file(rock_fname) | 87 | |
84 | if err then | 88 | if rock_fname and args.sign then |
85 | return nil, "Failed signing rock: " .. err | 89 | rock_sigfname, err = signing.sign_file(rock_fname) |
86 | end | 90 | if err then |
87 | util.printout("Signed packed rock: "..rock_sigfname) | 91 | return nil, "Failed signing rock: " .. err |
88 | end | 92 | end |
93 | util.printout("Signed packed rock: "..rock_sigfname) | ||
89 | end | 94 | end |
90 | 95 | ||
91 | local multipart = require("luarocks.upload.multipart") | 96 | local multipart = require("luarocks.upload.multipart") |