From db7264277704ba1faccae487a5cdd6918b28eae1 Mon Sep 17 00:00:00 2001 From: Alexander Larsson Date: Mon, 14 Oct 2013 10:53:12 +0200 Subject: [PATCH] Add some docs for newly exported functions Upstream-commit: 8e4b3a33906785c3181151cc46bb323952f6eb2b Component: engine --- components/engine/changes.go | 3 +++ components/engine/utils/utils.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/components/engine/changes.go b/components/engine/changes.go index 77bef6fb22..bf31114cdd 100644 --- a/components/engine/changes.go +++ b/components/engine/changes.go @@ -283,6 +283,8 @@ func collectFileInfo(sourceDir string) (*FileInfo, error) { return root, nil } +// Compare a directory with an array of layer directories it was based on and +// generate an array of Change objects describing the changes func ChangesLayers(newDir string, layers []string) ([]Change, error) { newRoot, err := collectFileInfo(newDir) if err != nil { @@ -299,6 +301,7 @@ func ChangesLayers(newDir string, layers []string) ([]Change, error) { return newRoot.Changes(oldRoot), nil } +// Compare two directories and generate an array of Change objects describing the changes func ChangesDirs(newDir, oldDir string) ([]Change, error) { oldRoot, err := collectFileInfo(oldDir) if err != nil { diff --git a/components/engine/utils/utils.go b/components/engine/utils/utils.go index 5a46d8562b..4187da1aec 100644 --- a/components/engine/utils/utils.go +++ b/components/engine/utils/utils.go @@ -1051,6 +1051,8 @@ func quote(word string, buf *bytes.Buffer) { buf.WriteString("'") } +// Take a list of strings and escape them so they will be handled right +// when passed as arguments to an program via a shell func ShellQuoteArguments(args []string) string { var buf bytes.Buffer for i, arg := range args {