Commit Graph

172 Commits

Author SHA1 Message Date
lukem 4815827f69 tools: binstall can use posix_spawn() instead of vfork() 2023-07-20 16:21:23 +00:00
lukem c4b7a9e794 bsd.own.mk: rename GCC_NO_* to CC_WNO_*
Rename compiler-warning-disable variables from
	GCC_NO_warning
to
	CC_WNO_warning
where warning is the full warning name as used by the compiler.

GCC_NO_IMPLICIT_FALLTHRU is CC_WNO_IMPLICIT_FALLTHROUGH

Using the convention CC_compilerflag, where compilerflag
is based on the full compiler flag name.
2023-06-03 09:09:01 +00:00
rillig 5a14d4c6bd 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.
2020-10-30 20:05:00 +00:00
roy 2d02f67b40 xinstall: define MAKE_NATIVE so our make parts compile 2020-09-29 12:04:48 +00:00
mrg d94d71e771 apply GCC_NO_ADDR_OF_PACKED_MEMBER 2020-09-07 00:26:23 +00:00
pgoyette ed42ce54d9 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)!)
2016-05-31 06:55:02 +00:00
dholland 1fb0cf16c7 Don't assume HAVE_POSIX_SPAWN when building a host prog. From Joachim
Kuebart in PR 50301. needs pullup-7
2015-10-10 22:54:03 +00:00
christos be0200b5b7 remove unused label 2015-06-19 17:20:02 +00:00
christos 43fc769556 remove useless assignment and explain why. 2015-06-19 17:17:24 +00:00
christos a038441bc0 restore use of whitespace needing shell. 2015-06-19 14:32:56 +00:00
christos 5e58d82807 restore unlink file if strip fails (from Takeshi Nakayama) 2015-06-17 15:52:37 +00:00
christos e9677ce525 Use the bourne shell if the after command has shell metachars. 2015-06-17 15:34:08 +00:00
christos 561ef1fe67 - improve error printing
- deduplicate run functions and don't use the shell so that we handle
  filenames with spaces and metacharacters consistently.
2015-06-15 16:33:38 +00:00
martin 61f9154cab Add optional support for posix_spawn (instead of vfork) and enable it for
the in-tree build.
2015-06-15 07:05:09 +00:00
apb 1546931886 mtree spec files want nanoseconds, so multiply the microseconds by 1000. 2014-07-06 20:54:47 +00:00
apb 117589e5c1 When printing a timestamp to a metalog, use 9 digits
for the nanoseconds part, except use only 1 digit if
the value was zero.
2014-07-06 20:50:03 +00:00
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