From: Tobias Ulmer Date: Thu, 31 Oct 2013 20:29:36 +0000 (+0100) Subject: e2-fetch-project: make p.destdir an absolute path X-Git-Tag: e2factory-2.3.15rc1~423 X-Git-Url: https://git.e2factory.org/?a=commitdiff_plain;h=d02f68073b34c291b5b4c3f1fc3cf02e236aab9c;p=e2factory.git e2-fetch-project: make p.destdir an absolute path Signed-off-by: Tobias Ulmer --- diff --git a/global/e2-fetch-project.lua b/global/e2-fetch-project.lua index 535fdbe..ca44e6b 100644 --- a/global/e2-fetch-project.lua +++ b/global/e2-fetch-project.lua @@ -97,6 +97,17 @@ local function e2_fetch_project(arg) else p.destdir = p.name end + + -- Make destdir an absolute path. + if string.sub(p.destdir, 1) ~= "/" then + rc, re = e2lib.cwd() + if not rc then + return false, e:cat(re) + end + + p.destdir = e2lib.join(rc, p.destdir) + end + if opts["branch"] then p.branch = opts["branch"] else @@ -139,9 +150,8 @@ local function e2_fetch_project(arg) -- clone the git repository local location = string.format("%s/proj/%s.git", p.location, p.name) local skip_checkout = false - local destdir = p.destdir local rc, re = generic_git.git_clone_from_server(scache, p.server, location, - p.destdir, skip_checkout) + p.destdir, skip_checkout) if not rc then return false, e:cat(re) end