Commit Graph

12885 Commits

Author SHA1 Message Date
Warner Losh
a35f04fba2 Adopt SRCTOP in usr.bin
Prefer ${SRCTOP}/foo over ${.CURDIR}/../../foo and ${SRCTOP}/usr.bin/foo
over ${.CURDIR}/../foo for paths in Makefiles.

Differential Revision:	https://reviews.freebsd.org/D9932
Sponsored by:		Netflix
Silence on:		arch@ (twice)
2017-03-12 18:58:44 +00:00
Tijl Coosemans
971c1c4219 - Remove separate handling of /bin and /usr/bin in manpath. They are no
longer a special case.
- Prefer PREFIX/share/man over PREFIX/man.
- Add /usr/local/share/man to man_default_path.
- Update manpath man page.

Reviewed by:	bapt
2017-03-12 10:56:19 +00:00
Enji Cooper
3947900cdc Restore some of the error message text accidentally removed in r315098
"unexpected symlink contents" is more pedantically correct than
"unexpected symlink".

MFC after:	1 week
X-MFC with:	r315098
Sponsored by:	Dell EMC Isilon
2017-03-12 04:08:36 +00:00
Baptiste Daroussin
d5b187aefb Fix building with recent gcc
Reported by:	lwhsu, ngie
2017-03-12 04:04:16 +00:00
Enji Cooper
ec0ada9dc4 Add 3 more testcases demonstrating how install -l sr works
The additional testcases use absolute paths for sources and targets,
as the other testcase which tested `-l sr` used flat relative paths in
the same directory.

Please note that these testcases do not test `-l a` -- that's already
addressed in the battery of tests.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-12 03:58:54 +00:00
Baptiste Daroussin
901a475b7a Implement a stub --horizon-lines=NUM for compatibility with GNU diff3
some options of GNU diff3 would call diff with --horizon-lines, rcs is depending
on that.

Reported by:	antoine
2017-03-12 03:49:05 +00:00
Baptiste Daroussin
57f942af81 Fix wrong date in diff(1)
Reported by:	rgrimes
2017-03-12 03:36:33 +00:00
Enji Cooper
ef74be51be Clarify src vs dest path mismatch in :symbolic_link_{absolute,relative}_body
Unfortunately kyua does not omit the path mismatch on failure, so it must be coded
into the error message.

Cache the values, run the test(1) call, then print out the values in an atf_fail
call to emit the required diagnostics to debug why things are failing.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-12 03:29:49 +00:00
Baptiste Daroussin
97ab006d51 Remove the WITHOUT_MANDOCDB option
mandoc database is activated since FreeBSD 11.0, let's remove the previous
database format for FreeBSD 12.0
2017-03-11 06:51:21 +00:00
Baptiste Daroussin
6970ca8f1e Remove the warning when MANPATH is set in the environment
The MANPATH environment variable behaviour is documented properly in the manpage
and it now has extended to new feature that allows to make MANPATH env variable
extending the default search path rather than overwriting it making the warning
painful

Reported by:	kargl
MFC after:	1 week
2017-03-11 06:31:16 +00:00
Baptiste Daroussin
b2394e73fc Extend functionality MANPATH in man(1) to followup with apropos(1) from
mandoc.

If MANPATH begins with a colon, it is appended to the default list; if it ends
with a colon, it is prepended to the default list; or if it contains two
adjacent colons, the standard search path is inserted between the colons.  If
none of these conditions are met, it overrides the standard search path.

Import the MANPATH description from mandoc into the man(1) man page

Reported by:	kargl
MFC after:	1 week
2017-03-11 06:24:49 +00:00
Baptiste Daroussin
61d5f2d162 Add share/man if it exists to the MANPATH
localbase is not consistent with base for manpages:
/usr/local/man vs /usr/share/man adding share/man allows to fix that
inconsistency and would permit to remove tons of patches/modifications in the
ports tree
2017-03-11 05:56:50 +00:00
Baptiste Daroussin
3bbe3f672e Import diff from OpenBSD and remove GNU diff
Some of the modifications from the previous summer of code has been integrated
Modification for compatibility with GNU diff output has been added

