Home | History | Annotate | Download | only in xinstall
History log of /src/usr.bin/xinstall/xinstall.c
RevisionDateAuthorComments
 1.130  20-Jan-2025  kre Replace space in METALOG output dropped in previous change.

Should unbreak -U builds.
 1.129  20-Jan-2025  christos From FreeBSD via Ed Maste:

install's -o and -g flags both accept a name or a numeric argument.
In -U -M (non-root METALOG) mode it always emitted uname= and gname= in
the METALOG, but these are not appropriate for numeric IDs.

If the -o and/or -u arguments parse as an ID, emit uid= and/or gid=
respectively.

Note that if an argument is valid as both a name and numeric ID we will
prefer the name in normal (non -U -M) mode and the ID in -U -M mode. We
don't want to require a passwd db in non-root mode, and entirely-numeric
user or group names are a terrible idea so just accept this discrepancy.

PR: 284119
 1.128  10-May-2024  wiz branches: 1.128.2;
nstall(1): add support for -v

Reviewed by rillig@ and thorpej@, thanks!
 1.127  20-Jul-2023  lukem tools: binstall can use posix_spawn() instead of vfork()
 1.126  30-Oct-2020  rillig install(1): copy metachar table from usr.bin/make

It is not worth having a dependency on usr.bin/make just for including
this small table. The header file usr.bin/make/make.h, which is
included for consistency with the rest of the usr.bin/make code, is
using inline functions a lot and refers to several parts of make that
are completely irrelevant to usr.bin/install.
 1.125  31-May-2016  pgoyette Move __MKTEMP_OK up earlier so it has an actual impact. Reduces the
number of warnings during build.

XXX There are still some other warnings remaining to be resolved.

Fixes PR bin/48195 although we really should go back someday and fix
this correctly (by replacing all uses of mktemp(3)!)
 1.124  19-Jun-2015  christos remove unused label
 1.123  19-Jun-2015  christos remove useless assignment and explain why.
 1.122  19-Jun-2015  christos restore use of whitespace needing shell.
 1.121  17-Jun-2015  christos restore unlink file if strip fails (from Takeshi Nakayama)
 1.120  17-Jun-2015  christos Use the bourne shell if the after command has shell metachars.
 1.119  15-Jun-2015  christos - improve error printing
- deduplicate run functions and don't use the shell so that we handle
filenames with spaces and metacharacters consistently.
 1.118  15-Jun-2015  martin Add optional support for posix_spawn (instead of vfork) and enable it for
the in-tree build.
 1.117  06-Jul-2014  apb mtree spec files want nanoseconds, so multiply the microseconds by 1000.
 1.116  06-Jul-2014  apb When printing a timestamp to a metalog, use 9 digits
for the nanoseconds part, except use only 1 digit if
the value was zero.
 1.115  06-Sep-2011  joerg branches: 1.115.8; 1.115.18;
Use static and __dead.
 1.114  12-Nov-2009  tron Don't assume that "id_t", "gid_t" and "uid_t" use the same underlying type
and use the appropriate types instead. Tested under NetBSD 5.99.22
and Darwin 10.2.0.

This should fix one of the cross-builds under FreeBSD as reported by
Rhialto on the "current-users" mailing list.
 1.113  30-Oct-2009  joerg Only trust STRIP from environment if it is non-empty. Some packages set
STRIP in Makefiles and that makes install -s fail badly. OK apb@
 1.112  25-Jul-2009  gson When installing via a temporary file, base the name of the temporary
file on the name of the target file, not just the target directory, to
ensure uniqueness when multiple concurrent invocations of install(1)
simultaneously install files in the same directory. Fixes bin/41512.
 1.111  08-Jun-2009  yamt tabify and wrap long lines.
 1.110  08-Jun-2009  gson Fix race condition causing "install -d" to randomly fail when multiple
concurrent install processes try to create the same directory.
Modelled after the code handling the "mkdir -p" case in mkdir(1).
 1.109  01-May-2009  apb Add support for writing sha256, sha384, and sha512 digests to
a metalog. mtree(8) has supported these for a long time.
 1.108  17-Apr-2009  apb Re-calculate size and digestresult after stripping, to ensure that
