Commit graph

41 commits

Author SHA1 Message Date
Dag-Erling Smørgrav ad7bef8b89 sdiff: Fix binary case.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43942
2024-02-18 18:39:50 +01:00
Dag-Erling Smørgrav a834edfccd sdiff: Fix --expand-tabs and --tabsize.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43941
2024-02-18 18:39:50 +01:00
Dag-Erling Smørgrav 3cc86989bf sdiff: Misc cleanup.
MFC after:	1 week
Sponsored by:	Klara, Inc.
Reviewed by:	markj
Differential Revision:	https://reviews.freebsd.org/D43943
2024-02-18 18:39:50 +01:00
Warner Losh 5e3934b15a usr.bin: Automated cleanup of cdefs and other formatting
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by:		Netflix
2023-11-26 22:24:01 -07:00
Warner Losh b2c76c41be Remove $FreeBSD$: one-line nroff pattern
Remove /^\.\\"\s*\$FreeBSD\$$\n/
2023-08-16 11:55:15 -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 2a63c3be15 Remove $FreeBSD$: one-line .c comment pattern
Remove /^/[*/]\s*\$FreeBSD\$.*\n/
2023-08-16 11:54:29 -06:00
Simon J. Gerraty d9a4274795 Update/fix Makefile.depend for userland 2023-04-18 17:14:23 -07:00
Baptiste Daroussin 9f72a83a06 sdiff(1) can now be built defaults warning level 2017-12-06 20:10:05 +00:00
Baptiste Daroussin 0ace12afe4 Rename variables confusing gcc 4.2.1
While there is no reason it shadows div(3) gcc 4.2.1 complains about it

MFC after:	1 week
2017-12-06 20:09:30 +00:00
Baptiste Daroussin 2c32000225 Fix -Wincompatible-pointer-types-discards-qualifiers warnings
MFC after:	1 week
2017-12-06 20:05:36 +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
Baptiste Daroussin bcc76a2e83 Remove a useless loop over the long options before passing through some
options to diff(1)
2017-04-08 08:42:25 +00:00
Baptiste Daroussin 85bb63bd29 When passingthrough from sdiff to diff the -H/--speed-large-files
options rename it to the long version as GNU diff only support the long
version of the option not the short version
2017-04-08 08:41:05 +00:00
Enji Cooper 458cbf0ae6 Rename tests from <foo> to <foo>_test to match the FreeBSD test suite
naming scheme

usr.bin/diff/diff_test was renamed to usr.bin/diff/netbsd_diff_test
to avoid collisions with the renamed FreeBSD test.

MFC after:	1 week
Sponsored by:	Dell EMC Isilon
2017-03-23 03:28:24 +00:00
Baptiste Daroussin 42ced26621 Remove useless .Pp after the .Sh macro and remove empty line
Reported by:	make manlint
MFC after:	2 days
2017-02-11 23:39:14 +00:00
Baptiste Daroussin d630035127 Remove extra entries from the option enum
MFC after:	3 days
2016-12-30 23:46:11 +00:00
Baptiste Daroussin d481a92572 Make sdiff --left-column work as expected
MFC after:	3 days
2016-12-30 23:41:33 +00:00
Baptiste Daroussin 23421d5492 Fix typos in sdiff(1) message and improve display 2016-10-15 19:55:07 +00:00
Baptiste Daroussin db1fcc8008 Move cleanup() into the edit.c file which is the only users of that function
Remove common.{c,h}
2016-10-15 13:45:09 +00:00
Baptiste Daroussin e8ad1a6f3d Turn editit into a static function 2016-10-15 13:42:38 +00:00
Baptiste Daroussin 196a5c7c35 Remove the common.h include which is actually not used in sdiff.c 2016-10-15 13:41:58 +00:00
Baptiste Daroussin c59a0a34e8 Remove reference of z(s)diff which was dropped before importing 2016-09-18 10:06:35 +00:00
Ed Maste 6c6e388929 sdiff: improve errx string
errx() appends a newline so \n is superfluous. Also switch to lower case
with no period for consistency with other errx strings.
2016-09-15 02:48:56 +00:00
Bryan Drewery 1eb4ec9c62 DIRDEPS_BUILD: Add some missing dirctories to the build.
Sponsored by:	EMC / Isilon Storage Division
2016-08-31 19:30:59 +00:00
Baptiste Daroussin 9dc3843e67 sdiff: remove non finish/function code
2 extra options not available neither on other BSD nor in GNU sdiff:
--diff-pid and --pipe-fd were present in the SoC code, none were usable

Just remove it
2016-08-05 19:14:55 +00:00
Baptiste Daroussin a43d43d574 Remove usage of _WITH_GETLINE from usr.bin 2016-07-30 01:07:47 +00:00
Bryan Drewery 6e9a3c415e DIRDEPS_BUILD: Connect new directories and update dependencies.
Sponsored by:	EMC / Isilon Storage Division
2016-06-03 19:25:30 +00:00
Conrad Meyer a60711fd00 sdiff(1): Fix potential NULL deref in cleanup path
In the presence of the --diff-pid argument, it is possible for 'diffpipe' to be
NULL.  Only fclose() it if it was initialized.

Reported by:	Coverity
CID:		1355183
Sponsored by:	EMC / Isilon Storage Division
2016-05-10 20:09:40 +00:00
Baptiste Daroussin dbc0cf500d Only one program is build in usr.bin/sdiff use the right include 2016-05-07 20:23:26 +00:00
Baptiste Daroussin 1ddda798a6 Revert r299218 VISUAL is actually a perfecly valid env to specify an editor 2016-05-07 18:58:07 +00:00
Baptiste Daroussin 041db57684 Only use EDITOR as a variable to specify which text editor to use 2016-05-07 18:48:48 +00:00
Baptiste Daroussin 15eaa1aea0 Directly call the editor if needed instead of spawning /bin/sh 2016-05-07 18:44:30 +00:00
Baptiste Daroussin 0c4ac56e16 Replace fparseln(3) with getline(3)
It removes a dependency on libutil.
2016-05-07 18:21:58 +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
Bjoern A. Zeeb e29c552990 fgetc returns an int not a char.
Found by:   powerpc builds failing due to comparing with EOF raised:
"comparison is always false due to limited range of data type"
2016-05-02 15:07:43 +00:00
Baptiste Daroussin da5c2c4230 When checking for binary file, check if ch is not EOF only ch actually got
a value assigned

Reported by:	pfg
2016-04-30 14:48:30 +00:00
Baptiste Daroussin 13b5b54865 import sdiff(1) from GSoC 2012
Import sdiff(1) from the diff version written by Raymond Lai,
improved during GSoC 2012 by Jesse Hagewood.

Compared to the version done in during that summer of code:
- Remove the zlib frontend: zsdiff
- Compatible output (column size and separators) with GNU sdiff

Compared to GNU sdiff in ports:
- The only difference is padding using spaces vs tabs

Compared to OpenBSD and NetBSD import:
- Implement missing options (including long options) from GNU sdiff
- Improved support for the edition mode (signal handling)
- Output visually compatible with GNU sdiff: size of columns

While here import regression tests from NetBSD adapted to fit the output as
expected by GNU sdiff

Reviewed by:	emaste (in part)
Obtained from:	OpenBSD, NetBSD, GSoC 2012
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D5981
Differential Revision:	https://reviews.freebsd.org/D6032 (diff with NetBSD version)
Differential Revision:	https://reviews.freebsd.org/D6033 (diff with OpenBSD version)
2016-04-29 23:27:15 +00:00