mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-08 05:50:47 +00:00
only create bzip file if needed. #415
This commit is contained in:
+2
-2
@@ -11,7 +11,7 @@ import (
|
||||
//
|
||||
// It uses internal gzip and external bzip2, see:
|
||||
// https://code.google.com/p/go/issues/detail?id=4828
|
||||
func CompressFile(source *os.File) error {
|
||||
func CompressFile(source *os.File, onlyGzip bool) error {
|
||||
gzPath := source.Name() + ".gz"
|
||||
gzFile, err := os.Create(gzPath)
|
||||
if err != nil {
|
||||
@@ -24,7 +24,7 @@ func CompressFile(source *os.File) error {
|
||||
|
||||
source.Seek(0, 0)
|
||||
_, err = io.Copy(gzWriter, source)
|
||||
if err != nil {
|
||||
if err != nil || onlyGzip {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user