xbps-pkgdb, shutils: use red/bold, red/yellow and bold for

msg_error, msg_warn and msg_normal respectively.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091015141731-9ci2bnvslqe5gq7j
This commit is contained in:
Juan RP
2009-10-15 16:17:31 +02:00
parent a344468556
commit 1febd85f42
2 changed files with 37 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
#-
# Copyright (c) 2008 Juan Romero Pardines.
# Copyright (c) 2008-2009 Juan Romero Pardines.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -61,11 +61,14 @@ msg_error()
{
[ -z "$1" ] && return 1
# error messages in bold/red
printf "\033[1m\033[31m"
if [ -n "$in_chroot" ]; then
echo "[chroot] => ERROR: $1"
else
echo "=> ERROR: $1"
fi
printf "\033[m"
exit 1
}
@@ -74,20 +77,26 @@ msg_warn()
{
[ -z "$1" ] && return 1
# warn messages in bold/yellow
printf "\033[1m\033[33m"
if [ -n "$in_chroot" ]; then
echo "[chroot] => WARNING: $1"
else
echo "=> WARNING: $1"
fi
printf "\033[m"
}
msg_normal()
{
[ -z "$1" ] && return 1
# normal messages in bold
printf "\033[1m"
if [ -n "$in_chroot" ]; then
echo "[chroot] => $1"
else
echo "=> $1"
fi
printf "\033[m"
}