diff --git a/pkgs/plt-services/meta/pkg-index/official/build-update.rkt b/pkgs/plt-services/meta/pkg-index/official/build-update.rkt index f76e9b2989..3e8c6a6348 100644 --- a/pkgs/plt-services/meta/pkg-index/official/build-update.rkt +++ b/pkgs/plt-services/meta/pkg-index/official/build-update.rkt @@ -8,9 +8,7 @@ "common.rkt") (define SUMMARY-HOST "pkg-build.racket-lang.org") -(define SUMMARY-NAME "summary.rktd") (define SUMMARY-URL (string-append "/" SUMMARY-NAME)) -(define SUMMARY-PATH (build-path cache-path SUMMARY-NAME)) (define SUMMARY-ETAG-PATH (build-path cache-path (format "~a.etag" SUMMARY-NAME))) (define (extract-tag hs) diff --git a/pkgs/plt-services/meta/pkg-index/official/common.rkt b/pkgs/plt-services/meta/pkg-index/official/common.rkt index d85e2f3018..603c0bcbe2 100644 --- a/pkgs/plt-services/meta/pkg-index/official/common.rkt +++ b/pkgs/plt-services/meta/pkg-index/official/common.rkt @@ -27,6 +27,9 @@ (define cache-path (build-path root "cache")) (make-directory* cache-path) +(define SUMMARY-NAME "summary.rktd") +(define SUMMARY-PATH (build-path cache-path SUMMARY-NAME)) + (define pkgs-path (build-path root "pkgs")) (make-directory* pkgs-path) diff --git a/pkgs/plt-services/meta/pkg-index/official/static.rkt b/pkgs/plt-services/meta/pkg-index/official/static.rkt index cde6e180b6..99b93e6314 100644 --- a/pkgs/plt-services/meta/pkg-index/official/static.rkt +++ b/pkgs/plt-services/meta/pkg-index/official/static.rkt @@ -44,9 +44,22 @@ [x (error 'convert-to-json-key "~e" x)])) +(define (file->value* p dv) + (if (file-exists? p) + (file->value p) + dv)) + +;; From pkg-build/summary +(struct doc/main (name path) #:prefab) +(struct doc/extract (name path) #:prefab) +(struct doc/salvage (name path) #:prefab) +(struct doc/none (name) #:prefab) +(struct conflicts/indirect (path) #:prefab) + (define (generate-static) (define pkg-list (package-list)) (define pkg-ht (make-hash)) + (define build-summary (file->value* SUMMARY-PATH (hash))) (for ([pkg-name (in-list pkg-list)]) (define ht (file->value (build-path pkgs-path pkg-name))) @@ -174,12 +187,28 @@ pkg-url-str])) (for ([pkg (in-hash-keys pkg-ht)]) + (define pb (hash-ref build-summary pkg #f)) + (define (pbl k) + (and pb (hash-ref pb k #f))) + (hash-update! pkg-ht pkg (λ (ht) (define conflicts (package-conflicts? pkg)) (hash-set* ht + 'build + (hash 'success-log (pbl 'success-log) + 'failure-log (pbl 'failure-log) + 'dep-failure-log (pbl 'dep-failure-log) + 'conflicts-log (pbl 'conflicts-log) + 'docs + (for/list ([d (in-list (or (pbl 'docs) empty))]) + (match d + [(doc/main n p) (list "main" n p)] + [(doc/extract n p) (list "extract" n p)] + [(doc/salvage n p) (list "salvage" n p)] + [(doc/none n) (list "none" n)]))) 'conflicts conflicts 'versions (for/hash ([(v vht) (in-hash (hash-ref ht 'versions))]) @@ -210,7 +239,36 @@ st)] [st (if (empty? conflicts) st - (hash-set st ':conflicts: #t))]) + (hash-set st ':conflicts: #t))] + [st (if (pbl 'success-log) + (hash-set st ':build-success: #t) + st)] + [st (if (pbl 'failure-log) + (hash-set st ':build-fail: #t) + st)] + [st (if (pbl 'dep-failure-log) + (hash-set st ':build-dep-fail: #t) + st)] + [st (if (pbl 'conflicts-log) + (hash-set st ':build-conflicts: #t) + st)] + [pb-docs (pbl 'docs)] + [st (if (and pb-docs (cons? pb-docs) + (andmap (λ (d) + (or (doc/main? pb-docs) + (doc/extract? pb-docs) + (doc/salvage? pb-docs))) + pb-docs)) + (hash-set st ':docs: #t) + st)] + [st (if (and pb-docs (cons? pb-docs) + (andmap (λ (d) + (or (doc/extract? pb-docs) + (doc/salvage? pb-docs) + (doc/none? pb-docs))) + pb-docs)) + (hash-set st ':docs-error: #t) + st)]) st))))) diff --git a/pkgs/plt-services/meta/pkg-index/official/static/index.html b/pkgs/plt-services/meta/pkg-index/official/static/index.html index 84b3ef4292..3ef2af64cd 100644 --- a/pkgs/plt-services/meta/pkg-index/official/static/index.html +++ b/pkgs/plt-services/meta/pkg-index/official/static/index.html @@ -62,7 +62,9 @@ Ring: Authors: + Documentation: Source: + Build Status Checksum: Last Updated: Last Checked: @@ -87,9 +89,11 @@ Package + Docs Authors Description Tags + Build diff --git a/pkgs/plt-services/meta/pkg-index/official/static/index.js b/pkgs/plt-services/meta/pkg-index/official/static/index.js index f028541543..7e53aefa87 100644 --- a/pkgs/plt-services/meta/pkg-index/official/static/index.js +++ b/pkgs/plt-services/meta/pkg-index/official/static/index.js @@ -1,3 +1,4 @@ +var build_host = "http://pkg-build.racket-lang.org/"; var dynamic_host = "pkgd.racket-lang.org"; var dynamic_port = 443; @@ -100,6 +101,29 @@ $( document ).ready(function() { $( "#pi_last_checked" ).text( format_time(pkgi['last-checked']) ); $( "#pi_last_edit" ).text( format_time(pkgi['last-edit']) ); + // XXX show the doc[0] content? + $('#pi_docs').html("").append( $.map( pkgi['build']['docs'], function ( doc, i ) { + if ( doc[2] ) { + return $('', { href: build_host + doc[2] } ).html(doc[1]); } + else { + return $('').html(doc[1]); } } ) ); + + if ( pkgi['build']['failure-log'] ) { + $('#pi_build') + .append($('') + .append($('', { href: build_host + pkgi['build']['failure-log'] }).html( "fails" ))); + } else if ( pkgi['build']['success-log'] && pkgi['build']['dep-failure-log'] ) { + $('#pi_build') + .append($('') + .append($('', { href: build_host + pkgi['build']['success-log'] }).html( "succeeds" )) + .append(" with ") + .append($('', { href: build_host + pkgi['build']['dep-failure-log'] }).html( "dependency problems" ))); + } else if ( pkgi['build']['success-log'] ) { + $('#pi_build') + .append($('') + .append($('', { href: build_host + pkgi['build']['success-log'] }).html( "succeeds" ))); + } + $( "#pi_description" ).text( pkgi['description'] ); make_editbutton ( "pi_description", pkgi['description'], submit_mod_description ); @@ -413,6 +437,25 @@ $( document ).ready(function() { var dom = value['dom_obj']; + var bstatus; + if ( value['build']['failure-log'] ) { + bstatus = $('', {class: 'build_red'}) + .append($('') + .append($('', { href: build_host + value['build']['failure-log'] }).html( "fails" ))); + } else if ( value['build']['success-log'] && value['build']['dep-failure-log'] ) { + bstatus = $('', {class: 'build_red'}) + .append($('') + .append($('', { href: build_host + value['build']['success-log'] }).html( "succeeds" )) + .append(" with ") + .append($('', { href: build_host + value['build']['dep-failure-log'] }).html( "dependency problems" ))); + } else if ( value['build']['success-log'] ) { + bstatus = $('', {class: 'build_green'}) + .append($('') + .append($('', { href: build_host + value['build']['success-log'] }).html( "succeeds" ))); + } else { + bstatus = $('').html(""); + } + dom.attr("class", ((now - (60*60*24*2)) < value['last-updated'] ? "recent" : "old")) .data( "obj", value) .html("") @@ -421,11 +464,17 @@ $( document ).ready(function() { .append( curate_span ), $('').html("") .append( jslink( value['name'], function () { open_info ( value ); }) ), + $('').append( $.map( value['build']['docs'], function ( doc, i ) { + if ( doc[2] ) { + return $('', { href: build_host + doc[2] } ).html(doc[1]); } + else { + return $('').html(doc[1]); } } ) ), $('').append( $.map( value['authors'], function ( author, i ) { return addfilterlink ( author, "author:" + author, "possible" ); } ) ), $('').text( value['description'] ), $('').append( $.map( value['tags'], function ( tag, i ) { - return addfilterlink ( tag, tag, "possible" ); } ) )); } + return addfilterlink ( tag, tag, "possible" ); } ) ), + bstatus ); } var pkgdb = {}; $.getJSON( "/pkgs-all.json.gz", function( resp ) { diff --git a/pkgs/plt-services/meta/pkg-index/official/static/style.css b/pkgs/plt-services/meta/pkg-index/official/static/style.css index 0fc1c600d5..4960b1be29 100644 --- a/pkgs/plt-services/meta/pkg-index/official/static/style.css +++ b/pkgs/plt-services/meta/pkg-index/official/static/style.css @@ -155,6 +155,17 @@ tr#pi_delete_row td { text-align: center; } +.packages tr td:nth-child(7) { + text-align: center; +} +.packages tr td:nth-child(7) a { + text-decoration: none; +} + +.build_green { background-color: #ccffcc; } +.build_yellow { background-color: #ffffcc; } +.build_red { background-color: #ffcccc; } + /* racket nav */ .racketnav { background-color: #000000;