#!/bin/bash
for i in "$@"
do
	output=${i/_amd64.changes/_source.changes}
	output=${output/_i386.changes/_source.changes}
	output=${output/_hurd-i386.changes/_source.changes}
	if [ "$i" = "$output" ]
	then
		echo "$i is like $output, not doing anything"
		continue
	fi
	sed -e 's/Architecture: source.*/Architecture: source/' \
	    -e '/_amd64.buildinfo$/d' \
	    -e '/_amd64.deb$/d' \
	    -e '/_amd64.udeb$/d' \
	    -e '/_i386.buildinfo$/d' \
	    -e '/_i386.deb$/d' \
	    -e '/_i386.udeb$/d' \
	    -e '/_hurd-i386.buildinfo$/d' \
	    -e '/_hurd-i386.deb$/d' \
	    -e '/_hurd-i386.udeb$/d' \
	    -e '/_all.deb$/d' \
	    -e '/_all.udeb$/d' \
		< $i > $output
done
