annotate src/portaudio/install-sh @ 25:7c42c2fc4173

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