Skip to content

Commit 592aaf8

Browse files
text_cmds-199
Imported from text_cmds-199.tar.gz
1 parent 3342f27 commit 592aaf8

7 files changed

Lines changed: 184 additions & 32 deletions

File tree

‎.upstream_base_commits‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -549,8 +549,9 @@ jq/src/parser.c jq src/parser.c a9f97e9e61a910a374a5d768244e8ad63f407d3e
549549
jq/src/jv_file.c jq src/jv_file.c 90bc29c1b544c0436ec44246e180fdbb6d6384df
550550
jq/src/jq.h jq src/jq.h 6d89e297febdbcbad4ecf201e56fc8ec99f67137
551551

552-
lam/lam.1 freebsd usr.bin/lam/lam.1 07372194c3016882494a28a8a1ae00472ce31e69
553-
lam/lam.c freebsd usr.bin/lam/lam.c 377421df9690cddad7f0c8cba84bd392e62a3b6c
552+
lam/lam.1 freebsd usr.bin/lam/lam.1 bdcbfde31e8e9b343f113a1956384bdf30d1ed62
553+
lam/lam.c freebsd usr.bin/lam/lam.c 6a9452c8378a1aa767708ad2d235f847c880a21c
554+
lam/tests/lam_test.sh freebsd usr.bin/lam/tests/lam_test.sh 6a9452c8378a1aa767708ad2d235f847c880a21c
554555

555556
look/look.1 freebsd usr.bin/look/look.1 f3f16c31fea258b2b1ec51ddd1bceb6207b66198
556557
look/look.c freebsd usr.bin/look/look.c 8a16b7a18f5d0b031f09832fd7752fba717e2a97

‎lam/lam.1‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@
2525
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2626
.\" SUCH DAMAGE.
2727
.\"
28-
.\" @(#)lam.1 8.1 (Berkeley) 6/6/93
29-
.\" $FreeBSD$
30-
.\"
3128
.Dd April 7, 2015
3229
.Dt LAM 1
3330
.Os

‎lam/lam.c‎

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,6 @@
2929
* SUCH DAMAGE.
3030
*/
3131

