github.com/zhuohuang-hust/src-cbuild@v0.0.0-20230105071821-c7aab3e7c840/pkg/chrootarchive/diff.go (about)

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