tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Increasing FreeBSD compatibility in mtree

On Tue, Dec 11, 2012 at 01:40:22PM -0600, Brooks Davis wrote:
> Thanks to Christos for merging the majority of my changes.

With these changes, there remain a few incompatibilities for which I'd like
some feedback on possible resolutions.

The -t option is the default on FreeBSD.  My initial approach was to add
a -T option to turn it off and make -t the default on FreeBSD.  The
advantage of this approach is that existing FreeBSD scripts wouldn't
break and portable code could use -T or -t as appropriate.  I didn't get
any feedback on this, but it wasn't committed so I'm not sure which
direction to go.  Other options are to just turn -t on all the time
without a way to disable it since this matches current FreeBSD behavior
or to go with the existing behavior which would be consistent, but
potentially confusing.  If I merge mtree to our stable branches I will
have to go with something that changes the default to avoid breaking
scripts there.

I'm considering make -c -i set jflag and print a warning.  The reason
for this is that -i only makes sense with -c on FreeBSD and it looks
like it's a no-op on NetBSD.  Does this make sense?  This might be best
as a FreeBSD specific bit of compatibility code.

I think I've convinced myself to just not implement -w unless I merge
mtree to stable in which case I think I'll just do it in the FreeBSD
tree and not mess with the NetBSD source.

The remaining known issues are in output format.  Since changing output
format is quite disruptive to users I'm leaning toward a -F option to
enable FreeBSD compatible output.  Would such an option be acceptable or
should I just use #ifdef __FreeBSD__ in our tree?  Obviously, if I merge
the code I'd have to make that the default.  The differences I know of

 - A "..\n\n" is printed for the top level directory.
 - size keywords are printed for all file types.
 - -d mode suppresses most empty lines and uses type=dir in /set statements.


Attachment: pgpZLIQxzySrq.pgp
Description: PGP signature

Home | Main Index | Thread Index | Old Index