correct values appear in the metalog.
 1.107  14-Apr-2009  lukem Fix -Wshadow -Wcast-qual issues
 1.106  07-Apr-2009  apb Changes for installing with a metalog:
* When installing hard links and using a metalog, if -o, -g, -m, or -f
args were explicitly specified on the command line, then believe them,
but do not implicitly believe uname/gname/mode/flags from the file
system.
* Add a size= field (only for plain files).
* Output fields in the same order used by mtree.
 1.105  28-Dec-2008  christos branches: 1.105.2;
back out previous, and do it the better way.
 1.104  28-Dec-2008  christos In the "tool" case, pretend we don't have futimes because there is no visible
prototype for futimes without _NETBSD_SOURCE being defined. When we will do
a __RENAME() in futimes this will not work. XXX: This is a hack, better ideas
welcome.
 1.103  21-Jul-2008  lukem branches: 1.103.4; 1.103.6;
Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.102  28-Jun-2007  joerg branches: 1.102.12;
- When compiling nbinstall for the tool chain, use the target strip
and not /usr/bin/strip. This makes nbinstall usable for
cross-compiling in pkgsrc.
- Fix a typo in a comment.
- Fix strip() in the context of (v)fork:
- Build the argument string first using asprintf (simpler) and
avoid leaking memory from the child in the parent.
- Don't use warn in the child, as stdio should be avoided.

OK christos@, tested on Solaris by dmcmahill@.
 1.101  14-Dec-2006  he Complete the move of string_to_flags() and flags_to_string() from the
bin/ls sources to libutil:
o Bump libutil minor version number
o Fix uses to include <util.h> to pick up the function definitions
o Fix most uses of flags_to_string() to release the now-malloc()ed result
 1.100  30-Oct-2006  christos branches: 1.100.2; 1.100.4;
kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
 1.99  06-Oct-2006  rillig When trying to copy many files into another file, provide a useful and
more specific error message instead of the usage().
 1.98  25-Sep-2006  daniel PR/30698: install(1) stripping flags in METALOG [patch] (Jukka Salmi)

Apply patch, thanks!
 1.97  25-Sep-2006  daniel PR/32589: install -d ignores existing non-directories (joerg@netbsd.org)

