#!/bin/sh

for release in sarge woody; do
	if [ -e dsas-packages-$release.csv ] ; then
		cat dsas-packages-$release.csv | 
		sort | uniq -c| 
		while read number pack; do
		section=`grep-dctrl -n -PX -sSection "$pack" /home/mirrors/debian/debian.org/dists/$release/main/binary-i386/Packages`
		priority=`grep-dctrl -n -PX -sPriority "$pack" /home/mirrors/debian/debian.org/dists/$release/main/binary-i386/Packages`
		[ -z "$section" ] && section="NOT FOUND"
		[ -z "$priority" ] && priority="NOT FOUND"
		echo "$pack, $section, $priority, number" >>packages-section-$release.txt
		done
	fi

done
