breaking: exit normally when package already built

This is helpful when using local_build.sh scripts.
This commit is contained in:
leafee98 2024-01-30 16:32:31 +08:00
parent 985c0e7a06
commit 932f8b695e

11
makedeb
View file

@ -72,6 +72,11 @@ function msg2 {
local mesg=$1; shift local mesg=$1; shift
printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@" printf "${BLUE} ->${ALL_OFF}${BOLD} ${mesg}${ALL_OFF}\n" "$@"
} }
function warn {
(( QUIET )) && return 0
local mesg=$1; shift
printf "${YELLOW}==>${ALL_OFF}${BOLD}${YELLOW} ${mesg}${ALL_OFF}\n" "$@" >&2
}
function err { function err {
(( QUIET )) && return 0 (( QUIET )) && return 0
local mesg=$1; shift local mesg=$1; shift
@ -532,8 +537,10 @@ if (( ! _IN_FAKEROOT )) ; then
# Check if the package already exists # Check if the package already exists
if (( _STEP_CHCECK_PACKAGE_EXISTS )) ; then if (( _STEP_CHCECK_PACKAGE_EXISTS )) ; then
if [[ -f "$(get_deb_name)" ]] ; then if [[ -f "$(get_deb_name)" ]] ; then
err "The package already exists. (use -f to force build)" warn "%s %s" \
exit 13 "The package $(get_deb_name) already exists, skipping build." \
"(use -f to force re-build)"
exit 0
fi fi
fi fi