Raise an error if an argument to 'install -d' exists as a non-directory,
as suggested by joerg@ (and acked by some developers on #netbsd-code).
With this change behavior is equal in this respect to FreeBSD and
DragonFly.
 1.96  11-Sep-2006  dbj fixes for installing into a case insensitive $DESTDIR
when files may have hard links to a a name that only differs by case
- change install to unconditionally remove its temporary file
when installing hard links with -r. This avoids problems when
built with posix rename(2) semantics and reinstalling an existing
hard link.
- rework hard link targets in bsd.man.mk and bsd.links.mk
to use makefile constructs instead of shell constructs
- always reinstall hard links that may have case conflicts, even
when MKUPDATE=yes, this ensures that they get added to METALOG
- remove man pages which were hard linked to themselves in libform
- remove improper hard link command for existing man page in libkrb5
- fix libl's makefile to include bsd.lib.mk at end
- remove shell quoting in link target for test's [.1 man page
 1.95  11-May-2006  mrg char -> u_char for a buffer passed to MD5*().
 1.94  21-Apr-2006  christos Coverity CID 95: Fix resource leak.
 1.93  01-Oct-2005  christos fix setmode error handling.
 1.92  25-Sep-2005  elad Use crypto/rmd160.h.
 1.91  11-Jun-2005  christos mktemp() uses are ok here, so no more warnings.
 1.90  10-May-2005  lukem When creating a relative symlink (-lr), use the originally provided `to_name'
to create and metalog, rather than using the realpath(3) modified version.
Fixes a problem with -lr when -ddestdir contains a symlink.

Add some XXX comments reminding us that the `from_name' in a symlink may
point outside of destdir in the metalog, even though our build process
doesn't trigger this.
 1.89  08-May-2005  lukem strvis(3) encode the link=... argument in the metalog.
(mtree(8) already requires this.)
 1.88  08-May-2005  lukem metadata_log(): remove leading -D destdir before strsvis(3) encoding
the path, not after.
 1.87  20-Jun-2004  jmc branches: 1.87.2;
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.86  02-Feb-2004  lukem branches: 1.86.2;
Fix bug when calculating digest when copying from dev/null.
Problem noted by Matthias Scheler and Tomasz Luchowski.
 1.85  30-Jan-2004  lukem Auso support -h hash for hard-linked files.
 1.84  29-Jan-2004  lukem Implement -h {none,md5,rmd160,sha1} to determine the appropriate hash
(digest) when copying a file to store in the -M METALOG.
 1.83  29-Dec-2003  simonb Make "copy the file" (the -c option) the default behaviour. The -c option
is kept for backwards compatibility but now has no effect.

Patch from Bruce Nourish in PR bin/23874, with some minor changes by me.
 1.82  16-Dec-2003  heas Initialize uid and gid so that the owner/group is not inadvertantly changed
when only one of -g or -o are given by the super-user and -g works for others.
 1.81  21-Nov-2003  christos munmap() so that we don't accumulate memory on multiple files.
 1.80  27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.79  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22365, verified by myself.
 1.78  12-Jul-2003  itojun strlcat
 1.77  13-Mar-2003  thorpej 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.
 1.76  23-Dec-2002  lukem DTRT with -D destdir when the target == destdir
 1.75  22-Dec-2002  lukem 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.
 1.74  19-Dec-2002  lukem 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.
 1.73  09-Jun-2002  lukem Convert from flock() to the more portable fcntl().
As discussed with Mason Loring Bliss <mason@netbsd.org>
 1.72  08-Jun-2002  yamt make an auto const variable static.
 1.71  10-Apr-2002  lukem branches: 1.71.2;
doh. don't try and update from_sb and tv if dolink is set
 1.70  10-Apr-2002  lukem always stat into &from_sb and setup tv[]; stops weird problem noticed
by Simon Burge when installing from /dev/null resulted in weird dates.
 1.69  19-Mar-2002  lukem - 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.
 1.68  28-Feb-2002  lukem 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.
 1.67  31-Jan-2002  tv 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.
 1.66  28-Jan-2002  tv Identify where errors come from, rather than just doing err[x]("%s", foo).
 1.65  21-Jan-2002  tv Add non-NetBSD host hooks.
 1.64  10-Dec-2001  msaitoh ADD MISSING SLASH.
Broken insall had been made a temporary file at the parent directory
(may cause Cross-device link(EXDEV)).
 1.63  24-Nov-2001  perry fix an accidental use of dirname instead of xdirname
 1.62  23-Nov-2001  perry 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.
 1.61  23-Nov-2001  simonb 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.
 1.60  22-Nov-2001  dillo 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.
 1.59  19-Nov-2001  perry simplify metadata logging, and add metadata logging for hard links.
 1.58  12-Nov-2001  tv Actually do a chmod if -U, but only try chmod'ing the lower 0777 bits.
This is needed to make things executable, where appropriate.
 1.57  29-Oct-2001  lukem change metadata_log() to support logging symlink info as well
(including target name). pointed out by perry.
 1.56  29-Oct-2001  perry 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.
 1.55  28-Oct-2001  perry 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".
 1.54  25-Oct-2001  lukem 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.
 1.53  25-Oct-2001  lukem minor knf
 1.52  19-Oct-2001  tv 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.
 1.51  11-Oct-2001  lukem oops, got chflags() error checking around the wrong way
 1.50  11-Oct-2001  lukem - 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).
 1.49  15-Sep-2001  simonb Throw out home-grown strdup().
Error check malloc/strdup return values.
 1.48  15-Sep-2001  simonb ANSIfy.
 1.47  24-Aug-2001  wiz heirarchy -> hierarchy
 1.46  15-Jun-2001  kleink Add the -r flag to usage output.
 1.45  28-May-2001  chs fall back to read() if mmap() returns an error.
 1.44  21-Mar-2001  cgd slight portability improvement: use madvise(... MADV_SEQUENTIAL ...)
