]> git.e2factory.org Git - e2factory.git/commitdiff
e2build: do not include the '.' directory in result.tar
authorTobias Ulmer <tu@emlix.com>
Tue, 20 Sep 2016 16:20:21 +0000 (18:20 +0200)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:18 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
local/e2build.lua

index b8e98c9b2c77bf79c5547ba2c58f65c7ac8f28e1..4eca5b33bc5b5460aaa6cbc2ef71f8934bd295ac 100644 (file)
@@ -918,13 +918,20 @@ function e2build.build_process_class:_store_result(res, return_flags)
         return false, e:cat(re)
     end
 
-    -- XXX: don't pack ., but individual components
-    rc, re = e2lib.tar({
-        "-cf",  e2lib.join(tmpdir, "result.tar"),
-        "-C", resdir, "." })
+    -- do not include the "." directory in result.tar
+    local argv = { "-cf",  e2lib.join(tmpdir, "result.tar"), "-C", resdir, "--" }
+
+    for entry, re in e2lib.directory(resdir, true) do
+        if not entry then
+            return false, e:cat(re)
+        end
+        table.insert(argv, entry)
+    end
+    rc, re = e2lib.tar(argv)
     if not rc then
         return false, e:cat(re)
     end
+
     local server, location = res:build_mode().storage(info.project_location,
         project.release_id())
 
@@ -956,7 +963,7 @@ end
 function e2build.build_process_class:_linklast(res, return_flags)
     local rc, re, e
     local info, server, location, buildid, dst, lnk
-    
+
     e = err.new("creating link to last results")
     info = e2tool.info()
     -- calculate the path to the result