You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current output of casync mtree is not really compliant with any implementation, and I've mostly opened this issue so I can get an answer on what kind of patch you'd like me to send to correct this. The short version of the problem is that the handling of directory nesting is currently incorrect (namely, casync mtree spits out the full path of every file it finds as a single node -- which means that FreeBSD's mtree will reject output from casync because mtree doesn't allow slashes in node names).
There are two solutions I can see:
Append a .. after each type=dir entry. This is the simplest solution, and it means that gomtree will now happily verify casync mtree's output -- so there is at least some compatibility with another implementation. However, this still runs afoul of the canonical FreeBSD mtree implementation -- which doesn't permit slashes in node names at all (you need to use the mtree hierarchy to represent directory paths).
Output a proper directory tree to match the format of FreeBSD's mtree (and the output format of gomtree). The downside of this is that it could be a pain to do in C, and unless it was done directory-by-directory you could end up with a lot of repeated nodes (wasting space). But if we wanted to be completely compatible with FreeBSD's mtree this is the only real option.
If you were to interpret the specification that both gomtree and mtree implement, you would have to treat the node zzz as though it were a child of b/c and thus rather than being treated as /zzz it would be treated as /b/c/zzz (which is wrong and results in validation errors).
I'm not suggesting that we make use of /set or /unset -- just that we need to handle nested paths properly.
The text was updated successfully, but these errors were encountered:
The current output of
casync mtree
is not really compliant with any implementation, and I've mostly opened this issue so I can get an answer on what kind of patch you'd like me to send to correct this. The short version of the problem is that the handling of directory nesting is currently incorrect (namely,casync mtree
spits out the full path of every file it finds as a single node -- which means that FreeBSD'smtree
will reject output fromcasync
because mtree doesn't allow slashes in node names).There are two solutions I can see:
Append a
..
after eachtype=dir
entry. This is the simplest solution, and it means thatgomtree
will now happily verifycasync mtree
's output -- so there is at least some compatibility with another implementation. However, this still runs afoul of the canonical FreeBSDmtree
implementation -- which doesn't permit slashes in node names at all (you need to use the mtree hierarchy to represent directory paths).Output a proper directory tree to match the format of FreeBSD's
mtree
(and the output format ofgomtree
). The downside of this is that it could be a pain to do in C, and unless it was done directory-by-directory you could end up with a lot of repeated nodes (wasting space). But if we wanted to be completely compatible with FreeBSD'smtree
this is the only real option.Here's a motivating example:
If you were to interpret the specification that both
gomtree
andmtree
implement, you would have to treat the nodezzz
as though it were a child ofb/c
and thus rather than being treated as/zzz
it would be treated as/b/c/zzz
(which is wrong and results in validation errors).I'm not suggesting that we make use of
/set
or/unset
-- just that we need to handle nested paths properly.The text was updated successfully, but these errors were encountered: