#!/bin/bash
set -e
log=/var/log/java-deptools/backend.log
cd /var/lib/java-deptools/repos/
date >$log
java-deptools-repogen $(curl -sXPOST -d '<methodCall><methodName>getBuildTargets</methodName></methodCall>' https://koji.fedoraproject.org/kojihub | sed -n 's,^<value><string>\(f[2-9][0-9]\)</string></value>$,\1,;T;p' | sort -ru) &>>$log
date >>$log
echo 'Repo regeneration successful' >>$log
