X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=config%2Fdebian%2Fcron.unchecked;h=0006f80e3a4c5ddaf0730e962e50ae996bdafbd2;hb=87bf163d12ec8328d87e1b2a2ca2239221a73bd6;hp=fc146dad64d77e1b628d09ece76c92515615f8ed;hpb=d1643f66073182a31bce868db9e13f14f5bda987;p=dak.git diff --git a/config/debian/cron.unchecked b/config/debian/cron.unchecked index fc146dad..0006f80e 100755 --- a/config/debian/cron.unchecked +++ b/config/debian/cron.unchecked @@ -23,6 +23,25 @@ cleanup() { fi } +# in case there is anything NEW processed, move it over into the accepted queue +cd $newstage +for file in $(find . -maxdepth 1 -mindepth 1 -type f -name \*.changes | sed -e "s,./,," | xargs); do + sed '1,/Files:/d' "${file}" | sed '/BEGIN PGP SIGNATURE/,$d' \ + | while read notused1 notused2 notused3 notused4 NAME; do + if [ -z "${NAME}" ]; then + # Sometimes there is a newline after the Files:, ignore it + continue + fi + if [ -f "${NAME}" ]; then + mv --target-directory="${accepted}" "${NAME}" + else + log_error "Error, couldn't find file ${NAME} to move to ${accepted}" + exit 2 + fi + done + mv --target-directory="${accepted}" "${file}" "${file%%.changes}.dak" +done + # only run one cron.unchecked if lockfile -r3 $LOCKFILE; then trap cleanup 0