[Midnightbsd-cvs] src [11198] trunk/bin/mkdir: sync with freebsd
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Sun Jul 1 11:51:26 EDT 2018
Revision: 11198
http://svnweb.midnightbsd.org/src/?rev=11198
Author: laffer1
Date: 2018-07-01 11:51:25 -0400 (Sun, 01 Jul 2018)
Log Message:
-----------
sync with freebsd
Modified Paths:
--------------
trunk/bin/mkdir/Makefile
trunk/bin/mkdir/mkdir.1
trunk/bin/mkdir/mkdir.c
Added Paths:
-----------
trunk/bin/mkdir/tests/
trunk/bin/mkdir/tests/Makefile
trunk/bin/mkdir/tests/mkdir_test.sh
Property Changed:
----------------
trunk/bin/mkdir/mkdir.1
Modified: trunk/bin/mkdir/Makefile
===================================================================
--- trunk/bin/mkdir/Makefile 2018-07-01 15:50:08 UTC (rev 11197)
+++ trunk/bin/mkdir/Makefile 2018-07-01 15:51:25 UTC (rev 11198)
@@ -1,7 +1,13 @@
+# $MidnightBSD$
# @(#)Makefile 8.1 (Berkeley) 5/31/93
-# $FreeBSD: src/bin/mkdir/Makefile,v 1.9 2005/01/26 06:48:17 ssouhlal Exp $
-# $MidnightBSD$
+# $FreeBSD: stable/10/bin/mkdir/Makefile 326332 2017-11-28 18:18:39Z asomers $
+.include <bsd.own.mk>
+
+PACKAGE=runtime
PROG= mkdir
+HAS_TESTS=
+SUBDIR.${MK_TESTS}+= tests
+
.include <bsd.prog.mk>
Modified: trunk/bin/mkdir/mkdir.1
===================================================================
--- trunk/bin/mkdir/mkdir.1 2018-07-01 15:50:08 UTC (rev 11197)
+++ trunk/bin/mkdir/mkdir.1 2018-07-01 15:51:25 UTC (rev 11198)
@@ -1,3 +1,4 @@
+.\" $MidnightBSD$
.\"-
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -30,10 +31,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)mkdir.1 8.2 (Berkeley) 1/25/94
-.\" $FreeBSD: src/bin/mkdir/mkdir.1,v 1.21 2005/01/16 16:41:57 ru Exp $
-.\" $MidnightBSD: src/bin/mkdir/mkdir.1,v 1.2 2006/07/19 13:55:36 laffer1 Exp $
+.\" $FreeBSD: stable/10/bin/mkdir/mkdir.1 248342 2013-03-15 20:12:54Z joel $
.\"
-.Dd January 25, 1994
+.Dd March 15, 2013
.Dt MKDIR 1
.Os
.Sh NAME
@@ -88,6 +88,23 @@
The user must have write permission in the parent directory.
.Sh EXIT STATUS
.Ex -std
+.Sh EXAMPLES
+Create a directory named
+.Pa foobar :
+.Pp
+.Dl $ mkdir foobar
+.Pp
+Create a directory named
+.Pa foobar
+and set its file mode to 700:
+.Pp
+.Dl $ mkdir -m 700 foobar
+.Pp
+Create a directory named
+.Pa cow/horse/monkey ,
+creating any non-existent intermediate directories as necessary:
+.Pp
+.Dl $ mkdir -p cow/horse/monkey
.Sh COMPATIBILITY
The
.Fl v
Property changes on: trunk/bin/mkdir/mkdir.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/bin/mkdir/mkdir.c
===================================================================
--- trunk/bin/mkdir/mkdir.c 2018-07-01 15:50:08 UTC (rev 11197)
+++ trunk/bin/mkdir/mkdir.c 2018-07-01 15:51:25 UTC (rev 11198)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
/*-
* Copyright (c) 1983, 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -26,7 +27,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
-/* $FreeBSD: src/bin/mkdir/mkdir.c,v 1.32 2005/02/09 17:37:38 ru Exp $ */
#if 0
#ifndef lint
@@ -40,7 +40,7 @@
#endif /* not lint */
#endif
#include <sys/cdefs.h>
-__MBSDID("$MidnightBSD$");
+__FBSDID("$FreeBSD: stable/10/bin/mkdir/mkdir.c 249996 2013-04-27 21:59:43Z eadler $");
#include <sys/types.h>
#include <sys/stat.h>
Added: trunk/bin/mkdir/tests/Makefile
===================================================================
--- trunk/bin/mkdir/tests/Makefile (rev 0)
+++ trunk/bin/mkdir/tests/Makefile 2018-07-01 15:51:25 UTC (rev 11198)
@@ -0,0 +1,6 @@
+# $MidnightBSD$
+# $FreeBSD: stable/10/bin/mkdir/tests/Makefile 323275 2017-09-07 16:54:47Z asomers $
+
+ATF_TESTS_SH+= mkdir_test
+
+.include <bsd.test.mk>
Property changes on: trunk/bin/mkdir/tests/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: trunk/bin/mkdir/tests/mkdir_test.sh
===================================================================
--- trunk/bin/mkdir/tests/mkdir_test.sh (rev 0)
+++ trunk/bin/mkdir/tests/mkdir_test.sh 2018-07-01 15:51:25 UTC (rev 11198)
@@ -0,0 +1,61 @@
+#
+# Copyright 2017 Shivansh Rai
+# All rights reserved.
+#
+# 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.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR 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 AUTHOR 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.
+#
+# $FreeBSD: stable/10/bin/mkdir/tests/mkdir_test.sh 323275 2017-09-07 16:54:47Z asomers $
+# $MidnightBSD$
+
+usage_output='usage: mkdir'
+
+atf_test_case invalid_usage
+invalid_usage_head()
+{
+ atf_set "descr" "Verify that an invalid usage with a supported option produces a valid error message"
+}
+
+invalid_usage_body()
+{
+ atf_check -s not-exit:0 -e inline:"mkdir: option requires an argument -- m
+usage: mkdir [-pv] [-m mode] directory_name ...
+" mkdir -m
+ atf_check -s not-exit:0 -e match:"$usage_output" mkdir -p
+ atf_check -s not-exit:0 -e match:"$usage_output" mkdir -v
+}
+
+atf_test_case no_arguments
+no_arguments_head()
+{
+ atf_set "descr" "Verify that mkdir(1) fails and generates a valid usage message when no arguments are supplied"
+}
+
+no_arguments_body()
+{
+ atf_check -s not-exit:0 -e match:"$usage_output" mkdir
+}
+
+atf_init_test_cases()
+{
+ atf_add_test_case invalid_usage
+ atf_add_test_case no_arguments
+}
Property changes on: trunk/bin/mkdir/tests/mkdir_test.sh
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
More information about the Midnightbsd-cvs
mailing list