[pacman-dev] [PATCH 1/4] pacdiff: color filename and mention what we found
Allan McRae
allan at archlinux.org
Wed Dec 19 18:37:18 EST 2012
On 20/12/12 08:33, Florian Pritz wrote:
> Signed-off-by: Florian Pritz <bluewind at xinu.at>
> ---
Look at makepkg for how colors should be enabled.
> contrib/pacdiff.sh.in | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/contrib/pacdiff.sh.in b/contrib/pacdiff.sh.in
> index bfafda2..5797fef 100644
> --- a/contrib/pacdiff.sh.in
> +++ b/contrib/pacdiff.sh.in
> @@ -62,7 +62,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 "\e[0;32m%s\e[0m" "$file_type";;
> + pacorig) printf "\e[0;33m%s\e[0m" "$file_type";;
> + pacsave) printf "\e[0;34m%s\e[0m" "$file_type";;
> + esac
> +
> + printf " found for \e[0;35m%s\e[0m\n" "$file"
> if [ ! -f "$file" ]; then
> echo " $file does not exist"
> rm -i "$pacfile"
>
More information about the pacman-dev
mailing list