Handle namedpipe copy

CopyFile relies on copy.Copy from https://github.com/otiai10/copy which
doesn't handle named pipes copy. Handle it here until
https://github.com/otiai10/copy/issues/47 is fixed.

This causes luet to hang while copying packages that have named pipes in
it.

Also invert compression argument for gzip, it causes slowliness.
This commit is contained in:
Ettore Di Giacinto
2021-01-25 11:22:10 +01:00
parent 55d34a3b40
commit d89225f37d
2 changed files with 30 additions and 3 deletions

View File

@@ -373,7 +373,7 @@ func (a *PackageArtifact) Compress(src string, concurrency int) error {
}
// Create gzip writer.
w := gzip.NewWriter(dst)
w.SetConcurrency(concurrency, 10)
w.SetConcurrency(1<<20, concurrency)
defer w.Close()
defer dst.Close()
_, err = io.Copy(w, bufferedReader)