Commit graph

63 commits

Author SHA1 Message Date
John Baldwin eba230afba Purge more stray embedded $FreeBSD$ strings
These do not use __FBSDID but instead use bare char arrays.

Reviewed by:	imp, emaste
Differential Revision:	https://reviews.freebsd.org/D41957
2023-09-25 07:54:56 -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 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
Ka Ho Ng ce71a0fa99 truncate(1): Update tests' golden output
After commit 5ee2c35751 truncate(1)'s usage output was extended.
Update the golden output in test cases to match the changes made.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	lwhsu
Differential Revision:	https://reviews.freebsd.org/D31628
2021-08-21 17:04:21 +08:00
Ka Ho Ng a54abe119e truncate(1): Fix missing -d option manpage
Mention that either one of the -r, -s and -d options must be specified.

Sponsored by:	The FreeBSD Foundation
2021-08-19 18:45:25 +08:00
Ka Ho Ng 5ee2c35751 truncate(1): Add hole-punching support
This commit adds hole-punching support to the truncate(1) utility. If
the option -d is specified, truncate(1) performs zeroing, and if
possible hole-punching in case the operation is supported by the
underlying file system of the specified files.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	kib
Differential Revision:	https://reviews.freebsd.org/D31556
2021-08-19 18:30:41 +08:00
Ka Ho Ng 89c0d2b190 truncate(1): main() return statement style fix
Sponsored by:	The FreeBSD Foundation
2021-08-18 23:45:59 +08:00
Fernando Apesteguía c2895f1934 truncate(1): Add EXAMPLES section
Add four simple examples showing the use of -c, -r and -s

Approved by:	manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D25774
2020-07-27 15:25:04 +00:00
Eitan Adler ec9eb99714 truncate: delintify 2018-07-29 07:51:42 +00:00
Eitan Adler c517ae76c1 truncate: use better type for 'round' 2018-07-29 07:51:40 +00:00
Emmanuel Vadot 1017327049 truncate: Add support for -s % and /
% round up to the multiple size and / round down
This is compatible with gnu truncate.
Add tests and document in the man page.
2018-07-09 19:03:30 +00:00
Emmanuel Vadot dde27dbc9b truncate: style(9) some parts 2018-07-09 19:02:05 +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
Enji Cooper d511b20a69 Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.
2017-08-02 08:50:42 +00:00
Enji Cooper 4b330699f8 Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after:	1 weeks
2017-08-02 08:35:51 +00:00
Enji Cooper 430f7286a5 Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installed
after r298107

Summary of changes:

- Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that
  namespacing is kept with FILES appropriately, and that this shouldn't need
  to be repeated if the namespace changes -- only the definition of PACKAGE
  needs to be changed
- Allow PACKAGE to be overridden by callers instead of forcing it to always be
  `tests`. In the event we get to the point where things can be split up
  enough in the base system, it would make more sense to group the tests
  with the blocks they're a part of, e.g. byacc with byacc-tests, etc
- Remove PACKAGE definitions where possible, i.e. where FILES wasn't used
  previously.
- Remove unnecessary TESTSPACKAGE definitions; this has been elided into
  bsd.tests.mk
- Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES;
  ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk.
- Fix installation of files under data/ subdirectories in lib/libc/tests/hash
  and lib/libc/tests/net/getaddrinfo
- Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup)

Document the proposed changes in share/examples/tests/tests/... via examples
so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of
replacing FILES. share/mk/bsd.README didn't seem like the appropriate method
of communicating that info.

MFC after: never probably
X-MFC with: r298107
PR: 209114
Relnotes: yes
Tested with: buildworld, installworld, checkworld; buildworld, packageworld
Sponsored by: EMC / Isilon Storage Division
2016-05-04 23:20:53 +00:00
Glen Barber 7d536dc855 MFH
Sponsored by:	The FreeBSD Foundation
2016-03-10 21:16:01 +00:00
Bryan Drewery 15c433351f DIRDEPS_BUILD: Connect MK_TESTS.
Sponsored by:	EMC / Isilon Storage Division
2016-03-09 22:46:01 +00:00
Glen Barber 43faedc133 First pass to fix the 'tests' packages.
Sponsored by:	The FreeBSD Foundation
2016-02-02 22:26:49 +00:00
Alan Somers 1775042adb Fix usr.bin.truncate.truncate_test.bad_truncate with ZFS /tmp.
The bad_truncate test sets the uimmutable flag to produce an error in
truncate, but that flag isn't supported by ZFS.  If /tmp is on a ZFS
filesystem, the test will fail.  Change it to use readonly permissions and
an unpriveleged user instead.

