~jtaylor/ubuntu/oneiric/flightgear/fix-749249

« back to all changes in this revision

Viewing changes to install-sh

  • Committer: Bazaar Package Importer
  • Author(s): Reinhard Tartler
  • Date: 2005-11-26 12:31:23 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20051126123123-dhs3dijy6nd257up
Tags: 0.9.8-3ubuntu1
adapt gl/glu dependencies for Xorg

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
# install - install a program, script, or datafile
3
3
 
4
 
scriptversion=2004-04-01.17
 
4
scriptversion=2004-02-15.20
5
5
 
6
6
# This originates from X11R5 (mit/util/scripts/install.sh), which was
7
7
# later released in X11R6 (xc/config/util/install.sh) with the
280
280
      && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
281
281
      && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
282
282
 
 
283
    # Now remove or move aside any old file at destination location.  We
 
284
    # try this two ways since rm can't unlink itself on some systems and
 
285
    # the destination file might be busy for other reasons.  In this case,
 
286
    # the final cleanup might fail but the new file should still install
 
287
    # successfully.
 
288
    {
 
289
      if test -f "$dstdir/$dstfile"; then
 
290
        $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
 
291
        || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
 
292
        || {
 
293
          echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
 
294
          (exit 1); exit
 
295
        }
 
296
      else
 
297
        :
 
298
      fi
 
299
    } &&
 
300
 
283
301
    # Now rename the file to the real destination.
284
 
    { $doit $mvcmd -f "$dsttmp" "$dstdir/$dstfile" 2>/dev/null \
285
 
      || {
286
 
           # The rename failed, perhaps because mv can't rename something else
287
 
           # to itself, or perhaps because mv is so ancient that it does not
288
 
           # support -f.
289
 
 
290
 
           # Now remove or move aside any old file at destination location.
291
 
           # We try this two ways since rm can't unlink itself on some
292
 
           # systems and the destination file might be busy for other
293
 
           # reasons.  In this case, the final cleanup might fail but the new
294
 
           # file should still install successfully.
295
 
           {
296
 
             if test -f "$dstdir/$dstfile"; then
297
 
               $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
298
 
               || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
299
 
               || {
300
 
                 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
301
 
                 (exit 1); exit
302
 
               }
303
 
             else
304
 
               :
305
 
             fi
306
 
           } &&
307
 
 
308
 
           # Now rename the file to the real destination.
309
 
           $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
310
 
         }
311
 
    }
 
302
    $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
312
303
  fi || { (exit 1); exit; }
313
304
done
314
305