32-
#include <sys/cdefs.h>
33-
#ifndef lint
34-
__COPYRIGHT(
35-
"@(#) Copyright (c) 1993\n\
36-
The Regents of the University of California. All rights reserved.\n");
37-
#endif /* not lint */
38-
39-
#ifndef lint
40-
#if 0
41-
static char sccsid[] = "@(#)lam.c 8.1 (Berkeley) 6/6/93";
42-
#endif
43-
#endif /* not lint */
44-
__FBSDID("$FreeBSD$");
45-
4632
/*
4733
* lam - laminate files
4834
* Author: John Kunze, UCB
@@ -237,11 +223,8 @@ gatherline(struct openfile *ip)
237223
*p = '\0';
238224
if (c == EOF) {
239225
ip->eof = 1;
240-
if (ferror(ip->fp)) {
226+
if (ferror(ip->fp))
241227
err(EX_IOERR, NULL);
242-
}
243-
if (ip->fp == stdin)
244-
fclose(stdin);
245228
morefiles--;
246229
return (pad(ip));
247230
}

‎lam/lam.plist.part‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,15 @@
22
<key>OpenSourceProject</key>
33
<string>lam</string>
44
<key>OpenSourceVersion</key>
5-
<string>2021-07-27</string>
5+
<string>2025-11-14</string>
66
<key>OpenSourceWebsiteURL</key>
7-
<string>https://cgit.freebsd.org/src/tree/usr.bin/lam?id=07372194c3016882494a28a8a1ae00472ce31e69</string>
7+
<string>https://cgit.freebsd.org/src/tree/usr.bin/lam?id=6a9452c8378a1aa767708ad2d235f847c880a21c</string>
88
<key>OpenSourceImportDate</key>
9-
<string>2021-08-19</string>
9+
<string>2026-01-05</string>
1010
<key>OpenSourceModifications</key>
1111
<array>
12-
<string>lam.c: use __COPYRIGHT (81852355)</string>
1312
<string>lam.c: ifndef capsicum support (81852355)</string>
14-
<string>lam.c: fail on invalid input or i/o errors (6555390)</string>
13+
<string>lam.c: use fmtcheck to validate frmat strings (84571873)</string>
1514
</array>
1615
<key>OpenSourceLicense</key>
1716
<string>bsd</string>

‎lam/tests/lam_test.sh‎

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#
2+
# Copyright (c) 2025 Klara, Inc.
3+
#
4+
# SPDX-License-Identifier: BSD-2-Clause
5+
#
6+
7+
atf_test_case basic
8+
basic_head()
9+
{
10+
atf_set "descr" "Test basic lam(1) functionality"
11+
}
12+
basic_body()
13+
{
14+
printf '1\n2\n3\n' > a
15+
printf '4\n5\n6\n' > b
16+
17+
atf_check -o inline:"14\n25\n36\n" lam a b
18+
}
19+
20+
atf_test_case sep
21+
sep_head()
22+
{
23+
atf_set "descr" "Test lam(1) -s and -S options"
24+
}
25+
sep_body()
26+
{
27+
printf "1\n" > a
28+
printf "0\n" > b
29+
30+
atf_check -o inline:"x1x0\n" lam -S x a b
31+
atf_check -o inline:"1x0\n" lam a -S x b
32+
atf_check -o inline:"x10\n" lam -S x a -s '' b
33+
34+
atf_check -o inline:"x10\n" lam -s x a b
35+
atf_check -o inline:"x1y0\n" lam -s x a -s y b
36+
atf_check -o inline:"1x0\n" lam a -s x b
37+
}
38+
39+
atf_test_case stdin
40+
stdin_head()
41+
{
42+
atf_set "descr" "Test lam(1) using stdin"
43+
}
44+
stdin_body()
45+
{
46+
printf '1\n2\n3\n4\n' > a
47+
48+
atf_check -o inline:"11\n22\n33\n44\n" lam a - < a
49+
atf_check -o inline:"11\n22\n33\n44\n" lam - a < a
50+
51+
atf_check -o inline:"12\n34\n" lam - - < a
52+
}
53+
54+
atf_init_test_cases()
55+
{
56+
atf_add_test_case basic
57+
atf_add_test_case sep
58+
atf_add_test_case stdin
59+
}

‎tests/text_cmds.plist.in‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,87 @@
3030
<true/>
3131
</dict>
3232
#if TARGET_OS_OSX
33+
<dict>
34+
<key>TestName</key>
35+
<string>text_cmds.lam_test.sh.basic</string>
36+
<key>ShellEnv</key>
37+
<dict>
38+
<key>ATF_SH</key>
39+
<string>/usr/local/bin/atf-sh</string>
40+
<key>__RUNNING_INSIDE_ATF_RUN</key>
41+
<string>internal-yes-value</string>
42+
</dict>
43+
<key>Command</key>
44+
<array>
45+
<string>/usr/local/bin/atf-sh</string>
46+
<string>/AppleInternal/Tests/text_cmds/lam/lam_test.sh</string>
47+
<string>-s</string>
48+
<string>/AppleInternal/Tests/text_cmds/lam</string>
49+
<string>-r</string>
50+
<string>lam_test.sh.basic.results.txt</string>
51+
<string>basic</string>
52+
</array>
53+
<key>Description</key>
54+
<string>Test basic lam(1) functionality</string>
55+
<key>MayRunConcurrently</key>
56+
<true/>
57+
<key>Timeout</key>
58+
<integer>300</integer>
59+
</dict>
60+
<dict>
61+
<key>TestName</key>
62+
<string>text_cmds.lam_test.sh.sep</string>
63+
<key>ShellEnv</key>
64+
<dict>
65+
<key>ATF_SH</key>
66+
<string>/usr/local/bin/atf-sh</string>
67+
<key>__RUNNING_INSIDE_ATF_RUN</key>
68+
<string>internal-yes-value</string>
69+
</dict>
70+
<key>Command</key>
71+
<array>
72+
<string>/usr/local/bin/atf-sh</string>
73+
<string>/AppleInternal/Tests/text_cmds/lam/lam_test.sh</string>
74+
<string>-s</string>
75+
<string>/AppleInternal/Tests/text_cmds/lam</string>
76+
<string>-r</string>
77+
<string>lam_test.sh.sep.results.txt</string>
78+
<string>sep</string>
79+
</array>
80+
<key>Description</key>
81+
<string>Test lam(1) -s and -S options</string>
82+
<key>MayRunConcurrently</key>
83+
<true/>
84+
<key>Timeout</key>
85+
<integer>300</integer>
86+
</dict>
87+
<dict>
88+
<key>TestName</key>
89+
<string>text_cmds.lam_test.sh.stdin</string>
90+
<key>ShellEnv</key>
91+
<dict>
92+
<key>ATF_SH</key>
93+
<string>/usr/local/bin/atf-sh</string>
94+
<key>__RUNNING_INSIDE_ATF_RUN</key>
95+
<string>internal-yes-value</string>
96+
</dict>
97+
<key>Command</key>
98+
<array>
99+
<string>/usr/local/bin/atf-sh</string>
100+
<string>/AppleInternal/Tests/text_cmds/lam/lam_test.sh</string>
101+
<string>-s</string>
102+
<string>/AppleInternal/Tests/text_cmds/lam</string>
103+
<string>-r</string>
104+
<string>lam_test.sh.stdin.results.txt</string>
105+
<string>stdin</string>
106+
</array>
107+
<key>Description</key>
108+
<string>Test lam(1) using stdin</string>
109+
<key>MayRunConcurrently</key>
110+
<true/>
111+
<key>Timeout</key>
112+
<integer>300</integer>
113+
</dict>
33114
<dict>
34115
<key>TestName</key>
35116
<string>text_cmds.md5_test.sh.self_test_md5</string>

‎text_cmds.xcodeproj/project.pbxproj‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 55;
6+
objectVersion = 73;
77
objects = {
88

99
/* Begin PBXAggregateTarget section */
@@ -1664,6 +1664,16 @@
16641664
name = "Copy Test Files";
16651665
runOnlyForDeploymentPostprocessing = 1;
16661666
};
1667+
2A9F750D2F05804E00D421E7 /* Copy Teset Files */ = {
1668+
isa = PBXCopyFilesBuildPhase;
1669+
buildActionMask = 8;
1670+
dstPath = /AppleInternal/Tests/text_cmds/lam;
1671+
dstSubfolderSpec = 0;
1672+
files = (
1673+
);
1674+
name = "Copy Teset Files";
1675+
runOnlyForDeploymentPostprocessing = 1;
1676+
};
16671677
CBBD76EB2BACAC0E008CD52C /* CopyFiles */ = {
16681678
isa = PBXCopyFilesBuildPhase;
16691679
buildActionMask = 8;
@@ -2839,6 +2849,20 @@
28392849
FDF283701DAED7C700CF8C36 /* commoncrypto.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = commoncrypto.h; sourceTree = "<group>"; };
28402850
/* End PBXFileReference section */
28412851

2852+
/* Begin PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */
2853+
2A9F750F2F05805F00D421E7 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */ = {
2854+
isa = PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet;
2855+
buildPhase = 2A9F750D2F05804E00D421E7 /* Copy Teset Files */;
2856+
membershipExceptions = (
2857+
lam_test.sh,
2858+
);
2859+
};
2860+
/* End PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet section */
2861+
2862+
/* Begin PBXFileSystemSynchronizedRootGroup section */
2863+
2A9F750B2F057FED00D421E7 /* tests */ = {isa = PBXFileSystemSynchronizedRootGroup; exceptions = (2A9F750F2F05805F00D421E7 /* PBXFileSystemSynchronizedGroupBuildPhaseMembershipExceptionSet */, ); explicitFileTypes = {}; explicitFolders = (); path = tests; sourceTree = "<group>"; };
2864+
/* End PBXFileSystemSynchronizedRootGroup section */
2865+
28422866
/* Begin PBXFrameworksBuildPhase section */
28432867
2A15131C2946F9A20051ED9C /* Frameworks */ = {
28442868
isa = PBXFrameworksBuildPhase;
@@ -4296,6 +4320,7 @@
42964320
FC7A7C33149866AF0086576A /* lam */ = {
42974321
isa = PBXGroup;
42984322
children = (
4323+
2A9F750B2F057FED00D421E7 /* tests */,
42994324
FC7A7C34149866AF0086576A /* lam.1 */,
43004325
FC7A7C35149866AF0086576A /* lam.c */,
43014326
);
@@ -4902,11 +4927,15 @@
49024927
FC7A7D4D14986A340086576A /* Sources */,
49034928
FC7A7D4E14986A340086576A /* Frameworks */,
49044929
FC7A7D4F14986A340086576A /* CopyFiles */,
4930+
2A9F750D2F05804E00D421E7 /* Copy Teset Files */,
49054931
);
49064932
buildRules = (
49074933
);
49084934
dependencies = (
49094935
);
4936+
fileSystemSynchronizedGroups = (
4937+
2A9F750B2F057FED00D421E7 /* tests */,
4938+
);
49104939
name = lam;
49114940
productName = text_cmds;
49124941
productReference = FC7A7D5214986A340086576A /* lam */;
@@ -5272,14 +5301,14 @@
52725301
};
52735302
};
52745303
buildConfigurationList = FC7A7B33149865C80086576A /* Build configuration list for PBXProject "text_cmds" */;
5275-
compatibilityVersion = "Xcode 13.0";
52765304
developmentRegion = en;
52775305
hasScannedForEncodings = 0;
52785306
knownRegions = (
52795307
en,
52805308
Base,
52815309
);
52825310
mainGroup = FC7A7B2E149865C70086576A;
5311+
preferredProjectObjectVersion = 55;
52835312
productRefGroup = FC7A7B3A149865C80086576A /* Products */;
52845313
projectDirPath = "";
52855314
projectRoot = "";
@@ -6360,7 +6389,7 @@
63606389
GCC_C_LANGUAGE_STANDARD = gnu11;
63616390
GCC_PREPROCESSOR_DEFINITIONS = (
63626391
"__FBSDID=__RCSID",
6363-
"_REENTRANT",
6392+
_REENTRANT,
63646393
);
63656394
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
63666395
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
@@ -6371,7 +6400,10 @@
63716400
MACOSX_DEPLOYMENT_TARGET = 13.0;
63726401
MTL_ENABLE_DEBUG_INFO = NO;
63736402
MTL_FAST_MATH = YES;
6374-
OTHER_CFLAGS = "--include src/config_apple.h";
6403+
OTHER_CFLAGS = (
6404+
"--include",
6405+
src/config_apple.h,
6406+
);
63756407
PRODUCT_NAME = "$(TARGET_NAME)";
63766408
SDKROOT = macosx;
63776409
WARNING_CFLAGS = "-Werror=format";

0 commit comments

Comments
 (0)