libbusyna

package
v0.0.0-...-06e995a Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChanFromFile

func ChanFromFile(filename string) <-chan string

ChanFromFile returns a channel that receives the provided file, line-by-line.

func ChanFromList

func ChanFromList(list []string) <-chan string

ChanFromList returns a channel that receives the elements of the list.

func CmdDataEqual

func CmdDataEqual(cmddata1 CmdData, cmddata2 CmdData, strict bool) bool

CmdDataEqual checks if the provided CmdData's are equal strict controls wheather the deps of the second can be a subset of the deps of the first.

func CmdEqual

func CmdEqual(cmd1 Cmd, cmd2 Cmd) bool

CmdEqual checks if the provided Cmd's are equal

func DbRead

func DbRead(dbfilename string) <-chan CmdData

DbRead reads the database from filename and outputs the data to the returned channel.

func DbWrite

func DbWrite(c <-chan CmdData, outputfile string)

DbWrite dumps the CmdData that it reads from the provided channel into a sqlite database.

func DeployDot

func DeployDot(c <-chan CmdData, outputfile string)

Create a dot graphviz file with db data read form the provided channel.

func DeployMake

func DeployMake(c <-chan CmdData, outputfile string)

Create a Makefile file with db data read form the provided channel.

func DeployRc

func DeployRc(c <-chan CmdData, outputfile string)

func DeployRcCmd

func DeployRcCmd(c <-chan Cmd, outputfile string)

func DeployTup

func DeployTup(c <-chan CmdData, outputfile string)

Create a Makefile file with db data read form the provided channel.

func ExtractMake

func ExtractMake(outputfile string)

ExtractMake creates the shell script and the Makefile that are used to create a busyna.rc from an existing Makefile

func ExtractShellCreate

func ExtractShellCreate(rcfile *os.File) *os.File

ExtractShellCreate creates the shell help script that is executed as the shell itself.

func FileTrace

func FileTrace(command string, env map[string]string, dir string) (map[string]bool, map[string]bool)

FileTrace runs the given command and return two channels: the first with the files read and the second with the files written.

func RcParse

func RcParse(filename string, c <-chan string) <-chan Cmd

Parse a busynarc by channel.

func RcParseFile

func RcParseFile(rcfilename string) <-chan Cmd

Parse a busynarc file.

func RcRun

func RcRun(c <-chan Cmd) <-chan CmdData

Run all commands in channel, outputing the dependencies and targets to the second argument.

func ReFindMap

func ReFindMap(re *regexp.Regexp, l string) map[string]string

ReFindMap returns a map with the matched substrings of a regexp.

func StraceParse1

func StraceParse1(straceChan <-chan string) <-chan string

StraceParse1 is the parser that joins unfinished lines in proper order. Takes a channel that outputs strace lines, as returned by StraceRun. Returns a channel that receives the joined lines.

func StraceParse2

func StraceParse2(strace1Chan <-chan string) <-chan Strace2Info

StraceParse2 is the parser that interprets complete lines and returns the structured information. Takes a channel that outputs strace joined lines, as returned by StraceParser1.

func StraceParse2Argsplit

func StraceParse2Argsplit(straceArgs string) []string

StraceParse2Argsplit splits strace function arguments into a list.

func StraceParse3

func StraceParse3(siChan <-chan Strace2Info, dir string) (map[string]bool, map[string]bool)

StraceParse3 uses the structured strace output to generate the files read/written information. Returns read files, written files.

func StraceRun

func StraceRun(command string, env map[string]string, dir string) <-chan string

StraceRun runs a command using strace and writes the trace information to the returned channel. The environment variables and working directory can be specified. Returns a channel that receives the strace output, line-by-line.

func TmpEnd

func TmpEnd(f *os.File)

TmpEnd finishes a temporary file by closing its file descriptor and deleting it in the filesystem.

Types

type Cmd

type Cmd struct {
	Line string
	Env  map[string]string
	Dir  string
	Err  error
}

A single shell command and the environment where it should be executed. It is a stripped-down os/exec Cmd structure

type CmdData

type CmdData struct {
	Cmd     Cmd
	Deps    map[string]bool
	Targets map[string]bool
}

A shell command with the discovered dependencies and targets.

type Strace2Info

type Strace2Info struct {
	// contains filtered or unexported fields
}

Strace2Info is the structured strace output.

Jump to

Keyboard shortcuts

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