Commit graph

67 commits

Author SHA1 Message Date
Warner Losh bdcbfde31e usr.bin: Remove ancient SCCS tags.
Remove ancient SCCS tags from the tree, automated scripting, with two
minor fixup to keep things compiling. All the common forms in the tree
were removed with a perl script.

Sponsored by:		Netflix
2023-11-26 22:23:30 -07:00
Warner Losh fa9896e082 Remove $FreeBSD$: two-line nroff pattern
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:10 -06:00
Warner Losh d0b2dbfa0e Remove $FreeBSD$: one-line sh pattern
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-08-16 11:55:03 -06:00
Warner Losh 1d386b48a5 Remove $FreeBSD$: one-line .c pattern
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
2023-08-16 11:54:42 -06:00
Warner Losh b3e7694832 Remove $FreeBSD$: two-line .h pattern
Remove /^\s*\*\n \*\s+\$FreeBSD\$$\n/
2023-08-16 11:54:16 -06:00
Warner Losh 4d846d260e spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSD
The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch
up to that fact and revert to their recommended match of BSD-2-Clause.

Discussed with:		pfg
MFC After:		3 days
Sponsored by:		Netflix
2023-05-12 10:44:03 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Stefan Eßer c454c57163 whereis: fix fetching of user.cs_path sysctl variable
The current implementation of sysctlbyname() does not support the user
sub-tree. This function exits with a return value of 0, but sets the
passed string buffer to an empty string.

As a result, the whereis program did not use the value of the sysctl
variable "user.cs_path", but only the value of the environment
variable "PATH".

This update makes whereis use the sysctl function with a fixed OID,
which already supports the user sub-tree.

MFC after:	3 days
2022-02-04 23:44:34 +01:00
Ed Maste 09d7d4ad9a whereis: remove gnu/libexec from source search paths
The last subdirectory of gnu/libexec was removed in r85742.
2020-02-19 14:40:53 +00:00
Stefan Eßer f5ce14028c Silence Clang Scan warnings regarding the use of strcp().
While these warnings are false positives, the use of strdup() instead of
malloc() and strcpy() simplifies and clarifies the code.

While checking the remaining uses of strcpy and strcat I noticed an
assignment of a strlen() to a variable "s", whose value needs to be
preserved for use in later output routines (where it is used to allocate
a buffer). I do not think that the value of "s" will come out lower than
its correct value and thus there is no risk of a buffer overflow, in the
general case, but a specially crafter argument might lead to an overflow.

The bogus assignment to "s" is removed since this value was only used a
single time in the following malloc() call, which has been removed.

MFC after:	2 weeks
2019-01-24 18:39:45 +00:00
Pedro F. Giffuni 1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Bryan Drewery ea825d0274 DIRDEPS_BUILD: Update dependencies.
Sponsored by:	Dell EMC Isilon
2017-10-31 00:07:04 +00:00
Pedro F. Giffuni af7ca7c85d usr.bin: minor spelling fixes on comments.
No functional change.
2016-05-01 16:13:05 +00:00
Baptiste Daroussin c1eac826c2 Fix bad checking of the return of realloc(3)
Reported by:	Coverity
CID:		1007335
MFC after:	3 days
2016-04-20 20:56:06 +00:00
Marcelo Araujo d919e0d513 Use NULL instead of 0 for pointers.
realloc will return NULL if it cannot allocate memory.

MFC after:	2 weeks.
2016-04-18 06:12:00 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Colin Percival 11d9aa6707 Step 1 of eliminating the "games" distribution: Move binaries to /usr/bin;
update paths; and include everything in the "base" distribution.

The "games" distribution being optional made sense when there were more
games and we had small disks; but the "games-like" games were moved into
the ports tree a dozen years ago and the remaining "utility-like" games
occupy less than 0.001% of my laptop's small hard drive.  Meanwhile every
new user is confronted by the question "do you want games installed" when
they they try to install FreeBSD.

The next steps will be:

2. Removing punch card (bcd, ppt), phase-of-moon (pom), clock (grdc), and
caesar cipher (caesar, rot13) utilities.  I intend to keep fortune, factor,
morse, number, primes, and random, since there is evidence that those are
still being used.

3. Merging src/games into src/usr.bin.

This change will not be MFCed.

Reviewed by:	jmg
Discussed at:	EuroBSDCon
Approved by:	gjb (release-affecting changes)
2015-02-12 05:35:00 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty 3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Eitan Adler dda5b39711 multiple: Remove 3rd clause from BSD license where approved by the
regents and renumber.

This patch skips files in contrib/ and crypto/

Acked by:	imp
Discussed with:	emaste
2014-03-14 03:07:51 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Ulrich Spörlein fb2ad9d3a4 Reencode files from latin1 to UTF-8.
This makes a tiny percentage of entries in calendars ugly for latin1
users, but fixes them for UTF-8 users.