Main difference with OpenBSD:
Implement multiple GNU diff options:
* --ignore-file-name-case
* --no-ignore-file-name-case
* --normal
* --tabsize
* --strip-trailing-cr
Make diff -p compatible with GNU diff
Implement diff -l
Make diff -r compatible with GNU diff

Capsicumize diffing 2 regular files
Add a simple test suite

Approved by:	AsiaBSDcon devsummit
Obtained from:	OpenBSD, GSoC
Relnotes:	yes
2017-03-11 05:01:29 +00:00
Marcelo Araujo
ee1acd865e Bring back the cast removed in my previous commit to allow us build vmstat
with WARNS 2. This cast was first introduced at r87690.

Reported by:	bde, pfg and ngie
MFC after:	3 weeks.
2017-03-11 04:36:15 +00:00
Gleb Smirnoff
d9646465e3 Typo. 2017-03-10 19:08:31 +00:00
Pedro F. Giffuni
e12a957f8d localedef(1): Add comment markings for license. 2017-03-10 16:12:16 +00:00
Pedro F. Giffuni
56b1edd680 localedef(1): Fix mismatch.
Obtained from:	illumos
X-MFC with:	r314974
2017-03-10 16:06:14 +00:00
Marcelo Araujo
97942dfb4f Use nitems() from sys/param.h.
Reviewed by:	ngie
MFC after:	3 weeks.
Differential Revision:	https://reviews.freebsd.org/D9936
2017-03-10 06:23:15 +00:00
Marcelo Araujo
4e7ecee633 Use nitems() from sys/param.h and also remove the cast.
Reviewed by:	markj
MFC after:	3 weeks.
Differential Revision:	https://reviews.freebsd.org/D9937
2017-03-10 04:49:40 +00:00
Marcelo Araujo
807bd0d9f0 Use nitems() from sys/param.h.
Reviewed by:	ume
MFC after:	3 weeks.
Differential Revision:	https://reviews.freebsd.org/D9938
2017-03-10 04:30:31 +00:00
Pedro F. Giffuni
1bb0ddf99d localedef(1): Fix small coverity issues.
- Operands don't affect result (CONSTANT_EXPRESSION_RESULT)
- Buffer not null terminated (BUFFER_SIZE_WARNING)

CID:	1338557, 1338565

Obtained from:	illumos
MFC after:	5 days
2017-03-09 21:49:11 +00:00
Pedro F. Giffuni
c48c87b790 Revert r314969, r314961:
The localdef(1) changes are breaking world:

00:18:40.750 /usr/src/share/colldef/af_ZA.UTF-8.src: 2421: error: Bad file
descriptor

I will fix them offline.

Reported by:	lwshu and many others
2017-03-09 19:02:36 +00:00
Pedro F. Giffuni
5f6fcdca5b localedef(1): Fix mismatch in previous commit.
delete_category is meant to replace fclose() and unlink().
This broke world.

Found by:	kib
Pointedhat:	pfg
2017-03-09 18:06:48 +00:00
Pedro F. Giffuni
830784ef0f localedef(1): Fix for memory leaks reported by coverity.
Also some small cleanups to match better current illumos.

CID: 1338540, 1338541, 1338557, 1338566

Obtained from:	illumos
Discussed with:	Yuri Pankov (@Nexenta)
MFC after:	5 days
2017-03-09 15:21:03 +00:00
Bryan Drewery
d11bfd6fb8 Rename some tests to end in _test.
Requested by:	ngie
MFC after:	2 weeks
X-MFC-With:	r314886
2017-03-09 04:20:00 +00:00
Bryan Drewery
0be7e2c09c Remove unneeded -x from tests.
Reported by:	ngie
MFC after:	2 weeks
X-MFC-With:	r314886
2017-03-09 04:19:52 +00:00
Baptiste Daroussin
e1fe74ad7c Import the awk(1) manpage from OpenBSD
As discussed during AsiaBSDcon devsummit, import the manpage from OpenBSD which
is has been rewritten in mdoc(7) format making it readable by default with
mandoc, it also has been extended by OpenBSD to cover all awk(1) options

Obtained from:	OpenBSD
MFH:		1 week
2017-03-09 03:27:53 +00:00
Enji Cooper
cbd30a72ca usr.bin/fortune: convert to OBJTOP/SRCTOP idioms
- Use OBJTOP/SRCTOP-relative paths when looking for include files and
  strfile.
