mirror of
https://github.com/containers/podman.git
synced 2025-12-02 02:58:03 +08:00
Vendor in buildah and use as much of commit and bug as possible for podman build and commit. Resolves #586 Signed-off-by: baude <bbaude@redhat.com> Closes: #681 Approved by: mheon
35 lines
813 B
Go
35 lines
813 B
Go
package buildah
|
|
|
|
import (
|
|
"github.com/containers/storage/pkg/chrootarchive"
|
|
"github.com/containers/storage/pkg/reexec"
|
|
)
|
|
|
|
var (
|
|
// CopyWithTar defines the copy method to use.
|
|
copyWithTar = chrootarchive.NewArchiver(nil).CopyWithTar
|
|
copyFileWithTar = chrootarchive.NewArchiver(nil).CopyFileWithTar
|
|
untarPath = chrootarchive.NewArchiver(nil).UntarPath
|
|
)
|
|
|
|
// InitReexec is a wrapper for reexec.Init(). It should be called at
|
|
// the start of main(), and if it returns true, main() should return
|
|
// immediately.
|
|
func InitReexec() bool {
|
|
return reexec.Init()
|
|
}
|
|
|
|
func copyStringStringMap(m map[string]string) map[string]string {
|
|
n := map[string]string{}
|
|
for k, v := range m {
|
|
n[k] = v
|
|
}
|
|
return n
|
|
}
|
|
|
|
func copyStringSlice(s []string) []string {
|
|
t := make([]string, len(s))
|
|
copy(t, s)
|
|
return t
|
|
}
|