source: trunk/essentials/sys-devel/automake-1.10/lib/acinstall

Last change on this file was 3147, checked in by bird, 18 years ago

automake 1.10

File size: 1.6 KB
Line 
1#! /bin/sh
2
3# Install an aclocal-style M4 file. A script is needed to do this
4# because we want to do serial-number checking; newer versions of
5# macro files should always be preferred.
6
7# Usage:
8# acinstall file directory installprogram [install-args]...
9
10# Copyright 1996 Free Software Foundation, Inc.
11
12# This program is free software; you can redistribute it and/or modify
13# it under the terms of the GNU General Public License as published by
14# the Free Software Foundation; either version 2, or (at your option)
15# any later version.
16
17# This program is distributed in the hope that it will be useful,
18# but WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20# GNU General Public License for more details.
21
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, write to the Free Software
24# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25# 02110-1301, USA.
26
27file="$1"
28dir="$2"
29shift
30shift
31
32localserial=`grep '^# serial ' $file | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
33if test -z "$localserial"; then
34 echo "acinstall: no serial number in $file" 1>&2
35 exit 1
36fi
37
38# Maybe if the installed file has no serial number we should just
39# assume it is ancient.
40instserial=`grep '^# serial ' $dir/$file | sed -e 's/^# serial \([0-9][0-9]*\).*$/\1/; q'`
41if test -z "$instserial"; then
42 echo "acinstall: no serial number in $dir/$file" 1>&2
43 exit 1
44fi
45
46if test $localserial -lt $instserial; then
47 # Installed file is newer.
48 exit 0
49fi
50
51# Install the file.
52$* $file $dir/$file
Note: See TracBrowser for help on using the repository browser.