1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2025-07-03 22:28:29 +00:00

entries: comment with keyword metadata

Since not every keyword applies to every type entry, include a comment
with the keywords the manifest was generated with.

Signed-off-by: Aleksa Sarai <asarai@suse.de>
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
Aleksa Sarai 2016-11-12 15:03:20 +11:00 committed by Vincent Batts
parent a6df651d88
commit 408b615c3c
2 changed files with 27 additions and 4 deletions

9
tar.go
View file

@ -82,8 +82,13 @@ func (ts *tarStream) readHeaders() {
Set: nil,
Keywords: []KeyVal{"type=dir"},
}
metadataEntries := signatureEntries("<user specified tar archive>")
for _, e := range metadataEntries {
// insert signature and metadata comments first (user, machine, tree, date)
for _, e := range signatureEntries("<user specified tar archive>") {
e.Pos = len(ts.creator.DH.Entries)
ts.creator.DH.Entries = append(ts.creator.DH.Entries, e)
}
// insert keyword metadata next
for _, e := range keywordEntries(ts.keywords) {
e.Pos = len(ts.creator.DH.Entries)
ts.creator.DH.Entries = append(ts.creator.DH.Entries, e)
}