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