Commit Graph

156 Commits

Author SHA1 Message Date
wiz 1ac719d147 Remove unnecessary Bk/Ek pairs from SYNOPSIS.
No effective change except where I used the opportunity to sort options
and/or option descriptions.
2012-04-08 22:00:37 +00:00
wiz 3957bea1ef Fix whitespace nits. Suggested by Bug Hunting. 2012-03-22 07:58:16 +00:00
joerg 7d5aba78d7 Use static and __dead. 2011-09-06 18:50:32 +00:00
christos 82c2d298ee document non-literal format strings 2011-08-17 14:00:30 +00:00
joerg 3d90cef610 Reorder sections to canonical order. Use .Ex -std. 2010-05-14 17:03:19 +00:00
tron 87a288ba6f 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.
2009-11-12 10:10:49 +00:00
joerg 17c3d35d69 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@
2009-10-30 20:57:30 +00:00
gson 5861f6c435 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.
2009-07-25 11:45:58 +00:00
yamt 6539ec6cea tabify and wrap long lines. 2009-06-08 21:58:44 +00:00
gson 57a8678315 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).
2009-06-08 14:22:01 +00:00
wiz 52d9a489d1 Bump date for previous. 2009-05-01 21:38:19 +00:00
apb be7721cd8f Add support for writing sha256, sha384, and sha512 digests to
a metalog.  mtree(8) has supported these for a long time.
2009-05-01 20:16:23 +00:00
apb 7097476cb5 Re-calculate size and digestresult after stripping, to ensure that
correct values appear in the metalog.
2009-04-17 06:09:08 +00:00
lukem 240747d69a Fix -Wshadow -Wcast-qual issues 2009-04-14 08:54:59 +00:00
apb 534e2679af 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.
2009-04-07 22:07:54 +00:00
christos 0e48247bcf back out previous, and do it the better way. 2008-12-28 18:38:27 +00:00
christos 3ff2f379f6 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.
2008-12-28 18:34:58 +00:00
lukem 98e5374ccb Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
2008-07-21 14:19:20 +00:00
joerg 12929bba43 - 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@.
2007-06-28 19:05:55 +00:00
bouyer 3697550e70 Don't depend on lubutil if we're building host tools. Fix tools build on
non-NetBSD hosts.
2006-12-16 12:59:16 +00:00
he 0a97c3f688 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
2006-12-14 20:09:35 +00:00
christos 11c53ad61c 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.
2006-10-30 20:22:53 +00:00
rillig e723f89fb8 When trying to copy many files into another file, provide a useful and
more specific error message instead of the usage().
2006-10-06 20:22:59 +00:00
daniel c43e654c14 PR/30698: install(1) stripping flags in METALOG [patch] (Jukka Salmi)
Apply patch, thanks!
2006-09-25 16:05:44 +00:00
daniel 3b6bc88204 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.
2006-09-25 13:21:19 +00:00
dbj b41feff50f 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
2006-09-11 22:24:09 +00:00
mrg 982b2b7938 char -> u_char for a buffer passed to MD5*(). 2006-05-11 06:09:44 +00:00
christos 24f29ca641 Coverity CID 95: Fix resource leak. 2006-04-21 16:36:05 +00:00
christos c05266af8a fix setmode error handling. 2005-10-01 20:23:54 +00:00
elad 851adad0b8 Use crypto/rmd160.h. 2005-09-25 14:34:54 +00:00
christos cc6e13ee6e mktemp() uses are ok here, so no more warnings. 2005-06-11 22:59:05 +00:00
lukem 1282d958b8 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.
2005-05-10 01:24:42 +00:00
lukem 980e24707e strvis(3) encode the link=... argument in the metalog.
(mtree(8) already requires this.)
2005-05-08 23:05:02 +00:00
lukem 19452aceea metadata_log(): remove leading -D destdir before strsvis(3) encoding
the path, not after.
2005-05-08 10:23:13 +00:00
jmc b2f782612f 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
2004-06-20 22:20:14 +00:00
lukem f0cea2f5e2 Fix bug when calculating digest when copying from dev/null.
Problem noted by Matthias Scheler and Tomasz Luchowski.
2004-02-02 23:25:36 +00:00
lukem 75b72cb4f9 Auso support -h hash for hard-linked files. 2004-01-30 01:38:25 +00:00
wiz f46a4026cc Drop trailing space. 2004-01-29 11:17:37 +00:00
lukem 37cb4fb1d9 Implement -h {none,md5,rmd160,sha1} to determine the appropriate hash
(digest) when copying a file to store in the -M METALOG.
2004-01-29 07:58:33 +00:00
lukem 5541148775 now that -c is the default, use "copy" instead of "move" 2004-01-27 02:49:42 +00:00
simonb 60e35b79cc 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.
2003-12-29 02:01:27 +00:00
heas 16e5c22815 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.
2003-12-16 20:51:57 +00:00
christos dd092f8c34 munmap() so that we don't accumulate memory on multiple files. 2003-11-21 21:20:25 +00:00
lukem 171d653219 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).
2003-10-27 00:12:41 +00:00
agc 89aaa1bb64 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22365, verified by myself.
2003-08-07 11:13:06 +00:00
itojun ae4b4e6dbb strlcat 2003-07-12 14:30:53 +00:00
jmmv 5fa5de38b4 Use ; instead of , in a sentence (and fix case of next word). 2003-05-24 18:24:28 +00:00
lukem 826a14607a Now that <bsd.prog.mk> DTRT if HOSTPROG is defined (i.e, it is a no-op),
there's no need to special-case .include-ing it.
2003-05-18 07:57:31 +00:00
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