summaryrefslogtreecommitdiff
path: root/guix/store/deduplication.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2022-05-26 17:11:20 +0200
committerLudovic Courtès <ludo@gnu.org>2022-05-26 17:11:20 +0200
commit7097e98586df3110b80943a88c27804d65f214fa (patch)
tree2e244b9fc19acc569d6abd42306aaf013f02da0d /guix/store/deduplication.scm
parent15870cc08d20501e3526fa892111a43ae9e3e02f (diff)
parent4577f3c6b60ea100e521c246fb169d6c05214b20 (diff)
downloadguix-patches-7097e98586df3110b80943a88c27804d65f214fa.tar
guix-patches-7097e98586df3110b80943a88c27804d65f214fa.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'guix/store/deduplication.scm')
-rw-r--r--guix/store/deduplication.scm27
1 files changed, 1 insertions, 26 deletions
diff --git a/guix/store/deduplication.scm b/guix/store/deduplication.scm
index 370df4a74c..ab982e3b3d 100644
--- a/guix/store/deduplication.scm
+++ b/guix/store/deduplication.scm
@@ -22,7 +22,7 @@
(define-module (guix store deduplication)
#:use-module (gcrypt hash)
- #:use-module ((guix build utils) #:hide (dump-port))
+ #:use-module (guix build utils)
#:use-module (guix build syscalls)
#:use-module (guix base32)
#:use-module (srfi srfi-11)
@@ -38,31 +38,6 @@
dump-file/deduplicate
copy-file/deduplicate))
-;; TODO: Remove once 'dump-port' in (guix build utils) has an optional 'len'
-;; parameter.
-(define* (dump-port in out
- #:optional len
- #:key (buffer-size 16384))
- "Read LEN bytes from IN (or as much as possible if LEN is #f) and write it
-to OUT, using chunks of BUFFER-SIZE bytes."
- (define buffer
- (make-bytevector buffer-size))
-
- (let loop ((total 0)
- (bytes (get-bytevector-n! in buffer 0
- (if len
- (min len buffer-size)
- buffer-size))))
- (or (eof-object? bytes)
- (and len (= total len))
- (let ((total (+ total bytes)))
- (put-bytevector out buffer 0 bytes)
- (loop total
- (get-bytevector-n! in buffer 0
- (if len
- (min (- len total) buffer-size)
- buffer-size)))))))
-
(define (nar-sha256 file)
"Gives the sha256 hash of a file and the size of the file in nar form."
(let-values (((port get-hash) (open-sha256-port)))