#!/bin/bash
#
# written by Jan Engelhardt <jengelh [at] medozas de>, 2011
# 'left behind' in the Public Domain
#

count()
{
	local r;
	local i;

	for r in *; do
		if [[ ! -d "$r" ]]; then
			continue;
		fi;
		pushd "$r" >/dev/null;
		for i in *; do
			ls -1 "$i";
		done;
		popd >/dev/null;
	done | sort -u | wc -l;
}

# For me, /F is the NFS mount of a Debian mirror (in this case, ftp5.gwdg.de)
echo -en "Debian:\t";
pushd /F/linux/debian/debian/pool/ >/dev/null;
count;
popd >/dev/null;

echo -en "Ubuntu:\t";
pushd /F/linux/debian/ubuntu/pool/ >/dev/null;
# Something isn't right here, it counts too much in this directory.
count;
popd >/dev/null;
