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