#!/bin/sh
#
# reformat one line from unavailable ... sort packages and remove
# any duplicates
#

tmp=/var/tmp/$$
trap "rm -f $tmp; exit 0" 0 1 2 3 15

sed -e 's/\\/\\\\/g' >$tmp
read distro version arch pkgs_in <$tmp

pkgs_out=`echo "$pkgs_in" \
	  | tr ' ' '\012' \
	  | sort \
	  | uniq \
	  | tr '\012' ' ' \
	  | sed -e 's/  *$//'`

printf "%-12.12s %-8.8s %-7.7s %s\n" "$distro" "$version" "$arch" "$pkgs_out"
