Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use extra-src archive checksum in filename #104

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions BuildSourceImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1030,19 +1030,21 @@ sourcedriver_extra_src_dir() {
local out_dir="${3}"
local manifest_dir="${4}"
local tarname
local tmptarname
local mimetype
local source_info
local counter=0

for extra_src_dir in "${EXTRA_SRC_DIR_ARRAY[@]}"
do
_info "adding extra source directory $extra_src_dir"
_debug "$self: writing to $out_dir and $manifest_dir"
tarname="extra-src-${counter}.tar"
((counter+=1))
tmptarname="extra-src.tar"
_tar -C "${extra_src_dir}" \
--sort=name --mtime=@0 --owner=0 --group=0 --mode='a+rw' --no-xattrs --no-selinux --no-acls \
-cf "${out_dir}/${tarname}" .
-cf "${out_dir}/${tmptarname}" .
checksum=$(sha256sum "${out_dir}/${tmptarname}" | cut -d' ' -f1)
tarname="extra-src-${checksum}.tar"
mv "${out_dir}/${tmptarname}" "${out_dir}/${tarname}"
mimetype="$(file --brief --mime-type "${out_dir}"/"${tarname}")"
source_info="${manifest_dir}/${tarname}.json"
jq \
Expand Down