tech-userlevel archive

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

Re: Increasing FreeBSD compatibility in mtree

In article <>,
Brooks Davis  <> wrote:
>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.

I don't know what to do here either. I merged all the changes that did not
change the current behavior. I guess what we could do, is to merge all the
changes, #ifdef __FreeBSD__ the different behaviors and document them in
the man page. Yes, this is sub-optimal, but better than what we have now,
and we avoid breaking existing scripts.

Or if we feel brave, mention the bevavioral differences in the man page,
decide which behavior is the one to go with, and go for it. We can add
a single flag or environment variable to default to the old behavior.

- I think that -t should not be turned on all the time, since this matches
  -u, or is there something I am missing.
- I don't know about the "..\n\n"
- I think it makes sens to print size keywords for all the files; it makes
  parsing easier.
- I think that -d should suppress empty lines. I am ambivalent about
  type=dir in /set statements.

I am not an expert in mtree, so others please chime in.


Home | Main Index | Thread Index | Old Index