- Add FORTUNES_OBJ and FORTUNES_SRC to abbreviate usr.bin/fortune
  pathing.

This is being done to simplify make output/idioms.

MFC after:	1 week
Reviewed by:	bdrewery
Sponsored by:	Dell EMC Isilon
Differential Revision:	D9916
2017-03-08 05:31:54 +00:00
Rodney W. Grimes
ce9f2d31b3 Convert absolute links to relative links.
Style.Makefile(9) has been ignored to produce minimal diffs.

Approved by:	grehan (mentor)
MFC after:	1 week
2017-03-07 05:10:38 +00:00
Enji Cooper
60647474d9 Don't rely on dependency in Makefile.inc1 for strfile; make datfiles depend on strfile
In most cases strfile is built as part of build-tools, but in the event that someone
cd'ed to the directory, tried to build from scratch, and had MK_GAMES=no previously,
the build would fail in .../datfiles , trying to find strfile .

Mark this directory tree "SUBDIR_PARALLEL" safe to help facilitate this, instead of
shuffling around the SUBDIR entries (all of the other Makefiles will build standalone).

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-07 04:33:17 +00:00
Simon J. Gerraty
1ce939a7b7 Merge bmake-20170301 2017-03-06 23:02:33 +00:00
Pedro F. Giffuni
63433bc937 bc/dc/patch: make some use of reallocarray(3).
reallocarray(3) is a non portable extension from OpenBSD. Given that it is
already in FreeBSD, make easier future merges by adopting in some cases
where the code has some shared heritage with OpenBSD.

Obtained from:	OpenBSD
2017-03-05 16:10:35 +00:00
Bruce Evans
e245deadcb Fix formatting. ruptime output on FreeBSD cluster machines annoyed me
by usually being double-spaced due to auto-wrap at column 80.

r212771 increased width of the hostname field from 12 to 25.  This was
supposed to allow for 80-column output with all 3 load averages taking
5 characters each, but it actually gave width exactly 80 and thus worse
than useless auto-wrap in that case.  3 wide load average fields are
unusual, but later expansion of another field gave the auto-wrap with
just 2 wide load average fields.

Change to dynamic field widths for all fields except the uptime.  This
also fixes the formatting of high (above 9999) user counts and not
very high (above 9.99) load averages.  The formatting for numbers now
breaks at 99999.99, but scientific notation should be used starting
well below that.

The field width for the uptime remains hard-coded to work consistently
for uptimes less than 10000 days, but this gives too much space for
small uptimes.  Punctuation between fields could be improved in many
ways, for example by removing it.
2017-03-04 04:06:33 +00:00
Enji Cooper
7d9ade5da1 Integrate indent tests added in r313544 into ATF/Kyua and the FreeBSD
test suite

This change does the following:

- Introduces symmetry in the test inputs/outputs by adding the exit
  code to the files. This simplified the test driver notably by
  requiring less filename/test name manipulation.
- Adds a test driver for the testcases added in r313544, patterned
  after bin/sh/tests/functional_test.sh . The driver calls indent as
  noted in r313544, with an exception: The $FreeBSD$ RCS keyword's
  expansion is reindented with indent, which means that the output
  differs from the expected output. Thus, all lines with $FreeBSD$
  in them are deleted on the fly, both in the input file and the
  output file.

  The test inputs/outputs are copied to the kyua sandbox before the
  test is run as the pathing in some of the files relies on pathing
  normalized to the current directory (copying the files is the
  easiest way to resolve the issue).

Approved by:	pstef (maintainer)
Reviewed by:	pstef
X-MFC with:	r313544
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D9682
2017-03-03 20:15:22 +00:00
Alexander Motin
924233eb75 Fix JSON output.
MFC after:	1 week
2017-03-03 11:21:13 +00:00
Simon J. Gerraty
baf4abfc39 Allow building mkimg as cross-tool
For linux the mmap offset must also be page aligned, and we
need to disable macros like __FBSDID()

Change the linux osdep_uuidgen() to use more portable gettimeofday().

Reviewed by: marcel
2017-03-03 01:56:55 +00:00
Martin Matuska
642870485c MFV r314565,314567,314570:
Update libarchive to version 3.3.1 (and sync with latest vendor dist)

