diff.go 840 B

1234567891011121314151617181920212223
  1. package chrootarchive
  2. import (
  3. "io"
  4. "github.com/docker/docker/pkg/archive"
  5. )
  6. // ApplyLayer parses a diff in the standard layer format from `layer`,
  7. // and applies it to the directory `dest`. The stream `layer` can only be
  8. // uncompressed.
  9. // Returns the size in bytes of the contents of the layer.
  10. func ApplyLayer(dest string, layer io.Reader) (size int64, err error) {
  11. return applyLayerHandler(dest, layer, &archive.TarOptions{}, true)
  12. }
  13. // ApplyUncompressedLayer parses a diff in the standard layer format from
  14. // `layer`, and applies it to the directory `dest`. The stream `layer`
  15. // can only be uncompressed.
  16. // Returns the size in bytes of the contents of the layer.
  17. func ApplyUncompressedLayer(dest string, layer io.Reader, options *archive.TarOptions) (int64, error) {
  18. return applyLayerHandler(dest, layer, options, false)
  19. }