#!/bin/bash

CMD=$(basename $0)

set -e -u

sys=$1
distro="chimaera"
infile="recommended-autoremoved-$distro.txt"

ssh $sys dpkg -l | grep '^ii ' | sed -e 's/^ii  //' -e 's/ .*//' >$CMD.tmp

for pkg in $(sed -e 's/\s*#.*//' -e 's/^\s*$//' -e '/^$/d' $infile)
do
	grep "^$pkg$" $CMD.tmp || :
done
exit 0
