From 1d48ef9844c3f999487ba4041c124045676ed4c2 Mon Sep 17 00:00:00 2001 From: Zachary Storer Date: Sat, 22 Feb 2014 13:20:45 -0700 Subject: [PATCH] Import NetBSD true and false commands Replaces the 'true' and 'false' functionality provided by commands/true and commands/false. Change-Id: I736efb9a650f3154eb21e442d676a0f5d2dee957 --- benchmarks/unixbench-5.1.2/src/syscall.c | 4 +- commands/Makefile | 2 +- commands/false/Makefile | 5 --- commands/false/false.sh | 1 - commands/shared/README | 2 - commands/true/Makefile | 5 --- commands/true/true.sh | 1 - distrib/sets/lists/minix/mi | 5 ++- etc/master.passwd | 4 +- man/man1/Makefile | 2 +- man/man1/true.1 | 24 ---------- releasetools/nbsd_ports | 2 + usr.bin/Makefile | 4 +- usr.bin/false/Makefile | 7 +++ usr.bin/false/false.1 | 56 ++++++++++++++++++++++++ usr.bin/false/false.sh | 2 + usr.bin/true/Makefile | 7 +++ usr.bin/true/true.1 | 56 ++++++++++++++++++++++++ usr.bin/true/true.sh | 2 + 19 files changed, 143 insertions(+), 48 deletions(-) delete mode 100644 commands/false/Makefile delete mode 120000 commands/false/false.sh delete mode 100644 commands/true/Makefile delete mode 120000 commands/true/true.sh delete mode 100644 man/man1/true.1 create mode 100644 usr.bin/false/Makefile create mode 100644 usr.bin/false/false.1 create mode 100644 usr.bin/false/false.sh create mode 100644 usr.bin/true/Makefile create mode 100644 usr.bin/true/true.1 create mode 100644 usr.bin/true/true.sh diff --git a/benchmarks/unixbench-5.1.2/src/syscall.c b/benchmarks/unixbench-5.1.2/src/syscall.c index d0238bdce..1c4076882 100644 --- a/benchmarks/unixbench-5.1.2/src/syscall.c +++ b/benchmarks/unixbench-5.1.2/src/syscall.c @@ -88,8 +88,8 @@ int main(int argc, char *argv[]) fprintf(stderr,"%s: fork failed\n", argv[0]); exit(1); } else if (pid == 0) { - execl("/bin/true", (char *) 0); - fprintf(stderr,"%s: exec /bin/true failed\n", argv[0]); + execl("/usr/bin/true", (char *) 0); + fprintf(stderr,"%s: exec /usr/bin/true failed\n", argv[0]); exit(1); } else { if (waitpid(pid, NULL, 0) < 0) { diff --git a/commands/Makefile b/commands/Makefile index 29579854d..99de1e54b 100644 --- a/commands/Makefile +++ b/commands/Makefile @@ -35,7 +35,7 @@ SUBDIR= add_route arp ash at backup btrace \ atnormalize dosread fdisk loadfont \ autopart part partition playwave \ recwave repartition screendump \ - command echo expr false getopts read test true \ + command echo expr getopts read test \ umask wait .if ${MACHINE_ARCH} == "earm" diff --git a/commands/false/Makefile b/commands/false/Makefile deleted file mode 100644 index a109e84d3..000000000 --- a/commands/false/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -SCRIPTS= false.sh -BINDIR= /bin -MAN= - -.include diff --git a/commands/false/false.sh b/commands/false/false.sh deleted file mode 120000 index f9350d4b6..000000000 --- a/commands/false/false.sh +++ /dev/null @@ -1 +0,0 @@ -../shared/builtin.sh \ No newline at end of file diff --git a/commands/shared/README b/commands/shared/README index 246c4f7ff..1a885d781 100644 --- a/commands/shared/README +++ b/commands/shared/README @@ -9,11 +9,9 @@ At this moment it is installed as the following commands: /bin/command /bin/echo /bin/expr -/bin/false /bin/getopts /bin/read /bin/test -/bin/true /bin/umask /bin/wait diff --git a/commands/true/Makefile b/commands/true/Makefile deleted file mode 100644 index 6c3b4da8d..000000000 --- a/commands/true/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -SCRIPTS= true.sh -BINDIR= /bin -MAN= - -.include diff --git a/commands/true/true.sh b/commands/true/true.sh deleted file mode 120000 index f9350d4b6..000000000 --- a/commands/true/true.sh +++ /dev/null @@ -1 +0,0 @@ -../shared/builtin.sh \ No newline at end of file diff --git a/distrib/sets/lists/minix/mi b/distrib/sets/lists/minix/mi index 96d26bc03..b5474148b 100644 --- a/distrib/sets/lists/minix/mi +++ b/distrib/sets/lists/minix/mi @@ -22,7 +22,6 @@ ./bin/echo minix-sys ./bin/ed minix-sys ./bin/expr minix-sys -./bin/false minix-sys ./bin/getopts minix-sys ./bin/intr minix-sys ./bin/kill minix-sys @@ -50,7 +49,6 @@ ./bin/sysenv minix-sys ./bin/tar minix-sys ./bin/test minix-sys -./bin/true minix-sys ./bin/umask minix-sys ./bin/umount minix-sys ./bin/updateboot minix-sys @@ -291,6 +289,7 @@ ./usr/bin/ex minix-sys ./usr/bin/expand minix-sys ./usr/bin/factor minix-sys +./usr/bin/false minix-sys ./usr/bin/fbdctl minix-sys ./usr/bin/fdisk minix-sys ./usr/bin/fetch minix-sys @@ -493,6 +492,7 @@ ./usr/bin/touch minix-sys ./usr/bin/tput minix-sys ./usr/bin/tr minix-sys +./usr/bin/true minix-sys ./usr/bin/truncate minix-sys ./usr/bin/tsort minix-sys ./usr/bin/ttn minix-sys @@ -2038,6 +2038,7 @@ ./usr/man/man1/export.1 minix-sys ./usr/man/man1/expr.1 minix-sys ./usr/man/man1/factor.1 minix-sys +./usr/man/man1/false.1 minix-sys ./usr/man/man1/fetch.1 minix-sys ./usr/man/man1/fgrep.1 minix-sys ./usr/man/man1/file.1 minix-sys diff --git a/etc/master.passwd b/etc/master.passwd index 86fd414d6..c6307edff 100644 --- a/etc/master.passwd +++ b/etc/master.passwd @@ -11,7 +11,7 @@ server:*:11:11::0:0:OS Servers:/:/bin/sh service:*:12:12::0:0:System Services:/:/bin/sh sshd:*:22:22::0:0:sshd:/:/bin/sh smtpd:*:25:25::0:0:smtpd:/:/bin/sh -postfix:*:27:27::0:0:postfix:/usr/var/spool/postfix:/bin/false -postgres:*:30:30::0:0:postgresql:/:/bin/false +postfix:*:27:27::0:0:postfix:/usr/var/spool/postfix:/usr/bin/false +postgres:*:30:30::0:0:postgresql:/:/usr/bin/false games:*:9998:13::0:0:games:/:/bin/sh nobody:*:9999:39::0:0:Unprivileged user:/tmp:/bin/sh diff --git a/man/man1/Makefile b/man/man1/Makefile index 4a7bdeaab..394021eb9 100644 --- a/man/man1/Makefile +++ b/man/man1/Makefile @@ -18,7 +18,7 @@ MAN= ash.1 at.1 \ shar.1 sleep.1 spell.1 \ svc.1 svrctl.1 \ synctree.1 sysenv.1 sz.1 tail.1 telnet.1 template.1 \ - term.1 termcap.1 tget.1 time.1 true.1 \ + term.1 termcap.1 tget.1 time.1 \ truncate.1 umount.1 \ uud.1 uue.1 vol.1 whereis.1 which.1 \ yap.1 linkfarm.1 pkg_view.1 diff --git a/man/man1/true.1 b/man/man1/true.1 deleted file mode 100644 index ab4b835af..000000000 --- a/man/man1/true.1 +++ /dev/null @@ -1,24 +0,0 @@ -.TH TRUE 1 -.SH NAME -true, false \- exit with the value true or false -.SH SYNOPSIS -\fBtrue\fR -.br -\fBfalse\fR -.SH EXAMPLES -.ta +20n -.ft B -.nf -while true \fR# List the directory until DEL is hit\fP -do ls \-l -done -.fi -.ft P -.SH DESCRIPTION -These commands return the value -.I true -or -.I false . -They are used for shell programming. -.SH "SEE ALSO" -.BR sh (1). diff --git a/releasetools/nbsd_ports b/releasetools/nbsd_ports index 5f8671dcb..74478c986 100644 --- a/releasetools/nbsd_ports +++ b/releasetools/nbsd_ports @@ -177,6 +177,7 @@ 2013/12/1 12:00:00,usr.bin/du 2013/12/1 12:00:00,usr.bin/expand 2013/12/1 12:00:00,usr.bin/env +2013/12/1 12:00:00,usr.bin/false 2013/12/1 12:00:00,usr.bin/finger 2013/12/1 12:00:00,usr.bin/fold 2013/12/1 12:00:00,usr.bin/fpr @@ -243,6 +244,7 @@ 2013/12/1 12:00:00,usr.bin/tic 2013/12/1 12:00:00,usr.bin/tput 2013/12/1 12:00:00,usr.bin/tr +2013/12/1 12:00:00,usr.bin/true 2013/12/1 12:00:00,usr.bin/tsort 2013/12/1 12:00:00,usr.bin/tty 2013/12/1 12:00:00,usr.bin/ul diff --git a/usr.bin/Makefile b/usr.bin/Makefile index 7a53784d2..242e3a056 100644 --- a/usr.bin/Makefile +++ b/usr.bin/Makefile @@ -10,7 +10,7 @@ SUBDIR= asa \ column comm csplit ctags cut \ deroff dirname du \ env expand \ - finger fold fpr from \ + false finger fold fpr from \ fsplit ftp genassym getopt \ head hexdump id indent infocmp join jot \ lam last ldd leave \ @@ -26,7 +26,7 @@ SUBDIR= asa \ sdiff sed seq shlock \ shuffle sort split stat su \ tee tic tput \ - tr tsort tty ul uname unexpand unifdef \ + tr true tsort tty ul uname unexpand unifdef \ uniq units unvis unzip users \ uuidgen vis \ \ diff --git a/usr.bin/false/Makefile b/usr.bin/false/Makefile new file mode 100644 index 000000000..d3d48308c --- /dev/null +++ b/usr.bin/false/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.9 1997/03/24 21:59:34 christos Exp $ +# from: @(#)Makefile 5.3 (Berkeley) 5/11/90 + +MAN= false.1 +SCRIPTS=false.sh + +.include diff --git a/usr.bin/false/false.1 b/usr.bin/false/false.1 new file mode 100644 index 000000000..175b67a1a --- /dev/null +++ b/usr.bin/false/false.1 @@ -0,0 +1,56 @@ +.\" $NetBSD: false.1,v 1.8 2003/08/07 11:13:40 agc Exp $ +.\" +.\" Copyright (c) 1983, 1990 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the Institute of Electrical and Electronics Engineers, Inc. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" from: @(#)false.1 6.6 (Berkeley) 7/24/91 +.\" $NetBSD: false.1,v 1.8 2003/08/07 11:13:40 agc Exp $ +.\" +.Dd July 24, 1991 +.Dt FALSE 1 +.Os +.Sh NAME +.Nm false +.Nd return false value +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +The +.Nm +utility always exits with a nonzero exit code. +.Sh SEE ALSO +.Xr csh 1 , +.Xr sh 1 , +.Xr true 1 +.Sh STANDARDS +The +.Nm +utility conforms to +.St -p1003.2-92 . diff --git a/usr.bin/false/false.sh b/usr.bin/false/false.sh new file mode 100644 index 000000000..2526efb65 --- /dev/null +++ b/usr.bin/false/false.sh @@ -0,0 +1,2 @@ +#! /bin/sh +exit 1 diff --git a/usr.bin/true/Makefile b/usr.bin/true/Makefile new file mode 100644 index 000000000..4fb2d7c0e --- /dev/null +++ b/usr.bin/true/Makefile @@ -0,0 +1,7 @@ +# $NetBSD: Makefile,v 1.9 1997/03/24 21:59:56 christos Exp $ +# from: @(#)Makefile 5.3 (Berkeley) 5/11/90 + +MAN= true.1 +SCRIPTS=true.sh + +.include diff --git a/usr.bin/true/true.1 b/usr.bin/true/true.1 new file mode 100644 index 000000000..58295600e --- /dev/null +++ b/usr.bin/true/true.1 @@ -0,0 +1,56 @@ +.\" $NetBSD: true.1,v 1.7 2003/08/07 11:16:48 agc Exp $ +.\" +.\" Copyright (c) 1983, 1985, 1990 The Regents of the University of California. +.\" All rights reserved. +.\" +.\" This code is derived from software contributed to Berkeley by +.\" the Institute of Electrical and Electronics Engineers, Inc. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" 3. Neither the name of the University nor the names of its contributors +.\" may be used to endorse or promote products derived from this software +.\" without specific prior written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" from: @(#)true.1 6.4 (Berkeley) 6/27/91 +.\" $NetBSD: true.1,v 1.7 2003/08/07 11:16:48 agc Exp $ +.\" +.Dd June 27, 1991 +.Dt TRUE 1 +.Os +.Sh NAME +.Nm true +.Nd return true value +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +The +.Nm +utility always returns with exit code zero. +.Sh SEE ALSO +.Xr csh 1 , +.Xr false 1 , +.Xr sh 1 +.Sh STANDARDS +The +.Nm +utility conforms to +.St -p1003.2-92 . diff --git a/usr.bin/true/true.sh b/usr.bin/true/true.sh new file mode 100644 index 000000000..20f87efe1 --- /dev/null +++ b/usr.bin/true/true.sh @@ -0,0 +1,2 @@ +#! /bin/sh +exit 0 -- 2.44.0