iff MADV_SEQUENTIAL is actually defined.
 1.43  21-Feb-2001  cgd call setprogname(argv[0]) at start of main()
 1.42  10-Oct-2000  enami - 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.
 1.41  27-Jul-2000  cgd 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.
 1.40  27-Jul-2000  cgd invoke stripprog using execlp. (this mirrors the behaviour that would
be had from using the shell to invoke strip, and removes an unnecessary
limitation that the STRIP environment variable be an absolute path.)
 1.39  15-Jan-2000  christos don't bitch if madvise returns EOPNOTSUPP
 1.38  01-Aug-1999  sommerfeld Add `-U' flag (for "unprivileged"). Currently just skips the
chown/chgrp stages which would otherwise blow out if not running as
root. A future version may log the owner/group to allow correction by
a later privileged cleanup pass.

Just warn about madvise failure; it's not something to blow up about.

Document new option, and clean up option grouping for -d (install
directory) option.
 1.37  06-Jul-1999  christos pacify gcc-2.8 uninitialized variable warnings, and only use timespecs in
struct stat on BSD4_4 systems.
 1.36  26-Jun-1999  thorpej If we choose the mmap() method of copying the file, advise the VM
system that we'll be doing sequential access of the file.
 1.35  29-Mar-1999  hubertf Check if given suffix really generates different suffixes - catch e.g. ".%"
Submitted in PR 7278 by NAKAJIMA Yoshihiro <nakayosh@kcn.ne.jp>
 1.34  24-Mar-1999  christos Don't unlink the file first if we are renaming. We want to be as atomic as
possible, and this not only introduces time where the file is not valid,
but also breaks in the ld.so install where strip does not find ld.so, since
it has not been renamed yet.
 1.33  04-Feb-1999  christos PR/2936: Brian C. Grayson: Avoid truncating precious files when installing
and the filesystem is full. Added -r flag to install, which installs on
a temporary file and then renames to the final destination.
 1.32  26-Jan-1999  hubertf enable numbered backups via -B.old%02d
 1.31  25-Jan-1999  hubertf Add a -b(ackup) flag to move any existing file(s) aside by renaming
them to file.old instead of simply deleting them. A different backup
suffix may be chosen with the -B option's argument.
 1.30  20-Dec-1998  christos char -> unsigned char
 1.29  10-Oct-1998  mrg create a "stat_flags.h" to go with stat_flags.c
 1.28  08-Oct-1998  wsanchez Add new option -S, which is like -s, but takes a string of options to pass to strip,
rather than "-s". For example:
install -S "-i -s symbolfile" foo /usr/bin/foo
Invokes:
/bin/sh -c "strip -i -s /usr/bin/foo"
This is needed, because we need different strip options for dynamic libraries and
Mach-O bundles than for executables; our strip supports more directed stripping.
/bin/sh is used in this case, to parse the arguments.

Don't bother mmap()ing files of zero length. Was a workaround for a bug in our mmap(),
which didn't get along with such files, but makes sense anyway.
 1.27  01-Oct-1998  erh Add -p flag to usage().
 1.26  28-Sep-1998  christos add -p flag, similar to cp(1)
 1.25  20-Feb-1998  mycroft Fill in missing (default) mmap(2) flags.
 1.24  01-Dec-1997  chuck use MAP_PRIVATE for mmap flags, not the non-standard MAP_FILE (aka 0)
 1.23  30-Nov-1997  tv accept -c silently with -d; fixes GNU autoconf (among others) that assume
you can use -c with -d
...but this is NOT a reason for those of you making install procedures
to think this behaviour is `correct'... <grin>
 1.22  27-Oct-1997  thorpej In strip():
- Use the saved errno to print the error message if the vfork() fails.
- In the child, if the execl() fails, use warn()/_exit(), not err(),
as the latter is not safe in the presence of a Real vfork().
 1.21  20-Oct-1997  lukem branches: 1.21.2;
getopt returns -1 not EOF, fix .Nm
 1.20  19-Oct-1997  mrg WARNSify; deprecate register; clean up .Nm
 1.19  19-Apr-1997  mikel use proper pathname when unable to exec strip
 1.18  17-Apr-1997  thorpej Allow the environment variable $STRIP to override _PATH_STRIP for
