Commit Graph

108 Commits

Author SHA1 Message Date
thorpej 213cc4baf9 Don't do the madvise(2) call if __APPLE__. Even though madvise(2)
exists on Mac OS X, and we pass valid arguments, the call always
results in EINVAL, and the warning annoys me.
2003-03-13 18:23:02 +00:00
wiz 990562bfef .Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.
2003-02-25 10:34:36 +00:00
wiz 0065eb62cf Add a missing word. 2002-12-23 12:49:38 +00:00
lukem 08fab22988 DTRT with -D destdir when the target == destdir 2002-12-23 06:24:15 +00:00
lukem f766ef620d Implement '-D destdir'; if '-M metalog' is being used, remove a
leading `destdir' from the file name logged to the metalog.
The -D option has no effect on where the actual files are installed.
2002-12-22 10:15:17 +00:00
wiz 57f65f0dda Drop trailing whitespace. 2002-12-19 09:17:01 +00:00
lukem c7c281222a Add '-N dbdir', to specify that user & group lookups are to be done from
dbdir/master.passwd and dbdir/group, using simple text file parsing
routines from ../../usr.sbin/mtree/getid.c.
2002-12-19 08:30:39 +00:00
grant be8ae688ae New sentence, new line. 2002-09-30 11:08:56 +00:00
lukem 5d4973fe97 makefile delint. use NETBSDSRCDIR as appropriate 2002-09-18 14:00:33 +00:00
lukem 9d35c8059d Convert from flock() to the more portable fcntl().
As discussed with Mason Loring Bliss <mason@netbsd.org>
2002-06-09 04:16:39 +00:00
yamt 9ef78f3840 make an auto const variable static. 2002-06-08 15:02:27 +00:00
lukem d656686b8f doh. don't try and update from_sb and tv if dolink is set 2002-04-10 06:12:04 +00:00
lukem c1961c25e2 always stat into &from_sb and setup tv[]; stops weird problem noticed
by Simon Burge when installing from /dev/null resulted in weird dates.
2002-04-10 06:02:52 +00:00
lukem 3d000fd59c - Add "-a afterinstallcommand", which runs "sh -c afterinstallcmd target"
after target has been installed and possibly stripped with -s, but
  before ownership, permissions or timestamps are set, and before
  renaming (with -r) occurs.  Per discussion with simonb.
- When metalogging hardlinks, log the mode of the existing target
  (rather than the default 0755), and ignore owner/group/fflags.
- Improve man page description of various options to include argument name.
- Clean up usage() to use getprogname(), etc.
2002-03-19 14:17:04 +00:00
lukem 0d4517aa6c When metalogging a hard link, don't log it as "type=hlink".
Instead, stat the type, and only log an entry if it's a "type=file".
We could log hard links to symlinks, but they're not portable and
their use has been deprecated in our source tree.
Hard links to other types aren't as useful at this stage; if the need
arises we can change this to log the appropriate information then.
2002-02-28 00:22:51 +00:00
ross 2a76afae02 Generate <>& symbolically. I'm avoiding .../dist/... directories for now. 2002-02-08 01:36:18 +00:00
tv 9fbd88883c Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
  sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
2002-01-31 22:43:33 +00:00
tv b212f6ddf9 Identify where errors come from, rather than just doing err[x]("%s", foo). 2002-01-28 19:44:03 +00:00
tv 8f2707ae00 Add non-NetBSD host hooks. 2002-01-21 20:00:02 +00:00
msaitoh 4a4b629051 ADD MISSING SLASH.
Broken insall had been made a temporary file at the parent directory
(may cause Cross-device link(EXDEV)).
2001-12-10 08:54:38 +00:00
wiz 305734fe40 Punctuation nit. 2001-12-08 19:27:33 +00:00
wiz aded0d2cce Whitespace cleanup. 2001-12-01 16:43:07 +00:00
perry 37799562b4 fix an accidental use of dirname instead of xdirname 2001-11-24 21:58:42 +00:00
perry a772ed1f5f add comments noting the mktemp usage is safe.
long run I think we have to abandon using the linker for warnings and
beef up lint instead.
2001-11-23 18:14:51 +00:00
simonb 6c70c79401 Overhaul link creation - splitting out hard and symbolic link handling
to separate functions and handling -r (renaming) correctly for both
cases.
Also fix most lint(1) warnings.
2001-11-23 16:14:51 +00:00
dillo d1be3cca41 Make metadata logging of set-id bits work for unprived installs.
These bits were cleared from mode before a call to fchmod and later
that changed value was logged.
2001-11-22 23:27:38 +00:00
perry 75824c636a simplify metadata logging, and add metadata logging for hard links. 2001-11-19 02:51:00 +00:00
tv aff1bdffff Actually do a chmod if -U, but only try chmod'ing the lower 0777 bits.
This is needed to make things executable, where appropriate.
2001-11-12 19:08:31 +00:00
lukem 01381cc6c0 change metadata_log() to support logging symlink info as well
(including target name).  pointed out by perry.
2001-10-29 02:57:21 +00:00
perry 0f1e6ffaee Do not attempt to stat the source if we are dealing with a link. We
aren't going to do anything with the information anyway and there is
error checking later anyway.
We can now succeed in creating symlinks to locations that don't exist,
just as ln -s will let us do, and we can use install instead of ln -s
in several Makefiles. The code was written with the obvious intent to
let you do this but apparently it was never tested.
2001-10-29 00:25:44 +00:00
perry 1ceecb558f 1) Remove a comment that bore no resemblance to reality. It was worse
than having no comment at all by far.
2) fix an instance in which we checked if "from" wasn't a regular file
   and then bitched about "to".
2001-10-28 23:43:19 +00:00
lukem 99b386d4f8 Add '-T tags', to specify mtree(8) tags to be written out to the '-M metalog'
for the current entry.  Concept suggested by Perry Metzger.
2001-10-25 15:37:06 +00:00
lukem be0d379732 minor knf 2001-10-25 15:06:12 +00:00
tv 88917ec7e1 If unprivileged, we may be running on a system that doesn't have the proper
/etc/passwd and /etc/group (as well as concept of file flags) as the target.

Rather than look up users, groups, or flags with -U, do what the manpage
indicates:  don't even try changing them.  If -M is specified, use the
strings that are passed in via options with "gname", "uname", and "flags"
in the resultant mtree file, rather than retranslating them back from numbers.
2001-10-19 14:26:19 +00:00
lukem c3e7e8005a oops, got chflags() error checking around the wrong way 2001-10-11 04:27:30 +00:00
lukem c32ec6cb78 - Implement "-M log", which appends the metadata associated with the
installed file or directory to `log'. This is primarily designed
  to be used in conjunction with -U, but that's not mandatory.
  Provide metadata_log() to do the hard work. The log file is opened
  for append at the start, and flock(LOCK_EX) is used to prevent
  interleaved output (from multiple concurrent install(8) operations).