Reviewed by:	jilles
MFC after:	1 week
Sponsored by:	Spectra Logic Corp
Differential Revision:	https://reviews.freebsd.org/D4862
2016-01-19 22:07:39 +00:00
Enji Cooper b2d48be1bc Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) and
netbsd-tests.test.mk (r289151)

- Eliminate explicit OBJTOP/SRCTOP setting
- Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk
- Remove unnecessary TESTSDIR setting
- Use SRCTOP where possible for clarity

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Divison
2015-10-12 08:16:03 +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
Baptiste Daroussin 3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Simon J. Gerraty ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Baptiste Daroussin 2b7af31cf5 use .Mt to mark up email addresses consistently (part3)
PR:		191174
Submitted by:	Franco Fichtner  <franco at lastsummer.de>
2014-06-23 08:23:05 +00:00
Jilles Tjoelker fc96358cdd truncate: Detect integer overflow, fix relative sizes, add tests.
The change to expand_number (r204654) broke detection of too large sizes and
relative sizes ('+'/'-').

Also add some tests.

PR:		190735
Submitted by:	Kirk Russell
MFC after:	1 week
2014-06-09 10:39:55 +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 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
Maxim Sobolev 32bdc2b685 Use expand_number(3) from libutil instead of home-grown function to parse
human-friendly power-of-two numbers (i.e. 2k, 5M etc).

Suggested by:	many
MFC after:	1 week
2010-03-03 19:25:28 +00:00
Xin LI 614595dcc7 Initialize 'sz' as 0. 2009-02-21 03:42:31 +00:00
Colin Percival d59e8ae886 Don't close file descriptor number <whatever random garbage was on the
stack>.

Found by:	LLVM/Clang Static Checker
MFC after:	1 week
2008-08-04 06:48:54 +00:00
Ruslan Ermilov 5eccbe45a7 The -r option can also cause the files to be extended (not
necessarily truncated).
2006-12-19 11:20:34 +00:00
Ruslan Ermilov cb29445a92 Markup fixes. 2006-09-29 15:20:48 +00:00
Maxim Konovalov a39846b5e4 o Don't leak fd on error.
o parselength() returns 0 or -1 so int is enough for its return type.

Submitted by:	Ighighi Ighighi, sheldonh
MFC after:	3 weeks
2006-09-18 16:39:23 +00:00
Ceri Davies 0033dba88b Chase revision 1.10 in usage string and a comment. 2006-09-07 17:10:26 +00:00
Pawel Jakub Dawidek e6f3621dd3 Allow to specify size in terabytes by using T or t suffix.
This speeds up my testing a bit. Because truncate(1) doesn't allocate
blocks on file system before they are used, it is very useful to
emulate huge file systems:

	# truncate -s 16T fs.img
	# mdconfig -a -f fs.img
	# newfs /dev/mdX

(-t swap can be used as well)
2006-04-09 19:16:24 +00:00
Ruslan Ermilov f682f10c76 Sync program's usage() with manpage's SYNOPSIS. 2005-05-21 09:55:10 +00:00
Ruslan Ermilov a866e17077 Added the EXIT STATUS section where appropriate. 2005-01-17 07:44:44 +00:00
Lukas Ertl 6b61c155e6 Make size suffix case insensitive.
PR:            bin/27604
Submitted by:  David Xu <davidx@viasoft.com.cn>
2004-07-22 13:38:10 +00:00
Warner Losh 3f330d7d1a remove __P 2002-03-22 01:42:45 +00:00
Mark Murray 131f7ce586 Remove WARNS?=2 and -Wall. WARNS?=2 is going to be the default. 2001-12-12 00:06:52 +00:00
Sheldon Hearn d1050cb33c * Update author's e-mail address.
* When the author of an utility also wrote its manual page (a rarety, I
  know), it is not necessary to say that the utility "and this manual
  page" were written by the author.
2001-08-16 08:40:54 +00:00