2015-07-30 16:04:36 -04:00
|
|
|
package chrootarchive
|
|
|
|
|
|
|
|
import "github.com/docker/docker/pkg/archive"
|
|
|
|
|
|
|
|
// 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.
|
2015-08-03 21:52:54 -04:00
|
|
|
func ApplyLayer(dest string, layer archive.Reader) (size int64, err error) {
|
2015-07-30 16:04:36 -04:00
|
|
|
return applyLayerHandler(dest, layer, 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.
|
2015-08-03 21:52:54 -04:00
|
|
|
func ApplyUncompressedLayer(dest string, layer archive.Reader) (int64, error) {
|
2015-07-30 16:04:36 -04:00
|
|
|
return applyLayerHandler(dest, layer, false)
|
|
|
|
}
|