diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2010-09-23 15:46:19 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2010-09-23 15:46:19 -0300 |
| commit | dfb1de8faa236740e79d3d55c55c6535edda43cb (patch) | |
| tree | cc8e1486c8403c0f9604e04140502c943b59e3a2 | |
| parent | be03328e54d4f233e2ce64f9b99f921264bd0eeb (diff) | |
| parent | d051ad5a21b653dbc5845900b5c4e734d92073c1 (diff) | |
| download | luarocks-dfb1de8faa236740e79d3d55c55c6535edda43cb.tar.gz luarocks-dfb1de8faa236740e79d3d55c55c6535edda43cb.tar.bz2 luarocks-dfb1de8faa236740e79d3d55c55c6535edda43cb.zip | |
Merge branch 'master' of github.com:keplerproject/luarocks
| -rwxr-xr-x | src/bin/luarocks-admin | 1 | ||||
| -rw-r--r-- | src/luarocks/add.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/admin_remove.lua | 2 | ||||
| -rw-r--r-- | src/luarocks/fetch/git.lua | 8 |
4 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/luarocks-admin b/src/bin/luarocks-admin index 6e528cd9..69814459 100755 --- a/src/bin/luarocks-admin +++ b/src/bin/luarocks-admin | |||
| @@ -11,6 +11,7 @@ commands = { | |||
| 11 | commands.help = require("luarocks.help") | 11 | commands.help = require("luarocks.help") |
| 12 | commands.make_manifest = require("luarocks.make_manifest") | 12 | commands.make_manifest = require("luarocks.make_manifest") |
| 13 | commands.add = require("luarocks.add") | 13 | commands.add = require("luarocks.add") |
| 14 | commands.remove = require("luarocks.admin_remove") | ||
| 14 | commands.refresh_cache = require("luarocks.refresh_cache") | 15 | commands.refresh_cache = require("luarocks.refresh_cache") |
| 15 | 16 | ||
| 16 | command_line.run_command(...) | 17 | command_line.run_command(...) |
diff --git a/src/luarocks/add.lua b/src/luarocks/add.lua index 61d44665..a6dc4531 100644 --- a/src/luarocks/add.lua +++ b/src/luarocks/add.lua | |||
| @@ -91,7 +91,7 @@ local function add_files_to_server(refresh, rockfiles, server, upload_server) | |||
| 91 | -- TODO abstract away explicit 'curl' call | 91 | -- TODO abstract away explicit 'curl' call |
| 92 | 92 | ||
| 93 | local cmd | 93 | local cmd |
| 94 | if upload_server and upload_server.rsync then | 94 | if protocol == "rsync" then |
| 95 | local srv, path = server_path:match("([^/]+)(/.+)") | 95 | local srv, path = server_path:match("([^/]+)(/.+)") |
| 96 | cmd = "rsync -Oavz -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" | 96 | cmd = "rsync -Oavz -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 |
diff --git a/src/luarocks/admin_remove.lua b/src/luarocks/admin_remove.lua index 1b1f845c..99852e36 100644 --- a/src/luarocks/admin_remove.lua +++ b/src/luarocks/admin_remove.lua | |||
| @@ -74,7 +74,7 @@ local function remove_files_from_server(refresh, rockfiles, server, upload_serve | |||
| 74 | index.make_index(local_cache) | 74 | index.make_index(local_cache) |
| 75 | 75 | ||
| 76 | local srv, path = server_path:match("([^/]+)(/.+)") | 76 | local srv, path = server_path:match("([^/]+)(/.+)") |
| 77 | local cmd = "rsync -Oavz -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" | 77 | local cmd = "rsync -Oavz --delete -e ssh "..local_cache.."/ "..user.."@"..srv..":"..path.."/" |
| 78 | 78 | ||
| 79 | print(cmd) | 79 | print(cmd) |
| 80 | fs.execute(cmd) | 80 | fs.execute(cmd) |
diff --git a/src/luarocks/fetch/git.lua b/src/luarocks/fetch/git.lua index d2420ef8..f2f17fb5 100644 --- a/src/luarocks/fetch/git.lua +++ b/src/luarocks/fetch/git.lua | |||
| @@ -21,7 +21,7 @@ function get_sources(rockspec, extract, dest_dir) | |||
| 21 | local module = dir.base_name(rockspec.source.url) | 21 | local module = dir.base_name(rockspec.source.url) |
| 22 | -- Strip off .git from base name if present | 22 | -- Strip off .git from base name if present |
| 23 | module = module:gsub("%.git$", "") | 23 | module = module:gsub("%.git$", "") |
| 24 | local command = {"git", "clone", rockspec.source.url, module} | 24 | local command = {"git", "clone", "--depth=1", rockspec.source.url, module} |
| 25 | local checkout_command | 25 | local checkout_command |
| 26 | local tag_or_branch = rockspec.source.tag or rockspec.source.branch | 26 | local tag_or_branch = rockspec.source.tag or rockspec.source.branch |
| 27 | if tag_or_branch then | 27 | if tag_or_branch then |
| @@ -41,13 +41,15 @@ function get_sources(rockspec, extract, dest_dir) | |||
| 41 | if not fs.execute(unpack(command)) then | 41 | if not fs.execute(unpack(command)) then |
| 42 | return nil, "Failed fetching files from GIT while cloning." | 42 | return nil, "Failed fetching files from GIT while cloning." |
| 43 | end | 43 | end |
| 44 | fs.change_dir(module) | ||
| 44 | if checkout_command then | 45 | if checkout_command then |
| 45 | fs.change_dir(module) | ||
| 46 | if not fs.execute(unpack(checkout_command)) then | 46 | if not fs.execute(unpack(checkout_command)) then |
| 47 | return nil, "Failed fetching files from GIT while getting tag/branch." | 47 | return nil, "Failed fetching files from GIT while getting tag/branch." |
| 48 | end | 48 | end |
| 49 | fs.pop_dir() | ||
| 50 | end | 49 | end |
| 50 | fs.delete(".git") | ||
| 51 | fs.delete(".gitignore") | ||
| 52 | fs.pop_dir() | ||
| 51 | fs.pop_dir() | 53 | fs.pop_dir() |
| 52 | return module, store_dir | 54 | return module, store_dir |
| 53 | end | 55 | end |
