1
0
Fork 0
mirror of https://github.com/vbatts/go-mtree.git synced 2024-11-05 00:15:58 +00:00
Commit graph

14 commits

Author SHA1 Message Date
Stephen Chung
656e577ecc *: have gomtree always evaluate tar_time if it is present
if the keyword "tar_time" is present when evaluating
an Entry, gomtree should use the tar_time when evaluating
the "time" keyword as well. This commit also adds a test that
makes sure "tar_time" wins against "time" if both are present.
Some minor clean-ups as well, such as checking if KeywordFunc[keyword]
actually retrieves a function.

Signed-off-by: Stephen Chung <schung@redhat.com>
2016-07-23 12:07:43 -04:00
bc6f3bf902 tar_time: treat time from tar archives special
Since the field in a tar header for each file only preserves seconds
precision, not nanosecond precision, let's handle it special. This will
allow for more custom case handling in Check()

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-07-23 12:07:43 -04:00
Stephen Chung
f0f15a0e49 keywords: return "link" keyword along with its value
Originally only returning `Sys.linkname` when evaluating
a tar header's link field. We want it to be in the form of
keyword=value instead.

Signed-off-by: Stephen Chung <schung@redhat.com>
2016-07-23 12:07:43 -04:00
faa80931af *: refactoring to support streams
when creating a manifest from, or validating, a stream like a tar
archive, it requires thinking about some of the functions differently
than walking a directory tree.

This is the beginning of allowing for such features.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-07-23 12:07:43 -04:00
Stephen Chung
e29b993aa2 keywords: obtain all permission bits
Fixes #7. Upper 3 bits are 'special' mode bits, and are not
included when calling info.Mode().Perm(). Need to mask
the info.Mode() with the corresponding mode bit defined
by the go library to see if these bits are set or not.

Signed-off-by: Stephen Chung <schung@redhat.com>
2016-07-15 15:37:52 -04:00
6adcc98b22 keywords: time keyword 9 postition decimal
Matching with the FreeBSD standard format

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-06-27 13:24:03 -04:00
ac37b23f38 keywords: time can be 0
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-06-27 13:16:24 -04:00
2fd41fb43f check: an initial pass at a validation check
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-24 16:35:09 -04:00
3b6cb6e117 *: entry linking and keyword filter
Setting up sibling and parent relationships for entries, so they can be
easier to walk.

Also, making "keyword=value" easier to parse. This helps filtering.

Both of these ready us for checking/validating a hierarchy.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-24 16:35:09 -04:00
ef9ba54f10 keywords: accurate nanoseconds for time=
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-24 16:35:09 -04:00
d1ddeb8e3d *: close to producing a validating hierarchy
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-24 16:35:09 -04:00
ecdf381dd9 keywords: add mode= (only octal first)
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-24 16:35:09 -04:00
211687bcc4 keywords: added experimental "xattr" keyword
Initially only on linux platform, but could accommodate BSDs as well.
The keyword is rather a prefix of the key. So xattr keyword will have a
prefix of "xattr." followed by a suffix of its namespace and name.
The value stored in the manifest is the SHA1 digest of the extended
attribute's data.

Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-24 16:35:09 -04:00
b3198b462b keywords: they deserve their own file
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
2016-03-24 16:35:09 -04:00