diff options
author | Stefano Brivio <sbrivio@redhat.com> | 2022-05-15 09:37:00 +0200 |
---|---|---|
committer | Stefano Brivio <sbrivio@redhat.com> | 2022-05-15 09:37:00 +0200 |
commit | 1e4032296c387e5df1d6e032d09fe3d5a13fecd2 (patch) | |
tree | ce5ffd5f17da929f39db5c9113f605c503d25461 | |
parent | e83b5f0a52b0a704a95367d73c4ca617c23f13b2 (diff) | |
download | mbuto-1e4032296c387e5df1d6e032d09fe3d5a13fecd2.tar mbuto-1e4032296c387e5df1d6e032d09fe3d5a13fecd2.tar.gz mbuto-1e4032296c387e5df1d6e032d09fe3d5a13fecd2.tar.bz2 mbuto-1e4032296c387e5df1d6e032d09fe3d5a13fecd2.tar.lz mbuto-1e4032296c387e5df1d6e032d09fe3d5a13fecd2.tar.xz mbuto-1e4032296c387e5df1d6e032d09fe3d5a13fecd2.tar.zst mbuto-1e4032296c387e5df1d6e032d09fe3d5a13fecd2.zip |
mbuto: Return 0 from cleanup function
Otherwise, exit code if compression method is not automatic will be 1,
even if we don't hit any error.
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
-rwxr-xr-x | mbuto | 15 |
1 files changed, 9 insertions, 6 deletions
@@ -1,4 +1,4 @@ -#!/bin/sh -ef +#!/bin/sh -efx # # mbuto: Minimal Builder Using Terse Options # @@ -362,6 +362,7 @@ cleanup() { [ -n "${pkg_tmp}" ] && "${RM}" -f "${pkg_tmp}" [ -n "${compress_test1}" ] && "${RM}" -f "${compress_test1}" [ -n "${compress_test2}" ] && "${RM}" -f "${compress_test2}" + return 0 } # dir_size() - Print summed size of directories with SI suffix @@ -1029,14 +1030,15 @@ add() { [ -z "${wd}" ] && cpio_init kmod_init - [ -f "${1}" ] && __path="${1}" || __path=$(command -v "${1}") || : - if [ ! -f "${__path}" ]; then +set -x + [ -e "${1}" ] && __path="${1}" || __path=$(command -v "${1}") || : + if [ ! -e "${__path}" ]; then { pkg_add "${1}" && return; } || err "${1} not found" fi case $("${FILE}" -bi "${__path}") in - "application/x-sharedlib;"*) - PATH="${PATH}:/usr/libexec:/sbin:/usr/sbin" prog_add "${__p}" + "application/x-sharedlib;"* | "application/x-pie-executable;"*) + PATH="${PATH}:/usr/libexec:/sbin:/usr/sbin" prog_add "${__path}" ;; "application/x-object;"*) kmod_add "${__path}" @@ -1049,9 +1051,10 @@ add() { pkg_rpm_add "${__path}" ;; *) - "${CP}" --parent -a "${__path}" "${wd}" + "${CP}" --parents -a "$(${REALPATH} "${__path}")" "${wd}" ;; esac +set +x } # stats() - Print size information about created image |