This badly needs a solution involving locale-dependent re-encoding.
2011-12-30 10:59:15 +00:00
Ed Schouten 558b00f5a1 Mark global functions and/or variables in whereis(1) static where possible.
This allows compilers and static analyzers to more thorough analysis.
2011-11-06 18:50:19 +00:00
Ed Schouten b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Joerg Wunsch 2b7b4962ab Make the search for sources in PATH_PORTS more accurate. I only
noticed that a "whereis -qs qemu" matched the distfiles subdir of qemu
rather than /usr/ports/emulators/qemu.

It now ignores all dot entries in /usr/ports, plus all entries
starting with a capital letter (maintenance stuff like Templates, but
also includes subdir CVS), plus /usr/ports/distfiles which is simply a
magic name in that respect.
2008-06-20 08:39:42 +00:00
Stefan Farfeleder 6c97c3d1d3 Remove unused variables. 2005-04-09 14:31:41 +00:00
Ruslan Ermilov 48baa77217 Fixed usage(). 2005-02-10 16:07:23 +00:00
Ruslan Ermilov 254dd1666e Let bsd.prog.mk set SRCS and MAN to their default values. 2005-01-28 16:08:11 +00:00
Tim J. Robbins 4ff2396545 Respect locale settings from the environment. 2004-07-15 08:13:56 +00:00
Ruslan Ermilov 6a3e8b0adc Mechanically kill hard sentence breaks. 2004-07-02 22:22:35 +00:00
David E. O'Brien 1ee0ac542b Adjust max WARNs for sparc64. 2002-12-30 09:48:40 +00:00
Ruslan Ermilov 06e482e60a mdoc(7) police: markup polishing.
Approved by:	re
2002-11-26 17:33:37 +00:00
Johan Karlsson eb238d0692 Use correct document date for the -a option. 2002-08-22 01:54:18 +00:00
Johan Karlsson 1f05bc6c92 Add the -a option to report all matches instead of only the
first of each requested type.

Approved by: joerg, sheldonh (mentor)
2002-08-22 01:50:51 +00:00
Johan Karlsson ad23c58318 Correctly handle empty path arguments, e.g., whereis -S -f biff.
Approved by:	joerg, sheldonh (mentor)
2002-08-18 18:21:18 +00:00
Johan Karlsson 103d66460c Define all paths in pathnames.h
Approved by:	joerg, sheldonh (mentor)
2002-07-25 23:04:31 +00:00
Johan Karlsson 8e4c33e9e7 Teach whereis(1) about games.
Approved by:	joerg, sheldonh (mentor)
2002-07-24 14:35:29 +00:00
Philippe Charnier 084e19802d The .Nm utility 2002-07-14 15:12:00 +00:00
Joerg Wunsch e97f67f532 Complete rewrite, once again.
This is basically a ``C compilation'' of the former whereis.pl file,
employing the same algorithms, and aiming at being mostly
UI-compatible to the old (legally tainted) 4.3BSD whereis(1).  In
comparision, the 4.4BSD-Lite version is just another variant of
which(1) only, where in particular the option to search for source
directories is sorely missing.

While i was at it, i added two more options which i contemplated doing
long since.  -x will suppress the run of locate(1) to find sources
that could not be found otherwise, potentially saving a lot of time
(but obviously, risking to not find some sources that are well hidden
in the tree).  -q will omit the leading name of the query, so in
particular, you can now do something like:

	cd `whereis -qs ls`

I'd explicitly like to thank johan for his review which was quite a
bit more than an average review, including sending me a lot of diffs.

Reviewed by:	johan
2002-07-11 21:20:54 +00:00
Johan Karlsson b68725e33f Restore copyright and RCSID.
Remove duplicate $FreeBSD$, $NetBSD$.

Submitted by:   mike
Approved by:    sheldonh (mentor)
2002-07-04 12:29:39 +00:00
Johan Karlsson b81a9775c7 Switch to c version
Approved by:    sheldonh (mentor)
2002-07-03 19:22:52 +00:00
Johan Karlsson 8d430958db compact synopsis
s/program [program ...]/program .../
        s/program [...]/program .../

Approved by:    sheldonh (mentor)
2002-07-03 19:20:59 +00:00
Johan Karlsson 058e185122 Remove -p flag.
OpenBSD's implementation lacks -p, and we don't want to
support the option now, only to lose it if/when we later
switch to OpenBSD's implementation.
This functionality is provided by which(1).

Approved by:    sheldonh (mentor)
2002-07-03 19:19:54 +00:00
Johan Karlsson 9d1b456e66 Add __FBSDID.
Remove __COPYRIGHT, __RCSID which caused an assembler warning.

Approved by:    sheldonh (mentor)
2002-07-03 19:17:59 +00:00
Johan Karlsson b78dcb87c0 Change to NetBSDs version of whereis.
Approved by:    sheldonh (mentor)
Obtained from:  NetBSD
2002-07-03 19:16:31 +00:00