Generate info files for 5.3.6 correctly

This commit is contained in:
Jay McCarthy 2013-10-15 06:29:07 -06:00
parent 243533ba61
commit 3954ead8e7
3 changed files with 41 additions and 13 deletions

View File

@ -51,14 +51,34 @@
(for ([pkg-name (in-list pkg-list)])
(define ht (file->value (build-path pkgs-path pkg-name)))
(define versions-ht
(hash-set (hash-ref ht 'versions (hash))
'default
(hasheq 'source (hash-ref ht 'source "")
'checksum (hash-ref ht 'checksum ""))))
(define (hash-ref-or ht ks)
(or (for/or ([k (in-list ks)])
(hash-ref ht k #f))
(error 'hash-ref-or "Keys (~v) not found in ~e" ks ht)))
(define versions-5.3.6
(hash-ref-or versions-ht '("5.3.6" default)))
(define source-5.3.6
(hash-ref versions-5.3.6 'source))
(define checksum-5.3.6
(hash-ref versions-5.3.6 'checksum))
(hash-set!
pkg-ht pkg-name
(hash-set* ht
'name pkg-name
'source source-5.3.6
'checksum checksum-5.3.6
'last-updated (hash-ref ht 'last-updated (current-seconds))
'last-checked (hash-ref ht 'last-checked (current-seconds))
'last-edit (hash-ref ht 'last-edit (current-seconds))
'versions (hash-ref ht 'versions empty)
'versions versions-ht
'ring (hash-ref ht 'ring 2)
'tags (hash-ref ht 'tags empty)
'authors (author->list (hash-ref ht 'author "")))))
@ -159,7 +179,11 @@
(hash-set*
ht
'conflicts conflicts
'source_url (package-url->useful-url (hash-ref ht 'source))
'versions
(for/hash ([(v vht) (in-hash (hash-ref ht 'versions))])
(values v
(hash-set vht 'source_url
(package-url->useful-url (hash-ref vht 'source)))))
'search-terms
(let* ([st (hasheq)]
[st (for/fold ([st st])

View File

@ -77,11 +77,11 @@ $( document ).ready(function() {
else {
$( "#pi_add_author_row" ).hide(); }
$( "#pi_source" ).html( $('<a>', { text: pkgi['source'],
href: pkgi['source_url'] } ));
make_editbutton ( "pi_source", pkgi['source'], submit_mod_source );
$( "#pi_source" ).html( $('<a>', { text: pkgi['versions']['default']['source'],
href: pkgi['versions']['default']['source_url'] } ));
make_editbutton ( "pi_source", pkgi['versions']['default']['source'], submit_mod_source );
$( "#pi_checksum" ).html("").text( pkgi['checksum'] );
$( "#pi_checksum" ).html("").text( pkgi['versions']['default']['checksum'] );
if ( pkgi['checksum-error'] ) {
$( "#pi_checksum" ).append( [ "Error:", $("<pre>").text(pkgi['checksum-error']) ] ); }
@ -100,12 +100,16 @@ $( document ).ready(function() {
return [tag, " "]; } } ) ));
$( "#pi_versions" ).html("").append( $.map( pkgi['versions'], function ( vo, v ) {
return [ $('<tr>').append( $('<td>').html("").append(
v, (mypkg_p ? ["&nbsp;", jslink( "[x]", function () { submit_remove_version(v); }) ] : "") ),
$('<td>').html(vo['source']) ),
$('<tr>').append( $('<td>').html(""),
$('<td>').html(vo['checksum']) ),
" "]; } ) );
if ( v == 'default' ) {
return []; }
else {
return [ $('<tr>').append( $('<td>').html("").append(
v, (mypkg_p ? ["&nbsp;", jslink( "[x]", function () { submit_remove_version(v); }) ] : "") ),
$('<td>').html( $('<a>', { text: vo['source'],
href: vo['source_url'] } ) ) ),
$('<tr>').append( $('<td>').html(""),
$('<td>').html(vo['checksum']) ),
" "]; } } ) );
if ( mypkg_p ) {
$( "#pi_add_version_row" ).show(); }
else {

View File

@ -47,7 +47,7 @@
(define old-checksum (hash-ref vi 'checksum ""))
(define new-checksum
(package-url->checksum
(hash-ref vi 'source)))
(hash-ref vi 'source "")))
(values v
(hash-set vi 'checksum
(or new-checksum