exe

package
v12.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 23, 2024 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const SudoLoopDuration = 241

Variables

This section is empty.

Functions

This section is empty.

Types

type Call

type Call struct {
	Res  []interface{}
	Args []interface{}
	Dir  string
}

func (*Call) String

func (c *Call) String() string

type CmdBuilder

type CmdBuilder struct {
	GitBin           string
	GitFlags         []string
	GPGBin           string
	GPGFlags         []string
	MakepkgFlags     []string
	MakepkgConfPath  string
	MakepkgBin       string
	SudoBin          string
	SudoFlags        []string
	SudoLoopEnabled  bool
	PacmanBin        string
	PacmanConfigPath string
	PacmanDBPath     string
	KeepSrc          bool
	Runner           Runner
	Log              *text.Logger
}

func NewCmdBuilder added in v12.1.3

func NewCmdBuilder(cfg *settings.Configuration, runner Runner, logger *text.Logger, dbPath string) *CmdBuilder

func (*CmdBuilder) AddMakepkgFlag

func (c *CmdBuilder) AddMakepkgFlag(flag string)

func (*CmdBuilder) BuildGPGCmd

func (c *CmdBuilder) BuildGPGCmd(ctx context.Context, extraArgs ...string) *exec.Cmd

func (*CmdBuilder) BuildGitCmd

func (c *CmdBuilder) BuildGitCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd

func (*CmdBuilder) BuildMakepkgCmd

func (c *CmdBuilder) BuildMakepkgCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd

func (*CmdBuilder) BuildPacmanCmd

func (c *CmdBuilder) BuildPacmanCmd(ctx context.Context, args *parser.Arguments, mode parser.TargetMode, noConfirm bool) *exec.Cmd

func (*CmdBuilder) Capture

func (c *CmdBuilder) Capture(cmd *exec.Cmd) (stdout, stderr string, err error)

func (*CmdBuilder) GetKeepSrc added in v12.2.0

func (c *CmdBuilder) GetKeepSrc() bool

func (*CmdBuilder) Show

func (c *CmdBuilder) Show(cmd *exec.Cmd) error

func (*CmdBuilder) SudoLoop

func (c *CmdBuilder) SudoLoop()

type GitCmdBuilder

type GitCmdBuilder interface {
	Runner
	BuildGitCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd
}

type ICmdBuilder

type ICmdBuilder interface {
	Runner
	BuildGitCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd
	BuildGPGCmd(ctx context.Context, extraArgs ...string) *exec.Cmd
	BuildMakepkgCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd
	BuildPacmanCmd(ctx context.Context, args *parser.Arguments, mode parser.TargetMode, noConfirm bool) *exec.Cmd
	AddMakepkgFlag(string)
	GetKeepSrc() bool
	SudoLoop()
}

type MockBuilder

type MockBuilder struct {
	Runner                 Runner
	BuildMakepkgCmdCallsMu sync.Mutex
	BuildMakepkgCmdCalls   []Call
	BuildMakepkgCmdFn      func(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd
	BuildPacmanCmdFn       func(ctx context.Context, args *parser.Arguments, mode parser.TargetMode, noConfirm bool) *exec.Cmd
	GetKeepSrcFn           func() bool
}

func (*MockBuilder) AddMakepkgFlag

func (m *MockBuilder) AddMakepkgFlag(flag string)

func (*MockBuilder) BuildGPGCmd added in v12.1.3

func (m *MockBuilder) BuildGPGCmd(ctx context.Context, extraArgs ...string) *exec.Cmd

func (*MockBuilder) BuildGitCmd

func (m *MockBuilder) BuildGitCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd

func (*MockBuilder) BuildMakepkgCmd

func (m *MockBuilder) BuildMakepkgCmd(ctx context.Context, dir string, extraArgs ...string) *exec.Cmd

func (*MockBuilder) BuildPacmanCmd

func (m *MockBuilder) BuildPacmanCmd(ctx context.Context, args *parser.Arguments, mode parser.TargetMode, noConfirm bool) *exec.Cmd

func (*MockBuilder) Capture

func (m *MockBuilder) Capture(cmd *exec.Cmd) (stdout, stderr string, err error)

func (*MockBuilder) GetKeepSrc added in v12.2.0

func (m *MockBuilder) GetKeepSrc() bool

func (*MockBuilder) SetPacmanDBPath

func (m *MockBuilder) SetPacmanDBPath(path string)

func (*MockBuilder) Show

func (m *MockBuilder) Show(cmd *exec.Cmd) error

func (*MockBuilder) SudoLoop

func (m *MockBuilder) SudoLoop()

type MockRunner

type MockRunner struct {
	ShowCallsMu    sync.Mutex
	ShowCalls      []Call
	CaptureCallsMu sync.Mutex
	CaptureCalls   []Call
	ShowFn         func(cmd *exec.Cmd) error
	CaptureFn      func(cmd *exec.Cmd) (stdout string, stderr string, err error)
}

func (*MockRunner) Capture

func (m *MockRunner) Capture(cmd *exec.Cmd) (stdout, stderr string, err error)

func (*MockRunner) Show

func (m *MockRunner) Show(cmd *exec.Cmd) error

type OSRunner

type OSRunner struct {
	Log *text.Logger
}

func NewOSRunner added in v12.1.3

func NewOSRunner(log *text.Logger) *OSRunner

func (*OSRunner) Capture

func (r *OSRunner) Capture(cmd *exec.Cmd) (stdout, stderr string, err error)

func (*OSRunner) Show

func (r *OSRunner) Show(cmd *exec.Cmd) error

type Runner

type Runner interface {
	Capture(cmd *exec.Cmd) (stdout string, stderr string, err error)
	Show(cmd *exec.Cmd) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL