Cache curation computations

This commit is contained in:
Jay McCarthy 2013-09-05 07:40:49 -06:00
parent fe35cc096c
commit 2bb92b1709
2 changed files with 29 additions and 8 deletions

View File

@ -964,6 +964,16 @@
(for/or ([r (in-list right)])
(hash-ref seen? r #f)))
(define (string-min x y)
(if (string<=? x y)
x
y))
(define (string-max x y)
(if (string<? x y)
y
x))
(define (page/curate req)
(define u (current-user req #t))
(define (packages-conflict? left right)
@ -976,11 +986,25 @@
;; We have to say #t here because otherwise things with no
;; information won't be conflicting.
#t))
(define (package-conflicts? pkg)
(define other-pkgs (remove pkg (append (ring 0) (ring 1))))
(filter (curry packages-conflict? pkg) other-pkgs))
(define conflict-cache
(make-hash))
(define (packages-conflict?/cache left right)
(define smin (string-min left right))
(define smax (string-max left right))
(hash-ref! conflict-cache
(cons smin smax)
(λ ()
(packages-conflict? smin smax))))
(define (ring i)
(package-list/search (list (format "ring:~a" i))))
(define ring-01
(append (ring 0) (ring 1)))
(define (package-conflicts? pkg)
(filter (λ (other-pkg)
(if (equal? pkg other-pkg)
#f
(packages-conflict?/cache pkg other-pkg)))
ring-01))
(cond
[(curation-administrator? u)
(template

View File

@ -3,6 +3,7 @@
# planet-compat
rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc ../../meta/pkg-index/ plt-etc:local/new-plt/pkgs/plt-services/meta/pkg-index/
rsync -a --progress -h --delete plt-etc:local/galaxy-roots/planet-compat/ planet-compat/root/
rsync -a --progress -h --delete plt-etc:local/galaxy-roots/official/ official/root/
# official
rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc ../../meta/pkg-index/ plt-etc:local/galaxy/meta/pkg-index/
@ -11,10 +12,6 @@ rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc
rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc ../../../../pkgs/racket-pkgs/racket-test/tests/pkg plt-etc:local/galaxy/tests/pkg/
for i in official ; do
rsync -a --progress -h --delete plt-etc:local/galaxy/meta/pkg-index/$i/root/ $i/root/
done
rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc ../../../../racket/collects/pkg plt-etc:local/plt/collects/pkg/
rsync -a --progress -h --delete --exclude compiled ../../../web-server-pkgs/web-server-lib/web-server ../../../../racket/collects/net plt-etc:local/plt/collects/