From b5a1a17876788c5c81d952b2aa432d114257007f Mon Sep 17 00:00:00 2001 From: Davide Madrisan Date: Fri, 9 Nov 2012 22:57:36 +0100 Subject: [PATCH] plugins/*: Execute 'notify.disable_colors()' when 'colorize' is set to '0' (disabled) to ignore color redefinitions made by user Signed-off-by: Davide Madrisan --- autospec.in | 2 +- plugins/config-getvar.in | 2 +- plugins/pck-extract.in | 2 +- plugins/pck-update.in | 2 +- plugins/spec-create.in | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/autospec.in b/autospec.in index ff7614e..54670b2 100644 --- a/autospec.in +++ b/autospec.in @@ -131,7 +131,7 @@ esac . @libdir@/libcfg.lib [ "$logging" = "1" ] && let "colorize = 0" -[ "$colorize" = "1" ] && notify.enable_colors +[ "$colorize" = "1" ] && notify.enable_colors || notify.disable_colors notify.debug "[${me[0]}, "$"version"" ${me[1]}]" diff --git a/plugins/config-getvar.in b/plugins/config-getvar.in index 12cc539..720ee4e 100644 --- a/plugins/config-getvar.in +++ b/plugins/config-getvar.in @@ -131,7 +131,7 @@ for arg in $@; do notify.error $"unrecognized option"" -- \`$arg'" done -[ "$colorize" = "1" ] && notify.enable_colors +[ "$colorize" = "1" ] && notify.enable_colors || notify.disable_colors # config.getvar() # Parameters: diff --git a/plugins/pck-extract.in b/plugins/pck-extract.in index 0d5e5fe..2748b9f 100644 --- a/plugins/pck-extract.in +++ b/plugins/pck-extract.in @@ -137,7 +137,7 @@ for arg in $@; do notify.error $"unrecognized option"" -- \`$arg'" done -[ "$colorize" = "1" ] && notify.enable_colors +[ "$colorize" = "1" ] && notify.enable_colors || notify.disable_colors # s_rpm_pck : the name of the srpm package (local or remote) # (i.e. /usr/src/RPM/SRPMS/automake-1.9-1qilnx.src.rpm) diff --git a/plugins/pck-update.in b/plugins/pck-update.in index 9d06490..5edd498 100644 --- a/plugins/pck-update.in +++ b/plugins/pck-update.in @@ -310,7 +310,7 @@ fi [ "$logging" = "1" ] && let "colorize = 0" -[ "$colorize" = "1" ] && notify.enable_colors +[ "$colorize" = "1" ] && notify.enable_colors || notify.disable_colors # default values for non mandatory configuration variables [ "$logging_dir" ] || logging_dir="${tmppath_dir:-/var/tmp}/@package@" diff --git a/plugins/spec-create.in b/plugins/spec-create.in index 4ffc813..f6b90f7 100644 --- a/plugins/spec-create.in +++ b/plugins/spec-create.in @@ -207,12 +207,12 @@ while :; do shift done +[ "$colorize" = "1" ] && notify.enable_colors || notify.disable_colors + for arg in $@; do notify.error $"unrecognized option"" -- \`$arg'" done -[ "$colorize" = "1" ] && notify.enable_colors - function specfile.ckeck_defvalues() { # $1: name of the specfile local specfile="$1" currvalue