including new version of golang. Switch to go1.14 for linting.
and remove the build of `dep`. We're on go modules for vendoring now.
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
with the update to `golang.org/x/crypto`, the commit
c7dcf104e3
depends on a stdlib package introduced in go1.9
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
I have a use case where I'd like to know the files that are the same in the
tree, as well as the differences.
I could do this with a separate walk and excluding the paths that were
different, but since mtree is already doing all of this for me, it makes
sense to include it here. I've added a new function so that the behavior
stays the same for existing users of Compare(), since I assume mostly this
will be slower given that most files stay the same. I'd be happy to merge
it into one, though.
Signed-off-by: Tycho Andersen <tycho@tycho.ws>
The core issue comes about when you consider a trivial example of a path
like "./README". This path is lexically equivalent within mtree to
"README", but a simple string comparison will yield the wrong result.
Instead you need to lexically clean the path first (filepath.Clean isn't
enough here -- you need to prepend a "/" and then do filepath.Clean).
In gomtree we generate spec files in the same style of FreeBSD's
mtree(8), so you would be very hard-pressed to find an example of such
an inconsistency. However casync's mtree implementation does not
generate leading "./" for root paths which results in "missing" entries.
The implementation of CleanPath was written by me for umoci originally,
then later I copied it to runc for other uses, and now I've copied it
here. Since I'm the sole author I'm effectively dual-licensing it under
this project's license to avoid having to relicense go-mtree for no good
reason (or deal with the multiple-license hassle).
Signed-off-by: Aleksa Sarai <asarai@suse.de>
This allows people to create synthetic InodeDeltas, which is something
that umoci would like to be able to do in order to nicely create 'umoci
insert' layers.
Signed-off-by: Aleksa Sarai <asarai@suse.de>
Use UtimesNanoAt from golang.org/x/sys/unix instead of manually crafting
the syscall.
Since UtimesNanoAt is provided for all unix-like OSes, factor out
lchtimes to its own file with appropriate build tags. This allows to
make use of it on darwin, dragonfly, freebsd, openbsd, netbsd and
solaris in addition to linux.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>