mirror of
https://github.com/containers/podman.git
synced 2025-12-03 11:49:18 +08:00
vendor buildah, image, storage, cni
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
25
vendor/github.com/containers/storage/pkg/reexec/command_linux.go
generated
vendored
25
vendor/github.com/containers/storage/pkg/reexec/command_linux.go
generated
vendored
@@ -3,6 +3,7 @@
|
||||
package reexec
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
"syscall"
|
||||
|
||||
@@ -20,11 +21,23 @@ func Self() string {
|
||||
// This will use the in-memory version (/proc/self/exe) of the current binary,
|
||||
// it is thus safe to delete or replace the on-disk binary (os.Args[0]).
|
||||
func Command(args ...string) *exec.Cmd {
|
||||
return &exec.Cmd{
|
||||
Path: Self(),
|
||||
Args: args,
|
||||
SysProcAttr: &syscall.SysProcAttr{
|
||||
Pdeathsig: unix.SIGTERM,
|
||||
},
|
||||
cmd := exec.Command(Self())
|
||||
cmd.Args = args
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Pdeathsig: unix.SIGTERM,
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
// CommandContext returns *exec.Cmd which has Path as current binary, and also
|
||||
// sets SysProcAttr.Pdeathsig to SIGTERM.
|
||||
// This will use the in-memory version (/proc/self/exe) of the current binary,
|
||||
// it is thus safe to delete or replace the on-disk binary (os.Args[0]).
|
||||
func CommandContext(ctx context.Context, args ...string) *exec.Cmd {
|
||||
cmd := exec.CommandContext(ctx, Self())
|
||||
cmd.Args = args
|
||||
cmd.SysProcAttr = &syscall.SysProcAttr{
|
||||
Pdeathsig: unix.SIGTERM,
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
|
||||
15
vendor/github.com/containers/storage/pkg/reexec/command_unix.go
generated
vendored
15
vendor/github.com/containers/storage/pkg/reexec/command_unix.go
generated
vendored
@@ -3,6 +3,7 @@
|
||||
package reexec
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
@@ -16,8 +17,14 @@ func Self() string {
|
||||
// For example if current binary is "docker" at "/usr/bin/", then cmd.Path will
|
||||
// be set to "/usr/bin/docker".
|
||||
func Command(args ...string) *exec.Cmd {
|
||||
return &exec.Cmd{
|
||||
Path: Self(),
|
||||
Args: args,
|
||||
}
|
||||
cmd := exec.Command(Self())
|
||||
cmd.Args = args
|
||||
return cmd
|
||||
}
|
||||
|
||||
// CommandContext returns *exec.Cmd which has Path as current binary.
|
||||
func CommandContext(ctx context.Context, args ...string) *exec.Cmd {
|
||||
cmd := exec.CommandContext(ctx, Self())
|
||||
cmd.Args = args
|
||||
return cmd
|
||||
}
|
||||
|
||||
6
vendor/github.com/containers/storage/pkg/reexec/command_unsupported.go
generated
vendored
6
vendor/github.com/containers/storage/pkg/reexec/command_unsupported.go
generated
vendored
@@ -3,6 +3,7 @@
|
||||
package reexec
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
@@ -10,3 +11,8 @@ import (
|
||||
func Command(args ...string) *exec.Cmd {
|
||||
return nil
|
||||
}
|
||||
|
||||
// CommandContext is unsupported on operating systems apart from Linux, Windows, Solaris and Darwin.
|
||||
func CommandContext(ctx context.Context, args ...string) *exec.Cmd {
|
||||
return nil
|
||||
}
|
||||
|
||||
17
vendor/github.com/containers/storage/pkg/reexec/command_windows.go
generated
vendored
17
vendor/github.com/containers/storage/pkg/reexec/command_windows.go
generated
vendored
@@ -3,6 +3,7 @@
|
||||
package reexec
|
||||
|
||||
import (
|
||||
"context"
|
||||
"os/exec"
|
||||
)
|
||||
|
||||
@@ -16,8 +17,16 @@ func Self() string {
|
||||
// For example if current binary is "docker.exe" at "C:\", then cmd.Path will
|
||||
// be set to "C:\docker.exe".
|
||||
func Command(args ...string) *exec.Cmd {
|
||||
return &exec.Cmd{
|
||||
Path: Self(),
|
||||
Args: args,
|
||||
}
|
||||
cmd := exec.Command(Self())
|
||||
cmd.Args = args
|
||||
return cmd
|
||||
}
|
||||
|
||||
// Command returns *exec.Cmd which has Path as current binary.
|
||||
// For example if current binary is "docker.exe" at "C:\", then cmd.Path will
|
||||
// be set to "C:\docker.exe".
|
||||
func CommandContext(ctx context.Context, args ...string) *exec.Cmd {
|
||||
cmd := exec.CommandContext(ctx, Self())
|
||||
cmd.Args = args
|
||||
return cmd
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user