3 DISTNAME= bootstrap-install-sh-0.0
9 MAINTAINER= jlam@NetBSD.org
10 COMMENT= Test functionality of bootstrap install-sh
17 INSTALL_SH= ${WRKSRC}/install-sh
21 ${CP} ${FILESDIR}/install-sh ${INSTALL_SH}
22 ${CHMOD} +x ${INSTALL_SH}
24 # create one directory using -d
27 ${INSTALL_SH} -d ${WRKSRC}/d1_dir
28 ${TEST} -d ${WRKSRC}/d1_dir || exit 1
30 # create two directories using -d
33 ${INSTALL_SH} -d ${WRKSRC}/d2_dir1 ${WRKSRC}/d2_dir2
34 ( ${TEST} -d ${WRKSRC}/d2_dir1 && \
35 ${TEST} -d ${WRKSRC}/d2_dir2 ) || exit 1
37 # create three directories using -d
40 ${INSTALL_SH} -d ${WRKSRC}/d3_dir1 ${WRKSRC}/d3_dir2 ${WRKSRC}/d3_dir3
41 ( ${TEST} -d ${WRKSRC}/d3_dir1 && \
42 ${TEST} -d ${WRKSRC}/d3_dir2 && \
43 ${TEST} -d ${WRKSRC}/d3_dir3 ) || exit 1
45 # copy one existing file to nonexistent file
48 ${ECHO} "Test data" > ${WRKSRC}/c1_file1
49 ${INSTALL_SH} -c ${WRKSRC}/c1_file1 ${WRKSRC}/c1_file2
50 ${CMP} ${WRKSRC}/c1_file1 ${WRKSRC}/c1_file2 || exit 1
52 # copy one existing file into existing directory
55 ${ECHO} "Test data" > ${WRKSRC}/c2_file
56 ${MKDIR} ${WRKSRC}/c2_dir
57 ${INSTALL_SH} -c ${WRKSRC}/c2_file ${WRKSRC}/c2_dir
58 ${CMP} -s ${WRKSRC}/c2_file ${WRKSRC}/c2_dir/c2_file || exit 1
60 # copy two existing files into existing directory
63 ${ECHO} "Test data 1" > ${WRKSRC}/c3_file1
64 ${ECHO} "Test data 2" > ${WRKSRC}/c3_file2
65 ${MKDIR} ${WRKSRC}/c3_dir
66 ${INSTALL_SH} -c ${WRKSRC}/c3_file1 ${WRKSRC}/c3_file2 ${WRKSRC}/c3_dir
67 ( ${CMP} -s ${WRKSRC}/c3_file1 ${WRKSRC}/c3_dir/c3_file1 && \
68 ${CMP} -s ${WRKSRC}/c3_file2 ${WRKSRC}/c3_dir/c3_file2 ) || exit 1
70 # copy three existing files into existing directory
73 ${ECHO} "Test data 1" > ${WRKSRC}/c4_file1
74 ${ECHO} "Test data 2" > ${WRKSRC}/c4_file2
75 ${ECHO} "Test data 3" > ${WRKSRC}/c4_file3
76 ${MKDIR} ${WRKSRC}/c4_dir
77 ${INSTALL_SH} -c ${WRKSRC}/c4_file1 ${WRKSRC}/c4_file2 \
78 ${WRKSRC}/c4_file3 ${WRKSRC}/c4_dir
79 ( ${CMP} -s ${WRKSRC}/c4_file1 ${WRKSRC}/c4_dir/c4_file1 && \
80 ${CMP} -s ${WRKSRC}/c4_file2 ${WRKSRC}/c4_dir/c4_file2 && \
81 ${CMP} -s ${WRKSRC}/c4_file3 ${WRKSRC}/c4_dir/c4_file3 ) || exit 1
83 MODES= 0 1 2 3 4 5 6 7
93 # test mode permissions on installing file to nonexisting file
99 ${ECHO} "Test data" > ${WRKSRC}/m${_u_}${_g_}${_o_}_file1
100 ${INSTALL_SH} -m ${_u_}${_g_}${_o_} ${WRKSRC}/m${_u_}${_g_}${_o_}_file1 ${WRKSRC}/m${_u_}${_g_}${_o_}_file2
101 ${LS} -l ${WRKSRC}/m${_u_}${_g_}${_o_}_file2 | \
104 -${MODE_${_u_}}${MODE_${_g_}}${MODE_${_o_}}) \
113 # test mode permissions on creating directory
117 . for _g_ in ${MODES}
118 . for _o_ in ${MODES}
119 ${INSTALL_SH} -m 357 -d ${WRKSRC}/m357_dir
120 ${INSTALL_SH} -m ${_u_}${_g_}${_o_} -d ${WRKSRC}/m${_u_}${_g_}${_o_}_dir
121 ${LS} -l ${WRKSRC}/m${_u_}${_g_}${_o_}_file2 | \
124 -${MODE_${_u_}}${MODE_${_g_}}${MODE_${_o_}}) \
134 ${TEST} "`${ECHO} ${WRKSRC}/*`" = "${WRKSRC}/*" || \
135 ${CHMOD} -R u+rwx ${WRKSRC}/*
137 .include "../../mk/bsd.pkg.mk"