texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

texinfo update (Thu Sep 15 07:52:01 EDT 2005)


From: Karl Berry
Subject: texinfo update (Thu Sep 15 07:52:01 EDT 2005)
Date: Thu, 15 Sep 2005 07:52:10 -0400

Index: install-sh
===================================================================
RCS file: /cvsroot/texinfo/texinfo/install-sh,v
retrieving revision 1.14
retrieving revision 1.15
diff -c -r1.14 -r1.15
*** install-sh  10 Jul 2005 12:41:26 -0000      1.14
--- install-sh  15 Sep 2005 11:48:22 -0000      1.15
***************
*** 1,7 ****
  #!/bin/sh
  # install - install a program, script, or datafile
  
! scriptversion=2005-07-09.12
  
  # This originates from X11R5 (mit/util/scripts/install.sh), which was
  # later released in X11R6 (xc/config/util/install.sh) with the
--- 1,7 ----
  #!/bin/sh
  # install - install a program, script, or datafile
  
! scriptversion=2005-09-13.16
  
  # This originates from X11R5 (mit/util/scripts/install.sh), which was
  # later released in X11R6 (xc/config/util/install.sh) with the
***************
*** 58,64 ****
  rmprog="${RMPROG-rm}"
  mkdirprog="${MKDIRPROG-mkdir}"
  
! chmodcmd="$chmodprog 0755"
  chowncmd=
  chgrpcmd=
  stripcmd=
--- 58,78 ----
  rmprog="${RMPROG-rm}"
  mkdirprog="${MKDIRPROG-mkdir}"
  
! posix_glob=
! posix_mkdir=
! 
! # Symbolic mode for testing mkdir with directories.
! # It is the same as 755, but also tests that "u+" works.
! test_mode=u=rwx,g=rx,o=rx,u+wx
! 
! # Desired mode of installed file.
! mode=0755
! 
! # Desired mode of newly created intermediate directories.
! # It is empty if not known yet.
! intermediate_mode=
! 
! chmodcmd=$chmodprog
  chowncmd=
  chgrpcmd=
  stripcmd=
***************
*** 111,117 ****
  
      --help) echo "$usage"; exit $?;;
  
!     -m) chmodcmd="$chmodprog $2"
          shift
          shift
          continue;;
--- 125,131 ----
  
      --help) echo "$usage"; exit $?;;
  
!     -m) mode=$2
          shift
          shift
          continue;;
***************
*** 164,169 ****
--- 178,185 ----
    exit 0
  fi
  
+ test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15
+ 
  for src
  do
    # Protect names starting with `-'.
***************
*** 173,187 ****
  
    if test -n "$dir_arg"; then
      dst=$src
!     src=
! 
!     if test -d "$dst"; then
!       mkdircmd=:
!       chmodcmd=
!     else
!       mkdircmd=$mkdirprog
!     fi
    else
      # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
      # might cause directories to be created, which would be especially bad
      # if $src (and thus $dsttmp) contains '*'.
--- 189,199 ----
  
    if test -n "$dir_arg"; then
      dst=$src
!     dstdir=$dst
!     test -d "$dstdir"
!     dstdir_status=$?
    else
+ 
      # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
      # might cause directories to be created, which would be especially bad
      # if $src (and thus $dsttmp) contains '*'.
***************
*** 208,260 ****
        echo "$0: $dstarg: Is a directory" >&2
        exit 1
        fi
!       dst=$dst/`basename "$src"`
      fi
    fi
  
!   # This sed command emulates the dirname command.
!   dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
  
!   # Make sure that the destination directory exists.
! 
!   # Skip lots of stat calls in the usual case.
!   if test ! -d "$dstdir"; then
!     case $dstdir in
!       /*) pathcomp=/ ;;
!       -*) pathcomp=./ ;;
!       *)  pathcomp= ;;
      esac
!     oIFS=$IFS
!     IFS=/
!     set fnord $dstdir
!     shift
!     IFS=$oIFS
! 
!     for d
!     do
!       test "x$d" = x && continue
! 
!       pathcomp=$pathcomp$d
!       if test ! -d "$pathcomp"; then
!         $mkdirprog "$pathcomp"
!       # mkdir can fail with a `File exist' error in case several
!       # install-sh are creating the directory concurrently.  This
!       # is OK.
!       test -d "$pathcomp" || exit 1
!       fi
!       pathcomp=$pathcomp/
!     done
    fi
  
    if test -n "$dir_arg"; then
!     $doit $mkdircmd "$dst" \
!       && { test -z "$chowncmd" || $doit $chowncmd "$dst"; } \
!       && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } \
!       && { test -z "$stripcmd" || $doit $stripcmd "$dst"; } \
!       && { test -z "$chmodcmd" || $doit $chmodcmd "$dst"; }
! 
    else
-     dstfile=`basename "$dst"`
  
      # Make a coup
--- 356,365 ----
      { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
        && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
        && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
!       && { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } &&
  
      # Now rename the file to the real destination.
!     { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \
        || {
           # The rename failed, perhaps because mv can't rename something else
           # to itself, or perhaps because mv is so ancient that it does not
***************
*** 291,301 ****
           # reasons.  In this case, the final cleanup might fail but the new
           # file should still install successfully.
           {
!            if test -f "$dstdir/$dstfile"; then
!              $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null \
!              || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
               || {
!                echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
                 (exit 1); exit 1
               }
             else
--- 371,382 ----
           # reasons.  In this case, the final cleanup might fail but the new
           # file should still install successfully.
           {
!            if test -f "$dst"; then
!              $doit $rmcmd -f "$dst" 2>/dev/null \
!              || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \
!                    && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\
               || {
!                echo "$0: cannot unlink or rename $dst" >&2
                 (exit 1); exit 1
               }
             else
***************
*** 304,319 ****
           } &&
  
           # Now rename the file to the real destination.
!          $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
         }
!     }
!   fi || { (exit 1); exit 1; }
! done
  
! # The final little trick to "correctly" pass the exit status to the exit trap.
! {
!   (exit 0); exit 0
! }
  
  # Local variables:
  # eval: (add-hook 'write-file-hooks 'time-stamp)
--- 385,397 ----
           } &&
  
           # Now rename the file to the real destination.
!          $doit $mvcmd "$dsttmp" "$dst"
         }
!     } || exit 1
  
!     trap - 0
!   fi
! done
  
  # Local variables:
  # eval: (add-hook 'write-file-hooks 'time-stamp)
P install-sh


reply via email to

[Prev in Thread] Current Thread [Next in Thread]