The most awkward bit in this patch is the bootstrapping of m4:
We can't simply use the host version of m4 since that is not compatible
with the flags passed by lex (at least on macOS, possibly also on Linux).
Therefore we need to bootstrap m4, but lex needs m4 to build and m4 also
depends on lex (which needs m4 to generate any files). To work around this
cyclic dependency we can build a bootstrap version of m4 (with pre-generated
files) then use that to build the real m4.
This patch also changes the xz/unxz/dd tools to always use the host version
since the version in the source tree cannot easily be bootstrapped on macOS
or Linux.
Reviewed By: brooks, imp (earlier version)
Differential Revision: https://reviews.freebsd.org/D25992
Add small example section showing general use and -d and -h flags
Approved by: manpages (bcr@)
Differential Revision: https://reviews.freebsd.org/D26172
Every version of patch since the first one posted to mod.sources in 1985 have
included a heuristic for coping with the state of email messaging at the
time. This heuristic would add up to 4 blank lines to a patch if it thought it
needed it. The trouble is, though this causes at least one bug.
The bug in my case is that if you have a context diff whose last hunk only
deletes 3 or fewer lines, then if you try to reverse apply it with -R, it will
fail. The reason for this is the heuristic builds an internal representation
that includes those blank lines. However, it should really replicate the lines
from the pattern lines line it would any other time, not assume they are blank
lines. Removing this heuristic will prevent patch from misapplying the lines
removed after applying a 'fuzz' factor to the previous blank line in the file. I
believe this will only affect 'new-style' 4.3BSD context diffs and not the
older-style 4.2BSD diffs and plain, non-context diffs. It won't affect any of
the newer formats, since they don't use the 'omitted' construct in the same way.
Since this heuristic was put into patch at a time when email / etc ate trailing
white space on a regular basis, and since it's clear that this heuristic is the
wrong thing to do at least some of the time, it's better to remove it
entirely. It's not been needed for maybe 20 years since patch files are not
usually corrupted. If there are a small number of patch files that would benefit
from this corruption fixing, those already-currupt patches can be fixed by the
addition of blank lines. I'd wager that no one will ever come to me with an
example of a once-working patch file that breaks with this change. However, I
have 2 patches from the first 195 patches to 2.11BSD that are affected by this
bug, suggesting that the relative frequency of the issue has changed
signficantly since the original heuristic was put into place.
Reviewed by: phk@
Differential Revision: https://reviews.freebsd.org/D26081
- a couple of descriptions are incomplete
- synopsis doesn't show that all arguments are optional
- missing an ENVIRONMENT section with TERM mentioned
PR: 84670
Submitted by: Gary W. Swearingen <garys at opusnet dot com>
Reviewed by: bcr
Approved by: bcr
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D26009
- Instead of using isatty() to decide whether to call tcgetattr(), just
call tcgetattr() directly, since that's all that isatty() does anyway.
- Simplify error handling in termset(). Check for errno != ENOTTY from
tcgetattr() to handle errors that may be raised while running
script(1) under a debugger.
PR: 248377
Submitted by: Soumendra Ganguly <soumendraganguly@gmail.com>
MFC after: 1 week
My change to allow bootstrapping pwd_mkdb (r363992) resulted in i386 build
failures because the bootstrap header was being included in non-bootstrap chpass.
Dropping the no longer required pwd_mkdb include path from chpass fixes
the build, but to be certain that the failure doesn't get re-introduced,
I've also moved the bootstrap pwd.h into a subdirectory so that adding
-I${SRCTOP}/usr.sbin/pwd_mkdb doesn't pull it in.
Reported by: mjg
Otherwise recorded sessions of some interactive programs do not play
back properly.
PR: 248377
Submitted by: Soumendra Ganguly <0.gangzta@gmail.com>
MFC after: 1 week
libregex is incomplete, but it's a bit less buggy than the in-base
libgnuregex and mostly OK.
While here, rename -DIWTH_GNU -> -DWITH_GNU_COMPAT; the option implies
that we're compatible with the GNU counterpart, not that we're including GNU
anything.
The tests compare the command output (including of error cases) with the
expected output and exit code.
Not all tests are executed, since some expect to have a known good bc and
dc binary installed and compare results of large amounts of generated data
being processed by both versions to test for regressions.
This version omits the printing of a copyright header in interactive mode
and the dc command now exits after execution of the commands passed via -e
or -f instead of switching to interactive mode. To pass further commands
via STDIN when dc has been invoked with -e or -f, add "-f -" to the
parameter list.
r363679 is in-fact the future change referenced by the comment, helpfully
left and forgotten by kevans. Instead of just silently not matching, we
should now be erroring out with vigor.
It's currently unclear to me how this could have worked previously; \n here
is not a literal newline but actual '\' 'n', and was getting passed to the
underlying regex engine as such. regex(3) does not translate this to a
newline, and this became an error because we don't really allow escaping
of arbitrary ordinary characters anymore.
Run the pattern strings through printf to make sure we're dealing with real
newlines before passing them through to atf_check, which ultimately feeds
them directly to regcomp(3).
This fix is different than that will be needed for sed, in that this is the
proper way to inject newlines into search strings as long as regex(3)
won't combine \ + n as folks might expect.
Reported by: Jenkins via lwhsu
MFC after: 1 week
As part of onboarding, ensure that I'm listed in the FreeBSD calendar file,
while listening to Don't Take Away The Music by Tavares.
Reviewed by: 0mp, bcr
Approved by: 0mp (mentor), allanjude (mentor)
Differential Revision: D25856
implementation. The old description was left over from the 4.4 BSD Lite
import in 1994, and was a bit misleading (not all arches use simulated
reference bits, some implement reference tracking in hardware).
In 2018, r338094 removed the commented-out code for supporting the -t
command line option which had been present since the BSD 4.4 Lite import,
but was never implemented for freebsd.
This does the same for the man page.
'y' does not handle bracket expressions, treat '[' as ordinary character
and do not apply bracket expression checks (GNU sed agrees).
PR: 247931
Reviewed by: pfg, kevans
Tested by: antoine (exp-run), Quentin L'Hours <lhoursquentin@gmail.com>
Differential Revision: https://reviews.freebsd.org/D25640
- Handle whitespace with long flags that take arguments:
echo 'foo bar' > test
zgrep --regexp='foo bar' test
- Do not hang reading from stdin with patterns in a file:
echo foobar > test
echo foo > pattern
zgrep -f pattern test
zgrep --file=pattern test
- Handle any flags after -e:
echo foobar > test
zgrep -e foo --ignore-case < test
These two are still outstanding problems:
- Does not handle flags that take an argument if there is no
whitespace:
zgrep -enfs /etc/rpc
- When more than one -e pattern used matching should occur for all
patterns (similar to multiple patterns supplied with -f file).
Instead only the last pattern is used for matching:
zgrep -e rex -e nfs /etc/rpc
(This problem is masked in the unpatched version by the "any
flags after -e" problem.)
Add tests for the above problems.
Update the mange and add references to gzip(1) and zstd(1) and also
document the remaining known problems.
PR: 247126
Approved by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25613
With r318443, atrun was moved from /etc/crontab to /etc/cron.d/at,
but the man-page was unfortunately not updated to reflect this.
PR: 248048
Submitted by: debdrup
Reported by: yoitsmeremember+fbsd at gmail.com
Reviewed by: Pau Amma <pauamma at gundo.com>
Sponsored by: Klara Inc.
Differential Revision: https://reviews.freebsd.org/D25709
GLibc expects six 'X' characters in the mkstemp template argument and
will return EINVAL otherwise.
Reviewed By: emaste, imp, mjg
Differential Revision: https://reviews.freebsd.org/D25662
The current localedef simply assumes that the locale headers on build system
are compatible with those on the target system which is not necessarily true.
It generally works on FreeBSD (as long as we don't change the locale headers),
but Linux and macOS provide completely different locale headers.
This change adds new bootstrap headers that namespace certain xlocale
structures defined or used by in the headers that localdef needs.
This is required since system headers *must* be able to include the "real"
locale headers for printf(), etc., but we also want to access the target
systems's internal locale structures.
Reviewed By: yuripv, brooks
Differential Revision: https://reviews.freebsd.org/D25229
I hit those error messages when using a localedef built against headers
that don't match the target system (cross-building from a Linux host).
This problem will be fixed in the next commit.
Unset VIS_SAFE flag as it turned out to be actually unsafe
for continuos top display as it's passing through sequences
resulting cursor movement (backspace, tab, carriage-return),
and explicitly set VIS_TAB for the same reason.
Reported by: Mark Millard <marklmi@yahoo.com>, swills
Tested by: Mark Millard <marklmi@yahoo.com>, swills
- Part of BAT payload location was lost due to invalid
BAT entry encoding type (32 bits instead of 64 bits)
- The sequence of PB/SB entries in BAT was broken due to
off-by-one index check. It worked for smaller than
4Gb because there were no SB entries in BAT.
MFC after: 1 day
Make sure we call fsync(2) on strip result
in case of "safecopy" and "strip -o tempcopy -- src"
before renaming tempcopy to destination.
MFC after: 3 weeks
X-MFC-With: r363064