diff options
-rw-r--r-- | src/luarocks/add.lua | 2 | ||||
-rw-r--r-- | src/luarocks/admin_remove.lua | 2 | ||||
-rw-r--r-- | src/luarocks/cache.lua | 2 | ||||
-rw-r--r-- | src/luarocks/cfg.lua | 1 | ||||
-rw-r--r-- | src/luarocks/deps.lua | 35 |
5 files changed, 26 insertions, 16 deletions
diff --git a/src/luarocks/add.lua b/src/luarocks/add.lua index 831d3b92..f1142d2a 100644 --- a/src/luarocks/add.lua +++ b/src/luarocks/add.lua | |||
@@ -93,7 +93,7 @@ local function add_files_to_server(refresh, rockfiles, server, upload_server) | |||
93 | local cmd | 93 | local cmd |
94 | if protocol == "rsync" then | 94 | if protocol == "rsync" then |
95 | local srv, path = server_path:match("([^/]+)(/.+)") | 95 | local srv, path = server_path:match("([^/]+)(/.+)") |
96 | cmd = cfg.variables.RSYNC.." --exclude=.git -Oavz -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" | 96 | cmd = cfg.variables.RSYNC.." "..cfg.variables.RSYNCFLAGS.." -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" |
97 | elseif upload_server and upload_server.sftp then | 97 | elseif upload_server and upload_server.sftp then |
98 | local part1, part2 = upload_server.sftp:match("^([^/]*)/(.*)$") | 98 | local part1, part2 = upload_server.sftp:match("^([^/]*)/(.*)$") |
99 | cmd = cfg.variables.SCP.." "..table.concat(files, " ").." "..user.."@"..part1..":/"..part2 | 99 | cmd = cfg.variables.SCP.." "..table.concat(files, " ").." "..user.."@"..part1..":/"..part2 |
diff --git a/src/luarocks/admin_remove.lua b/src/luarocks/admin_remove.lua index a97026e8..d429ce59 100644 --- a/src/luarocks/admin_remove.lua +++ b/src/luarocks/admin_remove.lua | |||
@@ -68,7 +68,7 @@ local function remove_files_from_server(refresh, rockfiles, server, upload_serve | |||
68 | index.make_index(local_cache) | 68 | index.make_index(local_cache) |
69 | 69 | ||
70 | local srv, path = server_path:match("([^/]+)(/.+)") | 70 | local srv, path = server_path:match("([^/]+)(/.+)") |
71 | local cmd = "rsync -Oavz --delete -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" | 71 | local cmd = cfg.variables.RSYNC.." "..cfg.variables.RSYNCFLAGS.." --delete -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" |
72 | 72 | ||
73 | util.printout(cmd) | 73 | util.printout(cmd) |
74 | fs.execute(cmd) | 74 | fs.execute(cmd) |
diff --git a/src/luarocks/cache.lua b/src/luarocks/cache.lua index 6ea6e82a..a3dfe8b1 100644 --- a/src/luarocks/cache.lua +++ b/src/luarocks/cache.lua | |||
@@ -74,7 +74,7 @@ function refresh_local_cache(server, url, user, password) | |||
74 | local ok = false | 74 | local ok = false |
75 | if protocol == "rsync" then | 75 | if protocol == "rsync" then |
76 | local srv, path = server_path:match("([^/]+)(/.+)") | 76 | local srv, path = server_path:match("([^/]+)(/.+)") |
77 | ok = fs.execute(cfg.variables.RSYNC.." -avz -e ssh "..user.."@"..srv..":"..path.."/ "..local_cache.."/") | 77 | ok = fs.execute(cfg.variables.RSYNC.." "..cfg.variables.RSYNCFLAGS.." -e ssh "..user.."@"..srv..":"..path.."/ "..local_cache.."/") |
78 | else | 78 | else |
79 | local login_info = "" | 79 | local login_info = "" |
80 | if user then login_info = " --user="..user end | 80 | if user then login_info = " --user="..user end |
diff --git a/src/luarocks/cfg.lua b/src/luarocks/cfg.lua index 62c69597..8e26bb46 100644 --- a/src/luarocks/cfg.lua +++ b/src/luarocks/cfg.lua | |||
@@ -250,6 +250,7 @@ local defaults = { | |||
250 | CMAKE = "cmake", | 250 | CMAKE = "cmake", |
251 | SEVENZ = "7z", | 251 | SEVENZ = "7z", |
252 | 252 | ||
253 | RSYNCFLAGS = "--exclude=.git -Ocavz", | ||
253 | STATFLAG = "-c '%a'", | 254 | STATFLAG = "-c '%a'", |
254 | }, | 255 | }, |
255 | 256 | ||
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index e0b8a42d..f24dc507 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -360,6 +360,11 @@ local function match_dep(dep, blacklist, deps_mode) | |||
360 | end | 360 | end |
361 | end | 361 | end |
362 | 362 | ||
363 | local whitelist = {} | ||
364 | if cfg.lua_version == "5.2" then | ||
365 | whitelist["bit32"] = true | ||
366 | end | ||
367 | |||
363 | --- Attempt to match dependencies of a rockspec to installed rocks. | 368 | --- Attempt to match dependencies of a rockspec to installed rocks. |
364 | -- @param rockspec table: The rockspec loaded as a table. | 369 | -- @param rockspec table: The rockspec loaded as a table. |
365 | -- @param blacklist table or nil: Program versions to not use as valid matches. | 370 | -- @param blacklist table or nil: Program versions to not use as valid matches. |
@@ -367,24 +372,28 @@ end | |||
367 | -- are program versions and values are 'true'. | 372 | -- are program versions and values are 'true'. |
368 | -- @return table, table: A table where keys are dependencies parsed | 373 | -- @return table, table: A table where keys are dependencies parsed |
369 | -- in table format and values are tables containing fields 'name' and | 374 | -- in table format and values are tables containing fields 'name' and |
370 | -- version' representing matches, and a table of missing dependencies | 375 | -- version' representing matches; a table of missing dependencies |
371 | -- parsed as tables. | 376 | -- parsed as tables; and a table of "no-upgrade" missing dependencies |
377 | -- (to be used in plugin modules so that a plugin does not force upgrade of | ||
378 | -- its parent application). | ||
372 | function match_deps(rockspec, blacklist, deps_mode) | 379 | function match_deps(rockspec, blacklist, deps_mode) |
373 | assert(type(rockspec) == "table") | 380 | assert(type(rockspec) == "table") |
374 | assert(type(blacklist) == "table" or not blacklist) | 381 | assert(type(blacklist) == "table" or not blacklist) |
375 | local matched, missing, no_upgrade = {}, {}, {} | 382 | local matched, missing, no_upgrade = {}, {}, {} |
376 | 383 | ||
377 | for _, dep in ipairs(rockspec.dependencies) do | 384 | for _, dep in ipairs(rockspec.dependencies) do |
378 | local found = match_dep(dep, blacklist and blacklist[dep.name] or nil, deps_mode) | 385 | if not whitelist[dep.name] then |
379 | if found then | 386 | local found = match_dep(dep, blacklist and blacklist[dep.name] or nil, deps_mode) |
380 | if dep.name ~= "lua" then | 387 | if found then |
381 | matched[dep] = found | 388 | if dep.name ~= "lua" then |
382 | end | 389 | matched[dep] = found |
383 | else | 390 | end |
384 | if dep.constraints[1] and dep.constraints[1].no_upgrade then | ||
385 | no_upgrade[dep.name] = dep | ||
386 | else | 391 | else |
387 | missing[dep.name] = dep | 392 | if dep.constraints[1] and dep.constraints[1].no_upgrade then |
393 | no_upgrade[dep.name] = dep | ||
394 | else | ||
395 | missing[dep.name] = dep | ||
396 | end | ||
388 | end | 397 | end |
389 | end | 398 | end |
390 | end | 399 | end |
@@ -441,7 +450,7 @@ function fulfill_dependencies(rockspec, deps_mode) | |||
441 | end | 450 | end |
442 | end | 451 | end |
443 | 452 | ||
444 | local matched, missing, no_upgrade = match_deps(rockspec, nil, deps_mode) | 453 | local _, missing, no_upgrade = match_deps(rockspec, nil, deps_mode) |
445 | 454 | ||
446 | if next(no_upgrade) then | 455 | if next(no_upgrade) then |
447 | util.printerr("Missing dependencies for "..rockspec.name.." "..rockspec.version..":") | 456 | util.printerr("Missing dependencies for "..rockspec.name.." "..rockspec.version..":") |