diff options
Diffstat (limited to 'guix-data-service/model')
-rw-r--r-- | guix-data-service/model/package-metadata.scm | 54 |
1 files changed, 25 insertions, 29 deletions
diff --git a/guix-data-service/model/package-metadata.scm b/guix-data-service/model/package-metadata.scm index 030ad4f..9593b49 100644 --- a/guix-data-service/model/package-metadata.scm +++ b/guix-data-service/model/package-metadata.scm @@ -389,43 +389,39 @@ WHERE packages.id IN ( (insert-package-description-set conn package-description-ids)))))) (define (inferior-packages->package-metadata-ids conn - inferior - packages + package-metadata license-set-ids) - (define package-metadata - (map (lambda (package license-set-id) - (let ((translated-package-descriptions-and-synopsis - (inferior-packages->translated-package-descriptions-and-synopsis - inferior package))) - (list (non-empty-string-or-false - (inferior-package-home-page package)) - (location->location-id - conn - (inferior-package-location package)) - license-set-id - (package-description-data->package-description-set-id - conn - (car translated-package-descriptions-and-synopsis)) - (package-synopsis-data->package-synopsis-set-id - conn - (cdr translated-package-descriptions-and-synopsis))))) - packages - license-set-ids)) - (insert-missing-data-and-return-all-ids conn "package_metadata" - '(home_page location_id license_set_id package_description_set_id package_synopsis_set_id) - (map (match-lambda - ((home-page location-id license-set-id package_description_set_id package_synopsis_set_id) + '(home_page + location_id + license_set_id + package_description_set_id + package_synopsis_set_id) + + (map (match-lambda* + (((home-page + location + package-description-data + package-synopsis-data) + license-set-id) + (list (if (string? home-page) home-page NULL) - location-id + (location->location-id + conn + location) license-set-id - package_description_set_id - package_synopsis_set_id))) - package-metadata) + (package-description-data->package-description-set-id + conn + package-description-data) + (package-synopsis-data->package-synopsis-set-id + conn + package-synopsis-data)))) + package-metadata + license-set-ids) ;; There can be duplicated entires in package-metadata, for example where ;; you have one package definition which interits from another, and just ;; overrides the version and the source, the package_metadata entries for |