]> git.e2factory.org Git - e2factory.git/commitdiff
e2-fetch-project: make p.destdir an absolute path
authorTobias Ulmer <tu@emlix.com>
Thu, 31 Oct 2013 20:29:36 +0000 (21:29 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:01:23 +0000 (15:01 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
global/e2-fetch-project.lua

index 535fdbe361ff2464291a02513ecfed2f020f7923..ca44e6ba2a27ced10b00dd080508658a5da33bb9 100644 (file)
@@ -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