is in accordance with the information provided at
ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
Also add $FreeBSD$ to a few files to keep svn happy.
Discussed with: imp, rwatson
- Sort function prototypes;
- Apply static on all function bodies. To quote bde@:
> It is a good obfuscation to declare functions as static only in the
> prototype, so that you can't see the static for the actual function.
> The reverse obfuscation (with static only in the function definition)
> would make more sense, but is a constraint error.
Reviewed by: bde
because of the absence of a destination directory or if the
"destination directory" is not a directory.
PR: bin/11826
Submitted by: Denis Eremenko <moonshade@pnhz.kz>
Approved by: grog@
X-MFC after: various freezes
for a lot of unrelated error conditions, at least report the line
number where it bailed.
Don't use multiline string literals for Usage, gcc 3.3 doesn't like them.
FreeBSD. This method attempts to centralize all the necessary hacks
or work arounds in one of two places in the tree (src/Makefile.inc1
and src/tools/build). We build a small compatibility library
(libbuild.a) as well as selectively installing necessary include
files. We then include this directory when building host binaries.
This removes all the past release compatibilty hacks from various
places in the tree. We still build on tip of stable and current. I
will work with those that want to support more, although I anticipate
it will just work.
Many thanks to ru@, obrien@ and jhb@ for providing valuable input at
various stage of implementation, as well as for working together to
positively effect a change for the better.
the deprecated utime(3). utimes(2) uses timeval, but utime(3) uses
time_t's. If you do bad things (like I did) by mixing up include files
with libc, then install can do strange things if you mismatch the time_t
stuff. utime() is emulated entirely within libc.
Approved by: re (jhb)
Add some constness to avoid some warnings.
Remove use register keyword.
Deal with missing/unneeded extern/prototypes.
Some minor type changes/casts to avoid warnings.
Reviewed by: md5
environment variable that specifies the name of the strip(1)
program to use. The envvar is "STRIPBIN". The more natural
choice would be "STRIP", but that one is taken already.
o New flags: -b and -B (backup)
o New flag: -S (safe copy; aka "atomic" install)
o The -c flag is now the default.
o The -D flag was withdrawn.
Reviewed by: bde (up to some point)
Obtained from: OpenBSD but heavily modified
MFC after: 1 month
interface, and statically link them to the programs using them.
These functions, upon reflection and discussion, are too generically
named for a library interface with such specific functionality.
Also the api that they use, whilst ok for private use, isn't good
enough for a libc function.
Additionally there were complications with the build/install-world
process. It depends heavily upon xinstall, which got broken by
the change in api, and caused bootstrap problems and general mayhem.
There is work in progress to address future problems that may be
caused by changes in install-chain tools, and better names for
{g|s}etflags can be derived when some future program requires them.
For now the code has been left in src/lib/libc/gen (it started off
in src/bin/ls).
It's important to provide library functions for manipulating file
flag strings if we ever want this interface to be adopted outside
of the source tree, but now isn't necessarily the right moment
with 4.0-release just around the corner.
Approved: jkh
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 ;)
execvp() in the child branch of a vfork(). Changed to use fork()
instead.
Some of these (mv, find, apply, xargs) might benefit greatly from
being rewritten to use vfork() properly.
PR: Loosely related to bin/8252
Approved by: jkh and bde
it if flags were explicitly specified on the command line. Do not warn
if we were merely trying to preserve flags or remove UF_NODUMP. NFS does
not support flags.
I'm not sure that this is ideal, but it should do for now. Installing
a plain file onto a NFS server must work, we used to silently ignore the
attempt. Doing a binary install looses the flags anyway since cpio
doens't preserve them with the cdrom/network images.
XXX make world should not use flags or chown/chgrp in the obj/tmp area.
This is based on a suggestion from Ken Merry <ken@plutotech.com>.
types. The NetBSD compatibility cruft was more correct for -current
than FreeBSD's own code. It just used NetBSD #defines instead of
string literals for the filesystem names. NetBSD's MOUNT_UFS is
"ffs", so using a literal "ufs" gives wrong results, but this is
unimportant, especially for bootstrapping.
Fixed style bugs in trymmap().
Fixed some disordered declarations.
handy at the moment with -current's mmap+unlink interactions.. The
problems seem worst when using INSTALL="install -C" in /etc/make.conf.
This could well come in handy in the future too.
2) When uid/gid not specified, not try to set 0:0 owner, just do nothing.
It makes possible to use install -d by users without setting
their uid:gid each time.
3) Be more specific where install_dir fails
reopen it after strip has finished. This makes it work when
/usr/bin/strip replaces the file rather than doing an in-place edit
(such as the binutils-2.8 strip, which is a variation of objcopy).
This is necessary if install(1) and strip(1) are going to cooperate
on an ELF system.
until the includes are installed, and it doesn't install the includes until
xinstall is built (the previous xinstall binary may not have -C). As a
bandaid, define MAP_FAILED ourselves if <sys/mman.h> didn't. Perhaps it
would be safer to simply disable mmap if all the prerequisites are not
there.
- Use MAP_FAILED instead of the constant -1 to indicate
failure (required by POSIX).
- Removed flag arguments of '0' (required by POSIX).
- Fixed code which expected an error return of 0.
- Fixed code which thought any address with the high bit set
was an error.
- Check for failure where no checks were present.
Discussed with: bde
This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.
Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.
- Change the debug flag from -d to -D to avoid conflict with other
install programs.
- Update man page to reflect this
- Update usage string
-d meaning creat directory is specifically not implemented by these changes.
copy.
Dont leave stray INS@xxxx temp files around, especially when installing
something less than 8MB and the destination runs out of space, etc.
It still doesn't clean up the temp files on SEGV or other signals etc.
installing. mmap'ing stuff over a nfs mount took out my machine during
a 'make world' last night while I was asleep. I started out with a list
of fs's to avoid, when I realised that I really didn't know which ones
were safe with mmap, so I went for the ones I knew and implemented a
fallback compare.
installs something. This is not 100% right, since it has a false hit
when install -C snaps hard links.
Also, run strip(1) from the $PATH, otherwise you need a special version
of install to install (say) elf binaries which have a different strip.
With JDP's elfkit, the layout of the path determines which binary format
you are generating.