From 60abcbf00dfcda7a9552992c17730d019ae9ea3f Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 19 Jan 2021 19:05:13 +0100 Subject: bin/build-packages: run namcap if archbuild didn't create a namcap log --- bin/build-packages | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'bin/build-packages') diff --git a/bin/build-packages b/bin/build-packages index 46c1ef1..acf0f79 100755 --- a/bin/build-packages +++ b/bin/build-packages @@ -697,15 +697,15 @@ while [ "${count}" -ne 0 ] && \ # compressing successful echo 'post-build' > "${tmp_dir}/.ping-build-master" >&2 printf ' ok.\n' - if [ "${build_command}" = 'makepkg' ]; then - find . -maxdepth 1 -type f -name '*.pkg.tar.zst' \ - -exec sh -c 'namcap "$1" > "$1-namcap.log"' '_' '{}' \; - else - find . -maxdepth 1 -type f -name '*.pkg.tar-namcap.log' \ - | while read -r file; do - mv "${file}" "${file%-namcap.log}.zst-namcap.log" - done - fi + find . -maxdepth 1 -type f -name '*.pkg.tar.zst' \ + -exec sh -c ' + pkg="${1%.pkg.tar.zst}" + if [ -f "${pkg}.pkg.tar-namcap.log" ]; then + mv "${pkg}.pkg.tar-namcap.log" "${pkg}.pkg.tar.zst-namcap.log" + elif [ ! -f "${pkg}.pkg.tar.zst-namcap.log" ]; then + namcap "$1" > "${pkg}.pkg.tar.zst-namcap.log" + fi + ' '_' '{}' \; tar_content_dir=$(mktemp -d "${tmp_dir}/tar-content.XXXXXX") # remove unexpected packages if [ -n "${expected_packages}" ]; then -- cgit v1.2.3-70-g09d2