diff options
author | Martin Roth <gaumless@gmail.com> | 2022-09-02 14:23:25 -0600 |
---|---|---|
committer | Martin Roth <martin.roth@amd.corp-partner.google.com> | 2022-11-02 20:51:47 +0000 |
commit | b621d9bef31a92b5a8cf23af17bf576e5d341efd (patch) | |
tree | d676563ea8f6186244a1ddd6d0c99a3d3a9be782 /util/release | |
parent | df8677c9925f51d6b80cbf912d34a243909a9d5b (diff) |
util/release/build-release: Use bash arrays for params
Instead of using unquoted strings for the command line parameters,
use arrays which naturally split into separate elements inside the
quotes.
Signed-off-by: Martin Roth <gaumless@gmail.com>
Change-Id: I1c96d5072b98523af4e407cfff8f4d1d28ec3297
Reviewed-on: https://review.coreboot.org/c/coreboot/+/67318
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Diffstat (limited to 'util/release')
-rwxr-xr-x | util/release/build-release | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/util/release/build-release b/util/release/build-release index b76b1559a3..f609bf194e 100755 --- a/util/release/build-release +++ b/util/release/build-release @@ -40,15 +40,16 @@ if ! tar --sort=name -cf /dev/null /dev/null 2>/dev/null ; then fi if [ ! -d "coreboot-${VERSION_NAME}" ]; then + declare -a GIT_REF_OPTS if [ -d .git ]; then - GIT_REF_OPTS="--reference . --dissociate" + GIT_REF_OPTS=("--reference" "." "--dissociate") elif [ -d ../../.git ]; then - GIT_REF_OPTS="--reference ../.. --dissociate" + GIT_REF_OPTS=("--reference" "../.." "--dissociate") fi if [ -n "${USERNAME}" ]; then - git clone ${GIT_REF_OPTS} "ssh://${USERNAME}@review.coreboot.org:29418/coreboot.git" "coreboot-${VERSION_NAME}" + git clone "${GIT_REF_OPTS[@]}" "ssh://${USERNAME}@review.coreboot.org:29418/coreboot.git" "coreboot-${VERSION_NAME}" -- else - git clone ${GIT_REF_OPTS} https://review.coreboot.org/coreboot.git "coreboot-${VERSION_NAME}" + git clone "${GIT_REF_OPTS[@]}" https://review.coreboot.org/coreboot.git "coreboot-${VERSION_NAME}" -- fi fi @@ -76,13 +77,15 @@ exclude_paths+="3rdparty/intel-microcode " exclude_paths+="3rdparty/amd_blobs " exclude_paths+="3rdparty/qc_blobs " +declare -a blobs_paths +declare -a exclude_opts for i in ${exclude_paths}; do - blobs_paths+="coreboot-${VERSION_NAME}/${i} " - exclude_opts+="--exclude=coreboot-${VERSION_NAME}/${i} " + blobs_paths+=("coreboot-${VERSION_NAME}/${i}") + exclude_opts+=("--exclude=coreboot-${VERSION_NAME}/${i}") done -tar --sort=name --mtime="$tstamp" --owner=coreboot:1000 --group=coreboot:1000 --exclude=*/.git --exclude=*/.gitignore ${exclude_opts} -cvf - "coreboot-${VERSION_NAME}" |xz -9 > "coreboot-${VERSION_NAME}.tar.xz" -tar --sort=name --mtime="$tstamp" --owner=coreboot:1000 --group=coreboot:1000 --exclude=*/.git --exclude=*/.gitignore -cvf - ${blobs_paths} |xz -9 > "coreboot-blobs-${VERSION_NAME}.tar.xz" +tar --sort=name --mtime="${tstamp}" --owner=coreboot:1000 --group=coreboot:1000 --exclude=*/.git --exclude=*/.gitignore "${exclude_opts[@]}" -cvf - "coreboot-${VERSION_NAME}" |xz -9 > "coreboot-${VERSION_NAME}.tar.xz" +tar --sort=name --mtime="${tstamp}" --owner=coreboot:1000 --group=coreboot:1000 --exclude=*/.git --exclude=*/.gitignore -cvf - "${blobs_paths[@]}" |xz -9 > "coreboot-blobs-${VERSION_NAME}.tar.xz" if [ -n "${GPG_KEY_ID}" ]; then gpg --armor --local-user "$GPG_KEY_ID" --output "coreboot-${VERSION_NAME}.tar.xz.sig" --detach-sig "coreboot-${VERSION_NAME}.tar.xz" |