mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-12-22 05:46:30 +00:00
cmd: gomtree: re-enable errors when there is a Modified entry
Signed-off-by: Aleksa Sarai <asarai@suse.de>
This commit is contained in:
parent
3c76a35588
commit
9cdd9152b3
1 changed files with 10 additions and 10 deletions
|
@ -269,14 +269,20 @@ func app() error {
|
|||
if isTarSpec(specDh) || *flTar != "" {
|
||||
res = filterMissingKeywords(res)
|
||||
}
|
||||
//if len(res) > 0 {
|
||||
//return fmt.Errorf("unexpected missing keywords: %d", len(res))
|
||||
//}
|
||||
|
||||
out := formatFunc(res)
|
||||
if _, err := os.Stdout.Write([]byte(out)); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO: This should be a flag. Allowing files to be added and
|
||||
// removed and still returning "it's all good" is simply
|
||||
// unsafe IMO.
|
||||
for _, diff := range res {
|
||||
if diff.Type() == mtree.Modified {
|
||||
return fmt.Errorf("mainfest validation failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return fmt.Errorf("neither validating or creating a manifest. Please provide additional arguments")
|
||||
|
@ -289,13 +295,7 @@ var formats = map[string]func([]mtree.InodeDelta) string{
|
|||
"bsd": func(d []mtree.InodeDelta) string {
|
||||
var buffer bytes.Buffer
|
||||
for _, delta := range d {
|
||||
if delta.Type() == mtree.Modified {
|
||||
fmt.Fprintln(&buffer, delta)
|
||||
} else if delta.Type() == mtree.Missing {
|
||||
fmt.Fprintln(&buffer, delta)
|
||||
} else if delta.Type() == mtree.Extra {
|
||||
fmt.Fprintln(&buffer, delta)
|
||||
}
|
||||
fmt.Fprintln(&buffer, delta)
|
||||
}
|
||||
return buffer.String()
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue