[pacman-dev] [PATCH v2 1/5] pacdiff: color filename and mention what we found

Allan McRae allan at archlinux.org
Tue Jan 1 23:40:29 EST 2013


On 20/12/12 10:06, Florian Pritz wrote:
> Signed-off-by: Florian Pritz <bluewind at xinu.at>
> ---

<snip>

> @@ -62,7 +78,15 @@ fi
>  # see http://mywiki.wooledge.org/BashFAQ/020
>  while IFS= read -u 3 -r -d '' pacfile; do
>  	file="${pacfile%.pac*}"
> -	echo "File: $file"
> +	file_type="pac${pacfile##*.pac}"
> +
> +	case $file_type in
> +		pacnew) printf "$GREEN%s$ALL_OFF" "$file_type";;
> +		pacorig) printf "$YELLOW%s$ALL_OFF" "$file_type";;
> +		pacsave) printf "$BLUE%s$ALL_OFF" "$file_type";;
> +	esac
> +
> +	printf " found for $PURPLE%s$ALL_OFF\n" "$file"

would this be better:

printf " file found for $PURPLE%s$ALL_OFF\n" "$file"

pacnew found for /etc/passwd
vs
pacnew file found for /etc/passwd

>  	if [ ! -f "$file" ]; then
>  		echo "  $file does not exist"
>  		rm -i "$pacfile"
> 



More information about the pacman-dev mailing list