Cache curation computations
This commit is contained in:
parent
fe35cc096c
commit
2bb92b1709
|
@ -964,6 +964,16 @@
|
||||||
(for/or ([r (in-list right)])
|
(for/or ([r (in-list right)])
|
||||||
(hash-ref seen? r #f)))
|
(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 (page/curate req)
|
||||||
(define u (current-user req #t))
|
(define u (current-user req #t))
|
||||||
(define (packages-conflict? left right)
|
(define (packages-conflict? left right)
|
||||||
|
@ -976,11 +986,25 @@
|
||||||
;; We have to say #t here because otherwise things with no
|
;; We have to say #t here because otherwise things with no
|
||||||
;; information won't be conflicting.
|
;; information won't be conflicting.
|
||||||
#t))
|
#t))
|
||||||
(define (package-conflicts? pkg)
|
(define conflict-cache
|
||||||
(define other-pkgs (remove pkg (append (ring 0) (ring 1))))
|
(make-hash))
|
||||||
(filter (curry packages-conflict? pkg) other-pkgs))
|
(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)
|
(define (ring i)
|
||||||
(package-list/search (list (format "ring:~a" 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
|
(cond
|
||||||
[(curation-administrator? u)
|
[(curation-administrator? u)
|
||||||
(template
|
(template
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
# planet-compat
|
# 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 --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/planet-compat/ planet-compat/root/
|
||||||
|
rsync -a --progress -h --delete plt-etc:local/galaxy-roots/official/ official/root/
|
||||||
|
|
||||||
# official
|
# official
|
||||||
rsync -a --progress -h --delete --exclude root --exclude compiled --exclude doc ../../meta/pkg-index/ plt-etc:local/galaxy/meta/pkg-index/
|
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/
|
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 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/
|
rsync -a --progress -h --delete --exclude compiled ../../../web-server-pkgs/web-server-lib/web-server ../../../../racket/collects/net plt-etc:local/plt/collects/
|
||||||
|
|
Loading…
Reference in New Issue
Block a user