annotate lib-src/install-sid @ 251:677f6a0ee643 r20-5b24

Import from CVS: tag r20-5b24
author cvs
date Mon, 13 Aug 2007 10:19:59 +0200
parents 48d667d6f17f
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
112
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
1 #!/bin/sh
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
2 # Drop in the SUBMITTER id into a site's installed send-pr script.
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
3 # Copyright (C) 1993 Free Software Foundation, Inc.
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
4 # Contributed by Brendan Kehoe (brendan@cygnus.com), based on a
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
5 # version written by Heinz G. Seidl (hgs@ide.com).
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
6 #
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
7 # This file is part of GNU GNATS.
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
8 #
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
9 # GNU GNATS is free software; you can redistribute it and/or modify
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
10 # it under the terms of the GNU General Public License as published by
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
11 # the Free Software Foundation; either version 2, or (at your option)
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
12 # any later version.
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
13 #
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
14 # GNU GNATS is distributed in the hope that it will be useful,
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
17 # GNU General Public License for more details.
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
18 #
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
19 # You should have received a copy of the GNU General Public License
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
20 # along with GNU GNATS; see the file COPYING. If not, write to
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
21 # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
22
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
23 COMMAND=`echo $0 | sed -e 's,.*/,,g'`
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
24 USAGE="Usage: $COMMAND [--install-dir=prefix] [--help] [--version] submitter-id"
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
25
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
26 VERSION=3.101
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
27
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
28 BINDIR=/usr/bin
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
29
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
30 SUBMITTER=
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
31 TEMP=/tmp/sp$$
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
32
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
33 if [ $# -eq 0 ]; then
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
34 echo "$USAGE"
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
35 exit 1
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
36 fi
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
37
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
38 while [ $# -gt 0 ]; do
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
39 case "$1" in
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
40 -install-dir=*|--install-dir=*|--install-di=*|--install-d=*|--install-=*|--install=*|--instal=*|--insta=*|--inst=*|--ins=*|--in=*|--i=*)
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
41 I=`echo "$1" | sed 's/-*i[a-z\-]*=//'`
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
42 BINDIR=$I/bin ;;
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
43 --version) echo $COMMAND version $VERSION ; exit 1 ;;
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
44 -*) echo "$USAGE" ; exit 1 ;;
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
45 *) SUBMITTER=$1 ;;
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
46 esac
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
47 shift
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
48 done
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
49
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
50 path=`echo $0 | sed -e "s;${COMMAND};;"`
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
51
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
52 [ -z "$path" ] && path=.
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
53
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
54 examinebindir=yes
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
55
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
56 if [ "$examinebindir" = yes ] && [ -f $BINDIR/send-pr ]; then
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
57 SPPATHLIST=$BINDIR/send-pr
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
58 else
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
59 if [ -f $path/send-pr ]; then
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
60 SPPATHLIST=$path/send-pr
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
61 else
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
62 echo "$COMMAND: cannot find \`$BINDIR/send-pr' or \`$path/send-pr'" >&2
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
63 exit 1
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
64 fi
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
65 fi
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
66
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
67 trap 'rm -f $TEMP ; exit 0' 0
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
68 trap 'echo "$COM: Aborting ..."; rm -f $TEMP ; exit 1' 1 2 3 13 15
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
69
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
70 for SPPATH in $SPPATHLIST; do
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
71 sed -e "s/^SUBMITTER=.*/SUBMITTER=${SUBMITTER}/" $SPPATH > $TEMP
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
72
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
73 if grep $SUBMITTER $TEMP > /dev/null; then
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
74 cp $SPPATH $SPPATH.orig &&
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
75 rm -f $SPPATH &&
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
76 cp $TEMP $SPPATH &&
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
77 chmod a+rx $SPPATH &&
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
78 rm -f $TEMP $SPPATH.orig ||
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
79 { echo "$COMMAND: unable to replace send-pr" >&2 ; exit 1; }
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
80 else
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
81 echo "$COMMAND: something went wrong when sed-ing the submitter into send-pr" >&2
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
82 exit 1
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
83 fi
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
84 done
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
85
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
86 echo "$COMMAND: \`$SUBMITTER' is now the default submitter ID for send-pr"
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
87
48d667d6f17f Import from CVS: tag r20-1b8
cvs
parents:
diff changeset
88 exit 0