Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add some colors to pkg deletion messages #423

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/share/poudriere/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,7 @@ sanity_check_pkg() {
while read dep; do
if [ ! -e "${PACKAGES}/All/${dep}.${PKG_EXT}" ]; then
msg_debug "${pkg} needs missing ${PACKAGES}/All/${dep}.${PKG_EXT}"
msg "Deleting ${pkg##*/}: missing dependency: ${dep}"
msg "${COLOR_DELETE_PKG_NEWDEP}Deleting ${pkg##*/}: missing dependency: ${dep}"
delete_pkg "${pkg}"
return 65 # Package deleted, need another pass
fi
Expand Down Expand Up @@ -3593,7 +3593,7 @@ delete_old_pkg() {
_my_path mnt

if [ ! -d "${mnt}/usr/ports/${o}" ]; then
msg "${o} does not exist anymore. Deleting stale ${pkg##*/}"
msg "${COLOR_DELETE_PKG}${o} does not exist anymore. Deleting stale ${pkg##*/}"
delete_pkg "${pkg}"
return 0
fi
Expand All @@ -3603,7 +3603,7 @@ delete_old_pkg() {
cache_get_pkgname cached_pkgname "${o}"
v2=${cached_pkgname##*-}
if [ "$v" != "$v2" ]; then
msg "Deleting ${pkg##*/}: new version: ${v2}"
msg "${COLOR_DELETE_PKG_NEW}Deleting ${pkg##*/}: new version: ${v2}"
delete_pkg "${pkg}"
return 0
fi
Expand Down Expand Up @@ -3675,7 +3675,7 @@ delete_old_pkg() {
case " $compiled_deps " in
*\ $d\ *) ;;
*)
msg "Deleting ${pkg##*/}: new dependency: ${d}"
msg "${COLOR_DELETE_PKG_NEWDEP}Deleting ${pkg##*/}: new dependency: ${d}"
delete_pkg "${pkg}"
return 0
;;
Expand All @@ -3691,7 +3691,7 @@ delete_old_pkg() {
pkg_get_options compiled_options "${pkg}"

if [ "${compiled_options}" != "${current_options}" ]; then
msg "Deleting ${pkg##*/}: changed options"
msg "${COLOR_DELETE_PKG_OPTS}Deleting ${pkg##*/}: changed options"
if [ "${CHECK_CHANGED_OPTIONS}" = "verbose" ]; then
msg "Pkg: ${compiled_options}"
msg "New: ${current_options}"
Expand All @@ -3704,7 +3704,7 @@ delete_old_pkg() {
pkgname="${pkg##*/}"
# XXX: Check if the pkgname has changed and rename in the repo
if [ "${pkgname%-*}" != "${cached_pkgname%-*}" ]; then
msg "Deleting ${pkg##*/}: package name changed to '${cached_pkgname%-*}'"
msg "${COLOR_DELETE_PKG}Deleting ${pkg##*/}: package name changed to '${cached_pkgname%-*}'"
delete_pkg "${pkg}"
return 0
fi
Expand Down Expand Up @@ -4297,7 +4297,7 @@ prepare_ports() {
cache_get_pkgname pkgname "${port}"
pkg="${PACKAGES}/All/${pkgname}.${PKG_EXT}"
if [ -f "${pkg}" ]; then
msg "(-C) Deleting existing package: ${pkg##*/}"
msg "${COLOR_DELETE_PKG}(-C) Deleting existing package: ${pkg##*/}"
delete_pkg "${pkg}"
fi
done
Expand Down
8 changes: 8 additions & 0 deletions src/share/poudriere/include/colors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ if [ ${USE_COLORS} = "no" ]; then
COLOR_FAIL=
COLOR_PHASE=
COLOR_DRY_MODE=
COLOR_DELETE_PKG=
COLOR_DELETE_PKG_NEW=
COLOR_DELETE_PKG_NEWDEP=
COLOR_DELETE_PKG_OPTS=
else

: ${D_LEFT:="${COLOR_BOLD}[${COLOR_RESET}"}
Expand All @@ -92,6 +96,10 @@ else
: ${COLOR_FAIL:=${COLOR_RED}}
: ${COLOR_PHASE:=${COLOR_LIGHT_MAGENTA}}
: ${COLOR_DRY_MODE:=${COLOR_GREEN}}
: ${COLOR_DELETE_PKG:=${COLOR_RED}}
: ${COLOR_DELETE_PKG_NEW:=${COLOR_GREEN}}
: ${COLOR_DELETE_PKG_NEWDEP:=${COLOR_LIGHT_GREEN}}
: ${COLOR_DELETE_PKG_OPTS:=${COLOR_YELLOW}}
fi

colorize_job_id() {
Expand Down