OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-dev/] [fsf-gcc-snapshot-1-mar-12/] [or1k-gcc/] [move-if-change] - Diff between revs 683 and 783

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 683 Rev 783
#!/bin/sh
#!/bin/sh
# Like mv $1 $2, but if the files are the same, just delete $1.
# Like mv $1 $2, but if the files are the same, just delete $1.
# Status is zero if successful, nonzero otherwise.
# Status is zero if successful, nonzero otherwise.
VERSION='2011-01-28 20:09'; # UTC
VERSION='2011-01-28 20:09'; # UTC
# The definition above must lie within the first 8 lines in order
# The definition above must lie within the first 8 lines in order
# for the Emacs time-stamp write hook (at end) to update it.
# for the Emacs time-stamp write hook (at end) to update it.
# If you change this file with Emacs, please let the write hook
# If you change this file with Emacs, please let the write hook
# do its job.  Otherwise, update this string manually.
# do its job.  Otherwise, update this string manually.
# Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
# Copyright (C) 2002-2007, 2009-2011 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see .
# along with this program.  If not, see .
usage="usage: $0 SOURCE DEST"
usage="usage: $0 SOURCE DEST"
help="$usage
help="$usage
  or:  $0 OPTION
  or:  $0 OPTION
If SOURCE is different than DEST, then move it to DEST; else remove SOURCE.
If SOURCE is different than DEST, then move it to DEST; else remove SOURCE.
  --help     display this help and exit
  --help     display this help and exit
  --version  output version information and exit
  --version  output version information and exit
The variable CMPPROG can be used to specify an alternative to \`cmp'.
The variable CMPPROG can be used to specify an alternative to \`cmp'.
Report bugs to ."
Report bugs to ."
version=`expr "$VERSION" : '\([^ ]*\)'`
version=`expr "$VERSION" : '\([^ ]*\)'`
version="move-if-change (gnulib) $version
version="move-if-change (gnulib) $version
Copyright (C) 2011 Free Software Foundation, Inc.
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law."
There is NO WARRANTY, to the extent permitted by law."
cmpprog=${CMPPROG-cmp}
cmpprog=${CMPPROG-cmp}
for arg
for arg
do
do
  case $arg in
  case $arg in
    --help | --hel | --he | --h)
    --help | --hel | --he | --h)
      exec echo "$help" ;;
      exec echo "$help" ;;
    --version | --versio | --versi | --vers | --ver | --ve | --v)
    --version | --versio | --versi | --vers | --ver | --ve | --v)
      exec echo "$version" ;;
      exec echo "$version" ;;
    --)
    --)
      shift
      shift
      break ;;
      break ;;
    -*)
    -*)
      echo "$0: invalid option: $arg" >&2
      echo "$0: invalid option: $arg" >&2
      exit 1 ;;
      exit 1 ;;
    *)
    *)
      break ;;
      break ;;
  esac
  esac
done
done
test $# -eq 2 || { echo "$0: $usage" >&2; exit 1; }
test $# -eq 2 || { echo "$0: $usage" >&2; exit 1; }
if test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null; then
if test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null; then
  rm -f -- "$1"
  rm -f -- "$1"
else
else
  if mv -f -- "$1" "$2"; then :; else
  if mv -f -- "$1" "$2"; then :; else
    # Ignore failure due to a concurrent move-if-change.
    # Ignore failure due to a concurrent move-if-change.
    test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null && rm -f -- "$1"
    test -r "$2" && $cmpprog -- "$1" "$2" >/dev/null && rm -f -- "$1"
  fi
  fi
fi
fi
## Local Variables:
## Local Variables:
## eval: (add-hook 'write-file-hooks 'time-stamp)
## eval: (add-hook 'write-file-hooks 'time-stamp)
## time-stamp-start: "VERSION='"
## time-stamp-start: "VERSION='"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-format: "%:y-%02m-%02d %02H:%02M"
## time-stamp-time-zone: "UTC"
## time-stamp-time-zone: "UTC"
## time-stamp-end: "'; # UTC"
## time-stamp-end: "'; # UTC"
## End:
## End:
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.