pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/regress/bootstrap-install-sh Add a test to verify that...
details: https://anonhg.NetBSD.org/pkgsrc/rev/e2f8432ed329
branches: trunk
changeset: 530683:e2f8432ed329
user: jlam <jlam%pkgsrc.org@localhost>
date: Wed Jul 04 19:18:12 2007 +0000
description:
Add a test to verify that nonexistent intermediate directories are
created with the proper permissions.
XXX sysutils/install-sh isn't quite right the same as /usr/bin/install
XXX because it ignores the umask for directory creation.
diffstat:
regress/bootstrap-install-sh/Makefile | 31 +++++++++++++++++++++++++++++--
1 files changed, 29 insertions(+), 2 deletions(-)
diffs (59 lines):
diff -r 9421014e8241 -r e2f8432ed329 regress/bootstrap-install-sh/Makefile
--- a/regress/bootstrap-install-sh/Makefile Wed Jul 04 15:21:16 2007 +0000
+++ b/regress/bootstrap-install-sh/Makefile Wed Jul 04 19:18:12 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2007/06/20 16:26:20 jlam Exp $
+# $NetBSD: Makefile,v 1.4 2007/07/04 19:18:12 jlam Exp $
DISTNAME= bootstrap-install-sh-0.0
CATEGORIES= regress
@@ -15,7 +15,7 @@
NO_INSTALL= yes
NO_PACKAGE= yes
-INSTALL_SH= ${WRKSRC}/install-sh
+INSTALL_SH?= ${WRKSRC}/install-sh
post-extract:
${CP} ${PKGSRCDIR}/sysutils/install-sh/files/install-sh.in ${WRKSRC}
@@ -48,6 +48,30 @@
${TEST} -d ${WRKSRC}/d3_dir2 && \
${TEST} -d ${WRKSRC}/d3_dir3 ) || exit 1
+# create one directory with several nonexistent intermediate directories
+regress: test-d4
+test-d4:
+ ${INSTALL_SH} -d -m 700 ${WRKSRC}/d4_comp1/d4_comp2/d4_comp3/d4_final
+ ${TEST} -d ${WRKSRC}/d4_comp1/d4_comp2/d4_comp3/d4_final || exit 1
+ ${FIND} ${WRKSRC}/d4_comp1 -type d -exec ${LS} -ld {} \; | \
+ while read a b; do \
+ case "$$b" in \
+ */d4_final) \
+ case "$$a" in \
+ d${MODE_7}${MODE_0}${MODE_0}) \
+ exit 0 ;; \
+ *) exit 1 ;; \
+ esac; \
+ ;; \
+ *) \
+ case "$$a" in \
+ ${MODE_DIR}) exit 0 ;; \
+ *) exit 1 ;; \
+ esac; \
+ ;; \
+ esac; \
+ done
+
# copy one existing file to nonexistent file
regress: test-c1
test-c1:
@@ -96,6 +120,9 @@
MODE_6= rw-
MODE_7= rwx
+# Convert ${PKGDIRMODE} into the appropriate "ls" output.
+MODE_DIR= d${MODE_${PKGDIRMODE:C/(.)(.)(.)/\1/}}${MODE_${PKGDIRMODE:C/(.)(.)(.)/\2/}}${MODE_${PKGDIRMODE:C/(.)(.)(.)/\3/}}
+
# test mode permissions on installing file to nonexisting file
regress: test-m1
test-m1:
Home |
Main Index |
Thread Index |
Old Index