Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / atf / dist / admin / choose-revision.sh
blob8323d979c40461a978032746e269ae78a71bc0ef
1 #! /bin/sh
3 # Automated Testing Framework (atf)
5 # Copyright (c) 2009 The NetBSD Foundation, Inc.
6 # All rights reserved.
8 # Redistribution and use in source and binary forms, with or without
9 # modification, are permitted provided that the following conditions
10 # are met:
11 # 1. Redistributions of source code must retain the above copyright
12 # notice, this list of conditions and the following disclaimer.
13 # 2. Redistributions in binary form must reproduce the above copyright
14 # notice, this list of conditions and the following disclaimer in the
15 # documentation and/or other materials provided with the distribution.
17 # THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND
18 # CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
19 # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20 # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21 # IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS BE LIABLE FOR ANY
22 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
24 # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
26 # IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
27 # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
28 # IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 set -e
33 Prog_Name=${0##*/}
36 # err message
38 err() {
39 echo "${Prog_Name}: ${@}" 1>&2
40 exit 1
44 # do_cp
46 # Verbose copy.
48 do_cp() {
49 echo "${Prog_Name}: cp -p ${1} ${2}"
50 cp -p ${1} ${2}
54 # main
56 # Entry point.
58 main() {
59 [ ${#} -eq 3 ] || err "Invalid number of arguments"
60 mtnfile=${1}
61 distfile=${2}
62 tgtfile=${3}
64 if [ -f ${mtnfile} ]; then
65 cmp -s ${mtnfile} ${tgtfile} || do_cp ${mtnfile} ${tgtfile}
66 else
67 cmp -s ${distfile} ${tgtfile} || do_cp ${distfile} ${tgtfile}
71 main "${@}"
73 # vim: syntax=sh:expandtab:shiftwidth=4:softtabstop=4