#!/bin/sh
umask 0002

CHECKSUM=sha256
if [ "$*" = "" ]; then
        DIRS="noarch i386 x86_64"
else
        DIRS=$*
fi

for dir in ${DIRS}; do
	COMPS=
	if [ -f "comps.xml" ]; then
		cp -a comps.xml ${dir}/repodata/
		COMPS="-g repodata/comps.xml"
	fi

	createrepo_c ${COMPS} --checksum=${CHECKSUM} -c /var/cache/createrepo -o ${dir} -v --update -d ${dir}
done
