1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-06-03 18:02:28 +00:00

*: fix comparison of missing keywords

Adding another test validated from the FreeBSD workflow.

Just because the keywords requested to be validated are not present in
the manifest, it is not an error.
Also, if the keywords from a new manifest are not present in a prior
manifest, then only compare the common keywords.

Fixes https://github.com/vbatts/go-mtree/issues/86

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Vincent Batts 2016-11-17 21:29:55 -05:00
parent 4eec68be4b
commit 21723a3974
Signed by: vbatts
GPG key ID: 10937E57733F1362
4 changed files with 36 additions and 17 deletions

View file

@ -184,10 +184,6 @@ func app() error {
if (keyword == "time" && mtree.InKeywordSlice("tar_time", specKeywords)) || (keyword == "tar_time" && mtree.InKeywordSlice("time", specKeywords)) {
continue
}
if !mtree.InKeywordSlice(keyword, specKeywords) {
return fmt.Errorf("cannot verify keywords not in mtree specification: %s\n", keyword)
}
}
}
@ -263,9 +259,9 @@ func app() error {
if isTarSpec(specDh) || *flTar != "" {
res = filterMissingKeywords(res)
}
if len(res) > 0 {
return fmt.Errorf("unexpected missing keywords: %d", len(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 {