From: Joerg Jaspert Date: Wed, 15 Aug 2012 22:22:38 +0000 (+0200) Subject: Merge remote-tracking branch 'ansgar/pu/multiarchive-1' X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=ffa6f7b4004942f0f1a83dc8a7766fc3a5f0ae0f;hp=a678233656faab3bf616081c4eda7a62bc876a89;p=dak.git Merge remote-tracking branch 'ansgar/pu/multiarchive-1' * ansgar/pu/multiarchive-1: dak/process_policy.py: use the right source package Signed-off-by: Joerg Jaspert --- diff --git a/config/debian/common b/config/debian/common index d16d2855..b1fc1901 100644 --- a/config/debian/common +++ b/config/debian/common @@ -68,6 +68,8 @@ function make_buildd_dir () { mv Release Release.gpg buildd/ done + STAMP=${STAMP:-$(date "+%Y%m%d%H%M")} + for dist in $(ls -1 ${incoming}/dists/); do # Skip project trace directory if [ "${dist}x" = "projectx" ]; then continue; fi @@ -89,10 +91,12 @@ function punew_do() { dak generate-packages-sources2 -s "${queue}" + STAMP=${STAMP:-$(date "+%Y%m%d%H%M")} + local exportdir="${queuedir}${qdir}/tree/${STAMP}" local targetdir="${queuedir}${qdir}/export" dak export -q "${queue}" -d "${exportdir}" --all - ln -sfT ${targetdir} ${exportdir} + ln -sfT ${exportdir} ${targetdir} find ${queuedir}${qdir}/tree -mindepth 1 -maxdepth 1 -not -name "${STAMP}" -type d -print0 | xargs --no-run-if-empty -0 rm -rf } diff --git a/config/debian/cron.hourly b/config/debian/cron.hourly index 382dd1a9..80c912f8 100755 --- a/config/debian/cron.hourly +++ b/config/debian/cron.hourly @@ -17,10 +17,6 @@ PROGRAM="Hourly" . "${configdir}/common" dak import-users-from-passwd -dak queue-report -n > $webdir/new.html -dak queue-report -8 -d new,byhand,stable-new,oldstable-new -r $webdir/stat -dak show-deferred -r $webdir/stat > ${webdir}/deferred.html -dak graph -n new,byhand,p-u-new,o-p-u-new,deferred -r $webdir/stat -i $webdir/stat -x $scriptsdir/rrd-release-freeze-dates # do not run show-new and other stuff in parallel LOCKFILE="$lockdir/unchecked.lock" @@ -30,6 +26,11 @@ if lockfile -r16 $LOCKFILE 2> /dev/null; then rm -f $LOCKFILE fi +dak queue-report -n > $webdir/new.html +dak queue-report -8 -d new,byhand,stable-new,oldstable-new -r $webdir/stat +dak show-deferred -r $webdir/stat > ${webdir}/deferred.html +dak graph -n new,byhand,p-u-new,o-p-u-new,deferred -r $webdir/stat -i $webdir/stat -x $scriptsdir/rrd-release-freeze-dates + cd $webdir cat removals-20*.txt > removals-full.txt cat removals.txt >> removals-full.txt diff --git a/dak/process_new.py b/dak/process_new.py index 8d4cd6bb..0b71541b 100755 --- a/dak/process_new.py +++ b/dak/process_new.py @@ -693,6 +693,43 @@ def show_new_comments(uploads, session): ################################################################################ +def sort_uploads(uploads, session, nobinaries=False): + sources = {} + sorteduploads = [] + suitesrc = [s.source for s in session.query(DBSource.source). \ + filter(DBSource.suites.any(Suite.suite_name.in_(['unstable', 'experimental'])))] + comments = [p.package for p in session.query(NewComment.package). \ + filter_by(trainee=False).distinct()] + for upload in uploads: + source = upload.changes.source + if not source in sources: + sources[source] = [] + sources[source].append({'upload': upload, + 'date': upload.changes.created, + 'stack': 1, + 'binary': True if source in suitesrc else False, + 'comments': True if source in comments else False}) + for src in sources: + if len(sources[src]) > 1: + changes = sources[src] + firstseen = sorted(changes, key=lambda k: (k['date']))[0]['date'] + changes.sort(key=lambda item:item['date']) + for i in range (0, len(changes)): + changes[i]['date'] = firstseen + changes[i]['stack'] = i + 1 + sorteduploads += sources[src] + if nobinaries: + sorteduploads = [u["upload"] for u in sorted(sorteduploads, + key=lambda k: (k["comments"], k["binary"], + k["date"], -k["stack"]))] + else: + sorteduploads = [u["upload"] for u in sorted(sorteduploads, + key=lambda k: (k["comments"], -k["binary"], + k["date"], -k["stack"]))] + return sorteduploads + +################################################################################ + def end(): accept_count = SummaryStats().accept_count accept_bytes = SummaryStats().accept_bytes @@ -755,7 +792,7 @@ def main(): if len(uploads) > 1: sys.stderr.write("Sorting changes...\n") - uploads.sort() + uploads = sort_uploads(uploads, session, Options["No-Binaries"]) if Options["Comments"]: show_new_comments(uploads, session)