annotate install-sh @ 738:48001ed9143b audio-source-refactor

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