annotate src/portaudio/install-sh @ 97:efb4b8187266

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