- Improve parsing of owner and groups (e.g., strtoul() instead of atoi()),
  and don't rely upon uid==-1 to indicate "no owner"; use a flag instead.
- Make fileflags a global variable; uid, gid, and mode are, so lets be
  consistent...
- Improve -U (unpriv); work on file flags as well, and only try to change
  the file flags after the temporary file is renamed (since certain flags
  will prevent the rename from working).
2001-10-11 02:06:32 +00:00
simonb 1730261818 Throw out home-grown strdup().
Error check malloc/strdup return values.
2001-09-15 16:45:23 +00:00
simonb 0b2413bddc ANSIfy. 2001-09-15 14:55:38 +00:00
wiz 251b3464be heirarchy -> hierarchy 2001-08-24 10:24:45 +00:00
tv dba5d44670 Add hooks to allow toolchain bits to be reachover-built at the top level. 2001-08-14 10:18:26 +00:00
kleink 361f8ca975 Add the -r flag to usage output. 2001-06-15 08:25:11 +00:00
kleink d2fd431b8f The -r flag is applicable to the file1 -> file2 case, too. 2001-06-15 08:24:17 +00:00
chs 1055c758b8 fall back to read() if mmap() returns an error. 2001-05-28 03:37:22 +00:00
cgd ab2465366a slight portability improvement: use madvise(... MADV_SEQUENTIAL ...)
iff MADV_SEQUENTIAL is actually defined.
2001-03-21 23:16:33 +00:00
cgd 040de26f85 call setprogname(argv[0]) at start of main() 2001-02-21 00:06:22 +00:00
jlam d6ced75307 Change
"program used to trip installed binaries"
to
	"program used to strip installed binaries"
2000-12-27 18:56:21 +00:00
enami e92c3f2867 - The type of return value of setmode is a void * and getmode takes it,
rather than mode_t *.
- Free the storage allocated by setmode unless it is obvious that program
  exits immediately.
2000-10-10 14:30:40 +00:00
kleink 4918722a89 For commands and utilities, use EXIT STATUS rather than RETURN VALUES or
DIAGNOSTICS as appropriate (and documented in mdoc(7)).
2000-09-04 07:35:15 +00:00
hubertf d374d97e3c Allow overriding _PATH_STRIP 2000-09-04 02:45:33 +00:00
cgd 08f606dddb If unprivileged, don't even look up user or group name. (always set uid and
gid to -1.)  Don't bother checking 'unpriv' when it's redundant with the
uid/gid == -1 check.  (Doing the uid/gid handling consistently also fixes
the directory-creation code, which didn't check unpriv and did chmod/chown
anyway.)  One minor spaces/tabs cleanup at one of the uid/gid checks.
2000-07-27 03:57:50 +00:00