summaryrefslogtreecommitdiff
path: root/vendor/github.com/projectatomic/buildah/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/projectatomic/buildah/util.go')
-rw-r--r--vendor/github.com/projectatomic/buildah/util.go34
1 files changed, 34 insertions, 0 deletions
diff --git a/vendor/github.com/projectatomic/buildah/util.go b/vendor/github.com/projectatomic/buildah/util.go
new file mode 100644
index 000000000..33b5b9e83
--- /dev/null
+++ b/vendor/github.com/projectatomic/buildah/util.go
@@ -0,0 +1,34 @@
+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
+}