summaryrefslogtreecommitdiff
path: root/usr.bin/awk
AgeCommit message (Collapse)Author
2025-09-03awk: Merge upstream manpage updatesWarner Losh
Merge the upstream manpage upades into awk.1. This goes through upstream hash 9acc510. Upstream man page is written in raw nroff with "an" macros, rather than in mandoc, so convert to mandoc as well. The man page isn't updated on imports automatically, plus our man page has diverged somewhat from upstraem's so it's not a mechanical change... PR: 230730 Sponsored by: Netflix
2024-10-14Update Makefile.depend filesSimon J. Gerraty
After building packages we have a number of new and updated Makefile.depend files Reviewed by: stevek
2024-09-18awk: update dependencies for dirdeps buildStephen J. Kiernan
When building "awk" for the host, we need yacc to also exist
2024-07-15Remove residual blank line at start of MakefileWarner Losh
This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
2024-03-07awk: Fix the testsWarner Losh
I'd forgotten that we have to adjust the stderr tests from upstream. Remove the OK files. Also remove system-status.*. These restore the fixes I made in 517e52b6c21c which were lost when I imported the last version of awk. Also, force LANG to be C.UTF-8 when testing to ensure that stray lang settings don't fail tests. Sponsored by: Netflix
2023-12-17awk(1): Fix typoYu-Hsun Chen
This is from the Advanced UNIX Programming Course (Fall’23) at NTHU. MFC after: 3 days Pull Request: https://github.com/freebsd/freebsd-src/pull/928
2023-08-16Remove $FreeBSD$: two-line nroff patternWarner Losh
Remove /^\.\\"\n\.\\"\s*\$FreeBSD\$$\n/
2023-08-16Remove $FreeBSD$: one-line sh patternWarner Losh
Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
2023-06-29Separate dependencies on tools built for host.Simon J. Gerraty
When generated files depend on tools that need to be built for host, we need to carefully separate them for the DIRDEPS_BUILD so we only build them once. Reviewed by: stevek Sponsored by: Juniper Networks, Inc.
2023-04-27Additions to targets/pseudo/host-toolsSimon J. Gerraty
More tools needed to be built for Linux. These are the ones that "just work".
2023-04-20Fix building host tools for hostSimon J. Gerraty
Several makefile depend on tools built for host. At least when using DIRDEPS_BUILD we can build these for the pseudo machine "host" to facilitate building on older host versions. Ideally we would build these tools in their own directories to avoid building more than needed. For now, setting an appropriate default for BTOOLSPATH will suffice Reviewed by: stevek Sponsored by: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D39708
2023-04-18Update/fix Makefile.depend for userlandSimon J. Gerraty
2021-11-05awk: Move to using two sets of testsWarner Losh
Upstream one-true-awk has two sets of tests. These are in addition to NetBSD's tests we're using. The 'bugs-fixed' tests from upstream are ready to use as-is (more or less). However, the 'tests' from upstream are not, so for now we'll just use the netbsd and bugs-fixed tests. They provide an OK workout and are better than nothing, though the tests themselves are for specific esoteric things. The upstream bugs-fixed tests are *ALMOST* a drop in. However, 3 test for errors and the upstream test jig mashes stdout and stderr together, which atf doesn't do, so make a tiny tweak to the upstream tests that I hope to upstream. Plus upstream has ../a.out: instead of awk: in the output. Not sure how to deal with this yet, so I've not proposed anything upstream and have changed the test locally. In addition, the system-status.awk test is not suitable to run in ATF. It wants to force sh to dump core, but kyua doesn't seem to allow that sometimes so the test will fail or pass based on whether or not a core dump can be created. Since it's unstable, remove it. This required moving the netbsd tests to a new direcotry, so update mtree files as well. The change is useless for 'make check' without it. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31376
2021-08-02awk: Enable tests againWarner Losh
Since we now pass all 24 of the NetBSD awk tests, re-enable these tests. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D31370
2021-07-31awk: use awkgram.tab.h consistentlyWarner Losh
yacc makes awkgram.h. However, one true awk includes awkgram.tab.h, so we link to for the builds. Make sure that we consistently link to it. Also, restore the awkgram.tab.h dependency to maketab. It should not have been deleted, despite apparently making meta build on stable/12 work. The important missing arc was proctab.c's dependence on awkgram.tab.h. MFC After: 1 day (build breakage) Fixes: c50c8502cb629571f35089690d6e9a9bc4d60813 Sponsored by: Netflix
2021-07-31awk: Fix dependenciesWarner Losh
proctab.c is generated from awktab.h, so needs to depend on it. maketab does not depend on awktab.h, and gets the maketab.c dependency automatically, so remove them both. Normally, these don't matter. However, for a meta build, they can cause us to build maketab twice (once host, once for target) resulting in a binary that can't run on the host due to proctab.c racing maketab in parallel legs. In stable/12, this was a reliably lost race, while in main I've been unable to trigger the race at all (maybe due to dirdep changes making main more robust). MFC After: 1 day (build breakage) Reported by: kp Sponsored by: Netflix
2021-07-30awk: Document deprecated behavior of hex constants and locales.Warner Losh
FreeBSD will convert "0x12" from hex and print it as 18. Other awks will convert it to 0. This extension has been removed upstream, and will be removed in FreeBSD 14.0. FreeBSD used to set the locale on startup, and make the ranges use that locale. This lead to weird results like "[A-Z]" matching lower case characters in some locales. This bug has been fixed. MFC After: 3 days Sponsored by: Netflix
2021-07-30awk: Flag -Ft as deprecated behaviorWarner Losh
Upstream is poised to deprecate the -Ft wart in one true awk. None of the other awks do this, and the gawk maintainer says that he's had no requests for it in gawk in 30 years maintaining it. github can find a few instances of it in the wild. As such, warn that it's deprecated and will go away in the future. MFC After: 3 days Sponsored by: Netflix
2021-07-19awk: Add more details top the FS variableWarner Losh
The current description of the FS is true, but only part of the truth. Add information about single characters and note that FS="" is undefined by the standard, though the two other awk implenetations (mawk and gawk) also have this interpretation. PR: 226112 Sponsored by: Netflix
2021-07-07one-true-awk: import 20210221 (1e4bc42c53a1) which fixes a number of bugsWarner Losh
Import the latest bsd-features branch of the one-true-awk upstream: o Move to bison for $YACC o Set close-on-exec flag for file and pipe redirects that aren't std* o lots of little fixes to modernize ocde base o free sval member before setting it o fix a bug where a{0,3} could match aaaa o pull in systime and strftime from NetBSD awk o pull in fixes from {Net,Free,Open}BSD (normalized our code with them) o add BSD extensions and, or, xor, compl, lsheift, rshift (mostly a nop) Also revert a few of the trivial FreeBSD changes that were done slightly differently in the upstreaming process. Also, our PR database may have been mined by upstream for these fixes, and Mikolaj Golub may deserve credit for some of the fixes in this update. Suggested by: Mikolaj Golub <to.my.trociny@gmail.com> PR: 143363,143365,143368,143369,143373,143375,214782 Sponsored by: Netflix
2020-06-13awk(1): use -version instead of -VYuri Pankov
-V is OpenBSD specific, use -version instead. While here, fix issue reported by mandoc lint and drop nonexistent script(7) reference. PR: 247004 Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D25164 Notes: svn path=/head/; revision=362147
2019-06-15Fix .depend files to work for build tools.Bryan Drewery
This is somewhat of a follow-up to r335746. MFC after: 2 weeks Sponsored by: DellEMC Notes: svn path=/head/; revision=349062
2019-06-02This should have been committed in r348511 with the awk update.Warner Losh
It was in my tree, the build worked, but I committed from contrib/one-true-awk rather than the top level, so was omitted. Notes: svn path=/head/; revision=348515
2018-01-29awk(1): Don't install tests at allKyle Evans
Tests were disconnected so that running `make check` in usr.bin/awk did not have any effect, but CI runs use installed tests. Fully disconnect tests/ from the build for the time being as a short term solutio Reported by: lwhsu Notes: svn path=/head/; revision=328550
2018-01-11awk(1): Add necessary bits for connecting tests, but leave disconnectedKyle Evans
The NetBSD test suite has 24 tests for awk, and we pass exactly 4 of them. Add the necessary pieces for interested parties to easily connect the tests and run them, but leave them disconnected for the time being. Some of these tests outright segfault in our awk, others just exhibit the wrong behavior. Notes: svn path=/head/; revision=327806
2017-10-31DIRDEPS_BUILD: Update dependencies.Bryan Drewery
Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
2017-09-14Implement gawk multiple-arg extension to and, or, and xor.Warner Losh
gawk allows multiple arguemnts to bit-wiste and, or and xor functions. Implement an arbitrary number of arguments for these functions. Also, use NULL in preference to 0 to match rest of file. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D12361 Notes: svn path=/head/; revision=323577
2017-03-09Import the awk(1) manpage from OpenBSDBaptiste Daroussin
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 Notes: svn path=/head/; revision=314942
2017-02-11Use SRCTOP to refer to awk source in contrib/awk and remove unnecessary ↵Enji Cooper
AWKSRC prefix for maketab.c The former simplifies pathing in make/displayed output, whereas the latter was just unnecessarily superfluous since .PATH referenced the path to maketab.c earlier on in the Makefile. MFC after: 1 week Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=313654
2016-06-14WITH_META_MODE: Fix rebuilding maketab outside of build-tools.Bryan Drewery
The bsd.dep.mk yacc targets rely on only the .c file getting a .meta file. However the previous code here relying on only the .h file meant that it would be generated with a .meta file. r301285 made it so that the .h file is never expected to get a .meta file. To keep this restriction in place add in an extra dependency on the .c file so that it is generated at this time. It's a hack but the best for the patterns we have at the moment for handling build-tools and side-effect-generated files. Reported by: Mark Millard Approved by: re (implicit) Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=301884
2016-05-09DIRDEPS_BUILD: Run the staged bootstrap-tools version of build-tools.Bryan Drewery
This avoids running target binaries. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299289
2016-04-14META_MODE: Don't rebuild build-tools targets during normal build.Bryan Drewery
This avoids 'build command changed' due to CFLAGS/CC changes during the normal build. Without this the build-tools targets end up rebuilding for the *target* rather than keeping the native versions built in build-tools. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=297997
2016-02-24DIRDEPS_BUILD: Regenerate without local dependencies.Bryan Drewery
These are no longer needed after the recent 'beforebuild: depend' changes and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports skipping 'make depend'. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=295989
2015-11-25META MODE: Don't create .meta files when symlinking sources into the obj ↵Bryan Drewery
directory. Tracking these leads to situations where meta mode will consider the file to be out of date if /bin/sh or /bin/ln are newer than the source file. There's no reason for meta mode to do this as make is already handling the rebuild dependency fine. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291320
2015-06-13Add META_MODE support.Simon J. Gerraty
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 Notes: svn path=/head/; revision=284345
2015-06-08dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=284172
2015-05-27Merge sync of headSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=283595
2014-11-25Convert to usr.bin/ to LIBADDBaptiste Daroussin
Reduce overlinking Notes: svn path=/head/; revision=275042
2014-05-16Updated dependenciesSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=266219
2014-05-10Updated dependenciesSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=265802
2013-03-11Updated dependenciesSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=248169
2013-02-16Updated dependenciesSimon J. Gerraty
Notes: svn path=/projects/bmake/; revision=246868
2012-08-22Sync FreeBSD's bmake branch with Juniper's internal bmake branch.Marcel Moolenaar
Requested by: Simon Gerraty <sjg@juniper.net> Notes: svn path=/projects/bmake/; revision=239572
2010-01-10Apply patches directly to sources. Their effect is as follows:Ruslan Ermilov
- Make one-true-awk respect locale's collating order in [a-z] bracket expressions, until a more complete fix (like handing BREs) is ready. - Don't require a space between -[fv] and its argument. Notes: svn path=/head/; revision=201989
2010-01-09Regen diffs.Ruslan Ermilov
Notes: svn path=/head/; revision=201957
2010-01-09Update to a 26-Nov-2009 release.Ruslan Ermilov
Notes: svn path=/head/; revision=201951
2010-01-02Build usr.bin/ with WARNS=6 by default.Ed Schouten
Also add some missing $FreeBSD$ to keep svn happy. Notes: svn path=/head/; revision=201386
2008-03-27Allow awk (the one true one!) to handle 64 files instead of just 20.John Birrell
The current FreeBSD syscall generation script uses all 20 and I need another open file. It's a shame that something named as the 'one-true-awk' is so limited by an old denition like FOPEN_MAX when it could just make the file handling dynamic. This is done to avoid touching contrib sources on a vendor branch. Notes: svn path=/head/; revision=177655
2008-02-28Now that we're way past our conversion from GNU awk to BWK awk, we don'tDavid E. O'Brien
need to primarily install as a non-conflicting name. Notes: svn path=/head/; revision=176641
2007-10-25The AWK 23-Oct-2007 release includes fixes for FreeBSD PR's bin/104795David E. O'Brien
and bin/100443. Notes: svn path=/head/; revision=172962