Commit Graph

21 Commits

Author SHA1 Message Date
phk
42e3d092ba Make the output of mtree(8) more systematic and machine readable.
The new format is:

        filename        {changed,missing,extra}
                $field expected $foo found $bar
                ...

Fix various bugs along the way:
        Don't complain about directory sizes differing.
        Correctly check flags.
2000-10-03 13:13:47 +00:00
joe
8de98cc2fa Switch over to using the new fflagstostr and strtofflags library calls. 2000-06-17 14:19:33 +00:00
wollman
198f09c649 Give mtree the ability to exclude files and directories from its traversal.
PR:		16944
2000-05-12 03:03:00 +00:00
joe
f1a9497df5 Historically file flags (schg, uschg, etc) have been converted from
string to u_long and back using two functions, flags_to_string and
string_to_flags, which co-existed with 'ls'.  As time has progressed
more and more other tools have used these private functions to
manipulate the file flags.

Recently I moved these functions from /usr/src/bin/ls to libutil,
but after some discussion with bde it's been decided that they
really ought to go in libc.

There are two already existing libc functions for manipulating file
modes:  setmode and getmode.  In keeping with these flags_to_string
has been renamed getflags and string_to_flags to setflags.

The manual page could probably be improved upon ;)
2000-01-27 21:17:01 +00:00
joe
2d2f34a6b0 Added support for file flags, mostly merged from the NetBSD version.
The way is now open to schg and sappnd key files and directories in
our tree.  There are recommendations in bin/15229.

PR:		bin/15229
Reviewed by:	imp, brian
1999-12-09 20:38:36 +00:00
billf
f3e2a0e313 -Wall fixes.
Submitted by:	nrahlstr
1999-09-27 00:36:03 +00:00
peter
efabb9ccb1 $Id$ -> $FreeBSD$ 1999-08-28 01:35:59 +00:00
wollman
2c2e09fe90 Add support for SHA-1 and RIPEMD160, now that libmd includes them. Make
all of the hashes (including MD5) conditionalized in case we want
to turn one of them off later.
1999-02-26 18:44:56 +00:00
jkoshy
6d86b58d3a Move to a uniform '\ooo' (VIS_OCTAL) encoding for special characters.
The previous commit broke mtree(8) when file names using certain 8-bit
characters ended up being encoded with '/', '*', and other shell
metacharacters.

PR:			bin/9538
Submitted by:		"Eugene M. Kim" <astralblue@usa.net>
Reviewed by:		jkoshy
Bug-missed-last-time-by: jkoshy
1999-01-18 06:58:25 +00:00
jkoshy
c93a7d05cf Teach mtree(8) to handle whitespace in filenames. Uses strvis(3).
PR:		bin/3246
Submitted by:	Eugene M. Kim <astralblue@usa.net>
Reviewed by:	jkoshy, wollman
1999-01-12 02:58:23 +00:00
bde
aaeb261fcc Fixed printf format errors. 1998-08-02 14:41:34 +00:00
peter
00b7e773c5 Create a new flag, "nochange", which will specify that a directory is
to be created if it's missing, otherwise completely ignore it's modes and
owners.  Primary intended targets:  /usr/src and /usr/obj.

Adjust the 'not created: File exists' message to mention that it's a
directory that's the problem, otherwise it doesn't make sense.

I had created chown-style  -L and -P flag to control logical/physical mode
(ie: whether symlinks were followed), but the nochange flag is enough to
get the blasted thing out of my hair so I took them back out.
1998-06-05 14:43:42 +00:00
charnier
c8ef4a7a48 Use err(3) instead of local redefinition. 1997-10-01 06:30:02 +00:00
nate
c6c987075a ts_sec -> tv_sec
ts_nsec -> tv_nsec

Pointed out by:	bde
1996-09-20 04:13:44 +00:00
bde
7eb5058726 Report fts_errno' instead of errno' when the former applies. 1995-07-24 02:50:50 +00:00
phk
1b1b92f5a7 Fix to match new MD5 api, faster. 1995-07-12 09:15:15 +00:00
rgrimes
4f960dd75f Remove trailing whitespace. 1995-05-30 03:57:47 +00:00
wollman
f56d4ade79 mtree * MD5 = better security
Idea from: Dr. John T. Wroclawski
1995-02-10 03:12:42 +00:00
rgrimes
7be4a7b142 My optimization to eliminate /set records was a little too aggressive, it
optimized away the first one :-(.
1994-09-19 01:32:57 +00:00
rgrimes
b98c90be2e 1. Remove commented out CFLAGS+=-DDEBUG from Makefile
2.  Clean up code so it compiles -Wall (except for sccsid's and copyright).
    This included fixing several printf formats that where not correct,
    and changing the data types of a few things.

3.  Implement new option -i that produces indented mtree output files.

4.  Implement new option -n that turns off directory comments.

5.  Only emit /set records if something has changed since the last one.
1994-09-18 21:17:40 +00:00
rgrimes
862fdf11a2 BSD 4.4 Lite usr.sbin Sources 1994-05-26 05:23:31 +00:00