2016-11-22 19:32:10 +00:00
|
|
|
package chrootarchive
|
|
|
|
|
2017-09-12 23:29:24 +00:00
|
|
|
import (
|
|
|
|
"io"
|
|
|
|
|
|
|
|
"github.com/containers/storage/pkg/archive"
|
|
|
|
)
|
2016-11-22 19:32:10 +00:00
|
|
|
|
|
|
|
// ApplyLayer parses a diff in the standard layer format from `layer`,
|
|
|
|
// and applies it to the directory `dest`. The stream `layer` can only be
|
|
|
|
// uncompressed.
|
|
|
|
// Returns the size in bytes of the contents of the layer.
|
2017-09-12 23:29:24 +00:00
|
|
|
func ApplyLayer(dest string, layer io.Reader) (size int64, err error) {
|
2016-11-22 19:32:10 +00:00
|
|
|
return applyLayerHandler(dest, layer, &archive.TarOptions{}, true)
|
|
|
|
}
|
|
|
|
|
|
|
|
// ApplyUncompressedLayer parses a diff in the standard layer format from
|
|
|
|
// `layer`, and applies it to the directory `dest`. The stream `layer`
|
|
|
|
// can only be uncompressed.
|
|
|
|
// Returns the size in bytes of the contents of the layer.
|
2017-09-12 23:29:24 +00:00
|
|
|
func ApplyUncompressedLayer(dest string, layer io.Reader, options *archive.TarOptions) (int64, error) {
|
2016-11-22 19:32:10 +00:00
|
|
|
return applyLayerHandler(dest, layer, options, false)
|
|
|
|
}
|