Install luarocks .bat files correctly for older versions

This commit is contained in:
mpeterv 2016-03-28 20:55:57 +03:00
parent bf6026cb70
commit b6e056a671

View File

@ -902,9 +902,12 @@ class LuaRocks(Program):
run(args) run(args)
for script in ["luarocks.bat", "luarocks-admin.bat"]: for script in ["luarocks.bat", "luarocks-admin.bat"]:
shutil.copy( for subdir in [".", "2.2", "2.1", "2.0"]:
os.path.join(opts.location, "luarocks", script), script_path = os.path.join(opts.location, "luarocks", subdir, script)
os.path.join(opts.location, "bin"))
if os.path.exists(script_path):
shutil.copy(script_path, os.path.join(opts.location, "bin"))
break
else: else:
print("Building LuaRocks" + self.version_suffix) print("Building LuaRocks" + self.version_suffix)
run("./configure", "--prefix=" + opts.location, run("./configure", "--prefix=" + opts.location,