annotate src/portaudio_20140130/install-sh @ 169:223a55898ab9 tip default

Add null config files
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 02 Mar 2020 14:03:47 +0000
parents e3d5853d5918
children
rev   line source
cannam@124 1 #!/bin/sh
cannam@124 2 # install - install a program, script, or datafile
cannam@124 3
cannam@124 4 scriptversion=2009-04-28.21; # UTC
cannam@124 5
cannam@124 6 # This originates from X11R5 (mit/util/scripts/install.sh), which was
cannam@124 7 # later released in X11R6 (xc/config/util/install.sh) with the
cannam@124 8 # following copyright and license.
cannam@124 9 #
cannam@124 10 # Copyright (C) 1994 X Consortium
cannam@124 11 #
cannam@124 12 # Permission is hereby granted, free of charge, to any person obtaining a copy
cannam@124 13 # of this software and associated documentation files (the "Software"), to
cannam@124 14 # deal in the Software without restriction, including without limitation the
cannam@124 15 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
cannam@124 16 # sell copies of the Software, and to permit persons to whom the Software is
cannam@124 17 # furnished to do so, subject to the following conditions:
cannam@124 18 #
cannam@124 19 # The above copyright notice and this permission notice shall be included in
cannam@124 20 # all copies or substantial portions of the Software.
cannam@124 21 #
cannam@124 22 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
cannam@124 23 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
cannam@124 24 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
cannam@124 25 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
cannam@124 26 # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
cannam@124 27 # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
cannam@124 28 #
cannam@124 29 # Except as contained in this notice, the name of the X Consortium shall not
cannam@124 30 # be used in advertising or otherwise to promote the sale, use or other deal-
cannam@124 31 # ings in this Software without prior written authorization from the X Consor-
cannam@124 32 # tium.
cannam@124 33 #
cannam@124 34 #
cannam@124 35 # FSF changes to this file are in the public domain.
cannam@124 36 #
cannam@124 37 # Calling this script install-sh is preferred over install.sh, to prevent
cannam@124 38 # `make' implicit rules from creating a file called install from it
cannam@124 39 # when there is no Makefile.
cannam@124 40 #
cannam@124 41 # This script is compatible with the BSD install script, but was written
cannam@124 42 # from scratch.
cannam@124 43
cannam@124 44 nl='
cannam@124 45 '
cannam@124 46 IFS=" "" $nl"
cannam@124 47
cannam@124 48 # set DOITPROG to echo to test this script
cannam@124 49
cannam@124 50 # Don't use :- since 4.3BSD and earlier shells don't like it.
cannam@124 51 doit=${DOITPROG-}
cannam@124 52 if test -z "$doit"; then
cannam@124 53 doit_exec=exec
cannam@124 54 else
cannam@124 55 doit_exec=$doit
cannam@124 56 fi
cannam@124 57
cannam@124 58 # Put in absolute file names if you don't have them in your path;
cannam@124 59 # or use environment vars.
cannam@124 60
cannam@124 61 chgrpprog=${CHGRPPROG-chgrp}
cannam@124 62 chmodprog=${CHMODPROG-chmod}
cannam@124 63 chownprog=${CHOWNPROG-chown}
cannam@124 64 cmpprog=${CMPPROG-cmp}
cannam@124 65 cpprog=${CPPROG-cp}
cannam@124 66 mkdirprog=${MKDIRPROG-mkdir}
cannam@124 67 mvprog=${MVPROG-mv}
cannam@124 68 rmprog=${RMPROG-rm}
cannam@124 69 stripprog=${STRIPPROG-strip}
cannam@124 70
cannam@124 71 posix_glob='?'
cannam@124 72 initialize_posix_glob='
cannam@124 73 test "$posix_glob" != "?" || {
cannam@124 74 if (set -f) 2>/dev/null; then
cannam@124 75 posix_glob=
cannam@124 76 else
cannam@124 77 posix_glob=:
cannam@124 78 fi
cannam@124 79 }
cannam@124 80 '
cannam@124 81
cannam@124 82 posix_mkdir=
cannam@124 83
cannam@124 84 # Desired mode of installed file.
cannam@124 85 mode=0755
cannam@124 86
cannam@124 87 chgrpcmd=
cannam@124 88 chmodcmd=$chmodprog
cannam@124 89 chowncmd=
cannam@124 90 mvcmd=$mvprog
cannam@124 91 rmcmd="$rmprog -f"
cannam@124 92 stripcmd=
cannam@124 93
cannam@124 94 src=
cannam@124 95 dst=
cannam@124 96 dir_arg=
cannam@124 97 dst_arg=
cannam@124 98
cannam@124 99 copy_on_change=false
cannam@124 100 no_target_directory=
cannam@124 101
cannam@124 102 usage="\
cannam@124 103 Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
cannam@124 104 or: $0 [OPTION]... SRCFILES... DIRECTORY
cannam@124 105 or: $0 [OPTION]... -t DIRECTORY SRCFILES...
cannam@124 106 or: $0 [OPTION]... -d DIRECTORIES...
cannam@124 107
cannam@124 108 In the 1st form, copy SRCFILE to DSTFILE.
cannam@124 109 In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
cannam@124 110 In the 4th, create DIRECTORIES.
cannam@124 111
cannam@124 112 Options:
cannam@124 113 --help display this help and exit.
cannam@124 114 --version display version info and exit.
cannam@124 115
cannam@124 116 -c (ignored)
cannam@124 117 -C install only if different (preserve the last data modification time)
cannam@124 118 -d create directories instead of installing files.
cannam@124 119 -g GROUP $chgrpprog installed files to GROUP.
cannam@124 120 -m MODE $chmodprog installed files to MODE.
cannam@124 121 -o USER $chownprog installed files to USER.
cannam@124 122 -s $stripprog installed files.
cannam@124 123 -t DIRECTORY install into DIRECTORY.
cannam@124 124 -T report an error if DSTFILE is a directory.
cannam@124 125
cannam@124 126 Environment variables override the default commands:
cannam@124 127 CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
cannam@124 128 RMPROG STRIPPROG
cannam@124 129 "
cannam@124 130
cannam@124 131 while test $# -ne 0; do
cannam@124 132 case $1 in
cannam@124 133 -c) ;;
cannam@124 134
cannam@124 135 -C) copy_on_change=true;;
cannam@124 136
cannam@124 137 -d) dir_arg=true;;
cannam@124 138
cannam@124 139 -g) chgrpcmd="$chgrpprog $2"
cannam@124 140 shift;;
cannam@124 141
cannam@124 142 --help) echo "$usage"; exit $?;;
cannam@124 143
cannam@124 144 -m) mode=$2
cannam@124 145 case $mode in
cannam@124 146 *' '* | *' '* | *'
cannam@124 147 '* | *'*'* | *'?'* | *'['*)
cannam@124 148 echo "$0: invalid mode: $mode" >&2
cannam@124 149 exit 1;;
cannam@124 150 esac
cannam@124 151 shift;;
cannam@124 152
cannam@124 153 -o) chowncmd="$chownprog $2"
cannam@124 154 shift;;
cannam@124 155
cannam@124 156 -s) stripcmd=$stripprog;;
cannam@124 157
cannam@124 158 -t) dst_arg=$2
cannam@124 159 shift;;
cannam@124 160
cannam@124 161 -T) no_target_directory=true;;
cannam@124 162
cannam@124 163 --version) echo "$0 $scriptversion"; exit $?;;
cannam@124 164
cannam@124 165 --) shift
cannam@124 166 break;;
cannam@124 167
cannam@124 168 -*) echo "$0: invalid option: $1" >&2
cannam@124 169 exit 1;;
cannam@124 170
cannam@124 171 *) break;;
cannam@124 172 esac
cannam@124 173 shift
cannam@124 174 done
cannam@124 175
cannam@124 176 if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
cannam@124 177 # When -d is used, all remaining arguments are directories to create.
cannam@124 178 # When -t is used, the destination is already specified.
cannam@124 179 # Otherwise, the last argument is the destination. Remove it from $@.
cannam@124 180 for arg
cannam@124 181 do
cannam@124 182 if test -n "$dst_arg"; then
cannam@124 183 # $@ is not empty: it contains at least $arg.
cannam@124 184 set fnord "$@" "$dst_arg"
cannam@124 185 shift # fnord
cannam@124 186 fi
cannam@124 187 shift # arg
cannam@124 188 dst_arg=$arg
cannam@124 189 done
cannam@124 190 fi
cannam@124 191
cannam@124 192 if test $# -eq 0; then
cannam@124 193 if test -z "$dir_arg"; then
cannam@124 194 echo "$0: no input file specified." >&2
cannam@124 195 exit 1
cannam@124 196 fi
cannam@124 197 # It's OK to call `install-sh -d' without argument.
cannam@124 198 # This can happen when creating conditional directories.
cannam@124 199 exit 0
cannam@124 200 fi
cannam@124 201
cannam@124 202 if test -z "$dir_arg"; then
cannam@124 203 trap '(exit $?); exit' 1 2 13 15
cannam@124 204
cannam@124 205 # Set umask so as not to create temps with too-generous modes.
cannam@124 206 # However, 'strip' requires both read and write access to temps.
cannam@124 207 case $mode in
cannam@124 208 # Optimize common cases.
cannam@124 209 *644) cp_umask=133;;
cannam@124 210 *755) cp_umask=22;;
cannam@124 211
cannam@124 212 *[0-7])
cannam@124 213 if test -z "$stripcmd"; then
cannam@124 214 u_plus_rw=
cannam@124 215 else
cannam@124 216 u_plus_rw='% 200'
cannam@124 217 fi
cannam@124 218 cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
cannam@124 219 *)
cannam@124 220 if test -z "$stripcmd"; then
cannam@124 221 u_plus_rw=
cannam@124 222 else
cannam@124 223 u_plus_rw=,u+rw
cannam@124 224 fi
cannam@124 225 cp_umask=$mode$u_plus_rw;;
cannam@124 226 esac
cannam@124 227 fi
cannam@124 228
cannam@124 229 for src
cannam@124 230 do
cannam@124 231 # Protect names starting with `-'.
cannam@124 232 case $src in
cannam@124 233 -*) src=./$src;;
cannam@124 234 esac
cannam@124 235
cannam@124 236 if test -n "$dir_arg"; then
cannam@124 237 dst=$src
cannam@124 238 dstdir=$dst
cannam@124 239 test -d "$dstdir"
cannam@124 240 dstdir_status=$?
cannam@124 241 else
cannam@124 242
cannam@124 243 # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
cannam@124 244 # might cause directories to be created, which would be especially bad
cannam@124 245 # if $src (and thus $dsttmp) contains '*'.
cannam@124 246 if test ! -f "$src" && test ! -d "$src"; then
cannam@124 247 echo "$0: $src does not exist." >&2
cannam@124 248 exit 1
cannam@124 249 fi
cannam@124 250
cannam@124 251 if test -z "$dst_arg"; then
cannam@124 252 echo "$0: no destination specified." >&2
cannam@124 253 exit 1
cannam@124 254 fi
cannam@124 255
cannam@124 256 dst=$dst_arg
cannam@124 257 # Protect names starting with `-'.
cannam@124 258 case $dst in
cannam@124 259 -*) dst=./$dst;;
cannam@124 260 esac
cannam@124 261
cannam@124 262 # If destination is a directory, append the input filename; won't work
cannam@124 263 # if double slashes aren't ignored.
cannam@124 264 if test -d "$dst"; then
cannam@124 265 if test -n "$no_target_directory"; then
cannam@124 266 echo "$0: $dst_arg: Is a directory" >&2
cannam@124 267 exit 1
cannam@124 268 fi
cannam@124 269 dstdir=$dst
cannam@124 270 dst=$dstdir/`basename "$src"`
cannam@124 271 dstdir_status=0
cannam@124 272 else
cannam@124 273 # Prefer dirname, but fall back on a substitute if dirname fails.
cannam@124 274 dstdir=`
cannam@124 275 (dirname "$dst") 2>/dev/null ||
cannam@124 276 expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
cannam@124 277 X"$dst" : 'X\(//\)[^/]' \| \
cannam@124 278 X"$dst" : 'X\(//\)$' \| \
cannam@124 279 X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
cannam@124 280 echo X"$dst" |
cannam@124 281 sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
cannam@124 282 s//\1/
cannam@124 283 q
cannam@124 284 }
cannam@124 285 /^X\(\/\/\)[^/].*/{
cannam@124 286 s//\1/
cannam@124 287 q
cannam@124 288 }
cannam@124 289 /^X\(\/\/\)$/{
cannam@124 290 s//\1/
cannam@124 291 q
cannam@124 292 }
cannam@124 293 /^X\(\/\).*/{
cannam@124 294 s//\1/
cannam@124 295 q
cannam@124 296 }
cannam@124 297 s/.*/./; q'
cannam@124 298 `
cannam@124 299
cannam@124 300 test -d "$dstdir"
cannam@124 301 dstdir_status=$?
cannam@124 302 fi
cannam@124 303 fi
cannam@124 304
cannam@124 305 obsolete_mkdir_used=false
cannam@124 306
cannam@124 307 if test $dstdir_status != 0; then
cannam@124 308 case $posix_mkdir in
cannam@124 309 '')
cannam@124 310 # Create intermediate dirs using mode 755 as modified by the umask.
cannam@124 311 # This is like FreeBSD 'install' as of 1997-10-28.
cannam@124 312 umask=`umask`
cannam@124 313 case $stripcmd.$umask in
cannam@124 314 # Optimize common cases.
cannam@124 315 *[2367][2367]) mkdir_umask=$umask;;
cannam@124 316 .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
cannam@124 317
cannam@124 318 *[0-7])
cannam@124 319 mkdir_umask=`expr $umask + 22 \
cannam@124 320 - $umask % 100 % 40 + $umask % 20 \
cannam@124 321 - $umask % 10 % 4 + $umask % 2
cannam@124 322 `;;
cannam@124 323 *) mkdir_umask=$umask,go-w;;
cannam@124 324 esac
cannam@124 325
cannam@124 326 # With -d, create the new directory with the user-specified mode.
cannam@124 327 # Otherwise, rely on $mkdir_umask.
cannam@124 328 if test -n "$dir_arg"; then
cannam@124 329 mkdir_mode=-m$mode
cannam@124 330 else
cannam@124 331 mkdir_mode=
cannam@124 332 fi
cannam@124 333
cannam@124 334 posix_mkdir=false
cannam@124 335 case $umask in
cannam@124 336 *[123567][0-7][0-7])
cannam@124 337 # POSIX mkdir -p sets u+wx bits regardless of umask, which
cannam@124 338 # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
cannam@124 339 ;;
cannam@124 340 *)
cannam@124 341 tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
cannam@124 342 trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
cannam@124 343
cannam@124 344 if (umask $mkdir_umask &&
cannam@124 345 exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
cannam@124 346 then
cannam@124 347 if test -z "$dir_arg" || {
cannam@124 348 # Check for POSIX incompatibilities with -m.
cannam@124 349 # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
cannam@124 350 # other-writeable bit of parent directory when it shouldn't.
cannam@124 351 # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
cannam@124 352 ls_ld_tmpdir=`ls -ld "$tmpdir"`
cannam@124 353 case $ls_ld_tmpdir in
cannam@124 354 d????-?r-*) different_mode=700;;
cannam@124 355 d????-?--*) different_mode=755;;
cannam@124 356 *) false;;
cannam@124 357 esac &&
cannam@124 358 $mkdirprog -m$different_mode -p -- "$tmpdir" && {
cannam@124 359 ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
cannam@124 360 test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
cannam@124 361 }
cannam@124 362 }
cannam@124 363 then posix_mkdir=:
cannam@124 364 fi
cannam@124 365 rmdir "$tmpdir/d" "$tmpdir"
cannam@124 366 else
cannam@124 367 # Remove any dirs left behind by ancient mkdir implementations.
cannam@124 368 rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
cannam@124 369 fi
cannam@124 370 trap '' 0;;
cannam@124 371 esac;;
cannam@124 372 esac
cannam@124 373
cannam@124 374 if
cannam@124 375 $posix_mkdir && (
cannam@124 376 umask $mkdir_umask &&
cannam@124 377 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
cannam@124 378 )
cannam@124 379 then :
cannam@124 380 else
cannam@124 381
cannam@124 382 # The umask is ridiculous, or mkdir does not conform to POSIX,
cannam@124 383 # or it failed possibly due to a race condition. Create the
cannam@124 384 # directory the slow way, step by step, checking for races as we go.
cannam@124 385
cannam@124 386 case $dstdir in
cannam@124 387 /*) prefix='/';;
cannam@124 388 -*) prefix='./';;
cannam@124 389 *) prefix='';;
cannam@124 390 esac
cannam@124 391
cannam@124 392 eval "$initialize_posix_glob"
cannam@124 393
cannam@124 394 oIFS=$IFS
cannam@124 395 IFS=/
cannam@124 396 $posix_glob set -f
cannam@124 397 set fnord $dstdir
cannam@124 398 shift
cannam@124 399 $posix_glob set +f
cannam@124 400 IFS=$oIFS
cannam@124 401
cannam@124 402 prefixes=
cannam@124 403
cannam@124 404 for d
cannam@124 405 do
cannam@124 406 test -z "$d" && continue
cannam@124 407
cannam@124 408 prefix=$prefix$d
cannam@124 409 if test -d "$prefix"; then
cannam@124 410 prefixes=
cannam@124 411 else
cannam@124 412 if $posix_mkdir; then
cannam@124 413 (umask=$mkdir_umask &&
cannam@124 414 $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
cannam@124 415 # Don't fail if two instances are running concurrently.
cannam@124 416 test -d "$prefix" || exit 1
cannam@124 417 else
cannam@124 418 case $prefix in
cannam@124 419 *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
cannam@124 420 *) qprefix=$prefix;;
cannam@124 421 esac
cannam@124 422 prefixes="$prefixes '$qprefix'"
cannam@124 423 fi
cannam@124 424 fi
cannam@124 425 prefix=$prefix/
cannam@124 426 done
cannam@124 427
cannam@124 428 if test -n "$prefixes"; then
cannam@124 429 # Don't fail if two instances are running concurrently.
cannam@124 430 (umask $mkdir_umask &&
cannam@124 431 eval "\$doit_exec \$mkdirprog $prefixes") ||
cannam@124 432 test -d "$dstdir" || exit 1
cannam@124 433 obsolete_mkdir_used=true
cannam@124 434 fi
cannam@124 435 fi
cannam@124 436 fi
cannam@124 437
cannam@124 438 if test -n "$dir_arg"; then
cannam@124 439 { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
cannam@124 440 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
cannam@124 441 { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
cannam@124 442 test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
cannam@124 443 else
cannam@124 444
cannam@124 445 # Make a couple of temp file names in the proper directory.
cannam@124 446 dsttmp=$dstdir/_inst.$$_
cannam@124 447 rmtmp=$dstdir/_rm.$$_
cannam@124 448
cannam@124 449 # Trap to clean up those temp files at exit.
cannam@124 450 trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
cannam@124 451
cannam@124 452 # Copy the file name to the temp name.
cannam@124 453 (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
cannam@124 454
cannam@124 455 # and set any options; do chmod last to preserve setuid bits.
cannam@124 456 #
cannam@124 457 # If any of these fail, we abort the whole thing. If we want to
cannam@124 458 # ignore errors from any of these, just make sure not to ignore
cannam@124 459 # errors from the above "$doit $cpprog $src $dsttmp" command.
cannam@124 460 #
cannam@124 461 { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
cannam@124 462 { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
cannam@124 463 { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
cannam@124 464 { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
cannam@124 465
cannam@124 466 # If -C, don't bother to copy if it wouldn't change the file.
cannam@124 467 if $copy_on_change &&
cannam@124 468 old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
cannam@124 469 new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
cannam@124 470
cannam@124 471 eval "$initialize_posix_glob" &&
cannam@124 472 $posix_glob set -f &&
cannam@124 473 set X $old && old=:$2:$4:$5:$6 &&
cannam@124 474 set X $new && new=:$2:$4:$5:$6 &&
cannam@124 475 $posix_glob set +f &&
cannam@124 476
cannam@124 477 test "$old" = "$new" &&
cannam@124 478 $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
cannam@124 479 then
cannam@124 480 rm -f "$dsttmp"
cannam@124 481 else
cannam@124 482 # Rename the file to the real destination.
cannam@124 483 $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
cannam@124 484
cannam@124 485 # The rename failed, perhaps because mv can't rename something else
cannam@124 486 # to itself, or perhaps because mv is so ancient that it does not
cannam@124 487 # support -f.
cannam@124 488 {
cannam@124 489 # Now remove or move aside any old file at destination location.
cannam@124 490 # We try this two ways since rm can't unlink itself on some
cannam@124 491 # systems and the destination file might be busy for other
cannam@124 492 # reasons. In this case, the final cleanup might fail but the new
cannam@124 493 # file should still install successfully.
cannam@124 494 {
cannam@124 495 test ! -f "$dst" ||
cannam@124 496 $doit $rmcmd -f "$dst" 2>/dev/null ||
cannam@124 497 { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
cannam@124 498 { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
cannam@124 499 } ||
cannam@124 500 { echo "$0: cannot unlink or rename $dst" >&2
cannam@124 501 (exit 1); exit 1
cannam@124 502 }
cannam@124 503 } &&
cannam@124 504
cannam@124 505 # Now rename the file to the real destination.
cannam@124 506 $doit $mvcmd "$dsttmp" "$dst"
cannam@124 507 }
cannam@124 508 fi || exit 1
cannam@124 509
cannam@124 510 trap '' 0
cannam@124 511 fi
cannam@124 512 done
cannam@124 513
cannam@124 514 # Local variables:
cannam@124 515 # eval: (add-hook 'write-file-hooks 'time-stamp)
cannam@124 516 # time-stamp-start: "scriptversion="
cannam@124 517 # time-stamp-format: "%:y-%02m-%02d.%02H"
cannam@124 518 # time-stamp-time-zone: "UTC"
cannam@124 519 # time-stamp-end: "; # UTC"
cannam@124 520 # End: