| @@ -1,16 +1,16 @@ | | | @@ -1,16 +1,16 @@ |
1 | #!/bin/sh | | 1 | #!/bin/sh |
2 | # | | 2 | # |
3 | # $NetBSD: maketars,v 1.70 2009/11/30 16:13:23 uebayasi Exp $ | | 3 | # $NetBSD: maketars,v 1.71 2009/12/03 12:44:57 apb Exp $ |
4 | # | | 4 | # |
5 | # Make release tar files for some or all lists. Usage: | | 5 | # Make release tar files for some or all lists. Usage: |
6 | # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir] | | 6 | # maketars [-b] [-x] [-i installdir] [-a arch] [-m machine] [-s setsdir] |
7 | # [-M metalog] [-N etcdir] [-d destdir] [-t tardir] [setname ...] | | 7 | # [-M metalog] [-N etcdir] [-d destdir] [-t tardir] [setname ...] |
8 | # | | 8 | # |
9 | # The default sets are "base comp etc games man misc tests text" | | 9 | # The default sets are "base comp etc games man misc tests text" |
10 | # The X sets are "xbase xcomp xetc xfont xserver" | | 10 | # The X sets are "xbase xcomp xetc xfont xserver" |
11 | # The extsrc sets are "extbase extcomp extetc" | | 11 | # The extsrc sets are "extbase extcomp extetc" |
12 | # | | 12 | # |
13 | # If '-i installdir' is given, copy the given sets to installdir | | 13 | # If '-i installdir' is given, copy the given sets to installdir |
14 | # (using pax -rw ...) instead of creating tar files. | | 14 | # (using pax -rw ...) instead of creating tar files. |
15 | # In this case, remove "etc", "xetc", and "extetc" from the list of default sets. | | 15 | # In this case, remove "etc", "xetc", and "extetc" from the list of default sets. |
16 | # | | 16 | # |
| @@ -151,26 +151,30 @@ cleanup() | | | @@ -151,26 +151,30 @@ cleanup() |
151 | trap - 0 | | 151 | trap - 0 |
152 | exit ${es} | | 152 | exit ${es} |
153 | } | | 153 | } |
154 | trap cleanup 0 2 3 13 # EXIT INT QUIT PIPE | | 154 | trap cleanup 0 2 3 13 # EXIT INT QUIT PIPE |
155 | | | 155 | |
156 | # | | 156 | # |
157 | # build the setfiles | | 157 | # build the setfiles |
158 | # | | 158 | # |
159 | | | 159 | |
160 | for setname in ${lists}; do | | 160 | for setname in ${lists}; do |
161 | ${HOST_SH} "${setsdir}/makeflist" -a "${MACHINE_ARCH}" -m "${MACHINE}" \ | | 161 | ${HOST_SH} "${setsdir}/makeflist" -a "${MACHINE_ARCH}" -m "${MACHINE}" \ |
162 | -s "${setsdir}" "${setname}" > "${SDIR}/flist.${setname}" \ | | 162 | -s "${setsdir}" "${setname}" > "${SDIR}/flist.${setname}" \ |
163 | || exit 1 | | 163 | || exit 1 |
| | | 164 | if ! [ -s "${SDIR}/flist.${setname}" ]; then |
| | | 165 | echo >&2 "makeflist output is empty for ${setname}" |
| | | 166 | exit 1 |
| | | 167 | fi |
164 | if [ -n "${metalog}" ]; then | | 168 | if [ -n "${metalog}" ]; then |
165 | ${setfilesonly} && msg "Creating ${setlistdir}/set.${setname}" | | 169 | ${setfilesonly} && msg "Creating ${setlistdir}/set.${setname}" |
166 | ${AWK} -f "${rundir}/getdirs.awk" "${SDIR}/flist.${setname}" \ | | 170 | ${AWK} -f "${rundir}/getdirs.awk" "${SDIR}/flist.${setname}" \ |
167 | > "${SDIR}/flist.${setname}.full" \ | | 171 | > "${SDIR}/flist.${setname}.full" \ |
168 | || exit 1 | | 172 | || exit 1 |
169 | ( | | 173 | ( |
170 | echo "/set uname=root gname=wheel" | | 174 | echo "/set uname=root gname=wheel" |
171 | ${AWK} -f "${rundir}/join.awk" \ | | 175 | ${AWK} -f "${rundir}/join.awk" \ |
172 | "${SDIR}/flist.${setname}.full" "${metalog}" | | 176 | "${SDIR}/flist.${setname}.full" "${metalog}" |
173 | echo "./etc/mtree/set.${setname} type=file mode=0444" | | 177 | echo "./etc/mtree/set.${setname} type=file mode=0444" |
174 | ) | ${MTREE} -CS -k all -R time -N "${etcdir}" \ | | 178 | ) | ${MTREE} -CS -k all -R time -N "${etcdir}" \ |
175 | > "${setlistdir}/set.${setname}" \ | | 179 | > "${setlistdir}/set.${setname}" \ |
176 | || exit 1 | | 180 | || exit 1 |