From 932f8b695e10f7b3742f528a619e26808a808c46 Mon Sep 17 00:00:00 2001 From: leafee98 Date: Tue, 30 Jan 2024 16:32:31 +0800 Subject: [PATCH] breaking: exit normally when package already built This is helpful when using local_build.sh scripts. --- makedeb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/makedeb b/makedeb index 69a5d16..41b26bc 100755 --- a/makedeb +++ b/makedeb @@ -72,6 +72,11 @@ function msg2 { local mesg=$1; shift 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 { (( QUIET )) && return 0 local mesg=$1; shift @@ -532,8 +537,10 @@ if (( ! _IN_FAKEROOT )) ; then # Check if the package already exists if (( _STEP_CHCECK_PACKAGE_EXISTS )) ; then if [[ -f "$(get_deb_name)" ]] ; then - err "The package already exists. (use -f to force build)" - exit 13 + warn "%s %s" \ + "The package $(get_deb_name) already exists, skipping build." \ + "(use -f to force re-build)" + exit 0 fi fi