diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2024-04-04 23:32:09 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2024-04-05 17:32:15 -0300 |
commit | 15d71214638c6f7f808b838cfc4215ece0a53101 (patch) | |
tree | 9257a042e7bae73aa6aacf03885db03a13091f44 /src | |
parent | 8c4b4cf98ab1b46b24db3f1c6478bb8d521720e8 (diff) | |
download | luarocks-15d71214638c6f7f808b838cfc4215ece0a53101.tar.gz luarocks-15d71214638c6f7f808b838cfc4215ece0a53101.tar.bz2 luarocks-15d71214638c6f7f808b838cfc4215ece0a53101.zip |
fix(build): ensure --force works for build
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/build.lua | 1 | ||||
-rw-r--r-- | src/luarocks/cmd/build.lua | 3 | ||||
-rw-r--r-- | src/luarocks/cmd/install.lua | 2 | ||||
-rw-r--r-- | src/luarocks/cmd/make.lua | 1 |
4 files changed, 5 insertions, 2 deletions
diff --git a/src/luarocks/build.lua b/src/luarocks/build.lua index 55242e60..c6b3388b 100644 --- a/src/luarocks/build.lua +++ b/src/luarocks/build.lua | |||
@@ -24,6 +24,7 @@ build.opts = util.opts_table("build.opts", { | |||
24 | verify = "boolean", | 24 | verify = "boolean", |
25 | check_lua_versions = "boolean", | 25 | check_lua_versions = "boolean", |
26 | pin = "boolean", | 26 | pin = "boolean", |
27 | rebuild = "boolean", | ||
27 | no_install = "boolean" | 28 | no_install = "boolean" |
28 | }) | 29 | }) |
29 | 30 | ||
diff --git a/src/luarocks/cmd/build.lua b/src/luarocks/cmd/build.lua index ada6b7d2..32680411 100644 --- a/src/luarocks/cmd/build.lua +++ b/src/luarocks/cmd/build.lua | |||
@@ -95,7 +95,7 @@ local function do_build(name, namespace, version, opts) | |||
95 | 95 | ||
96 | name, version = path.parse_name(url) | 96 | name, version = path.parse_name(url) |
97 | if name and repos.is_installed(name, version) then | 97 | if name and repos.is_installed(name, version) then |
98 | if (not opts.force) and (not opts.force_fast) then | 98 | if not opts.rebuild then |
99 | util.printout(name .. " " .. version .. " is already installed in " .. path.root_dir(cfg.root_dir)) | 99 | util.printout(name .. " " .. version .. " is already installed in " .. path.root_dir(cfg.root_dir)) |
100 | util.printout("Use --force to reinstall.") | 100 | util.printout("Use --force to reinstall.") |
101 | return name, version, "skip" | 101 | return name, version, "skip" |
@@ -138,6 +138,7 @@ function cmd_build.command(args) | |||
138 | verify = not not args.verify, | 138 | verify = not not args.verify, |
139 | check_lua_versions = not not args.check_lua_versions, | 139 | check_lua_versions = not not args.check_lua_versions, |
140 | pin = not not args.pin, | 140 | pin = not not args.pin, |
141 | rebuild = not not (args.force or args.force_fast), | ||
141 | no_install = false | 142 | no_install = false |
142 | }) | 143 | }) |
143 | 144 | ||
diff --git a/src/luarocks/cmd/install.lua b/src/luarocks/cmd/install.lua index e71b6db8..9e705d12 100644 --- a/src/luarocks/cmd/install.lua +++ b/src/luarocks/cmd/install.lua | |||
@@ -84,7 +84,7 @@ function install.install_binary_rock(rock_file, opts) | |||
84 | return nil, "Incompatible architecture "..arch, "arch" | 84 | return nil, "Incompatible architecture "..arch, "arch" |
85 | end | 85 | end |
86 | if repos.is_installed(name, version) then | 86 | if repos.is_installed(name, version) then |
87 | if (not opts.force) and (not opts.force_fast) then | 87 | if not (opts.force or opts.force_fast) then |
88 | util.printout(name .. " " .. version .. " is already installed in " .. path.root_dir(cfg.root_dir)) | 88 | util.printout(name .. " " .. version .. " is already installed in " .. path.root_dir(cfg.root_dir)) |
89 | util.printout("Use --force to reinstall.") | 89 | util.printout("Use --force to reinstall.") |
90 | return name, version | 90 | return name, version |
diff --git a/src/luarocks/cmd/make.lua b/src/luarocks/cmd/make.lua index eaa4b899..0b3db27c 100644 --- a/src/luarocks/cmd/make.lua +++ b/src/luarocks/cmd/make.lua | |||
@@ -106,6 +106,7 @@ function make.command(args) | |||
106 | verify = not not args.verify, | 106 | verify = not not args.verify, |
107 | check_lua_versions = not not args.check_lua_versions, | 107 | check_lua_versions = not not args.check_lua_versions, |
108 | pin = not not args.pin, | 108 | pin = not not args.pin, |
109 | rebuild = true, | ||
109 | no_install = not not args.no_install | 110 | no_install = not not args.no_install |
110 | }) | 111 | }) |
111 | 112 | ||