]> diplodocus.org Git - nmh/blob - SPECS/build-nmh-cygwin
Skip the Cygwin package (.bz2) file when searching for the input (.gz) file.
[nmh] / SPECS / build-nmh-cygwin
1 #!/bin/bash
2 #
3 # ==========================================================================
4 # Based on Cygwin generic package build script, customized for nmh.
5 # Relies on nmh VERSION file.
6 #
7 # This script is incompatible with directory names that contain spaces, etc.
8 # To fix that, a whole bunch of shell variables need to be wrapped with "".
9 # ==========================================================================
10 #
11 # Generic package build script
12 #
13 # $Id: generic-build-script,v 1.47 2006/02/01 14:01:14 igor Exp $
14 #
15 # Package maintainers: if the original source is not distributed as a
16 # (possibly compressed) tarball, set the value of ${src_orig_pkg_name},
17 # and redefine the unpack() helper function appropriately.
18 # Also, if the Makefile rule to run the test suite is not "check", change
19 # the definition of ${test_rule} below.
20
21 # find out where the build script is located
22 tdir=`echo "$0" | sed 's%[\\/][^\\/][^\\/]*$%%'`
23 test "x$tdir" = "x$0" && tdir=.
24 scriptdir=`cd $tdir; pwd`
25 # find src directory.
26 # If scriptdir ends in SPECS, then topdir is $scriptdir/..
27 # If scriptdir ends in CYGWIN-PATCHES, then topdir is $scriptdir/../..
28 # Otherwise, we assume that topdir = scriptdir
29 topdir1=`echo ${scriptdir} | sed 's%/SPECS$%%'`
30 topdir2=`echo ${scriptdir} | sed 's%/CYGWIN-PATCHES$%%'`
31 if [ "x$topdir1" != "x$scriptdir" ] ; then # SPECS
32 topdir=`cd ${scriptdir}/..; pwd`
33 else
34 if [ "x$topdir2" != "x$scriptdir" ] ; then # CYGWIN-PATCHES
35 topdir=`cd ${scriptdir}/../..; pwd`
36 else
37 topdir=`cd ${scriptdir}; pwd`
38 fi
39 fi
40
41 # Change from generic-build-script: save pwd for later use.
42 pwd=`pwd`
43
44 # Change from generic-build-script: base version on contents of
45 # VERSION instead of script name. Looks first for VERSION in
46 # current directory, then in $topdir.
47 test -e VERSION && version=VERSION || version="${topdir}/VERSION"
48 if ! test -e "${version}"; then
49 echo "$0: need VERSION file"
50 exit 1
51 fi
52
53 tscriptname=nmh-`cat "${version}"`
54 # Change from generic-build-script: allow + in addition to - between
55 # VER and REL, e.g., 1.5+dev.
56 export PKG=`echo $tscriptname | sed -e 's/\-[^\-]*[+-][^+-]*$//'`
57 export VER=`echo $tscriptname | sed -e "s/${PKG}\-//" -e 's/[+-][^+-]*$//'`
58 export REL=`echo $tscriptname | sed -e "s/${PKG}\-${VER}\([+-]\)/\1/"`
59 # BASEPKG refers to the upstream base package
60 # SHORTPKG refers to the Cygwin package
61 # Normally, these are identical, but if the Cygwin package name is different
62 # from the upstream package name, you will want to redefine BASEPKG.
63 # Example: For Apache 2, BASEPKG=httpd-2.x.xx but SHORTPKG=apache2-2.x.xx
64 #
65 # Change from generic-build-script: added -${REL} to BASEPKG.
66 export BASEPKG=${PKG}-${VER}${REL}
67 export SHORTPKG=${PKG}-${VER}
68 export FULLPKG=${SHORTPKG}${REL}
69
70 # determine correct decompression option and tarball filename
71 export src_orig_pkg_name=
72 if [ -e "${src_orig_pkg_name}" ] ; then
73 export opt_decomp=? # Make sure tar punts if unpack() is not redefined
74 # Change from generic-build-script: ${BASEPKG}.tar.bz2 is an output of
75 # this script, so don't trip over it on a rerun.
76 # elif [ -e ${BASEPKG}.tar.bz2 ] ; then
77 # export opt_decomp=j
78 # export src_orig_pkg_name=${BASEPKG}.tar.bz2
79 elif [ -e ${BASEPKG}.tar.gz ] ; then
80 export opt_decomp=z
81 export src_orig_pkg_name=${BASEPKG}.tar.gz
82 elif [ -e ${BASEPKG}.tgz ] ; then
83 export opt_decomp=z
84 export src_orig_pkg_name=${BASEPKG}.tgz
85 elif [ -e ${BASEPKG}.tar ] ; then
86 export opt_decomp=
87 export src_orig_pkg_name=${BASEPKG}.tar
88 else
89 # Change from generic-build-script: build the tarball if it doesn't exist.
90 (cd "${topdir}" && make dist)
91 if [ -e "${topdir}/${BASEPKG}.tar.gz" ] ; then
92 export opt_decomp=z
93 export src_orig_pkg_name=${BASEPKG}.tar.gz
94 else
95 echo "Cannot find PKG:${PKG} VER:${VER} REL:${REL}. Rename $0 to"
96 echo "something more appropriate, and try again."
97 exit 1
98 fi
99 fi
100
101 export src_orig_pkg=${topdir}/${src_orig_pkg_name}
102
103 # determine correct names for generated files
104 export src_pkg_name=${FULLPKG}-src.tar.bz2
105 export src_patch_name=${FULLPKG}.patch
106 export bin_pkg_name=${FULLPKG}.tar.bz2
107 export log_pkg_name=${FULLPKG}-BUILDLOGS.tar.bz2
108
109 export configurelogname=${FULLPKG}-CONFIGURE.LOG
110 export makelogname=${FULLPKG}-MAKE.LOG
111 export checklogname=${FULLPKG}-CHECK.LOG
112 export installlogname=${FULLPKG}-INSTALL.LOG
113
114 # Change from generic-build-script: put src_pkg and bin_pkg in current
115 # directory.
116 export src_pkg=${pwd}/${src_pkg_name}
117 export src_patch="${topdir}"/${src_patch_name}
118 export bin_pkg=${pwd}/${bin_pkg_name}
119 export srcdir="${topdir}"/${BASEPKG}
120 export objdir=${srcdir}/.build
121 export instdir=${srcdir}/.inst
122 export srcinstdir=${srcdir}/.sinst
123 export buildlogdir=${srcdir}/.buildlogs
124 export configurelogfile=${srcinstdir}/${configurelogname}
125 export makelogfile=${srcinstdir}/${makelogname}
126 export checklogfile=${srcinstdir}/${checklogname}
127 export installlogfile=${srcinstdir}/${installlogname}
128
129 prefix=/usr
130 sysconfdir=/etc
131 localstatedir=/var
132 if [ -z "$MY_CFLAGS" ]; then
133 MY_CFLAGS="-O2"
134 fi
135 if [ -z "$MY_LDFLAGS" ]; then
136 MY_LDFLAGS=
137 fi
138
139 # Change from generic-build-script: removed ChangeLog because the nmh
140 # Makefile installs it.
141 export install_docs="\
142 ABOUT-NLS \
143 ANNOUNCE \
144 AUTHORS \
145 BUG-REPORTS \
146 CHANGES \
147 CONTRIBUTORS \
148 COPYING \
149 COPYRIGHT \
150 CREDITS \
151 CHANGELOG \
152 FAQ \
153 HOW-TO-CONTRIBUTE \
154 INSTALL \
155 KNOWNBUG \
156 LEGAL \
157 LICENSE \
158 NEWS \
159 NOTES \
160 PROGLIST \
161 README \
162 RELEASE_NOTES \
163 THANKS \
164 TODO \
165 USAGE \
166 "
167 export install_docs="`for i in ${install_docs}; do echo $i; done | sort -u`"
168 export test_rule=check
169 if [ -z "$SIG" ]; then
170 export SIG=0 # set to 1 to turn on signing by default
171 fi
172 # Sort in POSIX order.
173 export LC_ALL=C
174
175 # helper functions
176
177 # Provide help.
178 help() {
179 cat <<EOF
180 This is the cygwin packaging script for ${FULLPKG}.
181 Usage: $0 [<option>...] <action>...
182 Options are:
183 help, --help Print this message
184 version, --version Print the version message
185 with_logs, --logs Create logs of remaining steps
186 Actions are:
187 prep Unpack and patch into ${srcdir}
188 mkdirs Make hidden directories needed during build
189 conf, configure Configure the package (./configure)
190 reconf Rerun configure
191 build, make Build the package (make)
192 check, test Run the testsuite (make ${test_rule})
193 clean Remove built files (make clean)
194 install Install package to staging area (make install)
195 list List package contents
196 depend List package dependencies
197 strip Strip package executables
198 pkg, package Prepare the binary package ${bin_pkg_name}
199 mkpatch Prepare the patch file ${src_patch_name}
200 acceptpatch Copy patch file ${src_patch_name} to ${topdir}
201 spkg, src-package Prepare the source package ${src_pkg_name}
202 finish Remove source directory ${srcdir}
203 checksig Validate GPG signatures (requires gpg)
204 first Full run for spkg (mkdirs, spkg, finish)
205 almostall Full run for bin pkg, except for finish
206 all Full run for bin pkg
207 EOF
208 }
209
210 # Provide version of generic-build-script modified to make this script.
211 version() {
212 vers=`echo '$Revision: 1.47 $' | sed -e 's/Revision: //' -e 's/ *\\$//g'`
213 echo "$0 based on generic-build-script $vers"
214 }
215
216 # Unpacks the original package source archive into ./${BASEPKG}/.
217 # Change this if the original package was not tarred
218 # or if it doesn't unpack to a correct directory.
219 unpack() {
220 tar xv${opt_decomp}f "$1"
221 }
222
223 # Make the hidden directories used by this script.
224 mkdirs() {
225 (cd ${topdir} && \
226 rm -fr ${objdir} ${instdir} ${srcinstdir} && \
227 mkdir -p ${objdir} && \
228 mkdir -p ${instdir} && \
229 mkdir -p ${srcinstdir} )
230 }
231 mkdirs_log() {
232 (cd ${topdir} && \
233 mkdirs "$@" && \
234 rm -fr ${buildlogdir} && \
235 mkdir -p ${buildlogdir} )
236 }
237
238 # Unpack the original tarball, and get everything set up for this script.
239 # Change from generic-build-script: cd to ${srcdir} instead of ${topdir}.
240 # Change from generic-build-script: use -p1 instead of -p0 patch option.
241 prep() {
242 (cd ${topdir} && \
243 unpack ${src_orig_pkg} && \
244 cd ${srcdir} && \
245 if [ -f ${src_patch} ] ; then \
246 patch -Z -p1 < ${src_patch} ;\
247 fi && \
248 mkdirs )
249 }
250 prep_log() {
251 prep "$@" && \
252 mkdirs_log && \
253 if [ -f ${topdir}/${log_pkg_name} ] ; then \
254 # Change from generic-build-script: do the following in subshell
255 # so that cd isn't permanent.
256 (cd ${buildlogdir} && \
257 tar xvjf "${topdir}"/${log_pkg_name})
258 fi
259 }
260
261 # Configure the package.
262 conf() {
263 (cd ${objdir} && \
264 CFLAGS="${MY_CFLAGS}" LDFLAGS="${MY_LDFLAGS}" \
265 ${srcdir}/configure \
266 --srcdir=${srcdir} --prefix="${prefix}" \
267 --exec-prefix='${prefix}' --sysconfdir="${sysconfdir}" \
268 --libdir='${prefix}/lib' --includedir='${prefix}/include' \
269 --mandir='${prefix}/share/man' --infodir='${prefix}/share/info' \
270 --libexecdir='${sbindir}' --localstatedir="${localstatedir}" \
271 --datadir='${prefix}/share' )
272 }
273 conf_log() {
274 conf "$@" 2>&1 | tee ${configurelogfile}
275 return ${PIPESTATUS[0]}
276 }
277
278 # Rerun configure to pick up changes in the environment.
279 reconf() {
280 (cd ${topdir} && \
281 rm -fr ${objdir} && \
282 mkdir -p ${objdir} && \
283 conf )
284 }
285 reconf_log() {
286 reconf "$@" 2>&1 | tee ${configurelogfile}
287 return ${PIPESTATUS[0]}
288 }
289
290 # Run make.
291 build() {
292 (cd ${objdir} && \
293 make CFLAGS="${MY_CFLAGS}" )
294 }
295 build_log() {
296 build "$@" 2>&1 | tee ${makelogfile}
297 return ${PIPESTATUS[0]}
298 }
299
300 # Run the package testsuite.
301 check() {
302 (cd ${objdir} && \
303 make -k ${test_rule} )
304 }
305 check_log() {
306 check "$@" 2>&1 | tee ${checklogfile}
307 return ${PIPESTATUS[0]}
308 }
309
310 # Remove files created by configure and make.
311 clean() {
312 (cd ${objdir} && \
313 make clean )
314 }
315
316 # Install the package, with DESTDIR set to '.inst'.
317 # Change from generic-build-script: added ":;" after "find ... | gzip"
318 # because it returns non-zero status.
319 install() {
320 (cd ${objdir} && \
321 rm -fr ${instdir}/* && \
322 make install DESTDIR=${instdir} && \
323 for f in ${prefix}/share/info/dir ${prefix}/info/dir ; do \
324 if [ -f ${instdir}${f} ] ; then \
325 rm -f ${instdir}${f} ; \
326 fi ;\
327 done &&\
328 for d in ${prefix}/share/doc/${SHORTPKG} ${prefix}/share/doc/Cygwin ; do \
329 if [ ! -d ${instdir}${d} ] ; then \
330 mkdir -p ${instdir}${d} ;\
331 fi ;\
332 done &&\
333 if [ -d ${instdir}${prefix}/share/info ] ; then \
334 find ${instdir}${prefix}/share/info -name "*.info" | xargs -r gzip -q ; \
335 fi && \
336 if [ -d ${instdir}${prefix}/share/man ] ; then \
337 find ${instdir}${prefix}/share/man -name "*.1" -o -name "*.3" -o \
338 -name "*.3x" -o -name "*.3pm" -o -name "*.5" -o -name "*.6" -o \
339 -name "*.7" -o -name "*.8" | xargs -r gzip -q ; :; \
340 fi && \
341 templist="" && \
342 for fp in ${install_docs} ; do \
343 case "$fp" in \
344 */) templist="$templist `find ${srcdir}/$fp -type f`" ;;
345 *) for f in ${srcdir}/$fp ; do \
346 if [ -f $f ] ; then \
347 templist="$templist $f"; \
348 fi ; \
349 done ;; \
350 esac ; \
351 done && \
352 if [ ! "x$templist" = "x" ]; then \
353 /usr/bin/install -m 644 $templist \
354 ${instdir}${prefix}/share/doc/${SHORTPKG} ; \
355 fi && \
356 if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.README ]; then \
357 /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/${PKG}.README \
358 ${instdir}${prefix}/share/doc/Cygwin/${SHORTPKG}.README ; \
359 elif [ -f ${srcdir}/CYGWIN-PATCHES/README ] ; then \
360 /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/README \
361 ${instdir}${prefix}/share/doc/Cygwin/${SHORTPKG}.README ; \
362 fi && \
363 if [ -f ${srcdir}/CYGWIN-PATCHES/${PKG}.sh ] ; then \
364 if [ ! -d ${instdir}${sysconfdir}/postinstall ]; then \
365 mkdir -p ${instdir}${sysconfdir}/postinstall ; \
366 fi && \
367 /usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/${PKG}.sh \
368 ${instdir}${sysconfdir}/postinstall/${PKG}.sh ; \
369 elif [ -f ${srcdir}/CYGWIN-PATCHES/postinstall.sh ] ; then \
370 if [ ! -d ${instdir}${sysconfdir}/postinstall ]; then \
371 mkdir -p ${instdir}${sysconfdir}/postinstall ; \
372 fi && \
373 /usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/postinstall.sh \
374 ${instdir}${sysconfdir}/postinstall/${PKG}.sh ; \
375 fi && \
376 if [ -f ${srcdir}/CYGWIN-PATCHES/preremove.sh ] ; then \
377 if [ ! -d ${instdir}${sysconfdir}/preremove ]; then \
378 mkdir -p ${instdir}${sysconfdir}/preremove ; \
379 fi && \
380 /usr/bin/install -m 755 ${srcdir}/CYGWIN-PATCHES/preremove.sh \
381 ${instdir}${sysconfdir}/preremove/${PKG}.sh ; \
382 fi &&
383 if [ -f ${srcdir}/CYGWIN-PATCHES/manifest.lst ] ; then
384 if [ ! -d ${instdir}${sysconfdir}/preremove ]; then
385 mkdir -p ${instdir}${sysconfdir}/preremove ;
386 fi &&
387 /usr/bin/install -m 644 ${srcdir}/CYGWIN-PATCHES/manifest.lst \
388 ${instdir}${sysconfdir}/preremove/${PKG}-manifest.lst ;
389 fi )
390 }
391 install_log() {
392 install "$@" 2>&1 | tee ${installlogfile}
393 return ${PIPESTATUS[0]}
394 }
395
396 # Strip all binaries.
397 strip() {
398 (cd ${instdir} && \
399 find . -name "*.dll" -or -name "*.exe" | xargs -r strip 2>&1 ; \
400 true )
401 }
402
403 # List all non-hidden files that belong to the package.
404 list() {
405 (cd ${instdir} && \
406 find . -name "*" ! -type d | sed 's%^\.% %' | sort ; \
407 true )
408 }
409
410 # List the static .dll dependencies of the package. This does not pick up
411 # dynamic dependencies (whether or not libtool was used), nor does it pick
412 # up program dependencies, such as system() depending on /bin/sh.
413 depend() {
414 (cd ${instdir} && \
415 find ${instdir} -name "*.exe" -o -name "*.dll" | xargs -r cygcheck | \
416 sed -ne '/^ [^ ]/ s,\\,/,gp' | sort -bu | \
417 xargs -r -n1 cygpath -u | xargs -r cygcheck -f | sed 's%^% %' | sort -u ; \
418 true )
419 }
420
421 # Build the binary package tarball.
422 pkg() {
423 (cd ${instdir} && \
424 tar cvjf ${bin_pkg} * )
425 }
426
427 # Compare the original tarball against cygwin modifications.
428 mkpatch() {
429 (cd ${srcdir} && \
430 find . -name "autom4te.cache" | xargs -r rm -rf ; \
431 unpack ${src_orig_pkg} && \
432 mv ${BASEPKG} ../${BASEPKG}-orig && \
433 cd ${topdir} && \
434 diff -urN -x '.build' -x '.inst' -x '.sinst' -x '.buildlogs' \
435 ${BASEPKG}-orig ${BASEPKG} > \
436 ${srcinstdir}/${src_patch_name} ; \
437 rm -rf ${BASEPKG}-orig )
438 }
439
440 # Note: maintainer-only functionality
441 acceptpatch() {
442 cp --backup=numbered ${srcinstdir}/${src_patch_name} ${topdir}
443 }
444
445 # Build the source tarball.
446 # Change from generic-build-script: added VERSION file.
447 spkg() {
448 (mkpatch && \
449 if [ "${SIG}" -eq 1 ] ; then \
450 name=${srcinstdir}/${src_patch_name} text="PATCH" sigfile ; \
451 fi && \
452 cp ${src_orig_pkg} ${srcinstdir}/${src_orig_pkg_name} && \
453 if [ -e ${src_orig_pkg}.sig ] ; then \
454 cp ${src_orig_pkg}.sig ${srcinstdir}/ ; \
455 fi && \
456 cp $0 ${srcinstdir}/`basename $0` && \
457 name=$0 text="SCRIPT" sigfile && \
458 if [ "${SIG}" -eq 1 ] ; then \
459 cp $0.sig ${srcinstdir}/ ; \
460 fi && \
461 cp "${version}" "${srcinstdir}" && \
462 cd ${srcinstdir} && \
463 tar cvjf ${src_pkg} * )
464 }
465 spkg_log() {
466 spkg "$@" && \
467 (cd ${srcinstdir} && \
468 if [ -e ${configurelogname} -o -e ${makelogname} -o \
469 -e ${checklogname} -o -e ${installlogname} ]; then
470 tar --ignore-failed-read -cvjf ${log_pkg_name} \
471 ${configurelogname} ${makelogname} ${checklogname} ${installlogname} && \
472 rm -f \
473 ${configurelogname} ${makelogname} ${checklogname} ${installlogname} ; \
474 fi && \
475 tar uvjf ${src_pkg} * )
476 }
477
478 # Clean up everything.
479 finish() {
480 rm -rf ${srcdir}
481 }
482
483 # Generate GPG signatures.
484 sigfile() {
485 if [ \( "${SIG}" -eq 1 \) -a \( -e $name \) -a \( \( ! -e $name.sig \) -o \( $name -nt $name.sig \) \) ]; then \
486 if [ -x /usr/bin/gpg ]; then \
487 echo "$text signature need to be updated"; \
488 rm -f $name.sig; \
489 /usr/bin/gpg --detach-sign $name; \
490 else \
491 echo "You need the gnupg package installed in order to make signatures."; \
492 fi; \
493 fi
494 }
495
496 # Validate GPG signatures.
497 checksig() {
498 if [ -x /usr/bin/gpg ]; then \
499 if [ -e ${src_orig_pkg}.sig ]; then \
500 echo "ORIGINAL PACKAGE signature follows:"; \
501 /usr/bin/gpg --verify ${src_orig_pkg}.sig ${src_orig_pkg}; \
502 else \
503 echo "ORIGINAL PACKAGE signature missing."; \
504 fi; \
505 if [ -e $0.sig ]; then \
506 echo "SCRIPT signature follows:"; \
507 /usr/bin/gpg --verify $0.sig $0; \
508 else \
509 echo "SCRIPT signature missing."; \
510 fi; \
511 if [ -e ${src_patch}.sig ]; then \
512 echo "PATCH signature follows:"; \
513 /usr/bin/gpg --verify ${src_patch}.sig ${src_patch}; \
514 else \
515 echo "PATCH signature missing."; \
516 fi; \
517 else
518 echo "You need the gnupg package installed in order to check signatures." ; \
519 fi
520 }
521
522 f_mkdirs=mkdirs
523 f_prep=prep
524 f_conf=conf
525 f_reconf=conf
526 f_build=build
527 f_check=check
528 f_install=install
529 f_spkg=spkg
530
531 enablelogging() {
532 f_mkdirs=mkdirs_log && \
533 f_prep=prep_log && \
534 f_conf=conf_log && \
535 f_reconf=reconf_log && \
536 f_build=build_log && \
537 f_check=check_log && \
538 f_install=install_log && \
539 f_spkg=spkg_log
540 }
541
542 while test -n "$1" ; do
543 case $1 in
544 help|--help) help ; STATUS=$? ;;
545 version|--version) version ; STATUS=$? ;;
546 with_logs|--logs) enablelogging ; STATUS=$? ;;
547 prep) $f_prep ; STATUS=$? ;;
548 mkdirs) $f_mkdirs ; STATUS=$? ;;
549 conf) $f_conf ; STATUS=$? ;;
550 configure) $f_conf ; STATUS=$? ;;
551 reconf) $f_reconf ; STATUS=$? ;;
552 build) $f_build ; STATUS=$? ;;
553 make) $f_build ; STATUS=$? ;;
554 check) $f_check ; STATUS=$? ;;
555 test) $f_check ; STATUS=$? ;;
556 clean) $f_clean ; STATUS=$? ;;
557 install) $f_install ; STATUS=$? ;;
558 list) list ; STATUS=$? ;;
559 depend) depend ; STATUS=$? ;;
560 strip) strip ; STATUS=$? ;;
561 package) pkg ; STATUS=$? ;;
562 pkg) pkg ; STATUS=$? ;;
563 mkpatch) mkpatch ; STATUS=$? ;;
564 acceptpatch) acceptpatch ; STATUS=$? ;;
565 src-package) $f_spkg ; STATUS=$? ;;
566 spkg) $f_spkg ; STATUS=$? ;;
567 finish) finish ; STATUS=$? ;;
568 checksig) checksig ; STATUS=$? ;;
569 first) $f_mkdirs && $f_spkg && finish ; STATUS=$? ;;
570 almostall) checksig && $f_prep && $f_conf && $f_build && \
571 $f_install && strip && pkg && $f_spkg ; STATUS=$? ;;
572 all) checksig && $f_prep && $f_conf && $f_build && \
573 $f_install && strip && pkg && $f_spkg && finish ; \
574 STATUS=$? ;;
575 *) echo "Error: bad arguments" ; exit 1 ;;
576 esac
577 ( exit ${STATUS} ) || exit ${STATUS}
578 shift
579 done