]> git.e2factory.org Git - e2factory.git/commitdiff
collect_project: generate code to check checksums for chroot tarballs when
authorGordon Hecker <gh@emlix.com>
Fri, 30 Oct 2009 15:14:06 +0000 (16:14 +0100)
committerGordon Hecker <gh@emlix.com>
Mon, 2 Nov 2009 11:57:18 +0000 (12:57 +0100)
building out of the collect_project result

Signed-off-by: Gordon Hecker <gh@emlix.com>
local/e2build.lua
local/make/build.sh

index 183a7560e5db5892f7775f01ee27d593cc9ddd17..56b66bd12ffbe84b69c236d1b662493120df2f20 100644 (file)
@@ -1017,6 +1017,12 @@ function e2build.collect_project(info, r, return_flags)
                local destdir = string.format("%s/project/chroot/%s", 
                                                        res.build_config.T, g)
                e2lib.mkdir(destdir, "-p")
+               local makefile, msg = io.open(
+                       string.format("%s/makefile", destdir), "w")
+               if not makefile then
+                       return false, e:cat(msg)
+               end
+               makefile:write(string.format("place:\n"))
                for _,file in pairs(grp.files) do
                        local cache_flags = {}
                        rc, re = cache.fetch_file(info.cache, file.server,
@@ -1024,9 +1030,27 @@ function e2build.collect_project(info, r, return_flags)
                        if not rc then
                                return false, e:cat(re)
                        end
-                       -- XXX organize for checksum checking when building
-                       -- XXX the project out of the collect_project result
+                       if file.sha1 then
+                               local checksum_file = string.format(
+                                               "%s/%s.sha1", destdir,
+                                               e2lib.basename(file.location))
+                               local filename = e2lib.basename(file.location)
+                               rc, re = e2lib.write_file(checksum_file,
+                                               string.format("%s  %s",
+                                               file.sha1, filename))
+                               if not rc then
+                                       return false, e:cat(re)
+                               end
+                               makefile:write(string.format(
+                                       "\tsha1sum -c '%s'\n",
+                                       e2lib.basename(checksum_file)))
+                       end
+                       makefile:write(string.format(
+                               "\te2-su-2.2 extract_tar_2_2 $(chroot_path) "..
+                               "\"tar.gz\" '%s'\n",
+                               e2lib.basename(file.location)))
                end
+               makefile:close()
        end
        -- project/licences/<licence>/<files>
        for _,l in ipairs(res.collect_project_licences) do
index d1a33c03be995f567b66184efb8735ab4836ce05..3a9c9af82f39afe6f0ac91a62def2b2a490e6fcd 100755 (executable)
@@ -42,10 +42,7 @@ touch $chroot_path/emlix-chroot
 e2-su-2.2 set_permissions_2_2 $chroot_path
 # install chroot groups
 for g in $CHROOT ; do
-       for f in $(ls chroot/$g) ; do
-               e2-su-2.2 extract_tar_2_2 $chroot_path "tar.gz" chroot/$g/$f
-               true
-       done
+       make chroot_path=$chroot_path -C chroot/$g place
 done
 # install sources
 for s in $SOURCE ; do