X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian-security%2Fcron.unchecked;h=cba7c05ffcedae2270a0535629f81eff5f5708c4;hb=8303f4e3903b70213ac171c184c871d3d63d4c49;hp=7e2bb29ae4b3a5b5ec52e32dd58d6c9617d6fe28;hpb=28b86b197fffbd068c2f030e987bc145829d9601;p=dak.git diff --git a/config/debian-security/cron.unchecked b/config/debian-security/cron.unchecked index 7e2bb29a..cba7c05f 100755 --- a/config/debian-security/cron.unchecked +++ b/config/debian-security/cron.unchecked @@ -18,6 +18,10 @@ doanything=false dopolicy=false LOCKFILE="$lockdir/unchecked.lock" +last_changed() { + psql -qAtc "SELECT MAX(last_changed) FROM suite WHERE archive_id=(SELECT id FROM archive WHERE name='$1')" +} + cleanup() { rm -f "$LOCKFILE" } @@ -28,6 +32,8 @@ if ! lockfile -r8 "$LOCKFILE"; then fi trap cleanup EXIT +old_last_changed=$(last_changed security) + cd $unchecked changes=$(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs) if [ -n "$changes" ]; then @@ -81,8 +87,11 @@ dak manage-build-queues -a dak generate-packages-sources2 -a build-queues dak generate-releases -a build-queues >/dev/null ${scriptsdir}/update-buildd-archive ${base}/build-queues ${incoming}/debian-security-buildd +$configdir/cron.buildd -if [ "x${dopolicy}x" = "xtruex" ]; then +new_last_changed=$(last_changed security) + +if [[ "${old_last_changed}" != "${new_last_changed}" ]]; then # We had something approved from a policy queue, push out new archive dak dominate cd $configdir @@ -95,5 +104,3 @@ fi cleanup trap - EXIT - -$configdir/cron.buildd