#!/bin/bash
BASE=$PWD

for repo in $(find . -type d); do
        export repo=${repo:2}
        if [ "X${repo:2}" != "X" ] ; then
                rm ${BASE}/${repo}/${repo}.db.* ${BASE}/${repo}/${repo}.files.*
                for pkg in $(ls ${BASE}/${repo}/*.pkg.tar.*); do
                        repo-add ${BASE}/${repo}/${repo}.db.tar.xz $pkg
                done
        fi
done
