From cedadc06d6186b64a5c046adbde5d24cc49f73ba Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Fri, 30 Oct 2009 16:14:06 +0100 Subject: [PATCH] collect_project: generate code to check checksums for chroot tarballs when building out of the collect_project result Signed-off-by: Gordon Hecker --- local/e2build.lua | 28 ++++++++++++++++++++++++++-- local/make/build.sh | 5 +---- 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/local/e2build.lua b/local/e2build.lua index 183a756..56b66bd 100644 --- a/local/e2build.lua +++ b/local/e2build.lua @@ -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// for _,l in ipairs(res.collect_project_licences) do diff --git a/local/make/build.sh b/local/make/build.sh index d1a33c0..3a9c9af 100755 --- a/local/make/build.sh +++ b/local/make/build.sh @@ -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 -- 2.39.5