Notable vendor changes:
  PR #501: improvements in ACL path handling
  PR #724: fix hang when reading malformed cpio files
  PR #864: fix out of bounds read with malformed GNU tar archives
  Documentation, style, test suite improvements and typo fixes.

New options to bsdtar that enable or disable reading and/or writing of:
  Access Control Lists (--acls, --no-acls)
  Extended file flags (--fflags, --no-fflags)
  Extended attributes (--xattrs, --no-xattrs)
  Mac OS X metadata (Mac OS X only) (--mac-metadata, --no-mac-metadata)

MFC after:	2 weeks
2017-03-02 22:59:35 +00:00
Dimitry Andric
348238dbd4 Merge ^/head r314420 through r314481. 2017-03-01 08:22:51 +00:00
Warner Losh
43b96a4eb5 Revert prior commit to restore the files mangled by my "fixing" merge
conflicts for a git rebase I tried to do.
2017-03-01 02:10:40 +00:00
Warner Losh
fbbd9655e5 Renumber copyright clause 4
Renumber cluase 4 to 3, per what everybody else did when BSD granted
them permission to remove clause 3. My insistance on keeping the same
numbering for legal reasons is too pedantic, so give up on that point.

Submitted by:	Jan Schaumann <jschauma@stevens.edu>
Pull Request:	https://github.com/freebsd/freebsd/pull/96
2017-02-28 23:42:47 +00:00
Dimitry Andric
be64968040 Merge ^/head r314270 through r314419. 2017-02-28 21:30:26 +00:00
Pedro F. Giffuni
29dfec5294 dc(1): Introduce e command, equivalent to p, but writes to stderr
Obtained from:	OpenBSD
MFC after:	2 weeks
2017-02-28 20:50:49 +00:00
Pedro F. Giffuni
6ef0daee41 dc(1): Merge minor changes from OpenBSD.
Prefer setvbuf() to setlinebuf() for portability.
Some style(9) and redundant tests for NULL.

These are only meant to ease up merging newer changes but we are skipping
changes done in order to accomodate OpenBSD's pledge support.

Obtained from:	OpenBSD
MFC after:	2 weeks
2017-02-26 22:17:06 +00:00
Pedro F. Giffuni
7ba980521d dc(1): Catch up with OpenBSD tag.
OpenBSD rev 1.12 corresponds to our SVN r275162. Update the tag to make
easier future updates. No functional change.

MFC after:	3 days
2017-02-26 21:24:35 +00:00
Alfred Perlstein
73132e7be6 spelling fix
Submitted by: adamw
2017-02-26 06:05:29 +00:00
Alfred Perlstein
1909a1f494 More FreeBSD tips for fortune(6)
Submitted by: lme
PR: 192373
2017-02-26 04:41:37 +00:00
Dimitry Andric
eedd67c033 Merge ^/head r314129 through r314177. 2017-02-23 19:32:25 +00:00
Ed Maste
adbb8a93d6 make vi message catalogues build independent of locale
r275234 addressed sort automatically converting 8-bit locales to UTF-8
by using "LANG=C sort", but LC_ALL overrides LANG if set, so the issue
may still be present depending on the user's environment. Use LC_ALL=C
instead.

Reported by:	tests.reproducible-builds.org
Reviewed by:	bapt
MFC after:	1 week
Sponsored by:	The Linux Foundation / Core Infrastructure Initiative
Differential Revision:	https://reviews.freebsd.org/D9765
2017-02-23 14:39:51 +00:00
Dimitry Andric
6ae9acde63 Merge ^/head r313896 through r314128. 2017-02-23 07:45:58 +00:00
Baptiste Daroussin
0064a5b36d Better fix for r314098
The actual issue was the fact that if - was used then some restriction were
already set to stdin when we were applying caph_limit_stdio which was failing
due to the fact the fd was the fd was already restricted to lower rights.

Restricting stdio before actually opening the files prevent trying to raise the
right and fixes the issue.

And this allows to keep failing the program if restriction failed

Approved by:	allanjude
Differential Revision:	https://reviews.freebsd.org/D9723
2017-02-22 16:37:45 +00:00