;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 Mathieu Othacehe ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu installer dump) #:use-module (gnu installer utils) #:use-module (guix build utils) #:use-module (srfi srfi-11) #:use-module (ice-9 iconv) #:use-module (ice-9 match) #:use-module (ice-9 popen) #:use-module (ice-9 textual-ports) #:use-modul
aboutsummaryrefslogtreecommitdiff
blob: 8da13ee86603ca807855f409756dc75ca73f7740 (about) (plain)
blob size (153KB) exceeds display size limit (100KB).
fine* (send-dump-report dump #:key (url "https://dump.guix.gnu.org")) "Turn the DUMP archive into a multipart body and send it to the Guix crash dump server at URL." (define (match-boundary kont) (match-lambda (('boundary . (? string? b)) (kont b)) (x #f))) (define (response->string response) (bytevector->string (read-response-body response) "UTF-8")) (let-values (((body boundary) (call-with-input-file dump (lambda (port) (format-multipart-body `((,%dump-type . ,port))))))) (false-if-exception (response->string (http-post (string-append url "/upload") #:keep-alive? #t #:streaming? #t #:headers `((content-type . (multipart/form-data (boundary . ,boundary)))) #:body body)))))