`-s', helping out cross-compiling.
 1.17  16-Mar-1997  christos Fix pasto in error message.
 1.16  16-Mar-1997  christos Add support for installing hard and symbolic links via the [-l harms] flag.
 1.15  12-Mar-1997  mycroft Remove kluge for GCC bug on m68k.
 1.14  10-Mar-1997  thorpej Use a slightly more sane way to cheat around XXX_BROKEN_GCC on the m68k.
The old way was more complex than necessary, and buggy, as pointed out
by Bruce Albrecht <bruce@zuhause.mn.org> in PR #3309.
 1.13  10-Mar-1997  fvdl warnx --> warn, warnx wasn't needed anymore after previous change
(pointed out by enami tsugutomo)
 1.12  06-Mar-1997  fvdl Correct error in previous.
 1.11  05-Mar-1997  fvdl Don't bail out when chflags() fails with EOPNOTSUPP. Fixes PR #3288
 1.10  09-Dec-1996  thorpej XXX Kludge to make this compile with large MAXBSIZE until the
XXX GCC bug it tickles is fixed.
 1.9  20-Dec-1995  jonathan Change xinstall to work with strip from GNU binutils, for mips and alpha ports.

When using a strip that uses a temp file and moves that to the target,
unlinking the original, install would set the modes of the
original (now unlinked) file, not the new stripped one.
Fixed by re-opening the fd used for fchown/chmod after stripping.
 1.8  10-Aug-1995  ghudson Accept numeric uid or gid for -o and -g flags, for consistency with
chown and chgrp.
 1.7  20-Dec-1994  jtc added prototype for install_dir()
 1.6  18-Dec-1994  jtc added exit(1) to usage()
 1.5  14-Nov-1994  jtc Merged with 4.4lite.
Changed to conform to NetBSD's new RCS Id convention.
Changed to use err(),errx(),warn(),warnx().
 1.4  02-Oct-1994  cgd be a bit more careful abotu what we can stat()/mkdir()
 1.3  01-Aug-1993  mycroft Add RCS identifiers.
 1.2  11-Jun-1993  jtc Added -d option to install
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  12-Nov-1994  jtc imported from 4.4lite
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.21.2.1  27-Oct-1997  thorpej Pull up from trunk:

In strip():
- Use the saved errno to print the error message if the vfork() fails.
- In the child, if the execl() fails, use warn()/_exit(), not err(),
as the latter is not safe in the presence of a Real vfork().
 1.71.2.1  23-Jul-2004  tron Apply patch (request by dbj in ticket 1723):
Fix building the netbsd-1-6 branch under Darwin/MacOS.
 1.86.2.1  22-Jun-2004  tron Pull up revision 1.87 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.87.2.3  11-May-2005  tron Pull up revision 1.90 (requested by lukem in ticket #287):
When creating a relative symlink (-lr), use the originally provided `to_name'
to create and metalog, rather than using the realpath(3) modified version.
Fixes a problem with -lr when -ddestdir contains a symlink.
Add some XXX comments reminding us that the `from_name' in a symlink may
point outside of destdir in the metalog, even though our build process
doesn't trigger this.
 1.87.2.2  10-May-2005  tron Pull up revision 1.89 (requested by lukem in ticket #271):
strvis(3) encode the link=... argument in the metalog.
(mtree(8) already requires this.)
 1.87.2.1  10-May-2005  tron Pull up revision 1.88 (requested by lukem in ticket #270):
metadata_log(): remove leading -D destdir before strsvis(3) encoding
the path, not after.
 1.100.4.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.100.2.1  23-Aug-2007  liamjfoy Pull up following revision(s) (requested by joerg in ticket #823):
usr.bin/xinstall/xinstall.c: revision 1.102
tools/binstall/Makefile: revision 1.6
tools/binstall/Makefile: revision 1.7
share/mk/bsd.own.mk: revision 1.496
- When compiling nbinstall for the tool chain, use the target strip
and not /usr/bin/strip. This makes nbinstall usable for
cross-compiling in pkgsrc.
- Fix a typo in a comment.
- Fix strip() in the context of (v)fork:
- Build the argument string first using asprintf (simpler) and
avoid leaking memory from the child in the parent.
- Don't use warn in the child, as stdio should be avoided.
OK christos@, tested on Solaris by dmcmahill@.
Rename nbinstall to ${MACHINE_GNU_PLATFORM}-install as it calls the
target strip. Don't pass down strip as it is not needed any longer.
 1.102.12.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.103.6.1  06-Jun-2009  bouyer branches: 1.103.6.1.2;
Pull up following revision(s) (requested by snj in ticket #790):
share/mk/bsd.lib.mk: revision 1.298
share/mk/bsd.man.mk: revision 1.100
share/mk/bsd.hostprog.mk: revision 1.55
distrib/sets/maketars: revision 1.66
share/zoneinfo/Makefile: revision 1.43
share/mk/bsd.kmodule.mk: revision 1.19
usr.bin/xinstall/xinstall.c: revisions 1.106 - 1.108 via patch
share/mk/bsd.prog.mk: revision 1.241
share/dict/Makefile: revision 1.17
share/mk/bsd.README: revision 1.249
distrib/common/parselist.awk: revision 1.16
share/mk/bsd.links.mk: revision 1.34
Explicitly sort entries on preparing set files from METALOG.
METALOG could have different order due to install(1) race
on parallel builds, and mtree(8) doesn't sort files.
Should fix inconsistent shared sets among builds as seen in
/pub/NetBSD-daily/netbsd-5/200904010000Z/shared/ and
/pub/NetBSD-daily/netbsd-5/200904010002Z/shared/ dirs.
Okay'ed by snj@.
Changes for installing with a metalog:
* When installing hard links and using a metalog, if -o, -g, -m, or -f
args were explicitly specified on the command line, then believe them,
but do not implicitly believe uname/gname/mode/flags from the file
system.
* Output fields in the same order used by mtree.
Fix -Wshadow -Wcast-qual issues
Re-calculate size and digestresult after stripping, to ensure that
correct values appear in the metalog.
Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.
Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.
Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.
 1.103.6.1.2.1  21-Apr-2010  matt sync to netbsd-5
 1.103.4.1  06-Jun-2009  bouyer Pull up following revision(s) (requested by snj in ticket #790):
share/mk/bsd.lib.mk: revision 1.298
share/mk/bsd.man.mk: revision 1.100
share/mk/bsd.hostprog.mk: revision 1.55
distrib/sets/maketars: revision 1.66
share/zoneinfo/Makefile: revision 1.43
share/mk/bsd.kmodule.mk: revision 1.19
usr.bin/xinstall/xinstall.c: revisions 1.106 - 1.108 via patch
share/mk/bsd.prog.mk: revision 1.241
share/dict/Makefile: revision 1.17
share/mk/bsd.README: revision 1.249
distrib/common/parselist.awk: revision 1.16
share/mk/bsd.links.mk: revision 1.34
Explicitly sort entries on preparing set files from METALOG.
METALOG could have different order due to install(1) race
on parallel builds, and mtree(8) doesn't sort files.
Should fix inconsistent shared sets among builds as seen in
/pub/NetBSD-daily/netbsd-5/200904010000Z/shared/ and
/pub/NetBSD-daily/netbsd-5/200904010002Z/shared/ dirs.
Okay'ed by snj@.
Changes for installing with a metalog:
* When installing hard links and using a metalog, if -o, -g, -m, or -f
args were explicitly specified on the command line, then believe them,
but do not implicitly believe uname/gname/mode/flags from the file
system.
* Output fields in the same order used by mtree.
Fix -Wshadow -Wcast-qual issues
Re-calculate size and digestresult after stripping, to ensure that
correct values appear in the metalog.
Add LINKSOWN, LINKSGRP, and LINKSMODE variables for use by bsd.links.mk
when installing hard links. They have no effect except when using a
metalog, in which case the information is added to the metalog. In
the future, these variables may be replaced by a method for explicitly
recording hard links in a metadata log.
Also change a few things that called ${INSTALL_LINK} without going
through bsd.links.mk.
Reviewed by perry and joerg. This should fix PR 24457 and PR 41155.
 1.105.2.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.115.18.1  10-Aug-2014  tls Rebase.
 1.115.8.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.128.2.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed