summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CHANGES215
-rw-r--r--COPYING2
-rw-r--r--FAQ154
-rw-r--r--Makefile.am8
-rw-r--r--Makefile.in235
-rw-r--r--README149
-rw-r--r--README.lg12
-rw-r--r--Todo20
-rw-r--r--acconfig.h78
-rw-r--r--aclocal.m4663
-rw-r--r--bin/Makefile.am14
-rw-r--r--bin/Makefile.in199
-rw-r--r--bin/agmrancid.in493
-rw-r--r--bin/alogin.in70
-rw-r--r--bin/arancid.in114
-rw-r--r--bin/blogin.in79
-rw-r--r--bin/brancid.in82
-rw-r--r--bin/cat5rancid.in163
-rw-r--r--bin/clogin.in208
-rw-r--r--bin/control_rancid.in176
-rw-r--r--bin/cssrancid.in144
-rw-r--r--bin/elogin.in56
-rw-r--r--bin/erancid.in83
-rw-r--r--bin/f10rancid.in215
-rw-r--r--bin/flogin.in105
-rw-r--r--bin/fnrancid.in86
-rw-r--r--bin/francid.in157
-rw-r--r--bin/hlogin.in148
-rw-r--r--bin/hpuifilter.c710
-rw-r--r--bin/hrancid.in100
-rw-r--r--bin/htlogin.in60
-rw-r--r--bin/htrancid.in76
-rw-r--r--bin/jerancid.in91
-rw-r--r--bin/jlogin.in75
-rw-r--r--bin/jrancid.in339
-rw-r--r--bin/lg.cgi.in37
-rw-r--r--bin/lgform.cgi.in32
-rw-r--r--bin/mrancid.in73
-rw-r--r--bin/nlogin.in156
-rw-r--r--bin/nrancid.in169
-rw-r--r--bin/nslogin.in50
-rw-r--r--bin/nsrancid.in80
-rw-r--r--bin/par.in15
-rwxr-xr-xbin/prancid.in81
-rw-r--r--bin/rancid-cvs.in66
-rw-r--r--bin/rancid-fe.in61
-rw-r--r--bin/rancid-run.in119
-rw-r--r--bin/rancid.in731
-rw-r--r--bin/rivlogin.in433
-rw-r--r--bin/rivrancid.in99
-rw-r--r--bin/rrancid.in95
-rwxr-xr-xbin/srancid.in404
-rw-r--r--bin/tntlogin.in73
-rw-r--r--bin/tntrancid.in98
-rw-r--r--bin/xrancid.in91
-rwxr-xr-xbin/zrancid.in70
-rwxr-xr-xconfigure6652
-rw-r--r--configure.in250
-rwxr-xr-xdepcomp122
-rw-r--r--etc/Makefile.am27
-rw-r--r--etc/Makefile.in135
-rw-r--r--etc/lg.conf.sample.in7
-rw-r--r--etc/rancid.conf.sample.in36
-rw-r--r--include/Makefile.in98
-rw-r--r--include/config.h72
-rw-r--r--include/config.h.in50
-rw-r--r--include/version.h2
-rw-r--r--include/version.h.in2
-rwxr-xr-xinstall-sh536
-rw-r--r--man/Makefile.am21
-rw-r--r--man/Makefile.in135
-rw-r--r--man/arancid.11
-rw-r--r--man/brancid.11
-rw-r--r--man/clogin.155
-rw-r--r--man/cloginrc.568
-rw-r--r--man/control_rancid.114
-rw-r--r--man/drancid.11
-rw-r--r--man/lg.conf.5.in2
-rw-r--r--man/lg_intro.1.in4
-rw-r--r--man/rancid-cvs.142
-rw-r--r--man/rancid-run.136
-rw-r--r--man/rancid.1152
-rw-r--r--man/rancid.conf.5.in73
-rw-r--r--man/rancid_intro.122
-rw-r--r--man/router.db.520
-rwxr-xr-xmissing143
-rwxr-xr-xmkinstalldirs44
-rw-r--r--share/Makefile.in133
-rw-r--r--share/cisco-load.exp70
-rw-r--r--share/cisco-reload.exp24
-rw-r--r--share/downreport.in27
-rw-r--r--share/lgnotes.html5
-rw-r--r--share/rtrfilter.in6
93 files changed, 11127 insertions, 6573 deletions
diff --git a/CHANGES b/CHANGES
index fb139cf..1db87cf 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,14 +1,227 @@
-2.3.rc1
+2.3.2
+ srancid: SMC/Dell switch support - loaner from Randy Bush
+
+ *login: Set variables for do_login when both -e and -p/-v are specified
+ - reported by A Dudek
+
+ *login: recognize the environment variable CLOGINRC, see clogin(1)
+
+ agmrancid: Cisco AGM/Anomaly Guard Module
+
+ francid: drop fan speed o/p from show chassis - John Adams
+
+ clogin: match Cisco CSS's "save config?" prompt - Lance Vermilion
+
+ jrancid: include show system core-dumps - Michael Lyngbol
+
+ rancid: filter empty 'show inventory' fields - from Michael Stefaniuc
+
+ *login: If we timeout while trying to quit in run_commands(), close the
+ connection (ie: file descriptor/tty) gracefully. - from Ed
+ Ravin, adjusted to catch the close.
+
+ jrancid: Adapt M160 PCG freq rounding to new format - noted by Mark
+ Davis
+
+ rancid: collect flash size on the FWSM - from Aaron Gee-clough
+
+ francid: Fix temperature/show chassis filtering for newer Foundry boxes
+ - noted and tested by Gary Roberts
+
+ rancid: fix Cisco 3825,3845 show version parsing - Michael Stefaniuc
+
+ clogin/hlogin: use send -h for exit command - Michael Stefaniuc
+
+ clogin: Answer F10's "unsaved changes" logout prompt - Colin Corbett
+
+ f10rancid: "Current Conf" begins with ! in recent code - Colin Corbett
+
+ francid: sort intf "secure" MACs, order fluctuates - noted by Brad Volz
+
+ francid: filter temperature o/p on the SuperX - Brad Volz
+
+ convert rancid-fe vendor list to a hash - suggested by Ed Ravin.
+
+ rancid: new format for PIX 7.0 license string - Aaron Gee-clough
+
+ rancid: check for 7300 type of routers
+
+ clogin: older CatOS for 1900s has a CR after the pager prompt
+
+ clogin & xrancid: Extreme XOS prompt format changed - Tore Anderson
+
+ User a .cvsignore file to prevent non-cvs'd control files from appearing
+ in cvs update output.
+
+ rancid: include _ in IOS version strings
+
+ clogin: reduce the number of leading prompt characters used in
+ run_commands to accomodate change seen in cat6500
+ 12.1(13)E14 - Charles Aresenault
+
+ hlogin: fix ssh hanging on press any key prompt - Ryan Mooney
+
+ rancid: more support for HFRs
+
+ nlogin: fix missing -re option for password matching - Jee Kay
+
+ lg: fix quoting of juniper command arguments - Richard Doty
+
+ rancid: also match _ in software image names - Stafford A. Rau
+
+ nrancid: fix config comment character & more filtering - Stoned Elipot
+
+ hlogin: look for the 'press any key' prompt after ssh authentication,
+ unlike telnet, where it appears before authentication.
+
+ hpuifilter: allocate a pty to interact with ssh/telnet, so that we
+ interact with ssh for the password exchange.
+ WARNING: repeated ssh login failures to HP Procurves cause the switch's
+ management interface to lock-up (this includes snmp, ping) and sometimes
+ it will crash. This is with the latest firmware; 5.33 at the time of
+ this writing.
+
+ *rancid: check hostname, or filename, before opening the output file.
+
+ rancid: better filtering of {tacacs,radius}-server - Patrick Adlam
+
+ rancid: better filtering of PIX pager prompt - Aaron Gee-clough
+
+ rancid: collect show debug - Ed Ravin
+
+ add subversion support - mostly from Justin Grote
+
+ clogin: support rsh method - partly from James Stahr
+
+ collect show inventory raw on rancid and cat5rancid
+
+ add -ko to cvs diff commands - Michael Shields
+
+ Add a MAILHEADERS configuration variable for user-defined mail headers
+
+ rancid: match HSRP group numbers greater than 1 char wide - Ed Ravin
+
+ nrancid: filter radius secrest - Jee Kay
+
+ *rancid: collapse the two command list definitions to an array of
+ hashrefs and build the lists from it - Ed Ravin
+
+ *login: ignore rsh on platforms that do not support it and on those
+ that do (eg: cisco), skip rsh for interactive and script (-s) logins.
+
+ add MAX_ROUNDS rancid.conf knob - Mardechai Abzug
+
+ control_rancid: fix adminmailrcpt default - Danny Thomas
+
+ rancid: correct handling of SNMPv3 host configs - Patrick Adlam
+
+ rancid: filter nv_hdr file seen on sup720 - Bill Ouchark
+
+ etc/Makefile.am: support DESTDIR - from Michael Shields
+
+ rancid: add IOX/CRS support.
+
+ hrancid: show stack does not apply to all procurves - Eugene Zagrebelny
+
+ flogin: older foundry o/s has misc spaces preceeding : in username
+ prompt - from mike ethridge
+
+ A better nlogin & nrancid for NetScreens - help from Stephen Gill
+
+ jerancid: case fluctuates in "active/standby" - from David Gethings
+
+ jerancid: filter "please wait" from config - from David Gethings
+
+ jerancid: filter consecutive periods at top of write term - mark cooper
+
+ jerancid: fix check for slave RE sync in DirSlotN - from Mark Lovely
+
+ rancid: collect 6500's sub-module info from show modules
+
+ jrancid: collect license info & RE Model. Don't collect
+ the license keys as this is only supported on the jseries
+ and running 'show system license keys' on other junipers
+ produces output from *two* commands - 'show system license'
+ AND 'show system licensekeys'.
+
+ rancid: erroneous space in shared-secret match - from Blaz Zupan
+
+ nrancid: fix missing brace - from David King
+
+ lgform: need strftime from POSIX - from Joao Frade
+
+ rancid: filter multiple-fs file - from Yuval Ben-Ari
+
+ cssrancid: make this parse the collected output properly
+
+ rancid: filter & sort IOS AP username passwords - noted by Stafford Rau
+
+ rancid: parse more variants of 'show diag' output.
+
+2.3.1
+ jerancid: fail/retry if the RP is syncing to the backup - Dave Mack
+
+ clogin: cat 19k lacks a space in front of pager prompt - darren @ adam
+
+ nlogin: correct find(sshcmd) argument - from Samuele Giovanni Tonon
+
+ lg.cgi: allow :s in arguments for sub-interface from Richard Doty
+
+ jrancid: filter some more secrets
+
+ rancid: filter some more secrets
+
+ francid: bits for Mucho Grande - from Niels Bakker
+
+ add -- before (telnet|ssh) in call to hpuifilter so that any options
+ for telnet/ssh are not interpretted by hpuifilter
+
+ look for diff -U if diff -u fails in configure.
+
+ fix typo in nlogin that made cloginrc password lookups fail.
+
+2.3
The following files have been moved to make rancid more
install/pkg/port/rpm friendly.
*** bin/env has been moved to etc/rancid.conf ***
*** bin/hpfilter has been renamed hpuifilter ***
*** util/lg/lg.conf has been moved to etc/lg.conf ***
*** util/lg/lg*.cgi have been moved to bin/lg*cgi ***
+ *** bin/create_cvs has been renamed rancid-cvs ***
+ *** bin/do-diffs has been renamed rancid-run ***
Note: existing configuration files are *NOT* copied/moved for you
bin/rename is no longer shipped with rancid
+ rancid.conf: add MAILDOMAIN knob - from David C.
+
+ clogin: allow the port to be specified for method ssh
+
+ jlogin: add cloginrc passphrase directive and order of precedence is
+ cmd-line -r value -> passphrase -> password
+
+ xrancid: do 'show diag' instead of 'show diagnostics' as the
+ longer version has sometimes timed out.
+
+ rancid: filter file vlan.dat from show flash on IOS switches
+
+ rancid: parse cisco 1760's DSP slot show diag output
+
+ francid: reorder listing of ports in a vlans - from Niels Bakker and
+ Steven Bakker
+
+ clogin: disable session logging w/ -c on catos - from Jason Ornstein
+
+ rancid: add Processor ID to save output
+
+ *login: handle TCL meta-characters in cloginrc directive values
+
+ francid: correctly parse modules in slots >= 10. from Niels Bakker
+
+ run cvs delete code even when router.db is empty.
+
+ Riverstone/Enterasys updates from Andrew Fort
+
rancid.conf: add LOGDIR variable - see rancid.conf(5)
rancid: add show spe version and parse FRU show diag output
diff --git a/COPYING b/COPYING
index 888b207..eadbe1c 100644
--- a/COPYING
+++ b/COPYING
@@ -1,5 +1,5 @@
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
diff --git a/FAQ b/FAQ
index 210700e..c26e143 100644
--- a/FAQ
+++ b/FAQ
@@ -1,4 +1,4 @@
-Frequently Asked Questions about rancid - last updated 20040107.
+Frequently Asked Questions about rancid - last updated 20050813.
This FAQ contains information that may not apply directly to versions of
rancid prior to 2.3. It also contains paths containing tags such as
@@ -24,6 +24,7 @@ A. A catalyst running IOS is type "cisco". The 'show version' output will
have banner including a phrase similar to "Cisco Internetwork Operating
System Software". See the router.db(5) manual page.
+
Q. I have Hybrid Cisco switch, like a cat5k with an RSM. How do I collect
both the routing engine and switch configurations?
A. Recommended way is to use two entries in the router.db, one for each.
@@ -31,12 +32,14 @@ A. Recommended way is to use two entries in the router.db, one for each.
cat5k_rsm.domain.com:cisco:up
cat5k_sw.domain.com:cat5:up
+
Q. I have a Cisco ??? on which collection stopped working, but clogin works
as expected.
A. Check if 'write term' produces output. Some IOS combined with large
configs and low free memory produce zero 'write term' output, esp. combined
with a memory leak. The device will have to be rebooted and/or upgraded.
+
Q. I have a Cisco Catalyst switch. clogin connects, but after receiving the
prompt, it stalls until it times out. Why?
A. This may be due to your prompt. CatOS does not include an implicit '>' in
@@ -44,8 +47,9 @@ A. This may be due to your prompt. CatOS does not include an implicit '>' in
your prompt with a trailing '>'. Also see cat5rancid(1). For example:
cat5k>
cat5k> enable
- Password:
- cat5k> (enable)
+ Password:
+ cat5k> (enable)
+
Q. Polling a ZebOS box fails from cron, but is successful from the command-
line.
@@ -65,6 +69,7 @@ A. The manual page for CVS is quite complete, but can be be overwhelming even
for someone familiar with RCS. There are some excellent resources on the
web. See http://www.loria.fr/~molli/cvs-index.html
+
Q. Errors are showing up in the logs like:
cvs [diff aborted]: there is no version here; run 'cvs checkout' first
A. The directory was not imported into CVS properly or was not properly checked
@@ -76,6 +81,7 @@ A. The directory was not imported into CVS properly or was not properly checked
cd to <LOCALSTATEDIR> and use 'cvs co <rancid group>' to create all the CVS
control bits.
+
Q. I keep receiving the same diff for a (or set of) devices, but I know the
data is not changing repeatedly. Why?
A. This is probably a CVS or filesystem permissions problem. Check the log
@@ -115,7 +121,8 @@ A. This is probably a CVS or filesystem permissions problem. Check the log
ownership on the cvs repository is
chown -R <rancid user> <LOCALSTATEDIR>/CVS <LOCALSTATEDIR>/<GROUPS>
-Q. I am renaming a device but would like the retain the history in CVS. How
+
+Q. I am renaming a device but would like to retain the history in CVS. How
is this done?
A. CVS does not provide a way (AFAIK) to rename files or to rename or delete
directories. The best way is to copy the CVS repository file manually
@@ -134,6 +141,7 @@ A. CVS does not provide a way (AFAIK) to rename files or to rename or delete
history, the same procedure would work. Substituting the new group name
appropriately.
+
Q. I am removing a group and would like to remove all traces of it from the
rancid directory and the CVS repository. How is this done?
A. As far as I know, CVS does not provide a way to remove directories. First,
@@ -145,6 +153,26 @@ A. As far as I know, CVS does not provide a way to remove directories. First,
% rm -rf fubar CVS/fubar
+Q. I would like to place my CVS repository on a remote machine. How do I do
+ that?
+A. Assuming that you're starting fresh, its quite simple. Before running
+ rancid-cvs for the first time, adjust CVS_RSH & CVSROOT in rancid.conf
+ similar to the following:
+ CVS_RSH=ssh; export CVS_RSH
+ CVSROOT="myhost:/fqpn/CVS"; export CVSROOT
+ Note that CVS_RSH is not found in the sample rancid.conf that is distributed
+ with rancid.
+
+
+Q. I need a web interface to the rancid CVS repository, for the CVS unsavvy.
+A. cvsweb works with rancid. Other similar software may as well.
+ http://www.freebsd.org/projects/cvsweb.html
+ cvsweb.conf:
+ @CVSrepositories = (
+ 'rancid' => ['RANCID CVS, '/full_path_to_the_RANCID_CVS'],
+ where the path will be <LOCALSTATEDIR>/CVS.
+
+
3) General
Q. I have a (set of) device(s) on which collection fails. How can I debug
@@ -184,18 +212,20 @@ A. Our usual diagnostic procedure for this is:
If all of these work, make sure that the device's entry in the group's
router.db file is correct and check the group's last log file for errors.
+
Q. Are there any characters in the banner that rancid has problems with OR
I changed the device's command prompt and now collection is failing?
A. The trickiest part about clogin (et al) is recognizing the prompt
correctly. clogin looks for '>' and '#' to figure out if it is logged
in or in enable mode. So if you have a '>' or '#' in your login banner
- (other other motd), then clogin gets all confused and will not be
- able to log in correctly, and thus rancid will fail.
+ (or other motd), then clogin gets all confused and will not be able to log
+ in correctly, and thus rancid will fail.
Don't use '>' or '#' in your prompt or in your banner or other motd.
+
Q. I use <BINDIR>/*login -c to run commands on multiple boxes. Sometimes
- these are commands that take secondary input, like a filename. How can
+ these are commands that take secondary input, like a filename. How can I
enter the data for that secondary prompt?
A. Two methods will work. Write an expect script to be used with clogin's
-s option, for which a few examples come with rancid like cisco-load.exp.
@@ -206,7 +236,10 @@ A. Two methods will work. Write an expect script to be used with clogin's
clogin -c 'clear counters\n'
The specific return (\n) will be entered after 'clear counters' followed
- by the normal return after the command.
+ by the normal return after the command. Some devices apparently eat the
+ linefeed of the typical Unix \r\n sequence and require that a carriage-
+ return be used instead (\r).
+
Q. I would like to collect device configurations every hour, but only receive
diffs every Nth collection or every N hours. Is this possible?
@@ -226,7 +259,109 @@ A. Certainly, but rancid does not provide such a mechanism natively. Two
and passes this to the -D option of CVS.
Obviously, the first option is the cleanest and most featureful, which is
- why the script mention in the second option is not provided.
+ why the script mentioned in the second option is not provided.
+
+
+Q. I'd like to have RANCID automatically begin collection when someone
+ finishes configuring a router. How can I do this?
+A. Using a syslog watcher script, one can trigger RANCID from the syslog
+ line emitted by, for example, an IOS router after configuration mode is
+ ended.
+
+ Here's a simple example using the Simple Event Correlator:
+ (http://simple-evcorr.sourceforge.net/)
+
+ If the syslog line in your logs looks like this (wrapped for readability):
+
+ Apr 5 09:56:52 acc1.geo269.example.com 72: 000069: *Mar 6 21:40:13.466 \
+ AEDT: %SYS-5-CONFIG_I: Configured from console by gwbush on vty0 (10.1.1.1)
+
+ You would use a SEC configuration stanza like this:
+
+ # example rancid trigger
+ #
+ type=SingleWithSuppress
+ ptype=RegExp
+ pattern=\s\S+:\S+\S+\s(\S+)\.example\.com.*SYS-5-CONFIG_I
+ action=shellcmd /opt/rancid/bin/do-diffs -r $1
+ window=1800
+
+ This will execute the command '/opt/rancid/bin/do-diffs -r acc1.geo269'
+ when it is fed a line like that syslog line. The command will be run at
+ most once every 1800 seconds. If you do not get hostnames in your
+ log lines that match your router.db entries, either fix your reverse
+ DNS or remove the '-r $1' part.
+
+
+Q. I would like to limit the permissions of the rancid user on my devices. Is
+ this possible?
+A. Strictly speaking, no. Rancid needs permission to read device configuration
+ and other data which is often not available to underprivileged users.
+ However, if you use TACACS+, you can limit the commands that are available
+ to a user.
+
+ For example, to allow ping and show, but not "show tcp", and nothing else:
+
+ user = rancid {
+ cmd = "ping" {
+ permit .*
+ }
+ cmd = "show" {
+ deny tcp.*
+ permit .*
+ }
+ # the default is to deny other commands
+ }
+
+ For RADIUS, Justin Grote suggested privilege levels:
+ http://www.cisco.com/univercd/cc/td/doc/product/software/ios122/122newft/122t/122t13/ftprienh.htm
+
+
+Q. For approximately X hosts (configs) what size server should we be
+ considering - speed and data storage?
+A. On modern machines it is unlikely you will have issues with disk space or
+ memory - A heavily laden access router with a complex config won't consume
+ more than a few megabytes of disk space for its configs over several
+ years time (roughly 3 times the sum of all the config or */configs/* over
+ 2 years is a decent approximation).
+
+ Rancid is typically CPU bound if you have adequate network bandwidth.
+ Experience shows rancid takes around 50 Mhz * minutes / device of processing
+ power. This means that a 1Ghz machine can poll:
+
+ 1000 Mhz * 60 (min/hour) / 50(Mhz min / device) = 1200 devices/hour
+
+ That's obviously a ball park estimate which varies with many different
+ factors such as the CPU type and the types of devices on your network.
+
+
+Q. How can I run rancid to make the most efficient use of resources (i.e.
+ run in the shortest amount of time)?
+
+A. You can adjust PAR_COUNT in rancid.conf to achieve maximum efficiency
+ during polling. You can watch the output of the standard unix command
+ vmstat command during polling to determine whether or not the cpu is being
+ wholly utilized - there should be little idle time and no process blocking
+ (see vmstat).
+
+ Another simpler method is to look at the time stamps on the rancid log
+ files, and adjust PAR_COUNT until the least amount of time is taken
+ during polling. Make sure all devices are being polled by rancid before
+ using this method - failing devices can extend the amount of time rancid
+ takes to finish by a *LONG* period and throw your times way off.
+
+ It may help to run rancid niced (man nice) if it will be sharing
+ resources with other processes, as it may eat whatever is available if
+ PAR_COUNT is set high. This is done by changing the crontab to be
+ something like:
+
+ 5 * * * * nice -19 /usr/local/rancid/bin/rancid-run
+
+ If you _do_ share resources with other processes but want rancid to
+ run efficiently, probably the vmstat method above will work better -
+ rancid may take a little longer to run but you won't be stepping on
+ other people's toes.
+
Q. I'm still stuck on this problem. Where can I get more help?
A. A discussion list is available, rancid-discuss@shrubbery.net. You must
@@ -234,6 +369,7 @@ A. A discussion list is available, rancid-discuss@shrubbery.net. You must
shell% echo "subscribe" | mail rancid-discuss-request@shrubbery.net
+
Q. What else can I do with rancid?
A. The possibilities are endless...rancid is non-toxic when applied properly.
see Joe Abley and Stephen Stuart's NANOG presentation:
diff --git a/Makefile.am b/Makefile.am
index df32f4f..2d4f2fb 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
## A Makefile.in is supplied, in case you do not have automake.
-## $Id: Makefile.am,v 1.19 2004/01/10 22:47:29 heas Exp $
+## $Id: Makefile.am,v 1.21 2005/09/29 01:14:59 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -37,5 +37,9 @@ SUBDIRS = . include etc bin man share
# sysconfdir is here because etc/Makefile uses a script to be careful about
# installing rancid.conf, not over-writing an existing one.
+DIRS2_CREATE=$(DESTDIR)$(prefix) $(DESTDIR)$(sysconfdir)
+if MK_LCLSTATEDIR
+DIRS2_CREATE+=$(DESTDIR)$(localstatedir)
+endif
install-data-hook:
- $(mkinstalldirs) $(prefix) $(localstatedir) $(sysconfdir);
+ $(mkinstalldirs) $(DIRS2_CREATE);
diff --git a/Makefile.in b/Makefile.in
index 2c7c59e..31104f8 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.8 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,11 @@
@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -34,18 +30,18 @@ POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+@MK_LCLSTATEDIR_TRUE@am__append_1 = $(DESTDIR)$(localstatedir)
subdir = .
DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
- $(srcdir)/Makefile.in $(top_srcdir)/configure COPYING \
- acconfig.h configure configure.in depcomp install-sh missing \
- mkinstalldirs
+ $(srcdir)/Makefile.in $(top_srcdir)/configure COPYING depcomp \
+ install-sh missing mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
- configure.lineno
+ configure.lineno config.status.lineno
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
@@ -55,13 +51,22 @@ SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
html-recursive info-recursive install-data-recursive \
- install-exec-recursive install-info-recursive \
- install-recursive installcheck-recursive installdirs-recursive \
- pdf-recursive ps-recursive uninstall-info-recursive \
- uninstall-recursive
-am__installdirs = $(DESTDIR)$(pkgdatadir)
+ install-dvi-recursive install-exec-recursive \
+ install-html-recursive install-info-recursive \
+ install-pdf-recursive install-ps-recursive install-recursive \
+ installcheck-recursive installdirs-recursive pdf-recursive \
+ ps-recursive uninstall-recursive
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgdatadir)"
pkgdataDATA_INSTALL = $(INSTALL_DATA)
DATA = $(pkgdata_DATA)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
+ distclean-recursive maintainer-clean-recursive
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
@@ -78,8 +83,6 @@ distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
ADMINMAILPLUS = @ADMINMAILPLUS@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -108,6 +111,7 @@ EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -121,6 +125,7 @@ MAILPLUS = @MAILPLUS@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -132,6 +137,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -139,38 +145,53 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign no-dependencies
pkgdata_DATA = COPYING CHANGES FAQ README README.lg UPGRADING cloginrc.sample
EXTRA_DIST = BUGS Todo configure install-sh \
@@ -183,6 +204,11 @@ EXTRA_DIST = BUGS Todo configure install-sh \
# mkinstalldirs will create the install destination before descending into
# the subdirs.
SUBDIRS = . include etc bin man share
+
+# sysconfdir is here because etc/Makefile uses a script to be careful about
+# installing rancid.conf, not over-writing an existing one.
+DIRS2_CREATE = $(DESTDIR)$(prefix) $(DESTDIR)$(sysconfdir) \
+ $(am__append_1)
all: all-recursive
.SUFFIXES:
@@ -219,23 +245,22 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
-uninstall-info-am:
install-pkgdataDATA: $(pkgdata_DATA)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(pkgdata_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
- $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ f=$(am__strip_dir) \
+ echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
uninstall-pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgdata_DATA)'; for p in $$list; do \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
- rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
# This directory's subdirectories are mostly independent; you can cd
@@ -245,7 +270,13 @@ uninstall-pkgdataDATA:
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
- @set fnord $$MAKEFLAGS; amf=$$2; \
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -257,15 +288,20 @@ $(RECURSIVE_TARGETS):
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ || eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
-mostlyclean-recursive clean-recursive distclean-recursive \
-maintainer-clean-recursive:
- @set fnord $$MAKEFLAGS; amf=$$2; \
+$(RECURSIVE_CLEAN_TARGETS):
+ @failcom='exit 1'; \
+ for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=* | --[!k]*);; \
+ *k*) failcom='fail=yes';; \
+ esac; \
+ done; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
@@ -286,7 +322,7 @@ maintainer-clean-recursive:
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
- || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+ || eval $$failcom; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -311,14 +347,16 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- if (etags --etags-include --version) >/dev/null 2>&1; then \
+ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
+ empty_fix=.; \
else \
include_option=--include; \
+ empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
- test -f $$subdir/TAGS && \
+ test ! -f $$subdir/TAGS || \
tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
@@ -328,9 +366,11 @@ TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -356,24 +396,22 @@ distclean-tags:
distdir: $(DISTFILES)
$(am__remove_distdir)
- mkdir $(distdir)
- $(mkdir_p) $(distdir)/bin $(distdir)/include $(distdir)/share
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
+ test -d $(distdir) || mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -384,15 +422,19 @@ distdir: $(DISTFILES)
|| exit 1; \
fi; \
done
- list='$(SUBDIRS)'; for subdir in $$list; do \
+ list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d "$(distdir)/$$subdir" \
- || mkdir "$(distdir)/$$subdir" \
+ || $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
+ distdir=`$(am__cd) $(distdir) && pwd`; \
+ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
- top_distdir="../$(top_distdir)" \
- distdir="../$(distdir)/$$subdir" \
+ top_distdir="$$top_distdir" \
+ distdir="$$distdir/$$subdir" \
+ am__remove_distdir=: \
+ am__skip_length_check=: \
distdir) \
|| exit 1; \
fi; \
@@ -400,18 +442,18 @@ distdir: $(DISTFILES)
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
- ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist-bzip2: distdir
- $(AMTAR) chof - $(distdir) | bzip2 -9 -c >$(distdir).tar.bz2
+ tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
$(am__remove_distdir)
dist-tarZ: distdir
- $(AMTAR) chof - $(distdir) | compress -c >$(distdir).tar.Z
+ tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__remove_distdir)
dist-shar: distdir
@@ -424,7 +466,7 @@ dist-zip: distdir
$(am__remove_distdir)
dist dist-all: distdir
- $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
@@ -433,13 +475,13 @@ dist dist-all: distdir
distcheck: dist
case '$(DIST_ARCHIVES)' in \
*.tar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf - ;;\
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
- bunzip2 -c $(distdir).tar.bz2 | $(AMTAR) xf - ;;\
+ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.Z*) \
- uncompress -c $(distdir).tar.Z | $(AMTAR) xf - ;;\
+ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
- GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | unshar ;;\
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
@@ -462,7 +504,7 @@ distcheck: dist
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
- (cd ../.. && $(mkdir_p) "$$dc_destdir") \
+ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
@@ -475,7 +517,7 @@ distcheck: dist
$(am__remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
- sed -e '1{h;s/./=/g;p;x;}' -e '$${p;x;}'
+ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
@cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
@@ -499,7 +541,9 @@ check: check-recursive
all-am: Makefile $(DATA)
installdirs: installdirs-recursive
installdirs-am:
- $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ for dir in "$(DESTDIR)$(pkgdatadir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
@@ -519,7 +563,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -547,12 +591,20 @@ install-data-am: install-pkgdataDATA
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+install-dvi: install-dvi-recursive
+
install-exec-am:
+install-html: install-html-recursive
+
install-info: install-info-recursive
install-man:
+install-pdf: install-pdf-recursive
+
+install-ps: install-ps-recursive
+
installcheck-am:
maintainer-clean: maintainer-clean-recursive
@@ -573,32 +625,31 @@ ps: ps-recursive
ps-am:
-uninstall-am: uninstall-info-am uninstall-pkgdataDATA
+uninstall-am: uninstall-pkgdataDATA
-uninstall-info: uninstall-info-recursive
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \
+ install-data-am install-strip
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am am--refresh check \
- check-am clean clean-generic clean-recursive ctags \
- ctags-recursive dist dist-all dist-bzip2 dist-gzip dist-shar \
- dist-tarZ dist-zip distcheck distclean distclean-generic \
- distclean-recursive distclean-tags distcleancheck distdir \
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+ all all-am am--refresh check check-am clean clean-generic \
+ ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \
+ dist-shar dist-tarZ dist-zip distcheck distclean \
+ distclean-generic distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-pkgdataDATA install-strip installcheck installcheck-am \
- installdirs installdirs-am maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive \
- mostlyclean mostlyclean-generic mostlyclean-recursive pdf \
- pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
- uninstall-info-am uninstall-pkgdataDATA
+ install install-am install-data install-data-am \
+ install-data-hook install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-pkgdataDATA install-ps install-ps-am install-strip \
+ installcheck installcheck-am installdirs installdirs-am \
+ maintainer-clean maintainer-clean-generic mostlyclean \
+ mostlyclean-generic pdf pdf-am ps ps-am tags tags-recursive \
+ uninstall uninstall-am uninstall-pkgdataDATA
@SET_MAKE@
-
-# sysconfdir is here because etc/Makefile uses a script to be careful about
-# installing rancid.conf, not over-writing an existing one.
install-data-hook:
- $(mkinstalldirs) $(prefix) $(localstatedir) $(sysconfdir);
+ $(mkinstalldirs) $(DIRS2_CREATE);
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/README b/README
index 3fd7fe7..4e433e7 100644
--- a/README
+++ b/README
@@ -13,58 +13,76 @@ NetBSD pkgsrc, FreeBSD port, Linux RPM, etc.
Please please please please read the UPGRADING file for more information.
**********
-The following is the packing list for Rancid. .in is stripped from
-the files below by configure with substitutions completed:
+The following is the packing list for Rancid, excluding files supporting
+configure (autoconf) and make. .in is stripped from the files below by
+configure as substitutions are completed:
README This file.
+README.lg Information about the Looking Glass.
CHANGES List of changes to Rancid.
+COPYING RANCID license.
+FAQ Frequently Asked Questions
Todo Partial list of what needs to be done.
-rancid.conf.in Environment settings needed.
-rancid-run.in Script designed to be run from cron calling control_rancid.
-control_rancid.in
- Builds router list, calls rancid on each router and
- handles cvs routines.
-rancid-fe.in chooses between rancid/[abefhjrx]rancid/cat5rancid.
-rancid.in Runs commands on cisco routers and processes the output.
-brancid.in Runs commands on baynet/nortel routers and processes the output.
-erancid.in Runs commands on ADC EZ-T3 muxes and processes the output.
-f10rancid.in Runs commands on Force10 routers and processes the output.
-francid.in Runs commands on foundry switches and processes the output.
-hrancid.in Runs commands on hp procurve switches and processes the output.
-jrancid.in Runs commands on juniper routers and processes the output.
-mrancid.in Runs commands on MRT daemons and processes the output.
-nrancid.in Runs commands on netscreen routers and processes the output.
-rrancid.in Runs commands on redback routers and processes the output.
-xrancid.in Runs commands on extreme switches and processes the output.
-cat5rancid.in Runs commands on cisco Cat switches and processes the output.
-blogin.in Expect script that logs into baynet/nortel routers either
- interactively, runs a set of commands, or runs another expect
- script.
-clogin.in Expect script that logs into routers either interactively,
- runs a set of commands, or runs another expect script.
-elogin.in Expect script that logs into ADC EZ-T3 muxes either
- interactively, runs a set of commands, or runs another expect
- script.
-flogin.in Expect script that logs into foundry switches. Once foundry
- cleans up their bloody UI, clogin should do the job.
-hlogin.in Expect script that logs into hp procurve switches either
- interactively, runs a set of commands, or runs another expect
- script.
-jlogin.in Expect script that logs into juniper routers similarly to
- clogin. It is not terribly robust, but mainly used for it's
- -c and -s options.
-.cloginrc TCL commands to set passwords, usernames etc. used by clogin
- and jlogin.
-par.in Parallel processing of commands - any commands.
-rancid-cvs.in Creates all of the CVS and config directories.
-hpuifilter.c HP procurve login filter - see end of hlogin(1).
-etc/ Configuration file samples
-etc/lg.conf.sample
-etc/rancid.conf.sample
+cloginrc.sample TCL commands to set passwords, usernames etc. used by clogin
+ and jlogin. See cloginrc(5)
+etc/
+ lg.conf.sample Sample Looking Glass configuration
+ rancid.conf.sample Sample RANCID configuration
+bin/
+ clogin.in Expect script that logs into routers and either presents
+ an interactive shell, runs a set of commands, or runs
+ another expect script. It handles Cisco, Extreme,
+ Force10, Juniper E-series, Procket, Redback, Zebra/MRT.
+ control_rancid.in
+ Builds router list, calls rancid on each router and
+ handles cvs routines.
+ hpuifilter.c HP procurve login filter - see hlogin(1).
+ par.in Parallel processing of commands - any commands.
+ rancid-cvs.in Creates all of the CVS and config directories.
+ rancid-run.in Script designed to be run from cron.
+ rancid-fe.in Chooses between rancid/[abefhjrx]rancid/cat5rancid.
+ rancid.in Runs commands on cisco routers and processes the output.
+
+ arancid.in Version of rancid.in for Alteon switches.
+ brancid.in Version of rancid.in for baynet/nortel routers.
+ cat5rancid.in Version of rancid.in for Cisco Catalyst switches.
+ cssrancid.in Version of rancid.in for Cisco CSS switches.
+ erancid.in Version of rancid.in for ADC EZ-T3 muxes.
+ f10rancid.in Version of rancid.in for Force10 routers.
+ francid.in Version of rancid.in for Foundry switches.
+ hrancid.in Version of rancid.in for HP Procurve switches.
+ htrancid.in Version of rancid.in for Hitatchi routers.
+ jerancid.in Version of rancid.in for Juniper E-series routers.
+ jrancid.in Version of rancid.in for Juniper routers.
+ mrancid.in Version of rancid.in for MRT daemons.
+ nrancid.in Version of rancid.in for Netscreen firewalls.
+ nsrancid.in Version of rancid.in for Netscalars.
+ prancid.in Version of rancid.in for Procket routers.
+ rivancid.in Version of rancid.in for Riverstone routers.
+ rrancid.in Version of rancid.in for Redback routers.
+ tntrancid.in Version of rancid.in for TNT access servers.
+ xrancid.in Version of rancid.in for Extreme switches.
+ zrancid.in Version of rancid.in for Zebra routers.
+
+ alogin.in Version of clogin.in for Alteon switches.
+ blogin.in Version of clogin.in for baynet/Nortel routers.
+ elogin.in Version of clogin.in for ADC EZ-T3 muxes.
+ flogin.in Version of clogin.in for Foundry switches. If foundry
+ cleaned-up their bloody UI, clogin should do the job.
+ hlogin.in Version of clogin.in for HP procurve switches.
+ htlogin.in Version of clogin.in for Hitatchi routers.
+ jlogin.in Version of clogin.in for Juniper routers.
+ nlogin.in Version of clogin.in for Netscreen firewalls.
+ nslogin.in Version of clogin.in for Netscalars.
+ rivlogin.in Version of clogin.in for Riverstone routers.
+ tntlogin.in Version of clogin.in for TNT access servers.
man/ man pages
share/ Readmes, samples, utilities, contribs, etc
-The following are included as part of the installation tools:
+Also see rancid_intro(1), rancid(1), and clogin(1).
+
+The following (non-exhaustive list) are included as part of the installation
+and configuration tools:
Makefile.in processed by configure to produce Makefiles
configure GNU autoconf script
@@ -80,6 +98,9 @@ perl5 perl version 5 or greater available from www.cpan.org
expect http://expect.nist.gov/ We highly suggest that you stick to
expect 5.24.1 (or so). This seems to work best. Note that
you need to have the accompanying tcl &/ tk.
+svn Code revision system, an alternative to cvs. Available from
+ http://subversion.tigris.org/tarballs/. Use the configure
+ option --enable-svn to configure for Subversion.
tcl Required by expect.
Bill Fenner (now maintained by others) has a cgi script for interacting
@@ -99,10 +120,10 @@ Quick Installation Guide (an example):
./configure --prefix=/home/rancid
Rancid uses autoconf's "localstatedir" as the location of it's logs,
- CVS respository, and directories where it's groups are placed. The user
- who will run rancid (from cron, etc) will need write access to these
- directories. By default, this is <prefix>/var, or /home/rancid/var
- following the example above.
+ CVS or Subversion respository, and directories where it's groups are
+ placed. The user who will run rancid (from cron, etc) will need write
+ access to these directories. By default, this is <prefix>/var, or
+ /home/rancid/var following the example above.
We realize that this is not optimal, but it follows the standards. We
suggest that this be altered to include the package name, like so:
@@ -160,10 +181,10 @@ Quick Installation Guide (an example):
7) Run rancid-cvs.
This creates all of the necessary directories and config files for
- each of the groups in LIST_OF_GROUPS and imports them into CVS. This
- will also be run each time a new group is added. Do not create the
- directories or CVS repository manually, allow rancid-cvs do it. Also see
- 'man -M <basedir>/man rancid-cvs'.
+ each of the groups in LIST_OF_GROUPS and imports them into CVS (or
+ Subversion). This will also be run each time a new group is added. Do
+ not create the directories or CVS repository manually, allow rancid-cvs
+ do it. Also see 'man -M <basedir>/man rancid-cvs'.
8) For each "group", modify the router.db file in the group directory.
The file is of the form "router:mfg:state" where "router" is
@@ -212,11 +233,14 @@ Quick Installation Guide (an example):
Subscribe by sending an email whose body contains "subscribe
rancid-<announce or discuss>" to majordomo@shrubbery.net.
+ If you are reporting problems, please include the version of rancid,
+ expect, and your OS in the email.
+
Problem with clogin/telnet hanging within rancid or scripts?
If you have experienced rancid (or more precisely, telnet) hanging on a
-solaris 2.6 box; check to be sure you have the following two patches
+solaris 2.6 box; check to be sure you have the following two o/s patches
installed (see showrev -p). There may be more recent versions of these
patches and they are likely included with 2.7 and 2.8:
@@ -228,10 +252,15 @@ Patch-ID# 105786-11
Keywords: security ip tcp_priv_stream routing ip_enable_group_ifs ndd
Synopsis: SunOS 5.6: /kernel/drv/ip patch
-Another possibile contributor is expect/tcl. We've noticed that expect
-5.24.1 (possibly 5.28.*) and whatever tcl happens to compile with it,
-seems to not exhibit this problem, while 5.32.* appears to on linux and
-solaris but not on netbsd 1.5. See www.shrubbery.net/rancid for additional
-notes on this.
+Another contributor to rancid "hanging", with or without the o/s patches
+mentioned above, is a bug in expect/tcl. We've noticed that expect (from
+5.24.1 forward), and whatever tcl happens to compile with it, exhibits a
+problem on Linux and Solaris where rancid's scripts hang waiting for input
+from the device. Patches to expect are available on the rancid web page.
+
+Also, for rancid 2.3 and later, changes were made to the login scripts
+which use some more elaborate regexes that have failed with expect versions
+prior to 5.40. While 5.40 works, it still seems to need the patch offered
+on the rancid web page for Linux and Solaris.
--Hank
+See www.shrubbery.net/rancid for additional notes on this.
diff --git a/README.lg b/README.lg
index d66d1f1..1be67ca 100644
--- a/README.lg
+++ b/README.lg
@@ -54,6 +54,7 @@ directory options, such as --prefix, the default install prefix is
directory index like this:
% cat /usr/local/htdocs/lg/.htaccess
+ Options ExecCGI
DirectoryIndex lgform.cgi
2) The looking glass scripts need to be able to find and read lg.conf. By
@@ -66,6 +67,17 @@ directory options, such as --prefix, the default install prefix is
httpd.conf. For example:
SetEnvIf Request_URI "\/lg/.*.cgi" LG_CONF=/usr/local/htdocs/lg/lg.conf
+ Note: if you have chosen to locate your router.db (or other possibly
+ sensitive files in the http docs heirarchy, you may wish to restrict
+ download permission for these files. Something like:
+
+ % cat /usr/local/htdocs/lg/.htaccess
+ <Files ~ "^router.db">
+ Order allow,deny
+ Deny from all
+ Satisfy All
+ </Files>
+
3) Edit <SYSCONFIGDIR>/lg.conf (usually <PREFIX>/etc/lg.conf). See lg.conf(5)
for additional information.
diff --git a/Todo b/Todo
index 97ded87..d457091 100644
--- a/Todo
+++ b/Todo
@@ -1,3 +1,13 @@
+- why does hlogin fail when the host key is not yet known? eg:
+ unix% ./hlogin procurve
+ procurve
+ spawn hpuifilter -- ssh -c 3des -x -l user procurve
+ Host key verification failed.
+
+ Error: Couldn't login
+ This happens on solaris only; linux and netbsd seem to be ok.
+- lg.conf(5) needs the query stuff documented.
+- configure OLDTIME per-group
- could the cloginrc match function do a longest-match search instead of
first match?
- look at Andreas Dahl's Brocade switch collection scripts
@@ -18,7 +28,6 @@
- fix varargs for knf in util.c
- isis filtering for foundry?
- hlogin hangs when the procurve does not ask for passwords
-- hlogin does not work with ssh, needs to alloc a pty?
- share/ tool to prune cvs versions, excluding those with tags, by (all but
latest | keep N versions | keep N days/months/years)
- extreme collection fails for tacacs-enabled boxen due to diffs in UI - blech!
@@ -30,8 +39,10 @@
- should par's -c override an input files' : cmd?
- should *login emmit "clogin error:" or "*login error:" to make matches for
login failures definitive?
-- would like hpfilter to be more friendly to interactive logins
-- rancid with zebra? via vtysh?
+- would like hpuifilter to be more friendly to interactive logins
+- hpuifilter needs to allocate a pseudo terminal to work with ssh
+ Pseudo-terminal will not be allocated because stdin is not a terminal.
+- rancid with zebra via vtysh?
- rancid for unix?
- would be nice if it were possible to add additional commands to be run
per-platform as a user desires. how could the user also provide a
@@ -48,7 +59,6 @@
this is clouded by the UI mess.
- rancid needs to treat the 3600s like the 7Ks and 12Ks...
Also, need to allow 12012s, and force 700s to not be treated like 7Ks.
-- clogin/jlogin rsh is munged
- LG should sort routers
- LG {requested} command additions
- show controllers T3 (data)
@@ -91,3 +101,5 @@
Model number: WS-C2950-24
System serial number: FHK0619X2RN
Configuration register is 0xF
+- Why does nlogin use a gratuitiously different variable name for the device(s)
+ in the main loop?
diff --git a/acconfig.h b/acconfig.h
deleted file mode 100644
index 87d5f53..0000000
--- a/acconfig.h
+++ /dev/null
@@ -1,78 +0,0 @@
-#ifndef CONFIG_H
-#define CONFIG_H 1
-
-@TOP@
-
-@BOTTOM@
-
-#ifndef __P
-# if STDC_HEADERS
-# define __P(a) a
-# else
-# define __P(a) ()
-# endif
-#endif
-
-#define BUF_SZ LINE_MAX /* (increments of) size of bufs */
-
-#if HAVE_STDLIB_H
-# include <stdlib.h>
-#endif
-
-#if HAVE_UNISTD_H
-# include <unistd.h>
-# include <sys/types.h>
-#elif HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-
-#if HAVE_ERRNO_H
-# include <errno.h>
-#endif
-extern int errno;
-
-#if HAVE_STRING_H
-# include <string.h>
-#endif
-#if HAVE_STRINGS_H
-# include <strings.h>
-#endif
-
-#if ! HAVE_STRERROR
-# define strerror(n) sys_errlist[n];
-#endif
-
-#if HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-#ifndef WEXITSTATUS
-# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
-#endif
-#ifndef WIFEXITED
-# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
-
-#if HAVE_MEMSET
-# define bzero(p,s) memset(p, 0, s)
-# define bcopy(s,d,l) memcpy(d, s, l)
-#endif
-
-#if HAVE_INDEX && ! HAVE_STRCHR
-# define index(s,c) strchr(s,c)
-#endif
-
-#if HAVE_SYSEXITS_H
-# include <sysexits.h>
-#else
- /* missing sysexits.h */
-# define EX_OK 0
-# define EX_USAGE 64 /* command line usage error */
-# define EX_NOINPUT 66 /* cannot open input */
-# define EX_TEMPFAIL 75 /* temp failure */
-# define EX_OSERR 71 /* system error */
-# define EX_CANTCREAT 73 /* can't create (user) output file */
-# define EX_IOERR 74 /* input/output error */
-# define EX_CONFIG 78 /* configuration error */
-#endif
-
-#endif /* CONFIG_H */
diff --git a/aclocal.m4 b/aclocal.m4
index 42590ae..cc30020 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.8 -*- Autoconf -*-
+# generated automatically by aclocal 1.10 -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,55 +11,52 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-# -*- Autoconf -*-
-# Copyright (C) 2002, 2003 Free Software Foundation, Inc.
-# Generated from amversion.in; do not edit by hand.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+m4_if(m4_PACKAGE_VERSION, [2.61],,
+[m4_fatal([this file was generated for autoconf 2.61.
+You have another version of autoconf. If you want to use that,
+you should regenerate the build system entirely.], [63])])
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
-AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.8"])
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.10'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version. Point them to the right macro.
+m4_if([$1], [1.10], [],
+ [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too. Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
-# Call AM_AUTOMAKE_VERSION so it can be traced.
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.8])])
-
-# AM_AUX_DIR_EXPAND
+[AM_AUTOMAKE_VERSION([1.10])dnl
+_AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)])
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
@@ -106,26 +103,16 @@ AC_PREREQ([2.50])dnl
am_aux_dir=`cd $ac_aux_dir && pwd`
])
-# AM_CONDITIONAL -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# AM_CONDITIONAL -*- Autoconf -*-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 6
+# serial 8
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
@@ -134,8 +121,10 @@ AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
-AC_SUBST([$1_TRUE])
-AC_SUBST([$1_FALSE])
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
@@ -145,29 +134,18 @@ else
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
- AC_MSG_ERROR([conditional "$1" was never defined.
-Usually this means the macro was only invoked conditionally.])
+ AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
fi])])
-# serial 5 -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+# serial 9
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
@@ -176,7 +154,6 @@ fi])])
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
-
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
@@ -196,6 +173,7 @@ AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
@@ -235,7 +213,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- : > sub/conftst$i.h
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
@@ -259,13 +239,19 @@ AC_CACHE_CHECK([dependency style of $depcc],
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
- # (even with -Werror). So we grep stderr for any message
- # that says an option was ignored.
- if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
@@ -299,36 +285,27 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking Speeds up one-time builds
- --enable-dependency-tracking Do not reject slow dependency extractors])
+[ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
-AC_SUBST([AMDEPBACKSLASH])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
])
-# Generate code to set up dependency tracking. -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# Generate code to set up dependency tracking. -*- Autoconf -*-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-#serial 2
+#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
@@ -341,33 +318,28 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
- grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
- # Extract the definition of DEP_FILES from the Makefile without
- # running `make'.
- DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n -e '/^U = / s///p' < "$mf"`
- test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
- # We invoke sed twice because it is the simplest approach to
- # changing $(DEPDIR) to its actual value in the expansion.
- for file in `sed -n -e '
- /^DEP_FILES = .*\\\\$/ {
- s/^DEP_FILES = //
- :loop
- s/\\\\$//
- p
- n
- /\\\\$/ b loop
- p
- }
- /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
@@ -393,30 +365,19 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
-# Do all the work for Automake. -*- Autoconf -*-
+# Do all the work for Automake. -*- Autoconf -*-
-# This macro actually does too much some checks are only needed if
-# your package does certain things. But this isn't really a big deal.
-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# serial 12
-# serial 11
+# This macro actually does too much. Some checks are only needed if
+# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
@@ -430,16 +391,20 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.58])dnl
+[AC_PREREQ([2.60])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+ fi
fi
# test whether we have cygpath
@@ -459,6 +424,9 @@ m4_ifval([$2],
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+ [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
@@ -474,7 +442,6 @@ AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
-AM_MISSING_PROG(AMTAR, tar)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
@@ -483,7 +450,9 @@ AC_REQUIRE([AM_PROG_MKDIR_P])dnl
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
-
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+ [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+ [_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
@@ -493,6 +462,10 @@ AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+ [_AM_DEPENDENCIES(OBJC)],
+ [define([AC_PROG_OBJC],
+ defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
])
@@ -517,51 +490,27 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
-
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
-# -*- Autoconf -*-
-# Copyright (C) 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 1
+# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
@@ -576,26 +525,15 @@ fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
-# Check to see how 'make' treats includes. -*- Autoconf -*-
+# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 2
+# serial 3
# AM_MAKE_INCLUDE()
# -----------------
@@ -639,27 +577,16 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
-# -*- Autoconf -*-
-
-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 3
+# serial 5
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
@@ -675,6 +602,7 @@ AC_SUBST($1)])
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
@@ -685,68 +613,41 @@ else
fi
])
+# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
# AM_PROG_MKDIR_P
# ---------------
-# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-
-# Copyright (C) 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
+# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
-[if mkdir -m 0755 -p -- . 2>/dev/null; then
- mkdir_p='mkdir -m 0755 -p --'
-else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-m ./0755 ./-p ./--;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs) -m 0755'
- else
- mkdir_p='$(install_sh) -m 0755 -d'
- fi
-fi
-AC_SUBST([mkdir_p])])
-
-# Helper functions for option handling. -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+ [[\\/$]]* | ?:[[\\/]]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# Helper functions for option handling. -*- Autoconf -*-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 2
+# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
@@ -771,26 +672,14 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-
-# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003
+# Copyright (C) 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2005, 2006
# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 3
+# serial 5
AC_DEFUN([AM_C_PROTOTYPES],
[AC_REQUIRE([AC_C_PROTOTYPES])
@@ -801,35 +690,24 @@ else
fi
# Ensure some checks needed by ansi2knr itself.
AC_REQUIRE([AC_HEADER_STDC])
-AC_CHECK_HEADERS(string.h)
-AC_SUBST(U)dnl
-AC_SUBST(ANSI2KNR)dnl
+AC_CHECK_HEADERS([string.h])
+AC_SUBST([U])dnl
+AC_SUBST([ANSI2KNR])dnl
+_AM_SUBST_NOTMAKE([ANSI2KNR])dnl
])
AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
-#
-# Check to make sure that the build environment is sane.
-#
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# serial 3
+# serial 4
# AM_SANITY_CHECK
# ---------------
@@ -872,25 +750,14 @@ Check your system clock])
fi
AC_MSG_RESULT(yes)])
-# AM_PROG_INSTALL_STRIP
-
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
-
-# 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
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+# AM_PROG_INSTALL_STRIP
+# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
@@ -908,7 +775,115 @@ dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
+# Copyright (C) 2006 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# Check how to create a tarball. -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+# tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+# $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.
+AM_MISSING_PROG([AMTAR], [tar])
+m4_if([$1], [v7],
+ [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
+ [m4_case([$1], [ustar],, [pax],,
+ [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar;
+ do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
+
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
m4_include([acinclude.m4])
diff --git a/bin/Makefile.am b/bin/Makefile.am
index 21fac52..b7fc75f 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -1,9 +1,9 @@
## Process this file with automake to produce Makefile.in
## A Makefile.in is supplied, in case you do not have automake.
-## $Id: Makefile.am,v 1.28 2004/01/11 07:15:23 hank Exp $
+## $Id: Makefile.am,v 1.36 2007/01/13 22:01:53 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -25,12 +25,12 @@ AUTOMAKE_OPTIONS=foreign
bin_PROGRAMS = hpuifilter
bin_SCRIPTS = cat5rancid control_rancid \
- alogin arancid clogin blogin brancid cssrancid \
+ agmrancid alogin arancid blogin brancid clogin cssrancid \
elogin erancid f10rancid flogin francid fnrancid \
- jlogin jrancid jerancid \
hlogin hrancid htlogin htrancid \
+ jerancid jlogin jrancid \
mrancid nlogin nrancid nslogin nsrancid par prancid \
- rancid rancid-fe rivlogin rivrancid rrancid \
+ rancid rancid-fe rivlogin rivrancid rrancid srancid \
tntlogin tntrancid xrancid zrancid
bin_SCRIPTS += lg.cgi lgform.cgi rancid-cvs rancid-run
@@ -73,7 +73,9 @@ auto_edit = sed \
-e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
-e 's,@LG_PING_CMD\@,$(LG_PING_CMD),g' \
-e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
- -e 's,@MAILPLUS\@,$(MAILPLUS),g'
+ -e 's,@MAILPLUS\@,$(MAILPLUS),g' \
+ -e 's,@PACKAGE\@,$(PACKAGE),g' \
+ -e 's,@VERSION\@,$(VERSION),g'
lg.cgi: Makefile $(srcdir)/lg.cgi.in
rm -f lg.cgi lg.cgi.tmp; \
diff --git a/bin/Makefile.in b/bin/Makefile.in
index eedc795..ca80b2a 100644
--- a/bin/Makefile.in
+++ b/bin/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.8 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,17 +15,11 @@
@SET_MAKE@
-SOURCES = $(hpuifilter_SOURCES)
-
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -40,22 +34,23 @@ POST_UNINSTALL = :
bin_PROGRAMS = hpuifilter$(EXEEXT)
subdir = bin
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/alogin.in $(srcdir)/arancid.in $(srcdir)/blogin.in \
- $(srcdir)/brancid.in $(srcdir)/cat5rancid.in \
- $(srcdir)/clogin.in $(srcdir)/control_rancid.in \
- $(srcdir)/cssrancid.in $(srcdir)/elogin.in \
- $(srcdir)/erancid.in $(srcdir)/f10rancid.in \
- $(srcdir)/flogin.in $(srcdir)/fnrancid.in $(srcdir)/francid.in \
- $(srcdir)/hlogin.in $(srcdir)/hrancid.in $(srcdir)/htlogin.in \
+ $(srcdir)/agmrancid.in $(srcdir)/alogin.in \
+ $(srcdir)/arancid.in $(srcdir)/blogin.in $(srcdir)/brancid.in \
+ $(srcdir)/cat5rancid.in $(srcdir)/clogin.in \
+ $(srcdir)/control_rancid.in $(srcdir)/cssrancid.in \
+ $(srcdir)/elogin.in $(srcdir)/erancid.in \
+ $(srcdir)/f10rancid.in $(srcdir)/flogin.in \
+ $(srcdir)/fnrancid.in $(srcdir)/francid.in $(srcdir)/hlogin.in \
+ $(srcdir)/hrancid.in $(srcdir)/htlogin.in \
$(srcdir)/htrancid.in $(srcdir)/jerancid.in \
$(srcdir)/jlogin.in $(srcdir)/jrancid.in $(srcdir)/mrancid.in \
$(srcdir)/nlogin.in $(srcdir)/nrancid.in $(srcdir)/nslogin.in \
$(srcdir)/nsrancid.in $(srcdir)/par.in $(srcdir)/prancid.in \
$(srcdir)/rancid-fe.in $(srcdir)/rancid.in \
$(srcdir)/rivlogin.in $(srcdir)/rivrancid.in \
- $(srcdir)/rrancid.in $(srcdir)/tntlogin.in \
- $(srcdir)/tntrancid.in $(srcdir)/xrancid.in \
- $(srcdir)/zrancid.in
+ $(srcdir)/rrancid.in $(srcdir)/srancid.in \
+ $(srcdir)/tntlogin.in $(srcdir)/tntrancid.in \
+ $(srcdir)/xrancid.in $(srcdir)/zrancid.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
$(top_srcdir)/configure.in
@@ -63,13 +58,13 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
-CONFIG_CLEAN_FILES = control_rancid par rancid-fe alogin arancid \
- blogin brancid cat5rancid clogin rancid cssrancid elogin \
- erancid f10rancid flogin francid fnrancid jlogin jrancid \
- jerancid hlogin hrancid htlogin htrancid mrancid nlogin \
- nrancid nslogin nsrancid prancid rivlogin rivrancid rrancid \
- tntlogin tntrancid xrancid zrancid
-am__installdirs = $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
+CONFIG_CLEAN_FILES = control_rancid par rancid-fe agmrancid alogin \
+ arancid blogin brancid cat5rancid clogin rancid cssrancid \
+ elogin erancid f10rancid flogin francid fnrancid jlogin \
+ jrancid jerancid hlogin hrancid htlogin htrancid mrancid \
+ nlogin nrancid nslogin nsrancid prancid rivlogin rivrancid \
+ rrancid srancid tntlogin tntrancid xrancid zrancid
+am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"
binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
PROGRAMS = $(bin_PROGRAMS)
am_hpuifilter_OBJECTS = hpuifilter.$(OBJEXT)
@@ -77,10 +72,9 @@ hpuifilter_OBJECTS = $(am_hpuifilter_OBJECTS)
hpuifilter_LDADD = $(LDADD)
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(bin_SCRIPTS)
-DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir)/include
+DEFAULT_INCLUDES = -I. -I$(top_builddir)/include@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
-@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/hpuifilter.Po
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
@@ -92,8 +86,6 @@ CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMINMAILPLUS = @ADMINMAILPLUS@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -128,6 +120,7 @@ EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -141,6 +134,7 @@ MAILPLUS = @MAILPLUS@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -152,6 +146,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -159,50 +154,63 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
#AUTOMAKE_OPTIONS=foreign no-dependencies
AUTOMAKE_OPTIONS = foreign
-bin_SCRIPTS = cat5rancid control_rancid \
- alogin arancid clogin blogin brancid cssrancid \
- elogin erancid f10rancid flogin francid fnrancid \
- jlogin jrancid jerancid \
- hlogin hrancid htlogin htrancid \
- mrancid nlogin nrancid nslogin nsrancid par prancid \
- rancid rancid-fe rivlogin rivrancid rrancid \
- tntlogin tntrancid xrancid zrancid\
-lg.cgi lgform.cgi rancid-cvs rancid-run
+bin_SCRIPTS = cat5rancid control_rancid agmrancid alogin arancid \
+ blogin brancid clogin cssrancid elogin erancid f10rancid \
+ flogin francid fnrancid hlogin hrancid htlogin htrancid \
+ jerancid jlogin jrancid mrancid nlogin nrancid nslogin \
+ nsrancid par prancid rancid rancid-fe rivlogin rivrancid \
+ rrancid srancid tntlogin tntrancid xrancid zrancid lg.cgi \
+ lgform.cgi rancid-cvs rancid-run
EXTRA_DIST = lg.cgi.in lgform.cgi.in rancid-cvs.in rancid-run.in
#dist_bin_SCRIPTS= $(bin_SCRIPTS:%=%.in)
CLEANFILES = lg.cgi lgform.cgi rancid-cvs rancid-run
@@ -232,7 +240,9 @@ auto_edit = sed \
-e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
-e 's,@LG_PING_CMD\@,$(LG_PING_CMD),g' \
-e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
- -e 's,@MAILPLUS\@,$(MAILPLUS),g'
+ -e 's,@MAILPLUS\@,$(MAILPLUS),g' \
+ -e 's,@PACKAGE\@,$(PACKAGE),g' \
+ -e 's,@VERSION\@,$(VERSION),g'
all: all-am
@@ -273,6 +283,8 @@ par: $(top_builddir)/config.status $(srcdir)/par.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
rancid-fe: $(top_builddir)/config.status $(srcdir)/rancid-fe.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+agmrancid: $(top_builddir)/config.status $(srcdir)/agmrancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
alogin: $(top_builddir)/config.status $(srcdir)/alogin.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
arancid: $(top_builddir)/config.status $(srcdir)/arancid.in
@@ -333,6 +345,8 @@ rivrancid: $(top_builddir)/config.status $(srcdir)/rivrancid.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
rrancid: $(top_builddir)/config.status $(srcdir)/rrancid.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+srancid: $(top_builddir)/config.status $(srcdir)/srancid.in
+ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
tntlogin: $(top_builddir)/config.status $(srcdir)/tntlogin.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
tntrancid: $(top_builddir)/config.status $(srcdir)/tntrancid.in
@@ -343,14 +357,14 @@ zrancid: $(top_builddir)/config.status $(srcdir)/zrancid.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(bindir)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; for p in $$list; do \
p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
if test -f $$p \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
- $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
@@ -358,24 +372,24 @@ uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
hpuifilter$(EXEEXT): $(hpuifilter_OBJECTS) $(hpuifilter_DEPENDENCIES)
@rm -f hpuifilter$(EXEEXT)
- $(LINK) $(hpuifilter_LDFLAGS) $(hpuifilter_OBJECTS) $(hpuifilter_LDADD) $(LIBS)
+ $(LINK) $(hpuifilter_OBJECTS) $(hpuifilter_LDADD) $(LIBS)
install-binSCRIPTS: $(bin_SCRIPTS)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(bindir)
+ test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f"; \
- $(binSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(bindir)/$$f; \
+ echo " $(binSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(binSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(bindir)/$$f"; \
else :; fi; \
done
@@ -383,8 +397,8 @@ uninstall-binSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(bin_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
- rm -f $(DESTDIR)$(bindir)/$$f; \
+ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \
+ rm -f "$(DESTDIR)$(bindir)/$$f"; \
done
mostlyclean-compile:
@@ -396,21 +410,18 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hpuifilter.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c $<
.c.obj:
-@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \
-@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
-uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -432,9 +443,11 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -459,22 +472,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -489,7 +501,9 @@ check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(SCRIPTS)
installdirs:
- $(mkdir_p) $(DESTDIR)$(bindir) $(DESTDIR)$(bindir)
+ for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -510,7 +524,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -537,12 +551,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-am
+
install-exec-am: install-binPROGRAMS install-binSCRIPTS
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -562,20 +584,23 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
- uninstall-info-am
+uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
clean-generic ctags distclean distclean-compile \
distclean-generic distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-binPROGRAMS \
- install-binSCRIPTS install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
+ install-binSCRIPTS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-binPROGRAMS \
- uninstall-binSCRIPTS uninstall-info-am
+ uninstall-binSCRIPTS
lg.cgi: Makefile $(srcdir)/lg.cgi.in
diff --git a/bin/agmrancid.in b/bin/agmrancid.in
new file mode 100644
index 0000000..0542bd2
--- /dev/null
+++ b/bin/agmrancid.in
@@ -0,0 +1,493 @@
+#! @PERLV_PATH@
+##
+## $Id: agmrancid.in,v 1.2 2006/12/06 00:40:54 heas Exp $
+##
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## without fee for non-commerical purposes provided that this license
+## remains intact and unmodified with any RANCID distribution.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+## Except where noted otherwise, rancid was written by and is maintained by
+## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
+##
+# Amazingly hacked version of Hank's rancid - this one tries to
+# deal with Cisco AGMs.
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-dV] [-l] [-f filename | hostname]
+#
+use Getopt::Std;
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$clean_run = 0;
+$found_end = 0;
+$found_version = 0;
+$found_env = 0;
+$found_diag = 0;
+$timeo = 90; # clogin timeout in seconds
+
+# the AGM kicks us off if it does not know our terminal type
+$ENV{'TERM'} = "dumb";
+
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routine that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routine (ascending).
+sub numsort {
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "show version"
+sub ShowVersion {
+ print STDERR " In ShowVersion: $_" if ($debug);
+ my($slaveslot);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ if (/^$prompt/) { $found_version=1; last};
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
+ return(-1) if (/command authorization failed/i);
+ return(0) if ($found_version); # Only do this routine once
+ # the pager can not be disabled per-session on the PIX
+ if (/^(-+More-+)/i) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
+ /^Cisco Anomaly Guard Image /i &&
+ ProcessHistory("COMMENTS","keysort","B1", "! $_") && next;
+ /^MDM agent /i &&
+ ProcessHistory("COMMENTS","keysort","B1", "! $_") && next;
+ }
+ return(0);
+}
+
+# This routine parses "show diag"
+# This will create arrarys for hw info.
+sub ShowDiag {
+ print STDERR " In ShowDiag: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ if (/^$prompt/) { $found_diag=1; last};
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
+ return(-1) if (/command authorization failed/i);
+ return(0) if ($found_diag); # Only do this routine once
+ /^$/ && next;
+ # the pager can not be disabled per-session on the PIX
+ if (/^(-+More-+)/i) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
+ /^Cisco Anomaly Guard Image /i && next;
+ /^... ... \d+ \d+:\d+:\d+ \w \d+$/ && next;
+ /^Copyright /i && next;
+ /^All rights /i && next;
+ /sample loss:/i && next;
+ /forward failures /i && next;
+
+ ProcessHistory("DIAG","keysort","C1","! $_");
+ }
+ ProcessHistory("DIAG","","","!\n");
+ return(0);
+}
+
+# This routine processes a "write term"
+sub WriteTerm {
+ print STDERR " In WriteTerm: $_" if ($debug);
+ my($lineauto,$comment,$linecnt) = (0,0,0);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if (/(Invalid input detected|Type help or )/i);
+ return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ if (/^(-+More-+)/i) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
+ /Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
+ return(0) if ($found_end); # Only do this routine once
+ $linecnt++;
+ $lineauto = 0 if (/^[^ ]/);
+
+ # skip consecutive comment/blank lines to avoid oscillating extra
+ # comment line on some access servers. grrr.
+ if (/^!/ || /^$/) {
+ next if ($comment);
+ ProcessHistory("","","",$_);
+ $comment++;
+ next;
+ }
+ $comment = 0;
+
+ # Dog gone Cool matches to process the rest of the config
+ /^tftp-server flash / && next; # kill any tftp remains
+ /^ntp clock-period / && next; # kill ntp clock-period
+ /^ length / && next; # kill length on serial lines
+ /^ width / && next; # kill width on serial lines
+ $lineauto = 1 if /^ modem auto/;
+ /^ speed / && $lineauto && next; # kill speed on serial lines
+ /^ clockrate / && next; # kill clockrate on serial interfaces
+ if (/^(enable )?(password|passwd)( level \w+)? encrypted ((.)\S+)/) {
+ if ($filter_pwds >= 2) {
+ ProcessHistory("USER","keysort","$1",
+ "!$1$2$3 encrypted <removed>\n");
+ } elsif ($filter_pwds >= 1 && $5 ne "\$") {
+ ProcessHistory("USER","keysort","$1",
+ "!$1$2$3 encrypted <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$1","$_");
+ }
+ next;
+ }
+
+ if ((/^(enable )?(password|passwd)( level \w+)? encrypted [^\$]/ &&
+ $filter_pwds >= 1) ||
+ (/^(enable )?(password|passwd)( level \w+)? encrypted [^\$]/ &&
+ $filter_pwds >= 2)) {
+ ProcessHistory("ENABLE","","","!$1$2$3 <removed>\n");
+ next;
+ }
+ if (/^username (\S+)(\s.*)? encrypted ((.)\S+)/) {
+ if ($filter_pwds >= 2) {
+ ProcessHistory("USER","keysort","$1",
+ "!username $1$2 encrypted <removed>\n");
+ } elsif ($filter_pwds >= 1 && $4 ne "\$") {
+ ProcessHistory("USER","keysort","$1",
+ "!username $1$2 encrypted <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$1","$_");
+ }
+ next;
+ }
+ if (/^(\s*)password / && $filter_pwds >= 1) {
+ ProcessHistory("LINE-PASS","","","!$1password <removed>\n");
+ next;
+ }
+ if (/^(\s*)secret / && $filter_pwds >= 2) {
+ ProcessHistory("LINE-PASS","","","!$1secret <removed>\n");
+ next;
+ }
+ # filter out any RCS/CVS tags to avoid confusing local CVS storage
+ s/\$(Revision|Id):/ $1:/;
+ # order arp lists
+ /^arp\s+(\d+\.\d+\.\d+\.\d+)\s+/ &&
+ ProcessHistory("ARP","ipsort","$1","$_") && next;
+
+ # order logging statements
+ /^logging host (\d+\.\d+\.\d+\.\d+)/ &&
+ ProcessHistory("LOGGING","ipsort","$1","$_") && next;
+ # order/prune snmp-server host statements
+ # we only prune lines of the form
+ # snmp-server host a.b.c.d <community>
+ if (/^snmp-server trap-dest (\d+\.\d+\.\d+\.\d+) /) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ my($ip) = $1;
+ my($line) = "snmp-server host $ip";
+ my(@tokens) = split(' ', $');
+ my($token);
+ while ($token = shift(@tokens)) {
+ if ($token eq 'version') {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
+ if ($token eq '3') {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
+ }
+ } elsif ($token eq 'vrf') {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
+ } elsif ($token =~ /^(informs?|traps?|(no)?auth)$/) {
+ $line .= " " . $token;
+ } else {
+ $line = "!$line " . join(' ', ("<removed>", join(' ',@tokens)));
+ last;
+ }
+ }
+ ProcessHistory("SNMPSERVERHOST","ipsort","$ip","$line\n");
+ } else {
+ ProcessHistory("SNMPSERVERHOST","ipsort","$1","$_");
+ }
+ next;
+ }
+ if (/^(snmp community) (\S+)/) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","!$1 <removed>$'") && next;
+ } else {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$_","$_") && next;
+ }
+ }
+ # prune tacacs/radius server keys
+ if (/^((tacacs-server|radius-server)\s(\w*[-\s(\s\S+])*\s?key) \d \w+/
+ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
+ }
+
+ # delete ntp auth password - this md5 is a reversable too
+ if (/^(ntp authentication-key \d+ md5) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
+ # order ntp peers/servers
+ if (/^ntp (server|peer) (\d+)\.(\d+)\.(\d+)\.(\d+)/) {
+ $sortkey = sprintf("$1 %03d%03d%03d%03d",$2,$3,$4,$5);
+ ProcessHistory("NTP","keysort",$sortkey,"$_");
+ next;
+ }
+
+ # catch anything that wasnt matched above.
+ ProcessHistory("","","","$_");
+ # end of config. the ": " game is for the PIX
+ if (/^(: +)?end$/) {
+ $found_end = 1;
+ return(1);
+ }
+ }
+ # The AGM lacks a definitive "end of config" marker. If we have seen at
+ # least 5 lines of write term o/p, we can be reasonably sure that we got
+ # the config.
+ if ($linecnt > 5) {
+ $found_end = 1;
+ return(1);
+ }
+
+ return(0);
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'show diagnostic-info' => 'ShowDiag'},
+ {'show running-config' => 'WriteTerm'},
+);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n";
+} else {
+ print STDERR "executing hlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing hlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "hlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "hlogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "hlogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"hlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "hlogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: riverhead\n!\n");
+ProcessHistory("COMMENTS","keysort","B0","!\n");
+ProcessHistory("COMMENTS","keysort","C0","!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/[>#]\s?exit$/) {
+ $clean_run=1;
+ last;
+ }
+ if (/^Error:/) {
+ print STDOUT ("$host clogin error: $_");
+ print STDERR ("$host clogin error: $_") if ($debug);
+ $clean_run=0;
+ last;
+ }
+ while (/#\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (! defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
+ }
+ if (/[>#]\s?exit$/) {
+ $clean_run=1;
+ last;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$clean_run || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$clean_run || !$found_end) {
+print STDOUT $clean_run . " " . $found_end . "\n";
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/alogin.in b/bin/alogin.in
index 91623fb..27286d7 100644
--- a/bin/alogin.in
+++ b/bin/alogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: alogin.in,v 1.22 2004/01/11 05:39:15 heas Exp $
+## $Id: alogin.in,v 1.35 2006/12/05 16:50:52 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,7 +25,7 @@
# alogin - Alteon WebOS switch login
#
# afort@choqolat.org is responsible for this particular mess
-# (andrew fort)
+# (andrew fort)
#
# Usage line
@@ -43,7 +44,7 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 1
+set avenable 1
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
set avautoenable 0
@@ -52,7 +53,7 @@ set avautoenable 0
set do_passwd 1
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -65,9 +66,12 @@ if {[ info exists env(CISCO_USER) ] } {
if [ catch {exec id} reason ] {
send_error "\nError: could not exec id: $reason\n"
exit 1
- }
+ }
regexp {\(([^)]*)} "$reason" junk default_user
-}
+}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -85,13 +89,16 @@ for {set i 0} {$i < $argc} {incr i} {
set username [ lindex $argv $i ]
}
# VTY Password
- } -v* -
- -v* {
+ } -v* {
if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
incr i
set passwd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Enable Username
} -w* -
-W* {
@@ -264,6 +271,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user userpswd passwd prompt cmethod cyphertype } {
global spawn_id in_proc do_command do_script
global u_prompt p_prompt sshcmd
@@ -273,6 +281,7 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
@@ -282,23 +291,23 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
- } elseif ![string compare $prog "ssh"] {
+ } elseif ![string compare $prog "ssh"] {
if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
send_user "\nError: $sshcmd failed: $reason\n"
- exit 1
+ return 1
}
- } elseif ![string compare $prog "rsh"] {
- if [ catch {spawn rsh -l $user $router} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- exit 1
- }
- } else {
- puts "\nError: unknown connection method: $prog"
+ } elseif ![string compare $prog "rsh"] {
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
+ }
+ continue;
+ } else {
+ send_user "\nError: unknown connection method: $prog\n"
return 1
- }
- incr progs -1
+ }
sleep 0.3
# This helps cleanup each expect clause.
@@ -415,15 +424,16 @@ proc run_commands { prompt command } {
}
send "exit\r"
expect {
- -re "^WARNING: There are unsaved configuration changes."
- {
- send "y\r"
- exp_continue
- }
- "\n" { exp_continue }
- "\[^\n\r *]*Session terminated" { return 0 }
- timeout { return 0 }
- eof { return 0 }
+ -re "^WARNING: There are unsaved configuration changes." {
+ send "y\r"
+ exp_continue
+ }
+ "\n" { exp_continue }
+ "\[^\n\r *]*Session terminated" { return 0 }
+ timeout { catch {close}; wait
+ return 0
+ }
+ eof { return 0 }
}
set in_proc 0
}
diff --git a/bin/arancid.in b/bin/arancid.in
index a2bf1ef..165a187 100644
--- a/bin/arancid.in
+++ b/bin/arancid.in
@@ -1,12 +1,13 @@
#! @PERLV_PATH@
##
-## $Id: arancid.in,v 1.14 2004/01/11 03:49:13 heas Exp $
+## $Id: arancid.in,v 1.22 2006/10/05 04:27:42 heas Exp $
##
-## Hacked version of rancid for Alteon WebOS switches
+## @PACKAGE@ @VERSION@
+## Hacked version of rancid for Alteon WebOS switches
## tested with: ad3 v8.1.18
## afort@choqolat.org (andrew fort)
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,13 +25,17 @@
##
#
# RANCID - Really Awesome New Cisco confIg Differ
-#
+#
# arancid - Alteon WebOS plugin for rancid
#
-# usage: arancid [-d] [-l] [-f filename | $host]
+# usage: arancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
@@ -38,13 +43,16 @@ $host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
$prompt = "#";
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # alogin timeout in seconds
+
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -66,10 +74,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -79,10 +87,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -92,10 +100,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -105,9 +113,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -121,7 +129,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -134,7 +142,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -142,23 +150,23 @@ sub sortbyipaddr {
# This routine parses "/info/sys" (cf. show version)
sub ShowVersion {
- print STDERR " In ShowVersion: $_" if ($debug);
+ print STDERR " In ShowVersion: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^>>.*$prompt/);
+ next if(/^(\s*|\s*$cmd\s*)$/);
- while (<INPUT>) {
- tr/\015//d;
- last if (/^>>.*$prompt/);
- next if(/^(\s*|\s*$cmd\s*)$/);
-
- /^(ACEdirector.*|ACEswitch.*|Alteon.*)/i &&
+ /^(ACEdirector.*|ACEswitch.*|Alteon.*)/i &&
ProcessHistory("COMMENTS","keysort","A1", "\/\*Model: $1\n") && next;
/^Software Version\s+(.*?)\s\((.*)\)/i &&
ProcessHistory("COMMENTS","keysort","B1", "\/\*Image: Software: $1 ($2)\n") && next;
/^Hardware Part No:\s+(.*?)\s+/i &&
ProcessHistory("COMMENTS","keysort","A2", "\/\*Hardware part no: $1\n") && next;
/^MAC address:\s+([0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2}:[0-9a-f]{2})/i &&
- ProcessHistory("COMMENTS","keysort","C1", "\/\*Base MAC address: $1\n") && next;
- }
- return(0);
+ ProcessHistory("COMMENTS","keysort","C1", "\/\*Base MAC address: $1\n") && next;
+ }
+ return(0);
}
# This routine processes a "/cfg/dump"
@@ -170,10 +178,10 @@ sub WriteTerm {
# now just copy it verbatim to the history file
while (<INPUT>) {
- tr/\015//d;
- last if(/^>>.*$prompt/);
+ tr/\015//d;
+ last if(/^>>.*$prompt/);
chop;
- if (/(rcomm|wcomm|t1com|t2com)(\s+)(.*)/ &&
+ if (/(rcomm|wcomm|t1com|t2com)(\s+)(.*)/ &&
defined($ENV{'NOCOMMSTR'})) {
ProcessHistory("","","","\/\*\t$1$2\"<removed>\"\n") && next;
}
@@ -183,8 +191,8 @@ sub WriteTerm {
next if (/^\/\* Configuration dump taken/i);
next if (/^\/\* Version.*Base MAC.*/i);
- if (/^\/?script end/) {
- $found_end = 1;
+ if (/^\/?script end/) {
+ $found_end = 1;
ProcessHistory("","","","$_\n");
return(1);
}
@@ -198,19 +206,27 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- '/info/sys' => "ShowVersion",
- '/cfg/dump' => "WriteTerm",
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "/info/sys",
- "/cfg/dump",
+@commandtable = (
+ {'/info/sys' => 'ShowVersion'},
+ {'/cfg/dump' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -237,13 +253,13 @@ ProcessHistory("COMMENTS","keysort","F0","\/\*\n");
TOP: while(<INPUT>) {
tr/\015//d;
if (/^>>.*$prompt exit/) {
- $clean_run=1;
- last;
+ $clean_run=1;
+ last;
}
while (/>>.*$prompt\s*($cmds_regexp)\s*$/) {
- $cmd = $1;
- if (!defined($prompt)) {
+ $cmd = $1;
+ if (!defined($prompt)) {
$prompt = ($_ =~ /^([^#]+#)/)[0];
$prompt =~ s/([][}{)(\\])/\\$1/g;
print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
@@ -252,7 +268,7 @@ TOP: while(<INPUT>) {
if (!defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
$clean_run = 0;
- last TOP;
+ last TOP;
}
$rval = &{$commands{$cmd}};
delete($commands{$cmd});
diff --git a/bin/blogin.in b/bin/blogin.in
index 92d2e8c..37c28e8 100644
--- a/bin/blogin.in
+++ b/bin/blogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: blogin.in,v 1.22 2004/01/11 05:39:15 heas Exp $
+## $Id: blogin.in,v 1.36 2006/12/08 21:28:25 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -46,7 +47,7 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 0
+set avenable 0
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
set avautoenable 0
@@ -56,7 +57,7 @@ set do_passwd 1
set do_enapasswd 0
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -72,6 +73,9 @@ if {[ info exists env(CISCO_USER) ] } {
}
regexp {\(([^)]*)} "$reason" junk default_user
}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -97,13 +101,16 @@ for {set i 0} {$i < $argc} {incr i} {
}
set do_passwd 0
# VTY Password
- } -v* -
- -v* {
+ } -v* {
if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
incr i
set passwd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Enable Username
} -w* -
-W* {
@@ -112,14 +119,14 @@ for {set i 0} {$i < $argc} {incr i} {
set enausername [ lindex $argv $i ]
}
# Environment variable to pass to -s scripts
- } -E*
+ } -E*
{
if {[ regexp .\[E\](.+)=(.+) $arg ignore varname varvalue]} {
set E$varname $varvalue
} else {
send_user "\nError: invalid format for -E in $arg\n"
exit 1
- }
+ }
# Enable Password
} -e*
{
@@ -183,11 +190,11 @@ for {set i 0} {$i < $argc} {incr i} {
set do_command 1
# Do we enable?
} -noenable {
- set enable 0
+ set avenable 0
# Does tacacs automatically enable us?
} -autoenable {
set avautoenable 1
- set enable 0
+ set avenable 0
} -* {
send_user "\nError: Unknown argument! $arg\n"
send_user $usage
@@ -237,25 +244,25 @@ proc label { host } {
# add password * hanky-pie
proc add {var args} { global int_$var ; lappend int_$var $args}
proc include {args} {
- global env
- regsub -all "(^{|}$)" $args {} args
+ global env
+ regsub -all "(^{|}$)" $args {} args
if { [ regexp "^/" $args ignore ] == 0 } {
set args $env(HOME)/$args
- }
+ }
source_password_file $args
-}
-
+}
+
proc find {var router} {
- upvar int_$var list
+ upvar int_$var list
if { [info exists list] } {
foreach line $list {
if { [string match [lindex $line 0] $router ] } {
return [lrange $line 1 end]
- }
- }
- }
- return {}
-}
+ }
+ }
+ }
+ return {}
+}
# Loads the password file. Note that as this file is tcl, and that
# it is sourced, the user better know what to put in there, as it
@@ -280,6 +287,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } {
global spawn_id in_proc do_command do_script
global u_prompt p_prompt e_prompt sshcmd
@@ -288,6 +296,7 @@ proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } {
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
@@ -297,23 +306,23 @@ proc login { router user userpswd passwd enapasswd prompt cmethod cyphertype } {
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
} elseif ![string compare $prog "ssh"] {
if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
send_user "\nError: $sshcmd failed: $reason\n"
- exit 1
+ return 1
}
} elseif ![string compare $prog "rsh"] {
- if [ catch {spawn rsh -l $user $router} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- exit 1
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
}
+ continue;
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
# This helps cleanup each expect clause.
@@ -466,9 +475,11 @@ proc run_commands { prompt command } {
}
send "logout\r"
expect {
- "\n" { exp_continue }
- timeout { return 0 }
- eof { return 0 }
+ "\n" { exp_continue }
+ timeout { catch {close}; wait
+ return 0
+ }
+ eof { return 0 }
}
set in_proc 0
}
@@ -498,6 +509,7 @@ foreach router [lrange $argv $i end] {
set prompt "#"
} else {
set autoenable 0
+ set enable $avenable
set prompt ">"
}
}
@@ -520,6 +532,9 @@ foreach router [lrange $argv $i end] {
}
set passwd [join [lindex $pswd 0] ""]
set enapasswd [join [lindex $pswd 1] ""]
+ } else {
+ set passwd $userpasswd
+ set enapasswd $enapasswd
}
# Figure out username
@@ -593,7 +608,7 @@ foreach router [lrange $argv $i end] {
if { $enable } {
if {[do_enable $enauser $enapasswd]} {
if { $do_command || $do_script } {
- close; wait
+ catch {close}; catch {wait}
continue
}
}
diff --git a/bin/brancid.in b/bin/brancid.in
index c2e602e..35f3f2f 100644
--- a/bin/brancid.in
+++ b/bin/brancid.in
@@ -1,9 +1,10 @@
#! @PERLV_PATH@
##
-## $Id: brancid.in,v 1.16 2004/01/11 03:49:13 heas Exp $
+## $Id: brancid.in,v 1.24 2006/10/05 04:27:42 heas Exp $
## hacked version of Hank's rancid - this one tries to deal with Bay's.
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -22,25 +23,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # blogin timeout in seconds
+$timeo = 90; # blogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -62,10 +68,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -75,10 +81,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -88,10 +94,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -101,9 +107,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -117,7 +123,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -130,7 +136,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -158,8 +164,8 @@ sub ShowConfig {
}
# ProcessHistory("","","","!$_");
if (/exit$/) {
- $found_end = 1;
- return(1);
+ $found_end = 1;
+ return(1);
}
return(0);
}
@@ -186,23 +192,29 @@ sub RunCommand {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'bcc' => "RunCommand",
- 'show config' => "ShowConfig",
- 'show config -all' => "ShowConfig",
- 'exit' => "RunCommand"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "bcc",
- "show config",
- "show config -all",
- "exit"
+@commandtable = (
+ {'bcc' => 'RunCommand'},
+ {'show config' => 'ShowConfig'},
+ {'show config -all' => 'ShowConfig'},
+ {'exit' => 'RunCommand'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -225,7 +237,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
diff --git a/bin/cat5rancid.in b/bin/cat5rancid.in
index f1214a1..bd13d65 100644
--- a/bin/cat5rancid.in
+++ b/bin/cat5rancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: cat5rancid.in,v 1.36 2004/01/11 03:49:13 heas Exp $
+## $Id: cat5rancid.in,v 1.47 2006/10/05 04:27:42 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -21,26 +22,31 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
my(%modules); # module info (part from sh ver, part from sh module)
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -62,10 +68,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -75,10 +81,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -88,10 +94,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -101,9 +107,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -117,7 +123,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -130,7 +136,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -665,14 +671,46 @@ sub ShowDiag {
return(0);
}
+# This routine parses "show inventory".
+sub ShowInventory {
+ print STDERR " In ShowInventory: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ return if (/^\s*\^$/);
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ s/^<-+ More -+>\s*//;
+
+ chomp;
+
+ # split PID/VID line
+ if (/^(NAME: ".*,) (DESCR: .*)/) {
+ ProcessHistory("INVENTORY","","", sprintf("!%-30s%s\n", $1, $2));
+ next;
+ }
+ if (/^(PID: \w?) *, (VID: .*), (SN: .*)$/) {
+ ProcessHistory("INVENTORY","","", "!$1\n!$2\n!$3\n");
+ next;
+ }
+
+ ProcessHistory("INVENTORY","","","!$_");
+ }
+ ProcessHistory("INVENTORY","","","");
+
+ return(0);
+}
+
# This routine parses "show module"
sub ShowModule {
my($slot);
print STDERR " In ShowModule: $_" if ($debug);
OUTER:while (<INPUT>) {
- tr/\015//d;
- last if(/^$prompt/);
+ tr/\015//d;
+ last if(/^$prompt/);
# stuff module type into %module
if (/^Mod\s+Slot\s+Ports/) {
<INPUT>;
@@ -696,7 +734,7 @@ OUTER:while (<INPUT>) {
}
next;
}
- # one does it one way... pita
+ # one does it one way... pita
if (/^Mod\s+Module-Name\s+Ports/) {
<INPUT>;
#my($slot);
@@ -713,7 +751,7 @@ OUTER:while (<INPUT>) {
}
next;
}
- # daughter boards
+ # daughter boards
if (/^Mod\s+Sub-Type/) {
<INPUT>;
my($slot, $board);
@@ -767,7 +805,7 @@ OUTER:while (<INPUT>) {
ProcessHistory("MODS","","",$model);
if ($dboards) {ProcessHistory("MODS","","",$dboards);}
}
-}
+}
# This routine processes a "show port ifindex"
sub ShowPortIfindex {
@@ -790,7 +828,10 @@ sub ShowPortIfindex {
sub WriteTerm {
print STDERR " In WriteTerm: $_" if ($debug);
- ProcessHistory("","","","!\n");
+ if (! $found_end) {
+ ProcessHistory("","","","!\n");
+ }
+
while (<INPUT>) {
tr/\015//d;
last if (/^$prompt/);
@@ -822,9 +863,9 @@ sub WriteTerm {
/^#Time: / && next;
# Dog gone Cool matches to process the rest of the config
- /^#time: / && next; # kill time:
- /^tftp-server flash / && next; # kill any tftp remains
- /^ntp clock-period / && next; # kill ntp clock-period
+ /^#time: / && next; # kill time:
+ /^tftp-server flash / && next; # kill any tftp remains
+ /^ntp clock-period / && next; # kill ntp clock-period
/^ length / && next; # kill length on serial lines
/^ width / && next; # kill width on serial lines
if (/^enable password / && $filter_pwds >= 1) {
@@ -925,15 +966,15 @@ sub WriteTerm {
# order logging statements
/^set logging server (\d+\.\d+\.\d+\.\d+)/ &&
ProcessHistory("LOGGING","ipsort","$1","$_") && next;
- # order/prune snmp-server host statements
- # we only prune lines of the form
- # snmp-server host a.b.c.d <community>
+ # order/prune snmp-server host statements
+ # we only prune lines of the form
+ # snmp-server host a.b.c.d <community>
if (/^set snmp trap (\d+\.\d+\.\d+\.\d+) /) {
if (defined($ENV{'NOCOMMSTR'})) {
ProcessHistory("SNMPSERVERHOST","ipsort","$1","!set snmp trap $1 <removed>\n");
} else {
ProcessHistory("SNMPSERVERHOST","ipsort","$1","$_");
- }
+ }
next;
}
if (/^(set snmp community) (\S+) (\S+)/) {
@@ -991,39 +1032,39 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'show boot' => "ShowBoot",
- 'show flash' => "ShowFlash",
- 'dir bootflash:' => "DirSlotN",
- 'dir slot0:' => "DirSlotN",
- 'dir slot1:' => "DirSlotN",
- 'dir sup-bootflash:' => "DirSlotN",
- 'dir sup-microcode:' => "DirSlotN",
- 'show module' => "ShowModule",
- 'show port ifindex' => "ShowPortIfindex",
- 'write term all' => "WriteTerm",
- 'write term' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version",
- "show boot",
- "show flash",
- "dir bootflash:",
- "dir slot0:",
- "dir slot1:",
- "dir sup-bootflash:",
- "dir sup-microcode:",
- "show module",
- "show port ifindex",
- "write term all",
- "write term"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'show boot' => 'ShowBoot'},
+ {'show flash' => 'ShowFlash'},
+ {'dir bootflash:' => 'DirSlotN'},
+ {'dir slot0:' => 'DirSlotN'},
+ {'dir slot1:' => 'DirSlotN'},
+ {'dir sup-bootflash:' => 'DirSlotN'},
+ {'dir sup-microcode:' => 'DirSlotN'},
+ {'show module' => 'ShowModule'},
+ {'show inventory raw' => 'ShowInventory'},
+ {'show port ifindex' => 'ShowPortIfindex'},
+ {'write term all' => 'WriteTerm'},
+ {'write term' => 'WriteTerm'},
+ {'show running-config' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
diff --git a/bin/clogin.in b/bin/clogin.in
index b05b56e..b7ac1a2 100644
--- a/bin/clogin.in
+++ b/bin/clogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: clogin.in,v 1.72 2004/01/11 05:39:15 heas Exp $
+## $Id: clogin.in,v 1.107 2006/12/08 21:28:25 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -47,7 +48,7 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 1
+set avenable 1
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
set avautoenable 0
@@ -55,11 +56,11 @@ set avautoenable 0
# tracks if we receive them on the command line.
set do_passwd 1
set do_enapasswd 1
-# attempt at platform switching.
-set platform ""
+#
+set send_human {.4 .4 .7 .3 5}
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -75,6 +76,9 @@ if {[ info exists env(CISCO_USER) ] } {
}
regexp {\(([^)]*)} "$reason" junk default_user
}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -100,13 +104,16 @@ for {set i 0} {$i < $argc} {incr i} {
}
set do_passwd 0
# VTY Password
- } -v* -
- -v* {
+ } -v* {
if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
incr i
set passwd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Enable Username
} -w* -
-W* {
@@ -189,11 +196,11 @@ for {set i 0} {$i < $argc} {incr i} {
set do_command 1
# Do we enable?
} -noenable {
- set enable 0
+ set avenable 0
# Does tacacs automatically enable us?
} -autoenable {
set avautoenable 1
- set enable 0
+ set avenable 0
} -* {
send_user "\nError: Unknown argument! $arg\n"
send_user $usage
@@ -286,6 +293,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure, -1 if rsh was used successfully
proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
global spawn_id in_proc do_command do_script platform
global prompt u_prompt p_prompt e_prompt sshcmd usercmd usercmd_chat
@@ -295,6 +303,7 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
@@ -304,12 +313,19 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
- } elseif ![string compare $prog "ssh"] {
- if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
+ } elseif [string match "ssh*" $prog] {
+ regexp {ssh(:([^[:space:]]+))*} $prog command suffix port
+ if {"$port" == ""} {
+ set retval [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ]
+
+ } else {
+ set retval [ catch {spawn $sshcmd -c $cyphertype -x -l $user -p $port $router} reason ]
+ }
+ if { $retval } {
send_user "\nError: $sshcmd failed: $reason\n"
- exit 1
+ return 1
}
} elseif [string match "usercmd" $prog] { # user supplies connect cmd
set retval [ catch {eval spawn $usercmd} reason ]
@@ -328,15 +344,83 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
}
}
} elseif ![string compare $prog "rsh"] {
- if [ catch {spawn rsh -l $user $router} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- exit 1
+ global command
+
+ if { ! $do_command } {
+ if { [llength $cmethod] == 1 } {
+ send_user "\nError: rsh is an invalid method for -x and "
+ send_user "interactive logins\n"
+ }
+ if { $progs == 0 } {
+ return 1
+ }
+ continue;
+ }
+
+ set commands [split $command \;]
+ set num_commands [llength $commands]
+ set rshfail 0
+ for {set i 0} {$i < $num_commands && !$rshfail} { incr i} {
+ log_user 0
+ set retval [ catch {spawn rsh $user@$router [lindex $commands $i] } reason ]
+ if { $retval } {
+ send_user "\nError: rsh failed: $reason\n"
+ log_user 1; return 1
+ }
+ send_user "$router# [lindex $commands $i]\n"
+
+ # rcmd does not get a pager and no prompts, so we just have to
+ # look for failures & lines.
+ expect {
+ "Connection refused" { catch {close}; wait;
+ send_user "\nError: Connection\
+ Refused ($prog): $router\n"
+ set rshfail 1
+ }
+ -re "(Connection closed by|Connection to \[^\n\r]+ closed)" {
+ catch {close}; wait;
+ send_user "\nError: Connection\
+ closed ($prog): $router\n"
+ set rshfail 1
+ }
+ "Host is unreachable" { catch {close}; wait;
+ send_user "\nError: Host Unreachable:\
+ $router\n"
+ set rshfail 1
+ }
+ "No address associated with" {
+ catch {close}; wait;
+ send_user "\nError: Unknown host\
+ $router\n"
+ set rshfail 1
+ }
+ -re "\b+" { exp_continue }
+ -re "\[\n\r]+" { send_user -- "$expect_out(buffer)"
+ exp_continue
+ }
+ timeout { catch {close}; wait
+ send_user "\nError: TIMEOUT reached\n"
+ set rshfail 1
+ }
+ eof { catch {close}; wait }
+ }
+ log_user 1
+ }
+ if { $rshfail } {
+ if { !$progs } {
+ return 1
+ } else {
+ continue
+ }
}
+ # fake the end of the session for rancid.
+ send_user "$router# exit\n"
+ # return rsh "success"
+ return -1
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
# This helps cleanup each expect clause.
@@ -419,18 +503,26 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
send_user "\nError: Check your passwd for $router\n"
return 1
}
- -re "^Enter Selection: " {
+ "Press any key to continue." {
+ # send_user "Pressing the ANY key\n"
+ send "\r"
+ exp_continue
+ }
+ -re "Enter Selection: " {
# Catalyst 1900s have some lame menu. Enter
# K to reach a command-line.
send "K\r"
- exp_continue;
+ exp_continue
+ }
+ -re "Last login:" {
+ exp_continue
}
-re "@\[^\r\n]+ $p_prompt" {
- # ssh pwd prompt
- sleep 1
- send "$userpswd\r"
- exp_continue
- }
+ # ssh pwd prompt
+ sleep 1
+ send "$userpswd\r"
+ exp_continue
+ }
-re "$u_prompt" {
send "$user\r"
set uprompt_seen 1
@@ -469,8 +561,8 @@ proc do_enable { enauser enapasswd } {
-re "$e_prompt" { send "$enapasswd\r"; exp_continue}
"#" { set prompt "#" }
"(enable)" { set prompt "> (enable) " }
- "denied" {
- # % Access denied - from local auth
+ -re "(denied|Sorry|Incorrect)" {
+ # % Access denied - from local auth and poss. others
send_user "\nError: Check your Enable passwd\n";
return 1
}
@@ -501,6 +593,9 @@ proc run_commands { prompt command } {
if { [ string compare "extreme" "$platform" ] } {
if [ regexp -- ".*> .*enable" "$prompt" ] {
send "set length 0\r"
+ # This is ugly, but reduces code duplication, allowing the
+ # subsequent expects to handle everything as normal.
+ set command "set logging session disable;$command"
} else {
send "term length 0\r"
}
@@ -508,7 +603,7 @@ proc run_commands { prompt command } {
regsub -all {[)(]} $prompt {\\&} reprompt
# match cisco config mode prompts too, such as router(config-if)#,
# but catalyst does not change in this fashion.
- regsub -all {^(.{1,14}).*([#>])$} $reprompt {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
+ regsub -all {^(.{1,11}).*([#>])$} $reprompt {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
expect {
-re $reprompt {}
-re "\[\n\r]+" { exp_continue }
@@ -534,6 +629,9 @@ proc run_commands { prompt command } {
}
-re "^\[^\n\r]*$reprompt." { send_user -- "$expect_out(buffer)"
exp_continue }
+ -re "^--More--\r\n" { # specific match c1900 pager
+ send " "
+ exp_continue }
-re "\[\n\r]+" { send_user -- "$expect_out(buffer)"
exp_continue }
-re "\[^\r\n]*Press <SPACE> to cont\[^\r\n]*" {
@@ -544,7 +642,7 @@ proc run_commands { prompt command } {
}
exp_continue
}
- -re "^ --More--\[^\n\r]*" {
+ -re "^ *--More--\[^\n\r]*" {
send " "
exp_continue }
-re "^<-+ More -+>\[^\n\r]*" {
@@ -564,6 +662,9 @@ proc run_commands { prompt command } {
}
-re "^\[^\n\r]*$reprompt." { send_user -- "$expect_out(buffer)"
exp_continue }
+ -re "^--More--\r\n" { # specific match c1900 pager
+ send " "
+ exp_continue }
-re "\[\n\r]+" { send_user -- "$expect_out(buffer)"
exp_continue }
-re "\[^\r\n]*Press <SPACE> to cont\[^\r\n]*" {
@@ -574,7 +675,7 @@ proc run_commands { prompt command } {
}
exp_continue
}
- -re "^ --More--\[^\n\r]*" {
+ -re "^ *--More--\[^\n\r]*" {
send " "
exp_continue }
-re "^<-+ More -+>\[^\n\r]*" {
@@ -586,24 +687,34 @@ proc run_commands { prompt command } {
log_user 1
if { [ string compare "extreme" "$platform" ] } {
- send "exit\r"
+ send -h "exit\r"
} else {
- send "quit\r"
+ send -h "quit\r"
}
expect {
-re "^\[^\n\r *]*$reprompt" {
# the Cisco CE and Jnx ERX
# return to non-enabled mode
# on exit in enabled mode.
- send "exit\r"
+ send -h "exit\r"
exp_continue;
}
+ "Would you like to save them now" { # Force10
+ send "n\r"
+ exp_continue
+ }
+ "Configuration changes have occurred.*" { # Cisco CSS
+ send "n\r"
+ exp_continue
+ }
"Do you wish to save your configuration changes" {
send "n\r"
exp_continue
}
-re "\[\n\r]+" { exp_continue }
- timeout { close; return 0 }
+ timeout { catch {close}; wait
+ return 0
+ }
eof { return 0 }
}
set in_proc 0
@@ -616,12 +727,14 @@ source_password_file $password_file
set in_proc 0
foreach router [lrange $argv $i end] {
set router [string tolower $router]
- send_user "$router\n"
-
- # Figure out prompt.
- # Since autoenable is off by default, if we have it defined, it
- # was done on the command line. If it is not specifically set on the
- # command line, check the password file.
+ # attempt at platform switching.
+ set platform ""
+ send_user -- "$router\n"
+
+ # Figure out the prompt.
+ # autoenable is off by default. If we have it defined, it was done
+ # on the command line. If it is not specifically set on the command
+ # line, check the password file.
if $avautoenable {
set autoenable 1
set enable 0
@@ -634,6 +747,7 @@ foreach router [lrange $argv $i end] {
set prompt "(#| \\(enable\\))"
} else {
set autoenable 0
+ set enable $avenable
set prompt ">"
}
}
@@ -647,15 +761,18 @@ foreach router [lrange $argv $i end] {
if { $do_passwd || $do_enapasswd } {
set pswd [find password $router]
if { [llength $pswd] == 0 } {
- send_user "\nError: no password for $router in $password_file.\n"
+ send_user -- "\nError: no password for $router in $password_file.\n"
continue
}
if { $enable && $do_enapasswd && $autoenable == 0 && [llength $pswd] < 2 } {
- send_user "\nError: no enable password for $router in $password_file.\n"
+ send_user -- "\nError: no enable password for $router in $password_file.\n"
continue
}
set passwd [join [lindex $pswd 0] ""]
set enapasswd [join [lindex $pswd 1] ""]
+ } else {
+ set passwd $userpasswd
+ set enapasswd $enapasswd
}
# Figure out username
@@ -728,12 +845,13 @@ foreach router [lrange $argv $i end] {
# Login to the router
if {[login $router $ruser $userpswd $passwd $enapasswd $cmethod $cyphertype]} {
+ # if login failed or rsh was unsuccessful, move on to the next device
continue
}
if { $enable } {
if {[do_enable $enauser $enapasswd]} {
if { $do_command || $do_script } {
- close; wait
+ catch {close}; catch {wait}
continue
}
}
@@ -742,7 +860,7 @@ foreach router [lrange $argv $i end] {
send "\r"
expect {
-re "\[\r\n]+" { exp_continue; }
- -re "^(.+:)1 $prompt" { # stoopid extreme cmd-line numbers and
+ -re "^(.+\[:.])1 ($prompt)" { # stoopid extreme cmd-line numbers and
# prompt based on state of config changes,
# which may have an * at the beginning.
set junk $expect_out(1,string)
diff --git a/bin/control_rancid.in b/bin/control_rancid.in
index f51a21b..388bbf4 100644
--- a/bin/control_rancid.in
+++ b/bin/control_rancid.in
@@ -1,8 +1,9 @@
#! /bin/sh
##
-## $Id: control_rancid.in,v 1.61 2004/01/11 05:25:13 hank Exp $
+## $Id: control_rancid.in,v 1.80 2006/12/07 21:14:06 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,22 +25,21 @@
# print a usage message to stderr
pr_usage() {
- echo "usage: $0 [-r device_name] [-m mail rcpt] [group [group ...]]" >&2;
+ echo "usage: $0 [-V] [-r device_name] [-m mail rcpt] [group [group ...]]" >&2;
}
# command-line options
-# -r <device name>
+# -V print version string
# -m <mail recipients>
+# -r <device name>
alt_mailrcpt=0
if [ $# -ge 1 ] ; then
while [ 1 ] ; do
case $1 in
- -r)
- shift
- # next arg is the device name
- device="$1"
- shift
+ -V)
+ echo "@PACKAGE@ @VERSION@"
+ exit 0
;;
-m)
shift
@@ -52,6 +52,12 @@ if [ $# -ge 1 ] ; then
fi
shift
;;
+ -r)
+ shift
+ # next arg is the device name
+ device="$1"
+ shift
+ ;;
--)
shift; break;
;;
@@ -81,12 +87,33 @@ DIR=$BASEDIR/$GROUP
TMP=${TMPDIR:=/tmp}/rancid.$GROUP.$$
trap 'rm -fr $TMP;' 1 2 15
-# the receipient(s) of diffs
-mailrcpt=${mailrcpt:-"@MAILPLUS@$GROUP"}; export mailrcpt
-adminmailrcpt=${mailrcpt:-"@ADMINMAILPLUS@$GROUP"}; export adminmailrcpt
+# disable noclobber
+unset noclobber > /dev/null 2>&1
+
+# RCS system
+RCSSYS=${RCSSYS:=cvs};
+if [ $RCSSYS != "cvs" -a $RCSSYS != "svn" ] ; then
+ echo "$RCSSYS is not a valid value for RCSSYS."
+ exit 1
+fi
+
+# the receipient(s) of diffs & mail options
+mailrcpt=${mailrcpt:-"@MAILPLUS@${GROUP}${MAILDOMAIN}"}; export mailrcpt
+adminmailrcpt=${adminmailrcpt:-"@ADMINMAILPLUS@${GROUP}${MAILDOMAIN}"};
+export adminmailrcpt
+set | grep MAILHEADERS= > /dev/null 2>&1
+if [ $? -ne 0 ] ; then
+ MAILHEADERS="Precedence: bulk\n"; export MAILHEADERS
+fi
# Number of things par should run in parallel.
PAR_COUNT=${PAR_COUNT:-5}
+# Number of times failed collections should be retried. Minimum 1.
+MAX_ROUNDS=${MAX_ROUNDS:-4}
+if [ $MAX_ROUNDS -lt 1 ] ; then
+ echo "Error: MAX_ROUNDS must be at least 1."
+ MAX_ROUNDS=1
+fi
# Bail if we do not have the necessary info to run
if [ ! -d $DIR ]
@@ -96,20 +123,36 @@ then
(
echo "To: $adminmailrcpt"
echo "Subject: no $GROUP directory"
- echo "Precedence: bulk"
+ echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
echo ""
echo "$DIR does not exist."
echo "Run bin/rancid-cvs $GROUP to make all of the needed directories."
) | sendmail -t
exit 1
fi
+cd $DIR
+
+# create a .cvsignore
+if [ ! -f .cvsignore ]
+then
+ rm -f .cvsignore
+ cat >.cvsignore <<EOF
+.cvsignore
+routers.all
+routers.down
+routers.up
+EOF
+ if [ $RCSSYS = svn ]
+ then
+ svn propset svn:ignore -F .cvsignore .
+ fi
+fi
# do cvs update of router.db in case anyone has fiddled.
-cd $DIR
-cvs update router.db > $TMP 2>&1
+$RCSSYS update router.db > $TMP 2>&1
grep "^C" $TMP > /dev/null
if [ $? -eq 0 ] ; then
- echo "There were CVS conflicts during update."
+ echo "There were $RCSSYS conflicts during update."
echo ""
cat $TMP
rm -f $TMP
@@ -119,36 +162,34 @@ rm -f $TMP
if [ ! -f $DIR/router.db ]
then
+ echo "$DIR/router.db does not exist."
(
echo "To: $adminmailrcpt"
echo "Subject: no $GROUP/router.db file"
- echo "Precedence: bulk"
+ echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
echo ""
echo "$DIR/router.db does not exist."
) | sendmail -t
exit 1;
-elif [ ! -s $DIR/router.db ]
-then
- exit
fi
# generate the list of all, up, & down routers
cd $DIR
trap 'rm -fr routers.db routers.all.new routers.down.new routers.up.new \
routers.mail routers.added routers.deleted $TMP;' 1 2 15
-sed -e '/^#/d' -e 's/^ *//' -e 's/ *$//' -e 's/ *: */:/g' router.db |
+sed -e '/^#/d' -e 's/^ *//' -e 's/ *$//' -e 's/ *: */:/g' router.db |
sort -u > routers.db
cut -d: -f1,2 routers.db > routers.all.new
if [ ! -f routers.all ] ; then touch routers.all; fi
-diff routers.all routers.all.new > /dev/null 2>&1; RALL=$?
+@DIFF_CMD@ routers.all routers.all.new > /dev/null 2>&1; RALL=$?
@PERLV@ -F: -ane '{($F[0] =~ tr@A-Z@a-z@,print $_)
if ($F[2] !~ /^up$/i);}' routers.db > routers.down.new
if [ ! -f routers.down ] ; then touch routers.down; fi
-diff routers.down routers.down.new > /dev/null 2>&1; RDOWN=$?
+@DIFF_CMD@ routers.down routers.down.new > /dev/null 2>&1; RDOWN=$?
@PERLV@ -F: -ane '{($F[0] =~ tr@A-Z@a-z@,print "$F[0]:$F[1]\n")
if ($F[2] =~ /^up$/i);}' routers.db > routers.up.new
if [ ! -f routers.up ] ; then touch routers.up; fi
-diff routers.up routers.up.new > /dev/null 2>&1; RUP=$?
+@DIFF_CMD@ routers.up routers.up.new > /dev/null 2>&1; RUP=$?
if [ $RALL -ne 0 -o $RDOWN -ne 0 -o $RUP -ne 0 ]
then
@@ -177,10 +218,10 @@ then
WCDOWN=`comm -13 routers.down routers.down.new | wc -l | \
sed -e 's/^ *\([^ ]*\)/\1/'`
if [ $WCDOWN -eq 1 ] ; then
- echo Routers changed to down:
- comm -13 routers.down routers.down.new | \
+ echo Routers changed to down:
+ comm -13 routers.down routers.down.new | \
sed -e 's/^/ /'
- echo
+ echo
fi
fi
fi
@@ -195,14 +236,14 @@ then
if [ $WCADDED -gt 0 ]
then
- echo Added routers:
- cat routers.added
+ echo Added routers:
+ cat routers.added
echo
fi
if [ $WCDELETED -gt 0 ]
then
- echo Deleted routers:
- cat routers.deleted
+ echo Deleted routers:
+ cat routers.deleted
echo
fi
@@ -214,7 +255,7 @@ then
(
echo "To: $adminmailrcpt"
echo "Subject: changes in $GROUP routers"
- echo "Precedence: bulk"
+ echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
echo ""
cat routers.mail
) | sendmail -t
@@ -233,8 +274,12 @@ then
router=$1
touch $router
- cvs add -ko $router
- cvs commit -m 'new router' $router
+ if [ $RCSSYS = cvs ] ; then
+ cvs add -ko $router
+ else
+ svn add $router
+ fi
+ $RCSSYS commit -m 'new router' $router
echo "Added $router"
done
echo
@@ -257,23 +302,31 @@ rm -f routers.db
trap 'rm -fr $TMP;' 1 2 15
cd $DIR/configs
-# check for 'up' routers missing in cvs. no idea how this happens to some folks
+# check for 'up' routers missing in RCS. no idea how this happens to some folks
for router in `cut -d: -f1 ../routers.up` ; do
- cvs status $router | grep -i 'status: unknown' > /dev/null 2>&1
+ if [ $RCSSYS = cvs ] ; then
+ cvs status $router | grep -i 'status: unknown' > /dev/null 2>&1
+ else
+ svn status $router | grep '^?' > /dev/null 2>&1
+ fi
if [ $? -eq 0 ]; then
touch $router
- cvs add -ko $router
- echo "CVS added missing router $router"
+ if [ $RCSSYS = cvs ] ; then
+ cvs add -ko $router
+ else
+ svn add $router
+ fi
+ echo "$RCSSYS added missing router $router"
fi
done
echo
-# cvs delete configs for routers not listed in routers.up.
-for router in `find . \( -name \*.new -prune -o -name CVS -prune \) -o -type f -print | sed -e 's/^.\///'` ; do
+# delete configs from RCS for routers not listed in routers.up.
+for router in `find . \( -name \*.new -prune -o -name CVS -prune -o -name .svn -prune \) -o -type f -print | sed -e 's/^.\///'` ; do
grep -i "^$router:" ../router.db > /dev/null 2>&1
if [ $? -eq 1 ]; then
rm -f $router
- cvs delete $router
- cvs commit -m 'deleted router' $router
+ $RCSSYS delete $router
+ $RCSSYS commit -m 'deleted router' $router
echo "Deleted $router"
fi
done
@@ -283,7 +336,7 @@ cd $DIR
if [ ! -s routers.up ]
then
# commit router.db
- cvs commit -m updates router.db > /dev/null
+ $RCSSYS commit -m updates router.db
exit;
fi
@@ -311,7 +364,7 @@ par -q -n $PAR_COUNT -c "rancid-fe \{}" $devlistfile
# This section will generate a list of missed routers
# and try to grab them again. It will run through
# $pass times.
-pass=4
+pass=$MAX_ROUNDS
round=1
if [ -f $DIR/routers.up.missed ]; then
rm -f $DIR/routers.up.missed
@@ -349,10 +402,10 @@ echo
# Make sure that no empty configs are accepted. Those that are non-empty
# are renamed from device_name.new -> device_name.
for router in `cat $devlistfile`
-do
+do
OFS=$IFS
IFS=':'
- set $router
+ set $router
IFS=$OFS
router=$1;
@@ -371,8 +424,12 @@ done
# Diff the directory and then checkin.
trap 'rm -fr $TMP $TMP.diff $DIR/routers.single;' 1 2 15
cd $DIR
-cvs -f @DIFF_CMD@ | sed -e '/^RCS file: /d' -e '/^--- /d' \
+if [ $RCSSYS = "cvs" ] ; then
+ cvs -f @DIFF_CMD@ -ko | sed -e '/^RCS file: /d' -e '/^--- /d' \
-e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
+else
+ svn diff | sed -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
+fi
if [ $alt_mailrcpt -eq 1 ] ; then
subject="router config diffs - courtesy of $mailrcpt"
@@ -380,22 +437,23 @@ else
subject="router config diffs"
fi
if [ "X$device" != "X" ] ; then
- cvs commit -m "updates - courtesy of $mailrcpt"
+ $RCSSYS commit -m "updates - courtesy of $mailrcpt"
subject="$GROUP/$device $subject"
else
- cvs commit -m updates
+ $RCSSYS commit -m updates
subject="$GROUP $subject"
fi
# Mail out the diffs (if there are any).
-if [ -s $TMP.diff ]; then
- sendmail -t <<EMAIL
-To: $mailrcpt
-Subject: $subject
-Precedence: bulk
-
-`cat $TMP.diff`
-EMAIL
+if [ -s $TMP.diff ]
+then
+ (
+ echo "To: $mailrcpt"
+ echo "Subject: $subject"
+ echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
+ echo ""
+ cat $TMP.diff
+ ) | sendmail -t
fi
# If any machines have not been reached within the last $OLDTIME
@@ -412,7 +470,7 @@ then
(
echo "To: $adminmailrcpt"
echo "Subject: config fetcher problems - $GROUP"
- echo "Precedence: bulk"
+ echo "$MAILHEADERS" | awk '{L = "";LN = $0;while (LN ~ /\\n/) { I = index(LN,"\\n");L = L substr(LN,0,I-1) "\n";LN = substr(LN,I+2,length(LN)-I-1);}print L LN;}'
echo ""
echo "The following routers have not been successfully contacted for"
echo "more than $OLDTIME hours."
@@ -422,5 +480,5 @@ then
fi
# Cleanup
-rm -f $TMP.diff $DIR/routers.single
+rm -f $TMP.diff $DIR/routers.single $DIR/routers.failed
trap '' 1 2 15
diff --git a/bin/cssrancid.in b/bin/cssrancid.in
index 27049df..294f400 100644
--- a/bin/cssrancid.in
+++ b/bin/cssrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: cssrancid.in,v 1.4 2004/01/11 03:49:13 heas Exp $
+## $Id: cssrancid.in,v 1.13 2006/10/05 04:27:42 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -21,25 +22,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -64,7 +70,7 @@ sub numerically { $a <=> $b; }
# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -77,7 +83,7 @@ sub keynsort {
# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -90,7 +96,7 @@ sub keysort {
# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -102,7 +108,7 @@ sub valsort{
# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -116,7 +122,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -129,7 +135,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -141,7 +147,6 @@ sub ShowVersion {
while (<INPUT>) {
tr/\015//d;
- study;
last if(/^$prompt/);
next if(/^(\s*|\s*$cmd\s*)$/);
return(-1) if (/command authorization failed/i);
@@ -254,6 +259,8 @@ sub ShowVersion {
sub TermLength {
# Dummy subroutine.. need to set term length differently for CSS
# boxes as term length 0 doesnt work correctly. POS.
+ print STDERR " In TermLength: $_" if ($debug);
+ $_ = <INPUT>;
return(0);
}
@@ -264,6 +271,8 @@ sub CopyProfile {
## of couse breaks the interaction... strangely enough tho
## in a failover environment, only the secondary behaves this
## way.. the primary lets you log out and does not complain.
+ print STDERR " In CopyProfile: $_" if ($debug);
+ $_ = <INPUT>;
return(0);
}
@@ -283,15 +292,16 @@ sub ShowBoot {
return(1) if /Ambiguous command/i;
# return(1) if /(Invalid input detected|Type help or )/;
return(1) if /(Open device \S+ failed|Error opening \S+:)/;
+ next if (/\*\* BOOT CONFIG /);
next if /CONFGEN variable/;
if (!defined($H0)) {
$H0=1; ProcessHistory("COMMENTS","keysort","H0","!\n");
}
if ($type !~ /^(12[04]|7)/) {
if ($type !~ /^(29|35)00/) {
- ProcessHistory("COMMENTS","keysort","H2","!BootFlash: $_");
+ ProcessHistory("COMMENTS","keysort","H2","!BootFlash: $_");
} else {
- ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
+ ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
}
} elsif (/variable/) {
ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
@@ -305,17 +315,18 @@ sub ShowBoot {
# This routine processes a "show run"
sub ShowRun {
print STDERR " In ShowRun: $_" if ($debug);
- my($lineauto) = 0;
+ my($lines) = 0;
while (<INPUT>) {
tr/\015//d;
- study;
- last if(/^$prompt/);
+ if(/^$prompt/) {
+ $found_end = 1 if ($lines > 4);
+ return(1);
+ }
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
s/^<-+ More -+>\s*//;
/Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
- $lineauto = 0 if (/^[^ ]/);
# skip the crap
if (/^(##+$|(Building|Current) configuration)/i) {
while (<INPUT>) {
@@ -335,14 +346,14 @@ sub ShowRun {
/^! (Last configuration|NVRAM config last)/ && next;
## CSS specific....
/Generated on/ && next;
+ $lines++;
# Dog gone Cool matches to process the rest of the config
/^tftp-server flash / && next; # kill any tftp remains
/^ntp clock-period / && next; # kill ntp clock-period
/^ length / && next; # kill length on serial lines
/^ width / && next; # kill width on serial lines
- $lineauto = 1 if /^ modem auto/;
- /^ speed / && $lineauto && next; # kill speed on serial lines
+ /^ speed / && next; # kill speed on serial lines
/^ clockrate / && next; # kill clockrate on serial interfaces
if (/^(enable )?(password|passwd) / && $filter_pwds >= 1) {
ProcessHistory("ENABLE","","","!$1$2 <removed>\n");
@@ -360,11 +371,9 @@ sub ShowRun {
}
next;
}
- if (/^username (\S+)(\s.*)? password ((\d) \S+|\S+)/) {
- if ($filter_pwds == 2) {
- ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
- } elsif ($filter_pwds == 1 && $4 ne "5"){
- ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
+ if (/\s*username (\S+)(\s.*)? (des-password|password) (\S+|\S+)/) {
+ if ($filter_pwds >= 1) {
+ ProcessHistory("USER","keysort","$1","! username $1$2 $3 <removed>$'\n");
} else {
ProcessHistory("USER","keysort","$1","$_");
}
@@ -537,11 +546,6 @@ sub ShowRun {
# catch anything that wasnt matched above.
ProcessHistory("","","","$_");
- # end of config. the ": " game is for the PIX
- if (/^(: +)?end$/ || /CSS.*#/ || /$prompt/ ) {
- $found_end = 1;
- return(1);
- }
}
return(0);
}
@@ -550,25 +554,30 @@ sub ShowRun {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'term length 65535' => "TermLength",
- 'copy profile user-profile' => "CopyProfile",
- 'show version' => "ShowVersion",
- 'show boot' => "ShowBoot",
- 'show run' => "ShowRun"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and show run last). pita
-@commands=(
- "term length 65535",
- "copy profile user-profile",
- "show version",
- "show boot",
- "show run"
+@commandtable = (
+ {'term length 65535' => 'TermLength'},
+ {'copy profile user-profile' => 'CopyProfile'},
+ {'show version' => 'ShowVersion'},
+ {'show boot' => 'ShowBoot'},
+ {'show run' => 'ShowRun'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -590,7 +599,7 @@ if ($file) {
}
# determine password filtering mode
-if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
$filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
@@ -599,11 +608,12 @@ if ($ENV{"FILTER_PWDS"} =~ /no/i) {
}
ProcessHistory("","","","!RANCID-CONTENT-TYPE: cisco-css\n!\n");
-ProcessHistory("COMMENTS","keysort","B0","!\n");
-ProcessHistory("COMMENTS","keysort","F0","!\n");
-ProcessHistory("COMMENTS","keysort","G0","!\n");
+#ProcessHistory("COMMENTS","keysort","B0","!\n");
+#ProcessHistory("COMMENTS","keysort","F0","!\n");
+#ProcessHistory("COMMENTS","keysort","G0","!\n");
TOP: while(<INPUT>) {
+NEXT:
tr/\015//d;
if (/\#\s?exit/) {
$clean_run=1;
@@ -615,23 +625,27 @@ TOP: while(<INPUT>) {
$clean_run=0;
last;
}
- while (/#\s*($cmds_regexp)\s*$/) {
+ if (/#\s*($cmds_regexp)\s*$/) {
$cmd = $1;
- if (!defined($prompt)) {$prompt = ($_ =~ /^([^#]+#)/)[0]; }
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
- # $clean_run = 0;
- # last TOP;
- next TOP;
- } else {
- $rval = &{$commands{$cmd}};
- delete($commands{$cmd});
- if ($rval == -1) {
- $clean_run = 0;
- last TOP;
- }
+ $clean_run = 0;
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ $clean_run = 0;
+ last TOP;
}
+ # the function may have read the next prompt/cmd line
+ goto NEXT;
}
}
print STDOUT "Done $logincmd: $_\n" if ($log);
diff --git a/bin/elogin.in b/bin/elogin.in
index 651d7fb..d581101 100644
--- a/bin/elogin.in
+++ b/bin/elogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: elogin.in,v 1.27 2004/01/11 05:39:15 heas Exp $
+## $Id: elogin.in,v 1.38 2006/12/05 16:50:52 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -40,7 +41,7 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 1
+set avenable 1
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
set avautoenable 0
@@ -49,7 +50,7 @@ set avautoenable 0
set do_passwd 1
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -62,9 +63,12 @@ if {[ info exists env(CISCO_USER) ] } {
if [ catch {exec id} reason ] {
send_error "\nError: could not exec id: $reason\n"
exit 1
- }
+ }
regexp {\(([^)]*)} "$reason" junk default_user
-}
+}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -90,13 +94,16 @@ for {set i 0} {$i < $argc} {incr i} {
}
set do_passwd 0
# VTY Password
- } -v* -
- -v* {
+ } -v* {
if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
incr i
set passwd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Enable Username
} -w* -
-W* {
@@ -268,31 +275,44 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user userpswd passwd prompt cmethod cyphertype } {
global spawn_id in_proc do_command do_script
global u_prompt p_prompt
set in_proc 1
- set uprompt_seen 0
+ set uprompt_seen 0
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
- set retval [ catch {spawn telnet $router} reason ]
- } else {
+ set retval [ catch {spawn telnet $router} reason ]
+ } else {
set retval [ catch {spawn telnet $router $port} reason ]
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
+ } elseif ![string compare $prog "ssh"] {
+ send_error "\nError: unsupported method: ssh\n"
+ if { $progs == 0 } {
+ return 1
+ }
+ continue
+ } elseif ![string compare $prog "rsh"] {
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
+ }
+ continue
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
# This helps cleanup each expect clause.
@@ -394,9 +414,11 @@ proc run_commands { prompt command } {
}
send "exit\r"
expect {
- "\n" { exp_continue }
- timeout { return 0 }
- eof { return 0 }
+ "\n" { exp_continue }
+ timeout { catch {close}; wait
+ return 0
+ }
+ eof { return 0 }
}
set in_proc 0
}
diff --git a/bin/erancid.in b/bin/erancid.in
index 20da43d..a95da84 100644
--- a/bin/erancid.in
+++ b/bin/erancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: erancid.in,v 1.18 2004/01/11 03:49:13 heas Exp $
+## $Id: erancid.in,v 1.26 2006/10/05 04:27:42 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -21,25 +22,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # elogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -61,10 +67,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -74,10 +80,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -87,10 +93,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -100,9 +106,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -116,7 +122,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -129,7 +135,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -168,8 +174,8 @@ sub ShowModule {
# now just copy it verbatim to the history file
while (<INPUT>) {
- tr/\015//d;
- last if(/Active\) >/);
+ tr/\015//d;
+ last if(/Active\) >/);
last if(/^$/);
chop;
ProcessHistory("SLOT","","","-$_\n");
@@ -186,8 +192,8 @@ sub WriteTerm {
# now just copy it verbatim to the history file
while (<INPUT>) {
- tr/\015//d;
- last if(/Active\) >/);
+ tr/\015//d;
+ last if(/Active\) >/);
chop;
if (/^\s*snmp/ && defined($ENV{'NOCOMMSTR'})) {
/snmp (getcomm|setcomm|trapcomm)(\s+)(\S*)/ &&
@@ -204,21 +210,28 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'version' => "ShowVersion",
- 'equipment' => "ShowModule",
- 'config' => "WriteTerm",
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "version",
- "equipment",
- "config",
+@commandtable = (
+ {'version' => 'ShowVersion'},
+ {'equipment' => 'ShowModule'},
+ {'config' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -241,7 +254,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
diff --git a/bin/f10rancid.in b/bin/f10rancid.in
index 2c4e485..e61d215 100644
--- a/bin/f10rancid.in
+++ b/bin/f10rancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: f10rancid.in,v 1.11 2004/01/11 03:49:13 heas Exp $
+## $Id: f10rancid.in,v 1.23 2006/10/05 04:27:42 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -23,25 +24,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -63,10 +69,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -76,10 +82,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -89,10 +95,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -102,9 +108,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -118,7 +124,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -131,7 +137,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -360,41 +366,6 @@ sub ShowEnv {
return(0);
}
-# This routine parses "show gsr chassis-info" for the gsr
-# This will create arrays for hw info.
-sub ShowGSR {
- # Skip if this is not a 1200n.
- print STDERR " In ShowGSR: $_" if ($debug);
-
- while (<INPUT>) {
- tr/\015//d;
- last if (/^$prompt/);
- next if (/^(\s*|\s*$cmd\s*)$/);
- return(-1) if (/command authorization failed/i);
- # return(1) if ($type !~ /^12[40]/);
- /^$/ && next;
- /^\s+Chassis: type (\S+) Fab Ver: (\S+)/ &&
- ProcessHistory("COMMENTS","keysort","D0","!\n") &&
- ProcessHistory("COMMENTS","keysort","D1",
- "!GSR Chassis type: $1 Fab Ver: $2\n") &&
- next;
- /^\s+Chassis S\/N: (.*)$/ &&
- ProcessHistory("COMMENTS","keysort","D2",
- "!GSR Chassis S/N: $1\n") &&
- next;
- /^\s+PCA: (\S+)\s*rev: (\S+)\s*dev: \S+\s*HW ver: (\S+)$/ &&
- ProcessHistory("COMMENTS","keysort","D3",
- "!GSR Backplane PCA: $1, rev $2, ver $3\n") &&
- next;
- /^\s+Backplane S\/N: (\S+)$/ &&
- ProcessHistory("COMMENTS","keysort","D4",
- "!GSR Backplane S/N: $1\n") &&
- next;
- }
- ProcessHistory("COMMENTS","","","!\n");
- return(0);
-}
-
# This routine parses "show boot"
sub ShowBoot {
# Pick up boot variables if 7000/7200/7500/12000/2900/3500;
@@ -416,9 +387,9 @@ sub ShowBoot {
}
if ($type !~ /^(12[04]|7)/) {
if ($type !~ /^(29|35)00/) {
- ProcessHistory("COMMENTS","keysort","H2","!BootFlash: $_");
+ ProcessHistory("COMMENTS","keysort","H2","!BootFlash: $_");
} else {
- ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
+ ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
}
} elsif (/variable/) {
ProcessHistory("COMMENTS","keysort","H1","!Variable: $_");
@@ -800,41 +771,6 @@ sub ShowModule {
return(0);
}
-# This routine parses "show c7200" for the 7200
-# This will create arrays for hw info.
-sub ShowC7200 {
- # Skip if this is not a 7200.
- print STDERR " In ShowC7200: $_" if ($debug);
-
- while (<INPUT>) {
- tr/\015//d;
- last if (/^$prompt/);
- next if (/^(\s*|\s*$cmd\s*)$/);
- #return(1) if ($type !~ /^72/);
- return(-1) if (/command authorization failed/i);
- /^$/ && next;
- if (/C7200 Midplane EEPROM:/) {
- $_ = <INPUT>;
- /revision\s+(\S+).*revision\s+(\S+)/;
- ProcessHistory("SLOT","","","!Slot Midplane: hvers $1 rev $2\n");
- $_ = <INPUT>;
- /number\s+(\S+)\s+Part number\s+(\S+)/;
- ProcessHistory("SLOT","","","!Slot Midplane: part $2, serial $1\n!\n");
- next;
- }
- if (/C720\d(VXR)? CPU EEPROM:/) {
- $_ = <INPUT>;
- /revision\s+(\S+).*revision\s+(\S+)/ &&
- ProcessHistory("SLOT","","","!Slot CPU: hvers $1 rev $2\n");
- $_ = <INPUT>;
- /number\s+(\S+)\s+Part number\s+(\S+)/ &&
- ProcessHistory("SLOT","","","!Slot CPU: part $2, serial $1\n!\n");
- next;
- }
- }
- return(0);
-}
-
# This routine parses "show vtp status"
sub ShowVTP {
print STDERR " In ShowVTP: $_" if ($debug);
@@ -890,7 +826,7 @@ sub WriteTerm {
# skip the crap
if (/^(##+$|(Building|Current) configuration)/i) {
while (<INPUT>) {
- next if (/^Current configuration\s*:/i);
+ next if (/^!?Current configuration\s*:/i);
next if (/^:/);
next if (/^([%!].*|\s*)$/);
next if (/^ip add.*ipv4:/); # band-aid for 3620 12.0S
@@ -1109,65 +1045,48 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'show install active' => "ShowInstallActive",
- 'show env all' => "ShowEnv",
- 'show gsr chassis' => "ShowGSR",
- 'show boot' => "ShowBoot",
- 'show bootvar' => "ShowBoot",
- 'show variables boot' => "ShowBoot",
- 'show flash' => "ShowFlash",
- 'dir /all nvram:' => "DirSlotN",
- 'dir /all bootflash:' => "DirSlotN",
- 'dir /all slot0:' => "DirSlotN",
- 'dir /all disk0:' => "DirSlotN",
- 'dir /all slot1:' => "DirSlotN",
- 'dir /all disk1:' => "DirSlotN",
- "dir /all sup-bootflash:"=> "DirSlotN", # cat 6500-ios
- "dir /all sup-microcode:"=> "DirSlotN", # cat 6500-ios
- 'show controllers' => "ShowContAll",
- 'show controllers cbus' => "ShowContCbus",
- 'show diagbus' => "ShowDiagbus",
- 'show diag' => "ShowDiag",
- 'show module' => "ShowModule", # cat 6500-ios
- 'show c7200' => "ShowC7200",
- 'show vtp status' => "ShowVTP",
- 'show vlan' => "ShowVLAN",
- 'show running' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version",
- "show install active",
- "show env all",
- "show gsr chassis",
- "show boot",
- "show bootvar",
- "show variables boot",
- "show flash",
- "dir /all nvram:",
- "dir /all bootflash:",
- "dir /all slot0:",
- "dir /all disk0:",
- "dir /all slot1:",
- "dir /all disk1:",
- "dir /all sup-bootflash:",
- "dir /all sup-microcode:",
- "show controllers",
- "show controllers cbus",
- "show diagbus",
- "show diag",
- "show module",
- "show c7200",
- "show vtp status",
- "show vlan",
- "show running"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'show install active' => 'ShowInstallActive'},
+ {'show env all' => 'ShowEnv'},
+ {'show boot' => 'ShowBoot'},
+ {'show bootvar' => 'ShowBoot'},
+ {'show variables boot' => 'ShowBoot'},
+ {'show flash' => 'ShowFlash'},
+ {'dir /all nvram:' => 'DirSlotN'},
+ {'dir /all bootflash:' => 'DirSlotN'},
+ {'dir /all slot0:' => 'DirSlotN'},
+ {'dir /all disk0:' => 'DirSlotN'},
+ {'dir /all slot1:' => 'DirSlotN'},
+ {'dir /all disk1:' => 'DirSlotN'},
+ {'dir /all sup-bootflash:' => 'DirSlotN'},
+ {'dir /all sup-microcode:' => 'DirSlotN'},
+ {'show controllers' => 'ShowContAll'},
+ {'show controllers cbus' => 'ShowContCbus'},
+ {'show diagbus' => 'ShowDiagbus'},
+ {'show diag' => 'ShowDiag'},
+ {'show module' => 'ShowModule'},
+ {'show vtp status' => 'ShowVTP'},
+ {'show vlan' => 'ShowVLAN'},
+ {'show running' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -1189,7 +1108,7 @@ if ($file) {
}
# determine password filtering mode
-if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
$filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
diff --git a/bin/flogin.in b/bin/flogin.in
index 169e522..5c8813d 100644
--- a/bin/flogin.in
+++ b/bin/flogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: flogin.in,v 1.32 2004/01/11 05:39:15 heas Exp $
+## $Id: flogin.in,v 1.47 2006/12/08 21:28:26 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -50,7 +51,7 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 1
+set avenable 1
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
set avautoenable 0
@@ -60,7 +61,7 @@ set do_passwd 1
set do_enapasswd 1
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -73,9 +74,12 @@ if {[ info exists env(CISCO_USER) ] } {
if [ catch {exec id} reason ] {
send_error "\nError: could not exec id: $reason\n"
exit 1
- }
+ }
regexp {\(([^)]*)} "$reason" junk default_user
-}
+}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -101,13 +105,16 @@ for {set i 0} {$i < $argc} {incr i} {
}
set do_passwd 0
# VTY Password
- } -v* -
- -v* {
+ } -v* {
if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
incr i
set passwd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Enable Username
} -w* -
-W* {
@@ -186,11 +193,11 @@ for {set i 0} {$i < $argc} {incr i} {
set do_command 1
# Do we enable?
} -noenable {
- set enable 0
+ set avenable 0
# Does tacacs automatically enable us?
} -autoenable {
set avautoenable 1
- set enable 0
+ set avenable 0
} -* {
send_user "\nError: Unknown argument! $arg\n"
send_user $usage
@@ -244,9 +251,9 @@ proc include {args} {
regsub -all "(^{|}$)" $args {} args
if { [ regexp "^/" $args ignore ] == 0 } {
set args $env(HOME)/$args
- }
+ }
source_password_file $args
-}
+}
proc find {var router} {
upvar int_$var list
@@ -264,7 +271,7 @@ proc find {var router} {
# it is sourced, the user better know what to put in there, as it
# could install more than just password info... I will assume however,
# that a "bad guy" could just as easy put such code in the clogin
-# script, so I will leave .cloginrc as just an extention of that script
+# script, so I will leave .cloginrc as just an extention of that script
proc source_password_file { password_file } {
global env
if { ! [file exists $password_file] } {
@@ -283,6 +290,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
global spawn_id in_proc do_command do_script platform
global prompt u_prompt p_prompt e_prompt sshcmd
@@ -292,6 +300,7 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
@@ -301,23 +310,23 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
} elseif ![string compare $prog "ssh"] {
if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
send_user "\nError: $sshcmd failed: $reason\n"
- exit 1
+ return 1
}
} elseif ![string compare $prog "rsh"] {
- if [ catch {spawn rsh -l $user $router} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- exit 1
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
}
+ continue;
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
# This helps cleanup each expect clause.
@@ -354,15 +363,15 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
if !$progs {
send_user "\nError: Connection Refused ($prog): $router\n"
return 1
- }
+ }
}
-re "(Connection closed by|Connection to \[^\n\r]+ closed)" {
catch {close}; wait
if !$progs {
send_user "\nError: Connection closed ($prog): $router\n"
return 1
- }
- }
+ }
+ }
-re "Telnet server disabled" {
catch {close}; wait
if !$progs {
@@ -500,12 +509,14 @@ proc run_commands { prompt command } {
}
send "exit\r"
expect {
- "\n" { exp_continue }
- -re "^\[^ ]+>" {
- send "exit\r"
- exp_continue }
- timeout { return 0 }
- eof { return 0 }
+ "\n" { exp_continue }
+ -re "^\[^ ]+>" { send "exit\r"
+ exp_continue
+ }
+ timeout { catch {close}; wait
+ return 0
+ }
+ eof { return 0 }
}
set in_proc 0
}
@@ -535,6 +546,7 @@ foreach router [lrange $argv $i end] {
set prompt "#"
} else {
set autoenable 0
+ set enable $avenable
set prompt ">"
}
}
@@ -545,23 +557,26 @@ foreach router [lrange $argv $i end] {
if { [llength $pswd] == 0 } {
send_user "\nError: no password for $router in $password_file.\n"
continue
- }
+ }
if { $enable && $do_enapasswd && $autoenable == 0 && [llength $pswd] < 2 } {
send_user "\nError: no enable password for $router in $password_file.\n"
continue
}
set passwd [join [lindex $pswd 0] ""]
set enapasswd [join [lindex $pswd 1] ""]
+ } else {
+ set passwd $userpasswd
+ set enapasswd $enapasswd
}
# Figure out username
- if {[info exists username]} {
+ if {[info exists username]} {
# command line username
set ruser $username
} else {
set ruser [join [find user $router] ""]
if { "$ruser" == "" } { set ruser $default_user }
- }
+ }
# Figure out username's password (if different from the vty password)
if {[info exists userpasswd]} {
@@ -569,22 +584,22 @@ foreach router [lrange $argv $i end] {
set userpswd $userpasswd
} else {
set userpswd [join [find userpassword $router] ""]
- if { "$userpswd" == "" } { set userpswd $passwd }
- }
-
+ if { "$userpswd" == "" } { set userpswd $passwd }
+ }
+
# Figure out enable username
- if {[info exists enausername]} {
+ if {[info exists enausername]} {
# command line enausername
set enauser $enausername
} else {
set enauser [join [find enauser $router] ""]
- if { "$enauser" == "" } { set enauser $ruser }
- }
+ if { "$enauser" == "" } { set enauser $ruser }
+ }
# Figure out prompts
set u_prompt [find userprompt $router]
if { "$u_prompt" == "" } {
- set u_prompt "(Username|login|Name|User Name):"
+ set u_prompt "(Username|login|Name|User Name) *:"
} else {
set u_prompt [join [lindex $u_prompt 0] ""]
}
@@ -614,18 +629,18 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
- # Figure out the SSH executable name
- set sshcmd [find sshcmd $router]
- if { "$sshcmd" == "" } { set sshcmd {ssh} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
# Login to the router
if {[login $router $ruser $userpswd $passwd $enapasswd $cmethod $cyphertype]} {
continue
}
- if { $enable } {
+ if { $enable } {
if {[do_enable $enauser $enapasswd]} {
if { $do_command || $do_script } {
- close; wait
+ catch {close}; catch {wait}
continue
}
}
@@ -642,7 +657,7 @@ foreach router [lrange $argv $i end] {
source $sfile
close
} else {
- label $router
+ label $router
log_user 1
interact
}
diff --git a/bin/fnrancid.in b/bin/fnrancid.in
index 815227b..b14906a 100644
--- a/bin/fnrancid.in
+++ b/bin/fnrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: fnrancid.in,v 1.3 2004/01/11 03:49:13 heas Exp $
+## $Id: fnrancid.in,v 1.11 2006/10/05 04:27:42 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -20,29 +21,34 @@
##
#
# A library built on Stephen Gill's Netscreen stuff to accomodate
-# the Fortinet product line. [d_pfleger@juniper.net]
+# the Fortinet product line. [d_pfleger@juniper.net]
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
#$debug = 1;
$file = $opt_f;
$host = $ARGV[0];
$found_end = 0;
-$timeo = 90; # nlogin timeout in seconds
+$timeo = 90; # nlogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -64,10 +70,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -77,10 +83,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -90,22 +96,22 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
- $sorted_lines[$i] = $key;
- $i++;
+ $sorted_lines[$i] = $key;
+ $i++;
}
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -119,7 +125,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -132,7 +138,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -146,7 +152,7 @@ sub GetSystem {
tr/\015//d;
next if /^\s*$/;
last if(/$prompt/);
- ProcessHistory("","","","$_");
+ ProcessHistory("","","","$_");
#print STDOUT "$_";
}
print STDOUT "Vendor: $vendor";
@@ -170,9 +176,9 @@ sub GetConf {
next if /^\s*$/;
last if(/$prompt/);
if (/(^set.*)('Enc .*')(.*)/) {
- ProcessHistory("ENC","","","!$1 'Enc **encoding removed**' $3\n");
- next;
- }
+ ProcessHistory("ENC","","","!$1 'Enc **encoding removed**' $3\n");
+ next;
+ }
ProcessHistory("","","","$_");
#print STDOUT "$_";
}
@@ -184,19 +190,27 @@ sub GetConf {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'get system status' => "GetSystem",
- 'get conf' => "GetConf"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important. pita
-@commands=(
- "get system status",
- "get conf"
+@commandtable = (
+ {'get system status' => 'GetSystem'},
+ {'get conf' => 'GetConf'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -218,7 +232,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
diff --git a/bin/francid.in b/bin/francid.in
index e1fd284..2967a34 100644
--- a/bin/francid.in
+++ b/bin/francid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: francid.in,v 1.26 2004/01/11 03:49:13 heas Exp $
+## $Id: francid.in,v 1.42 2006/10/05 05:43:31 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,25 +25,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # flogin timeout in seconds
+$timeo = 90; # flogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -64,10 +70,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -77,10 +83,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -90,22 +96,22 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
- $sorted_lines[$i] = $key;
- $i++;
+ $sorted_lines[$i] = $key;
+ $i++;
}
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -119,7 +125,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -132,7 +138,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -147,14 +153,17 @@ sub ShowVersion {
while (<INPUT>) {
tr/\015//d;
next if /^\s*$/;
- last if(/^$prompt/);
+ last if (/^$prompt/);
next if (/^(The system |Crash time)/);
+ next if (/^((Active|Standby) Management|LP Slot \d+) uptime is/);
s/^\s*(HW|SW)/$1/;
s/^\s*(Compiled on)/SW: $1/;
+ s/^\s*(\(\d+ bytes\) from )/SW: $1/;
+
#s/^(HW.*)/$1\n/;
- if (/^SL (\d)/) {
+ if (/^SL (\d+)/) {
$slot = "Slot $1";
s/^SL \d+/$slot/;
}
@@ -172,6 +181,8 @@ sub ShowVersion {
# This routine parses "show chassis"
sub ShowChassis {
+ my($skip) = 0;
+
print STDERR " In ShowChassis: $_" if ($debug);
while (<INPUT>) {
@@ -179,6 +190,28 @@ sub ShowChassis {
last if (/^$prompt/);
next if (/ from /);
next if (/current temperature/i);
+
+ if (/^---/ || /^$/) { # next section reached
+ $skip = 0;
+ }
+ if (/(POWERS|TEMPERATURE READINGS)/) {
+ $skip = 1;
+ }
+ if (/fan controlled temperature:/i) {
+ $skip = 1;
+ }
+ if (/THERMAL PLANE/) {
+ $skip = 1;
+ }
+ if (/temperature:/i) {
+ $skip = 1;
+ }
+ s/(Fan \d+ \S+), speed .*/$1/;
+ if (/speed/i) {
+ $skip = 1;
+ }
+ next if $skip;
+
ProcessHistory("CHASSIS","","","! $_");
}
ProcessHistory("CHASSIS","","","!\n");
@@ -191,8 +224,8 @@ sub ShowFlash {
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if /^\s*$/;
+ last if (/^$prompt/);
+ next if (/^\s*$/);
ProcessHistory("FLASH","","","!Flash: $_");
}
ProcessHistory("","","","!\n");
@@ -205,9 +238,10 @@ sub ShowModule {
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if /^\s*$/;
- next if /:\s*$/;
+ last if (/^$prompt/);
+ return(1) if (/Invalid input ->/);
+ next if (/^\s*$/);
+ next if (/:\s*$/);
ProcessHistory("MODULE","","","!Module: $_");
}
ProcessHistory("","","","!\n");
@@ -220,17 +254,24 @@ sub WriteTerm {
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
+ last if (/^$prompt/);
/Current configuration:/i && next;
/^ver \d+\.\d+/ && next;
/^module \d+ / && next;
/^ntp clock-period / && next; # kill ntp clock-period
- /^ length / && next; # kill length on serial lines
- /^ width / && next; # kill width on serial lines
+ /^ length / && next; # kill length on serial lines
+ /^ width / && next; # kill width on serial lines
# filter out any RCS/CVS tags to avoid confusing local CVS storage
s/\$(Revision|Id):/ $1:/;
+ # sort secure-mac-addresses. Note: There is no way to determine which
+ # have been added dynamically vs statically. Thus, sort them?
+ /secure-mac-address (\S+)/ &&
+ ProcessHistory("SECMAC","keysort","$1","$_") && next;
+ # OR filter them? XXX
+ #next if (/secure-mac-address/);
+
# order access-lists
/^access-list\s+(\d+)\s+(perm|deny)\s+(\d\S+)(\/\d+)\s*$/ &&
ProcessHistory("PACL $1 $2","ipsort","$3","$_")
@@ -301,6 +342,23 @@ sub WriteTerm {
next;
}
+ # reorder listing of ports in a vlan
+ if (/^ (?:un)?tagged ethe/) {
+ chomp;
+ s/^\s+//;
+ s/\s+$//;
+
+ my @list = split /\s+ethe\s+/, $_;
+ my $tagtype = shift @list;
+
+ while (@list) {
+ ProcessHistory("","","",
+ " $tagtype ethe " . (shift @list) . "\n");
+ }
+ next;
+ }
+
+
ProcessHistory("","","","$_");
# end of config
if (/^end$/) {
@@ -315,25 +373,30 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'show chassis' => "ShowChassis",
- 'show module' => "ShowModule",
- 'show flash' => "ShowFlash",
- 'write term' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important. pita
-@commands=(
- "show version",
- "show chassis",
- "show module",
- "show flash",
- "write term"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'show chassis' => 'ShowChassis'},
+ {'show module' => 'ShowModule'},
+ {'show flash' => 'ShowFlash'},
+ {'write term' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -356,7 +419,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
diff --git a/bin/hlogin.in b/bin/hlogin.in
index 6af11b4..8777021 100644
--- a/bin/hlogin.in
+++ b/bin/hlogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: hlogin.in,v 1.21 2004/01/11 05:39:15 heas Exp $
+## $Id: hlogin.in,v 1.40 2006/12/08 21:28:26 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -47,7 +48,7 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 1
+set avenable 1
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
set avautoenable 0
@@ -57,9 +58,11 @@ set do_passwd 1
set do_enapasswd 1
# attempt at platform switching.
set platform ""
+#
+set send_human {.4 .4 .7 .3 5}
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -75,6 +78,9 @@ if {[ info exists env(CISCO_USER) ] } {
}
regexp {\(([^)]*)} "$reason" junk default_user
}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -100,13 +106,16 @@ for {set i 0} {$i < $argc} {incr i} {
}
set do_passwd 0
# VTY Password
- } -v* -
- -v* {
+ } -v* {
if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
incr i
set passwd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Enable Username
} -w* -
-W* {
@@ -181,20 +190,20 @@ for {set i 0} {$i < $argc} {incr i} {
}
if [ catch {set cmd_fd [open $cmd_file r]} reason ] {
send_user "\nError: $reason\n"
- exit 1
- }
+ exit 1
+ }
set cmd_text [read $cmd_fd]
close $cmd_fd
set command [join [split $cmd_text \n] \;]
set do_command 1
# Do we enable?
} -noenable {
- set enable 0
+ set avenable 0
# Does tacacs automatically enable us?
} -autoenable {
# hp does not autoenable
#set autoenable 1
- #set enable 0
+ #set avenable 0
} -* {
send_user "\nError: Unknown argument! $arg\n"
send_user $usage
@@ -244,25 +253,25 @@ proc label { host } {
# add password * hanky-pie
proc add {var args} { global int_$var ; lappend int_$var $args}
proc include {args} {
- global env
- regsub -all "(^{|}$)" $args {} args
+ global env
+ regsub -all "(^{|}$)" $args {} args
if { [ regexp "^/" $args ignore ] == 0 } {
set args $env(HOME)/$args
- }
+ }
source_password_file $args
-}
-
+}
+
proc find {var router} {
- upvar int_$var list
+ upvar int_$var list
if { [info exists list] } {
foreach line $list {
if { [string match [lindex $line 0] $router ] } {
return [lrange $line 1 end]
- }
- }
- }
- return {}
-}
+ }
+ }
+ }
+ return {}
+}
# Loads the password file. Note that as this file is tcl, and that
# it is sourced, the user better know what to put in there, as it
@@ -287,6 +296,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
global spawn_id in_proc do_command do_script platform
global prompt u_prompt p_prompt e_prompt sshcmd
@@ -295,37 +305,38 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
regexp {(telnet|ssh)(:([^[:space:]]+))*} $prog command suffix junk port
if [string match "telnet*" $prog] {
if {"$port" == ""} {
- set retval [ catch {spawn hpuifilter telnet $router} reason ]
+ set retval [ catch {spawn hpuifilter -- telnet $router} reason ]
} else {
- set retval [ catch {spawn hpuifilter telnet $router $port} reason ]
+ set retval [ catch {spawn hpuifilter -- telnet $router $port} reason ]
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
} elseif [string match "ssh*" $prog] {
if {"$port" == ""} {
- set retval [ catch {spawn hpuifilter $sshcmd -c $cyphertype -x -l $user $router} reason ]
+ set retval [ catch {spawn hpuifilter -- $sshcmd -c $cyphertype -x -l $user $router} reason ]
} else {
- set retval [ catch {spawn hpuifilter $sshcmd -c $cyphertype -p $port -x -l $user $router} reason ]
+ set retval [ catch {spawn hpuifilter -- $sshcmd -c $cyphertype -p $port -x -l $user $router} reason ]
}
if { $retval } {
send_user "\nError: $sshcmd failed: $reason\n"
- exit 1
+ return 1
}
} elseif ![string compare $prog "rsh"] {
- if [ catch {spawn hpuifilter rsh -l $user $router} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- exit 1
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
}
+ continue;
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
# This helps cleanup each expect clause.
@@ -367,11 +378,6 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
send_user "\nError: Connection Refused ($prog)\n"; return 1
}
}
- eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
- -nocase "unknown host\r" {
- catch {close};
- send_user "\nError: Unknown host\n"; wait; return 1
- }
"Host is unreachable" {
catch {close};
send_user "\nError: Host Unreachable!\n"; wait; return 1
@@ -392,12 +398,21 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
send "no\r"
send_user "\nError: host key mismatch for $router. Update the SSH known_hosts file accordingly.\n"
return 1 }
+ eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
+ -nocase "unknown host\r" {
+ catch {close};
+ send_user "\nError: Unknown host\n"; wait; return 1
+ }
-re "$u_prompt" { send "$user\r"
expect {
eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
"Login invalid" { send_user "\nError: Invalid login\n"; vatch {close}; wait; return 1 }
-re "$p_prompt" { send "$userpswd\r" }
"$prompt" { set in_proc 0; return 0 }
+ "Press any key to continue" {
+ send " "
+ exp_continue
+ }
}
exp_continue
}
@@ -408,9 +423,18 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
send "$passwd\r"
}
expect {
- eof { send_user "\nError: Couldn't login\n"; wait; return 1 }
+ eof { send_user "\nError: Couldn't login\n";
+ wait;
+ return 1
+ }
+ "Press any key to continue" {
+ send " ";
+ exp_continue
+ }
-re "$e_prompt" { send "$enapasswd\r" }
- "$prompt" { set in_proc 0; return 0 }
+ "$prompt" { set in_proc 0;
+ return 0
+ }
}
exp_continue
}
@@ -454,16 +478,14 @@ proc run_commands { prompt command } {
global in_proc platform
set in_proc 1
- # If the prompt is (enable), then we are on a switch and the
- # command is "set length 0"; otherwise its "term length 0".
- # skip if its and extreme.
+ # Turn off the pager and escape regex meta characters in the $prompt
send "no page\r"
regsub -all "\[)(]" $prompt {\\&} reprompt
- expect {
- -re $reprompt {}
- -re "\[\n\r]+" { exp_continue }
- }
- # this is the only way i see to get rid for more prompts in o/p..grrrrr
+ expect {
+ -re $reprompt {}
+ -re "\[\n\r]+" { exp_continue }
+ }
+ # this is the only way i see to get rid of more prompts in o/p..grrrrr
log_user 0
# Is this a multi-command?
if [ string match "*\;*" "$command" ] {
@@ -491,6 +513,10 @@ proc run_commands { prompt command } {
}
-re "^<-+ More -+>\[^\n\r]*" { send " "
exp_continue }
+ -re "^-+ MORE -+\[^\n\r]*" { send " "
+ exp_continue }
+ -re "^-+More-+\[^\n\r]*" { send " "
+ exp_continue }
-re "\b+" { exp_continue }
}
}
@@ -516,11 +542,13 @@ proc run_commands { prompt command } {
exp_continue }
-re "^-+ MORE -+\[^\n\r]*" { send " "
exp_continue }
+ -re "^-+More-+\[^\n\r]*" { send " "
+ exp_continue }
-re "\b+" { exp_continue }
}
}
log_user 1
- send "exit\r"
+ send -h "exit\r"
expect {
"Do you want to save current configuration" {
send "n\r"
@@ -536,10 +564,12 @@ proc run_commands { prompt command } {
}
-re "\[\r\n]+" { exp_continue }
-re "^.+>" {
- send "exit\r"
+ send -h "exit\r"
exp_continue
}
- timeout { return 0 }
+ timeout { catch {close}; wait
+ return 0
+ }
eof { return 0 }
}
set in_proc 0
@@ -570,6 +600,7 @@ foreach router [lrange $argv $i end] {
set prompt "#"
} else {
set autoenable 0
+ set enable $avenable
set prompt ">"
}
}
@@ -592,6 +623,9 @@ foreach router [lrange $argv $i end] {
}
set passwd [join [lindex $pswd 0] ""]
set enapasswd [join [lindex $pswd 1] ""]
+ } else {
+ set passwd $userpasswd
+ set enapasswd $enapasswd
}
# Figure out username
@@ -654,9 +688,9 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
- # Figure out the SSH executable name
- set sshcmd [find sshcmd $router]
- if { "$sshcmd" == "" } { set sshcmd {ssh} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
# Adjust our path to find hpuifilter
regexp {(.*)/[^/]+} $argv0 junk hpf_path
@@ -671,17 +705,17 @@ foreach router [lrange $argv $i end] {
if { $enable } {
if {[do_enable $enauser $enapasswd]} {
if { $do_command || $do_script } {
- close; wait
+ catch {close}; catch {wait}
continue
}
}
}
# we are logged in, now figure out the full prompt
- send "\r"
- expect {
+ send "\r"
+ expect {
-re "\[\r\n]+" { exp_continue; }
-re "^.+$prompt" { set prompt $expect_out(0,string); }
- }
+ }
if { $do_command } {
if {[run_commands $prompt $command]} {
diff --git a/bin/hpuifilter.c b/bin/hpuifilter.c
index 8f7005a..c278a3f 100644
--- a/bin/hpuifilter.c
+++ b/bin/hpuifilter.c
@@ -1,7 +1,7 @@
/*
- * $Id: hpuifilter.c,v 1.17 2004/01/11 03:49:13 heas Exp $
+ * $Id: hpuifilter.c,v 1.36 2006/11/29 01:02:27 heas Exp $
*
- * Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+ * Copyright (C) 1997-2006 by Terrapin Communications, Inc.
* All rights reserved.
*
* This software may be freely copied, modified and redistributed
@@ -21,51 +21,117 @@
* point of hpfilter is to filter all the bloody vt100 (curses) escape codes
* that the HP procurve switches belch out, which are a real bitch to handle
* in hlogin.
+ *
+ * Modified openpty() from NetBSD:
+ * Copyright (c) 1990, 1993, 1994
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
*/
-#define DFLT_TO 60 /* default timeout */
-#include <config.h>
-#include <version.h>
+#include "config.h"
+#include "version.h"
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <stdio.h>
#include <limits.h>
#include <fcntl.h>
+#include <poll.h>
+#if HAVE_PTY_H
+# include <pty.h>
+#endif
+#include <regex.h>
#include <signal.h>
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_PTMX && HAVE_STROPTS_H
+# include <stropts.h>
+#endif
+#include <sys/ioctl.h>
+#include <sys/stat.h>
#include <sys/time.h>
-#include <regex.h>
-
#include <termios.h>
+#if HAVE_UTIL_H
+# include <util.h>
+#endif
-char *progname;
-int debug = 0;
+#define BUFSZ (LINE_MAX * 2)
+
+char **environ,
+ *progname;
+int child,
+ debug,
+ drain,
+ timeo = 5; /* default timeout */
int filter __P((char *, int));
+RETSIGTYPE reapchild __P((void));
+#if !HAVE_OPENPTY
+int openpty(int *, int *, char *, struct termios *,
+ struct winsize *);
+#endif
+RETSIGTYPE sighdlr __P((int));
+#if !HAVE_UNSETENV
+int unsetenv __P((const char *));
+#endif
void usage __P((void));
void vers __P((void));
-RETSIGTYPE reapchild __P((void));
int
-main(int argc, char **argv)
+main(int argc, char **argv, char **ev)
{
extern char *optarg;
extern int optind;
char ch,
- hbuf[LINE_MAX * 2], /* hlogin buffer */
- *hbufp,
- tbuf[LINE_MAX * 2], /* telnet buffer */
+ hbuf[BUFSZ], /* hlogin buffer */
+ ptyname[FILENAME_MAX + 1],
+ tbuf[BUFSZ], /* telnet/ssh buffer */
*tbufp;
int bytes, /* bytes read/written */
- child,
- r[2], /* recv pipe */
- s[2]; /* send pipe */
+ devnull,
+ rval = EX_OK,
+ ptym, /* master pty */
+ ptys; /* slave pty */
ssize_t hlen = 0, /* len of hbuf */
tlen = 0; /* len of tbuf */
- struct timeval to = { DFLT_TO, 0 };
- fd_set rfds, /* select() */
- wfds;
+ struct pollfd pfds[3];
struct termios tios;
+ environ = ev;
+
/* get just the basename() of our exec() name and strip a .* off the end */
if ((progname = strrchr(argv[0], '/')) != NULL)
progname += 1;
@@ -74,11 +140,16 @@ main(int argc, char **argv)
if (strrchr(progname, '.') != NULL)
*(strrchr(progname, '.')) = '\0';
- while ((ch = getopt(argc, argv, "dhv")) != -1 )
+ while ((ch = getopt(argc, argv, "dhvt:")) != -1 )
switch (ch) {
case 'd':
debug++;
break;
+ case 't':
+ timeo = atoi(optarg);
+ if (timeo < 1)
+ timeo = 1;
+ break;
case 'v':
vers();
return(EX_OK);
@@ -93,26 +164,41 @@ main(int argc, char **argv)
return(EX_USAGE);
}
- /* reap our children */
- signal(SIGCHLD, (void *) reapchild);
- signal(SIGHUP, (void *) reapchild);
- signal(SIGINT, (void *) reapchild);
- signal(SIGTERM, (void *) reapchild);
+ unsetenv("DISPLAY");
- /* create 2 pipes for send/recv and then fork and exec telnet */
for (child = 3; child < 10; child++)
close(child);
- if (pipe(s) || pipe(r)) {
- fprintf(stderr, "%s: pipe() failed: %s\n", progname,
+
+ /* allocate pty for telnet/ssh, then fork and exec */
+ if (openpty(&ptym, &ptys, ptyname, NULL, NULL)) {
+ fprintf(stderr, "%s: could not allocate pty: %s\n", progname,
strerror(errno));
return(EX_TEMPFAIL);
}
+ /* make the pty raw */
+ if (tcgetattr(ptys, &tios)) {
+ fprintf(stderr, "%s: tcgetattr() failed: %s\n", progname,
+ strerror(errno));
+ return(EX_OSERR);
+ }
+ tios.c_lflag &= ~ECHO;
+ tios.c_lflag &= ~ICANON;
+#ifdef VMIN
+ tios.c_cc[VMIN] = 1;
+ tios.c_cc[VTIME] = 0;
+#endif
+ if (tcsetattr(ptys, TCSANOW, &tios)) {
+ fprintf(stderr, "%s: tcsetattr() failed: %s\n", progname,
+ strerror(errno));
+ return(EX_OSERR);
+ }
- /* if a tty, make it raw as the hp echos _everything_, including
+ /*
+ * if a tty, make it raw as the hp echos _everything_, including
* passwords.
*/
- if (isatty(0)) {
- if (tcgetattr(0, &tios)) {
+ if (isatty(fileno(stdin))) {
+ if (tcgetattr(fileno(stdin), &tios)) {
fprintf(stderr, "%s: tcgetattr() failed: %s\n", progname,
strerror(errno));
return(EX_OSERR);
@@ -123,180 +209,272 @@ main(int argc, char **argv)
tios.c_cc[VMIN] = 1;
tios.c_cc[VTIME] = 0;
#endif
- if (tcsetattr(0, TCSANOW, &tios)) {
+ if (tcsetattr(fileno(stdin), TCSANOW, &tios)) {
fprintf(stderr, "%s: tcsetattr() failed: %s\n", progname,
strerror(errno));
return(EX_OSERR);
}
}
+ /* zero the buffers */
+ memset(hbuf, 0, BUFSZ);
+ memset(tbuf, 0, BUFSZ);
+
+ /* reap our children, must be set-up *after* openpty() */
+ signal(SIGCHLD, (void *) reapchild);
+
if ((child = fork()) == -1) {
- fprintf(stderr, "%s: fork() failed: %s\n", progname,
- strerror(errno));
+ fprintf(stderr, "%s: fork() failed: %s\n", progname, strerror(errno));
return(EX_TEMPFAIL);
}
- /* zero the buffers */
- bzero(hbuf, LINE_MAX * 2);
- bzero(tbuf, LINE_MAX * 2);
-
if (child == 0) {
- /* close the parent's side of the pipes; we write r[1], read s[0] */
- close(s[1]);
- close(r[0]);
+ struct winsize ws;
+
+ /*
+ * Make sure our terminal length and width are something greater
+ * than 1, for pagers on stupid boxes.
+ */
+ ioctl(ptys, TIOCGWINSZ, &ws);
+ ws.ws_row = 24;
+ ws.ws_col = 132;
+ ioctl(ptys, TIOCSWINSZ, &ws);
+
+ signal(SIGCHLD, SIG_DFL);
+ /* close the master pty & std* inherited from the parent */
+ close(ptym);
+ if (ptys != 0)
+ close(0);
+ if (ptys != 1)
+ close(1);
+ if (ptys != 2)
+ close(2);
+#ifdef TIOCSCTTY
+ setsid();
+ if (ioctl(ptys, TIOCSCTTY, NULL) == -1) {
+ snprintf(ptyname, FILENAME_MAX, "%s: could not set controlling "
+ "tty: %s\n", progname, strerror(errno));
+ write(0, ptyname, strlen(ptyname));
+ return(EX_OSERR);
+ }
+#endif
+
/* close stdin/out/err and attach them to the pipes */
- if (dup2(s[0], 0) == -1 || dup2(r[1], 1) == -1 || dup2(r[1], 2) == -1) {
- fprintf(stderr, "%s: dup2() failed: %s\n", progname,
- strerror(errno));
+ if (dup2(ptys, 0) == -1 || dup2(ptys, 1) == -1 || dup2(ptys, 2) == -1) {
+ snprintf(ptyname, FILENAME_MAX, "%s: dup2() failed: %s\n", progname,
+ strerror(errno));
+ write(0, ptyname, strlen(ptyname));
return(EX_OSERR);
}
- close(s[0]);
- close(r[1]);
- /* exec telnet */
- if (execvp(argv[optind], argv + optind)) {
- fprintf(stderr, "%s: execlp() failed: %s\n", progname,
+ if (ptys > 2)
+ close(ptys);
+
+ /* exec telnet/ssh */
+ execvp(argv[optind], argv + optind);
+ snprintf(ptyname, FILENAME_MAX, "%s: execvp() failed: %s\n", progname,
+ strerror(errno));
+ write(0, ptyname, strlen(ptyname));
+ return(EX_TEMPFAIL);
+ /*NOTREACHED*/
+ }
+
+ /* parent */
+ if (debug)
+ fprintf(stderr, "child %d\n", child);
+
+ signal(SIGHUP, (void *) sighdlr);
+
+ /* close the slave pty */
+ close(ptys);
+
+ devnull = open("/dev/null", O_RDWR);
+
+ /* make FDs non-blocking */
+ if (fcntl(ptym, F_SETFL, O_NONBLOCK) ||
+ fcntl(fileno(stdin), F_SETFL, O_NONBLOCK) ||
+ fcntl(fileno(stdout), F_SETFL, O_NONBLOCK)) {
+ fprintf(stderr, "%s: fcntl(NONBLOCK) failed: %s\n", progname,
strerror(errno));
- return(EX_TEMPFAIL);
+ exit(EX_OSERR);
+ }
+
+ /* loop to read on stdin and ptym */
+#define POLLEXP (POLLERR | POLLHUP | POLLNVAL)
+ pfds[0].fd = fileno(stdin);
+ pfds[0].events = POLLIN | POLLEXP;
+ pfds[1].fd = fileno(stdout);
+ pfds[2].fd = ptym;
+ pfds[2].events = POLLIN | POLLEXP;
+
+ while (1) {
+ bytes = poll(pfds, 3, (timeo * 1000));
+ if (bytes == 0) {
+ if (drain)
+ break;
+ /* timeout */
+ continue;
}
- /* not reached */
- } else {
- /* parent */
- if (debug)
- fprintf(stderr, "child %d\n", child);
-
- /* close the child's side of the pipes; we write s[1], read r[0] */
- close(s[0]);
- close(r[1]);
-
- /* make FDs non-blocking */
- if (fcntl(s[1], F_SETFL, O_NONBLOCK) ||
- fcntl(r[0], F_SETFL, O_NONBLOCK) ||
- fcntl(0, F_SETFL, O_NONBLOCK) ||
- fcntl(1, F_SETFL, O_NONBLOCK)) {
- fprintf(stderr, "%s: fcntl(NONBLOCK) failed: %s\n", progname,
- strerror(errno));
- exit(EX_OSERR);
+ if (bytes == -1) {
+ switch (errno) {
+ case EAGAIN:
+ case EINTR:
+ break;
+ default:
+ rval = EX_IOERR;
+ break;
+ }
+ continue;
}
- /* loop to read on stdin and r[0] */
- FD_ZERO(&rfds); FD_ZERO(&wfds);
- hbufp = hbuf; tbufp = tbuf;
+ /*
+ * write buffers first
+ * write hbuf (stdin) -> ptym
+ */
+ if ((pfds[2].revents & POLLOUT) && hlen) {
+ if ((bytes = write(pfds[2].fd, hbuf, hlen)) < 0 &&
+ errno != EINTR && errno != EAGAIN) {
+ fprintf(stderr, "%s: write() failed: %s\n", progname,
+ strerror(errno));
+ hbuf[0] = '\0';
+ hlen = 0;
+ drain = 1;
+ pfds[2].events &= ~POLLOUT;
- while (1) {
- FD_SET(0, &rfds); FD_SET(r[0], &rfds);
- /* if we have stuff in our buffer(s), we select on writes too */
- FD_ZERO(&wfds);
- if (hlen) {
- FD_SET(s[1], &wfds);
- }
- if (tlen) {
- FD_SET(1, &wfds);
+ break;
+ } else if (bytes > 0) {
+ strcpy(hbuf, hbuf + bytes);
+ hlen -= bytes;
+ if (hlen < 1)
+ pfds[2].events &= ~POLLOUT;
}
+ } else if (pfds[2].revents & POLLEXP) {
+ hbuf[0] = '\0';
+ hlen = 0;
+ pfds[2].events &= POLLIN;
+ break;
+ }
- switch (select(r[1], &rfds, &wfds, NULL, &to)) {
- case 0:
- /* timeout */
- /* HEAS: what do i do here? */
+ /* write tbuf -> stdout */
+ if ((pfds[1].revents & POLLOUT) && tlen) {
+ /*
+ * if there is an escape char that didnt get filter()'d,
+ * we need to write only up to that point and wait for
+ * the bits that complete the escape sequence. if at least
+ * two bytes follow it, write it anyway as filter() didnt
+ * match it.
+ */
+ bytes = tlen;
+ if ((tbufp = index(tbuf, 0x1b)) != NULL)
+ if (tlen - (tbufp - tbuf) < 2)
+ bytes = tbufp - tbuf;
+
+ if ((bytes = write(pfds[1].fd, tbuf, bytes)) < 0 &&
+ errno != EINTR && errno != EAGAIN) {
+ fprintf(stderr, "%s: write() failed: %s\n", progname,
+ strerror(errno));
break;
- case -1:
- switch (errno) {
- case EINTR: /* interrupted syscall */
+ tbuf[0] = '\0';
+ tlen = 0;
+ drain = 1;
+ pfds[1].events = 0;
+ } else if (bytes > 0) {
+ strcpy(tbuf, tbuf + bytes);
+ tlen -= bytes;
+ if (tlen < 1)
+ pfds[1].events &= ~POLLOUT;
+ }
+ } else if (pfds[1].revents & POLLEXP) {
+ break;
+ tbuf[0] = '\0';
+ tlen = 0;
+ pfds[1].fd = devnull;
+ pfds[1].events = 0;
+ }
+
+ /* read stdin -> hbuf */
+ if (pfds[0].revents & POLLIN) {
+ if (BUFSZ - hlen > 1) {
+ bytes = read(pfds[0].fd, hbuf + hlen, (BUFSZ - 1) - hlen);
+ if (bytes > 0) {
+ hlen += bytes;
+ hbuf[hlen] = '\0';
+ pfds[2].events |= POLLOUT;
+ } else if (bytes == 0 && errno != EAGAIN && errno != EINTR) {
break;
- default:
- exit(EX_IOERR);
+ /* EOF or read error */
+ drain = 1;
+ pfds[0].fd = devnull;
+ pfds[0].events = 0;
}
- break;
- default:
- /* check exceptions first */
-
- /* which FD is ready? write our buffers asap. */
- /* write hbuf (stdin) -> s[1] */
- if (FD_ISSET(s[1], &wfds) && hlen) {
- if ((hlen = write(s[1], hbuf, hlen)) < 0) {
- fprintf(stderr, "%s: write() failed: %s\n", progname,
- strerror(errno));
- close(s[1]);
- } else
- strcpy(hbuf, hbuf + hlen);
-
- hlen = strlen(hbuf);
- }
- /* write tbuf -> stdout */
- if (FD_ISSET(1, &wfds) && tlen) {
- /* if there is an escape char that didnt get filter()'d,
- * we need to only write up to that point and wait for
- * the bits that complete the escape sequence
- */
- if ((tbufp = index(tbuf, 0x1b)) != NULL)
- tlen = tbufp - tbuf;
-
- if ((tlen = write(1, tbuf, tlen)) < 0) {
- fprintf(stderr, "%s: write() failed: %s\n", progname,
- strerror(errno));
- close(1);
- } else
- strcpy(tbuf, tbuf + tlen);
-
- tlen = strlen(tbuf);
- }
- if (FD_ISSET(0, &rfds)) {
- /* read stdin into hbuf */
- if (LINE_MAX * 2 - hlen > 1) {
- hlen += read(0, hbuf + hlen,
- (LINE_MAX * 2 - 1) - hlen);
- if (hlen > 0) {
- hbuf[hlen] = '\0';
- } else if (hlen == 0 || errno != EAGAIN)
- /* EOF or read error */
- close(0);
-
- hlen = strlen(hbuf);
- }
- } else if (FD_ISSET(r[0], &rfds)) {
- /* read telnet into tbuf, then filter */
- if (LINE_MAX * 2 - tlen > 1) {
- tlen += read(r[0], tbuf + tlen,
- (LINE_MAX * 2 - 1) - tlen);
- if (tlen > 0) {
- tbuf[tlen] = '\0';
- tlen = filter(tbuf, tlen);
- } else if (tlen == 0 || errno != EAGAIN)
- /* EOF or read error */
- close(r[0]);
-
- tlen = strlen(tbuf);
- }
- }
-
- break;
}
+ } else if (pfds[0].revents & POLLEXP) {
+ break;
+ drain = 1;
+ pfds[0].fd = devnull;
+ pfds[0].events = 0;
}
- /* close */
- close(0);
- close(1);
- close(s[1]);
- close(r[0]);
+ /* read telnet/ssh -> tbuf, then filter */
+ if (pfds[2].revents & POLLIN) {
+ if (BUFSZ - tlen > 1) {
+ bytes = read(pfds[2].fd, tbuf + tlen, (BUFSZ - 1) - tlen);
+ if (bytes > 0) {
+ tlen += bytes;
+ tbuf[tlen] = '\0';
+ tlen = filter(tbuf, tlen);
+ if (tlen > 0)
+ pfds[1].events |= POLLOUT;
+ } else if (bytes == 0 && errno != EAGAIN && errno != EINTR) {
+ /* EOF or read error */
+ break;
+ drain = 1;
+ pfds[2].fd = devnull;
+ pfds[2].events = 0;
+ }
+ }
+ } else if (pfds[2].revents & POLLEXP) {
+ break;
+ drain = 1;
+ pfds[2].fd = devnull;
+ pfds[2].events = 0;
+ }
+ }
+ /* try to flush buffers */
+ if (hlen) {
+ (void) write(pfds[2].fd, hbuf, hlen);
+ hlen = 0;
}
+ if (tlen) {
+ (void) write(pfds[1].fd, tbuf, tlen);
+ tlen = 0;
+ }
+ if ((bytes = read(pfds[2].fd, tbuf, (BUFSZ - 1))) > 0) {
+ tbuf[bytes] = '\0';
+ tlen = filter(tbuf, bytes);
+ (void) write(pfds[1].fd, tbuf, tlen);
+ }
+ tcdrain(pfds[1].fd);
+ if ((hlen = read(pfds[0].fd, hbuf, (BUFSZ - 1))) > 0) {
+ (void) write(pfds[2].fd, hbuf, hlen);
+ }
+ tcdrain(pfds[2].fd);
- if (! kill(child, SIGQUIT))
+ if (child && ! kill(child, SIGINT))
reapchild();
- return(EX_OK);
+ return(rval);
}
int
-filter(buf, len)
- char *buf;
- int len;
+filter(char *buf, int len)
{
static regmatch_t pmatch[1];
-#define N_REG 11 /* number of regexes in reg[][] */
+#define N_REG 14 /* number of regexes in reg[][] */
static regex_t preg[N_REG];
static char reg[N_REG][50] = { /* vt100/220 escape codes */
"\e7\e\\[1;24r\e8", /* ds */
"\e8", /* fs */
-
+
"\e\\[2J",
"\e\\[2K", /* kE */
@@ -307,8 +485,12 @@ filter(buf, len)
"\e\\[\\?7l", /* RA */
"\e\\[\\?25h", /* ve */
"\e\\[\\?25l", /* vi */
+ "\e\\[K", /* ce */
+ "\e\\[7m", /* mr - ansi */
- "\eE", /* replace w/ CR */
+ /* replace these with CR */
+ "\e\\[0m", /* me */
+ "\eE",
};
char ebuf[256];
size_t nmatch = 1;
@@ -319,7 +501,7 @@ filter(buf, len)
if (index(buf, 0x1b) == 0 || len == 0)
return(len);
- for (x = 0; x < N_REG - 1; x++) {
+ for (x = 0; x < N_REG - 2; x++) {
if (! init) {
if ((err = regcomp(&preg[x], reg[x], REG_EXTENDED))) {
regerror(err, &preg[x], ebuf, 256);
@@ -342,53 +524,89 @@ filter(buf, len)
/* replace \eE w/ CR NL */
if (! init++) {
- if ((err = regcomp(&preg[N_REG - 1], reg[N_REG - 1], REG_EXTENDED))) {
- regerror(err, &preg[N_REG - 1], ebuf, 256);
- fprintf(stderr, "%s: regex compile failed: %s\n", progname,
- ebuf);
- abort();
- }
+ for (x = N_REG - 2; x < N_REG; x++)
+ if ((err = regcomp(&preg[x], reg[x], REG_EXTENDED))) {
+ regerror(err, &preg[x], ebuf, 256);
+ fprintf(stderr, "%s: regex compile failed: %s\n", progname,
+ ebuf);
+ abort();
+ }
}
- while (1)
- if ((err = regexec(&preg[N_REG - 1], buf, nmatch, pmatch, 0))) {
+ for (x = N_REG - 2; x < N_REG; x++) {
+ if ((err = regexec(&preg[x], buf, nmatch, pmatch, 0))) {
if (err != REG_NOMATCH) {
- regerror(err, &preg[N_REG - 1], ebuf, 256);
+ regerror(err, &preg[x], ebuf, 256);
fprintf(stderr, "%s: regexec failed: %s\n", progname, ebuf);
abort();
- } else
- break;
+ }
} else {
- *(buf + pmatch[0].rm_so) = '\n';
- strcpy(buf + pmatch[0].rm_so + 1, buf + pmatch[0].rm_eo);
- x = 0;
+ *(buf + pmatch[0].rm_so) = '\r';
+ *(buf + pmatch[0].rm_so + 1) = '\n';
+ strcpy(buf + pmatch[0].rm_so + 2, buf + pmatch[0].rm_eo);
+ x = N_REG - 2;
}
-
+ }
return(strlen(buf));
}
-RETSIGTYPE
+RETSIGTYPE
reapchild(void)
{
int status;
pid_t pid;
-
- /* HEAS: this needs to deal with/without wait3 via HAVE_WAIT3 */
+
+ /* XXX this needs to deal with/without wait3 via HAVE_WAIT3 */
while ((pid = wait3(&status, WNOHANG, 0)) > 0)
if (debug)
fprintf(stderr, "reap child %d\n", pid);
-
- /*exit(1);*/
-return;
+ if (pid == child)
+ child = 0;
- /* not reached */
-}
+ return;
+}
+
+RETSIGTYPE
+sighdlr(int sig)
+{
+ if (debug)
+ fprintf(stderr, "GOT SIGNAL %d\n", sig);
+ drain = 1;
+ return;
+}
+
+#if !HAVE_UNSETENV
+int
+unsetenv(const char *name)
+{
+ char **victim,
+ **end;
+ int len;
+ if (environ == NULL)
+ return(0);
+ len = strlen(name);
+ victim = environ;
+ while (*victim != NULL) {
+ if (strncmp(name, *victim, len) == 0 && victim[0][len] == '=')
+ break;
+ victim++;
+ }
+ if (*victim == NULL)
+ return(0);
+ end = victim + 1;
+ while (*end != NULL)
+ end++;
+ end--;
+ *victim = *end;
+ *end = NULL;
+ return(0);
+}
+#endif
void
usage(void)
{
- fprintf(stderr,
-"usage: %s [-hv] <telnet|ssh> [<ssh options>] <hostname> [<telnet_port>]\n",
- progname);
+ fprintf(stderr, "usage: %s [-hv] [-t timeout] <telnet|ssh> [<ssh options>]"
+ " <hostname> [<telnet_port>]\n", progname);
return;
}
@@ -398,3 +616,107 @@ vers(void)
fprintf(stderr, "%s: %s version %s\n", progname, package, version);
return;
}
+
+
+#if !HAVE_OPENPTY
+#include <grp.h>
+#define TTY_LETTERS "pqrstuvwxyzPQRST"
+#define TTY_OLD_SUFFIX "0123456789abcdef"
+#define TTY_NEW_SUFFIX "ghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+
+int
+openpty(int *amaster, int *aslave, char *name, struct termios *term,
+ struct winsize *winp)
+{
+ static char line[] = "/dev/XtyXX";
+ const char *cp1, *cp2, *cp, *linep;
+ int master, slave;
+ gid_t ttygid;
+ mode_t mode;
+ struct group *gr;
+
+#if HAVE_PTMX
+ if ((master =
+#if HAVE_PTMX_BSD
+ open("/dev/ptmx_bsd", O_RDWR))
+#else
+ open("/dev/ptmx", O_RDWR))
+#endif
+ != -1) {
+ linep = ptsname(master);
+ grantpt(master);
+ unlockpt(master);
+#ifndef TIOCSCTTY
+ setsid();
+#endif
+ if ((slave = open(linep, O_RDWR)) < 0) {
+ slave = errno;
+ (void) close(master);
+ errno = slave;
+ return(-1);
+ }
+#if HAVE_PTMX_OSF
+ {
+ char buf[10240];
+ if (ioctl (slave, I_LOOK, buf) != 0)
+ if (ioctl (slave, I_PUSH, "ldterm")) {
+ close(slave);
+ close(master);
+ return(-1);
+ }
+ }
+#elif HAVE_STROPTS_H
+ ioctl(slave, I_PUSH, "ptem");
+ ioctl(slave, I_PUSH, "ldterm");
+ ioctl(slave, I_PUSH, "ttcompat");
+#endif
+ goto gotit;
+ }
+ if (errno != ENOENT)
+ return(-1);
+#endif
+
+ if ((gr = getgrnam("tty")) != NULL) {
+ ttygid = gr->gr_gid;
+ mode = S_IRUSR|S_IWUSR|S_IWGRP;
+ } else {
+ ttygid = getgid();
+ mode = S_IRUSR|S_IWUSR;
+ }
+
+ for (cp1 = TTY_LETTERS; *cp1; cp1++) {
+ line[8] = *cp1;
+ for (cp = cp2 = TTY_OLD_SUFFIX TTY_NEW_SUFFIX; *cp2; cp2++) {
+ line[5] = 'p';
+ line[9] = *cp2;
+ if ((master = open(line, O_RDWR, 0)) == -1) {
+ if (errno != ENOENT)
+ continue; /* busy */
+ if (cp2 - cp + 1 < sizeof(TTY_OLD_SUFFIX))
+ return -1; /* out of ptys */
+ else
+ break; /* out of ptys in this group */
+ }
+ line[5] = 't';
+ linep = line;
+ if (chown(line, getuid(), ttygid) == 0 &&
+ chmod(line, mode) == 0 &&
+ (slave = open(line, O_RDWR, 0)) != -1) {
+gotit:
+ *amaster = master;
+ *aslave = slave;
+ if (name)
+ (void)strcpy(name, linep);
+ if (term)
+ (void)tcsetattr(slave, TCSAFLUSH, term);
+ if (winp)
+ (void)ioctl(slave, TIOCSWINSZ, winp);
+ return 0;
+ }
+ (void)close(master);
+ }
+ }
+ errno = ENOENT; /* out of ptys */
+ return -1;
+}
+#endif
diff --git a/bin/hrancid.in b/bin/hrancid.in
index fa048ce..0feefd0 100644
--- a/bin/hrancid.in
+++ b/bin/hrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: hrancid.in,v 1.17 2004/01/11 03:49:13 heas Exp $
+## $Id: hrancid.in,v 1.27 2006/10/05 04:27:42 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,25 +25,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
-$found_end = 0; # unused - hp lacks an end-of-config tag.
-$timeo = 90; # clogin timeout in seconds
+$found_end = 0; # unused - hp lacks an end-of-config tag
+$timeo = 90; # hlogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -64,10 +70,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -77,10 +83,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -90,10 +96,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -103,9 +109,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -119,7 +125,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -132,7 +138,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -159,8 +165,6 @@ sub ShowVersion {
# This routine parses "show flash"
sub ShowFlash {
- # skip if this is 7000, 7200, 7500, or 12000; else we end up with
- # redundant data from dir /all slot0:
print STDERR " In ShowFlash: $_" if ($debug);
while (<INPUT>) {
@@ -188,8 +192,14 @@ sub ShowSystem {
return(-1) if (/command authorization failed/i);
return(-1) if /^(Invalid|Ambiguous) input:/i;
- /memory\s+-\s+total\s+:\s+(\S+)/i &&
- ProcessHistory("COMMENTS","keysort","B0",";Memory: $1\n");
+ if (/memory\s+-\s+total\s+:\s+(\S+)/i) {
+ my($mem) = $1;
+ $mem =~ s/,//g;
+ $mem /= (1024 * 1024);
+ ProcessHistory("COMMENTS","keysort","B0",";Memory: " . int($mem) .
+ "M\n");
+ next;
+ }
/serial\s+number\s+:\s+(\S+)/i &&
ProcessHistory("COMMENTS","keysort","A1",";Serial Number: $1\n");
/firmware\s+revision\s+:\s+(\S+)/i &&
@@ -230,7 +240,7 @@ sub ShowStack {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(-1) if (/command authorization failed/i);
- return(-1) if /^(Invalid|Ambiguous) input:/i;
+ return(1) if /^(Invalid|Ambiguous) input:/i;
s/stacking - (Stacking Status).*/$1/i;
s/\s*members unreachable .*$//i;
@@ -426,27 +436,31 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'show flash' => "ShowFlash",
- 'show system-information' => "ShowSystem",
- 'show module' => "ShowModule",
- 'show stack' => "ShowStack",
- 'write term' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version",
- "show flash",
- "show system-information",
- "show module",
- "show stack",
- "write term"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'show flash' => 'ShowFlash'},
+ {'show system-information' => 'ShowSystem'},
+ {'show module' => 'ShowModule'},
+ {'show stack' => 'ShowStack'},
+ {'write term' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -469,7 +483,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
diff --git a/bin/htlogin.in b/bin/htlogin.in
index 8e9c5f5..213f028 100644
--- a/bin/htlogin.in
+++ b/bin/htlogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: htlogin.in,v 1.7 2004/01/11 05:39:15 heas Exp $
+## $Id: htlogin.in,v 1.18 2006/12/05 16:50:52 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -42,7 +43,7 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 1
+set avenable 1
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
set avautoenable 0
@@ -51,7 +52,7 @@ set avautoenable 0
set do_passwd 1
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -64,9 +65,12 @@ if {[ info exists env(CISCO_USER) ] } {
if [ catch {exec id} reason ] {
send_error "\nError: could not exec id: $reason\n"
exit 1
- }
+ }
regexp {\(([^)]*)} "$reason" junk default_user
-}
+}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -92,13 +96,16 @@ for {set i 0} {$i < $argc} {incr i} {
}
set do_passwd 0
# VTY Password
- } -v* -
- -v* {
+ } -v* {
if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
incr i
set passwd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Enable Username
} -w* -
-W* {
@@ -270,31 +277,44 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user userpswd passwd prompt cmethod cyphertype } {
global spawn_id in_proc do_command do_script
global u_prompt p_prompt
set in_proc 1
- set uprompt_seen 0
+ set uprompt_seen 0
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
- set retval [ catch {spawn telnet $router} reason ]
- } else {
+ set retval [ catch {spawn telnet $router} reason ]
+ } else {
set retval [ catch {spawn telnet $router $port} reason ]
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
+ } elseif ![string compare $prog "ssh"] {
+ send_error "\nError: unsupported method: ssh\n"
+ if { $progs == 0 } {
+ return 1
+ }
+ continue
+ } elseif ![string compare $prog "rsh"] {
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
+ }
+ continue
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
# This helps cleanup each expect clause.
@@ -376,7 +396,7 @@ proc run_commands { prompt command } {
for {set i 0} {$i < $num_commands} { incr i} {
send "[lindex $commands $i]\r"
expect {
- -re "^\[^\n\r]*$prompt" {}
+ -re "^\[^\n\r]*$prompt" {}
-re "^\[^\n\r *]*$prompt" {}
-re "\[\n\r]" { exp_continue }
}
@@ -384,16 +404,18 @@ proc run_commands { prompt command } {
} else {
send "$command\r"
expect {
- -re "^\[^\n\r]*$prompt" {}
+ -re "^\[^\n\r]*$prompt" {}
-re "^\[^\n\r *]*$prompt" {}
-re "\[\n\r]" { exp_continue }
}
}
send "exit\r"
expect {
- "\n" { exp_continue }
- timeout { return 0 }
- eof { return 0 }
+ "\n" { exp_continue }
+ timeout { catch {close}; wait
+ return 0
+ }
+ eof { return 0 }
}
set in_proc 0
}
diff --git a/bin/htrancid.in b/bin/htrancid.in
index 2b2eaaa..d15d569 100644
--- a/bin/htrancid.in
+++ b/bin/htrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: htrancid.in,v 1.5 2004/01/11 03:49:13 heas Exp $
+## $Id: htrancid.in,v 1.13 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -23,25 +24,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: htrancid [-d] [-l] [-f filename | $host]
+# usage: htrancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # blogin timeout in seconds
+$timeo = 90; # htlogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -63,10 +69,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -76,10 +82,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -89,10 +95,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -102,9 +108,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -118,7 +124,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -131,7 +137,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -166,19 +172,27 @@ sub ShowVersion {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'version -a' => "ShowVersion",
- 'cat /config/router.cnf' => "ShowConfig"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "version -a",
- "cat /config/router.cnf"
+@commandtable = (
+ {'version -a' => 'ShowVersion'},
+ {'cat /config/router.cnf' => 'ShowConfig'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -201,7 +215,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
@@ -224,8 +238,8 @@ TOP: while(<INPUT>) {
while (/command:\s*($cmds_regexp)\s*$/) {
$cmd = $1;
if (!defined($prompt)) {
- $prompt = ($_ =~ /^([^:]+:)/)[0];
- }
+ $prompt = ($_ =~ /^([^:]+:)/)[0];
+ }
print STDERR ("HIT COMMAND:$_") if ($debug);
if (! defined($commands{$cmd})) {
print STDERR "$host: found unexpected command - \"$cmd\"\n";
diff --git a/bin/jerancid.in b/bin/jerancid.in
index 1b72737..c0fb33e 100644
--- a/bin/jerancid.in
+++ b/bin/jerancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: jerancid.in,v 1.25 2004/01/11 03:49:13 heas Exp $
+## $Id: jerancid.in,v 1.36 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -23,25 +24,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -63,10 +69,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -76,10 +82,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -89,10 +95,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -102,9 +108,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -118,7 +124,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -131,7 +137,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -203,6 +209,8 @@ sub ShowEnv {
next if (/^(\s*|\s*$cmd\s*)$/);
next if (/^Please wait/i);
return(-1) if (/command authorization failed/i);
+ # fail if the RP is amid the auto-sync process
+ return(-1) if (/auto-sync enabled/ && !/in sync/);
# skip the temperature goop
if (/processor\s+processor/) {
@@ -260,6 +268,8 @@ sub DirSlotN {
next if (/^(\s*|\s*$cmd\s*)$/);
next if (/^Please wait/i);
next if (/^system\.log/);
+ # fail if the RP is amid the auto-sync process
+ return(-1) if (/active\/standby/i && /not sync/);
ProcessHistory("FLASH","","","!Flash: $_");
}
@@ -303,6 +313,8 @@ sub WriteTerm {
# skip the crap
/^! Configuration script /i && next;
/^! Copyright /i && next;
+ /^Please wait/i && next;
+ /^(\.+)$/ && next; # Skip variable length pausing dot lines
# Dog gone Cool matches to process the rest of the config
/^ntp clock-period / && next; # kill ntp clock-period
@@ -530,29 +542,32 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'show redundancy' => "ShowRedundancy",
- 'show boot' => "ShowBoot",
- 'show environment all' => "ShowEnv",
- 'dir' => "DirSlotN",
- 'show hardware' => "ShowHardware",
- 'show configuration' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version",
- "show redundancy",
- "show boot",
- "show environment all",
- "dir",
- "show hardware",
- "show configuration"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'show redundancy' => 'ShowRedundancy'},
+ {'show boot' => 'ShowBoot'},
+ {'show environment all' => 'ShowEnv'},
+ {'dir' => 'DirSlotN'},
+ {'show hardware' => 'ShowHardware'},
+ {'show configuration' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$jnxe_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
diff --git a/bin/jlogin.in b/bin/jlogin.in
index 31be4f6..729afa7 100644
--- a/bin/jlogin.in
+++ b/bin/jlogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: jlogin.in,v 1.41 2004/01/11 05:39:15 heas Exp $
+## $Id: jlogin.in,v 1.56 2006/12/05 16:50:52 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -42,15 +43,13 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 1
+set avenable 1
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
-# No passphrase by default
-set passphrase ""
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -66,6 +65,9 @@ if {[ info exists env(CISCO_USER) ] } {
}
regexp {\(([^)]*)} "$reason" junk default_user
}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 120
@@ -107,12 +109,16 @@ for {set i 0} {$i < $argc} {incr i} {
set userpasswd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# passphrase
} -r* -
-R* {
if {! [ regexp .\[rR\](.+) $arg ignore passphrase]} {
incr i
- set passphrase [ lindex $argv $i ]
+ set avpassphrase [ lindex $argv $i ]
}
# Expect script to run.
} -s* -
@@ -254,6 +260,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user passwd cmethod cyphertype identfile} {
global spawn_id in_proc do_command do_script passphrase prompt
global sshcmd
@@ -262,6 +269,7 @@ proc login { router user passwd cmethod cyphertype identfile} {
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
@@ -271,7 +279,7 @@ proc login { router user passwd cmethod cyphertype identfile} {
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
} elseif ![string compare $prog "ssh"] {
# ssh to the router & try to login with or without an identfile.
@@ -280,24 +288,24 @@ proc login { router user passwd cmethod cyphertype identfile} {
if {$identfile != ""} {
if [ catch {spawn $sshcmd -c $cyphertype -x -l $user -i $identfile $router} reason ] {
send_user "\nError: failed to $sshcmd: $reason\n"
- exit 1
+ return 1
}
} else {
if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
send_user "\nError: failed to $sshcmd: $reason\n"
- exit 1
+ return 1
}
}
} elseif ![string compare $prog "rsh"] {
- if [ catch {spawn rsh -l $user $router} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- exit 1
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
}
+ continue
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
# This helps cleanup each expect clause.
@@ -345,8 +353,12 @@ proc login { router user passwd cmethod cyphertype identfile} {
catch {close};
send_user "\nError: Unknown host\n"; wait; return 1
}
- -re "Enter passphrase for RSA key '\[^'\]*': " {
- send_user "\nKey has passphrase!\n"
+ "Login incorrect" {
+ send_user "\nError: Check your password for $router\n"
+ catch {close}; wait; return 1
+ }
+ -re "Enter passphrase.*: " {
+ # sleep briefly to allow time for stty -echo
sleep 1
send "$passphrase\r"
exp_continue }
@@ -423,9 +435,11 @@ proc run_commands { prompt command } {
}
send "quit\r"
expect {
- "\n" { exp_continue }
- timeout { return 0 }
- eof { return 0 }
+ "\n" { exp_continue }
+ timeout { catch {close}; wait
+ return 0
+ }
+ eof { return 0 }
}
set in_proc 0
}
@@ -465,10 +479,17 @@ foreach router [lrange $argv $i end] {
}
}
- # figure out identity file to use
- set identfile ""
- if {[info exists identity]} {
- set identfile [join [lindex [find identity $router] 0] ""]
+ # Figure out identity file to use
+ set identfile [join [lindex [find identity $router] 0] ""]
+
+ # Figure out passphrase to use
+ if {[info exists avpassphrase]} {
+ set passphrase $avpassphrase
+ } else {
+ set passphrase [join [lindex [find passphrase $router] 0] ""]
+ }
+ if { ! [string length "$passphrase"]} {
+ set passphrase $passwd
}
# Figure out ssh cypher type
@@ -484,9 +505,9 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
- # Figure out the SSH executable name
- set sshcmd [find sshcmd $router]
- if { "$sshcmd" == "" } { set sshcmd {ssh} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
# Login to the router
if {[login $router $loginname $passwd $cmethod $cyphertype $identfile]} {
diff --git a/bin/jrancid.in b/bin/jrancid.in
index 2793446..252b1a3 100644
--- a/bin/jrancid.in
+++ b/bin/jrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: jrancid.in,v 1.58 2004/01/11 03:49:13 heas Exp $
+## $Id: jrancid.in,v 1.80 2006/12/05 17:14:27 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,10 +25,14 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: jrancid [-d] [-l] [-f filename | $host]
+# usage: jrancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$debug = $opt_d;
$log = $opt_l;
$file = $opt_f;
@@ -35,14 +40,17 @@ $host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
+$timeo = 120; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
+my($ShowChassisSCB); # Only run ShowChassisSCB() once
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -64,10 +72,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -77,10 +85,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -90,22 +98,22 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
- $sorted_lines[$i] = $key;
- $i++;
+ $sorted_lines[$i] = $key;
+ $i++;
}
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -119,7 +127,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -132,7 +140,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -150,9 +158,9 @@ sub ShowChassisClocks {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -162,10 +170,20 @@ sub ShowChassisClocks {
/syntax error/ && return;
# filter decimal places of m160 measured clock MHz
- /Measured frequency/ && s/\..*MHz/ MHz/;
+ if (/Measured frequency/) {
+ s/\..*MHz/ MHz/;
+ } elsif (/^.+\.[0-9]+ MHz$/) {
+ # filter for the m160 (newer format)
+ s/\.[0-9]+ MHz/ MHz/;
+ } elsif (/^(.+)(\.[0-9]+) MHz/) {
+ # filter for T series
+ my($leadlen) = length($1);
+ $x = sprintf(" MHz%".length($2)."s", " ");
+ substr($_, $leadlen, length($2)+4, $x);
+ }
ProcessHistory("","","","# $_");
}
- return;
+ return(0);
}
# This routine parses "show chassis environment"
@@ -176,9 +194,9 @@ sub ShowChassisEnvironment {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -186,6 +204,7 @@ sub ShowChassisEnvironment {
/command is not valid/ && return;
/^\s+\^/ && return;
/syntax error/ && return;
+
/ backplane temperature/ && next;
/(\s*Power supply.*), temperature/ &&
ProcessHistory("","","","# $1\n") && next;
@@ -193,9 +212,11 @@ sub ShowChassisEnvironment {
ProcessHistory("","","","# $1\n") && next;
/(^.*\S)\s+ Spinning at .*$/ &&
ProcessHistory("","","","# $1\n") && next;
+ /(^.*\S)\s+Measurement/ &&
+ ProcessHistory("","","","# $1\n") && next;
ProcessHistory("","","","# $_");
}
- return;
+ return(0);
}
# This routine parses "show chassis firmware"
@@ -206,9 +227,9 @@ sub ShowChassisFirmware {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -216,9 +237,10 @@ sub ShowChassisFirmware {
/command is not valid/ && return;
/^\s+\^/ && return;
/syntax error/ && return;
+
ProcessHistory("","","","# $_");
}
- return;
+ return(0);
}
# This routine parses "show chassis fpc detail"
@@ -229,9 +251,9 @@ sub ShowChassisFpcDetail {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -239,12 +261,13 @@ sub ShowChassisFpcDetail {
/command is not valid/ && return;
/^\s+\^/ && return;
/syntax error/ && return;
+
/ Temperature/ && next;
/ Start time/ && next;
/ Uptime/ && next;
ProcessHistory("","","","# $_");
}
- return;
+ return(0);
}
# This routine parses "show chassis hardware"
@@ -255,9 +278,9 @@ sub ShowChassisHardware {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -265,9 +288,10 @@ sub ShowChassisHardware {
/command is not valid/ && return;
/^\s+\^/ && return;
/syntax error/ && return;
+
ProcessHistory("","","","# $_");
}
- return;
+ return(0);
}
# This routine parses "show chassis routing-engine"
@@ -279,9 +303,9 @@ sub ShowChassisRoutingEngine {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/error: the chassis subsystem is not running/ && return;
/Couldn\'t initiate connection/ && return;
@@ -289,15 +313,17 @@ sub ShowChassisRoutingEngine {
/command is not valid/ && return;
/^\s+\^/ && return;
/syntax error/ && return;
+
/^Routing Engine status:/ && ProcessHistory("","","","# $_") && next;
/ Slot / && ProcessHistory("","","","# $_") && next;
/ Current state/ && ProcessHistory("","","","# $_") && next;
/ Election priority/ && ProcessHistory("","","","# $_") && next;
/ DRAM/ && ProcessHistory("","","","# $_") && next;
+ / Model/ && ProcessHistory("","","","# $_") && next;
/ Serial ID/ && ProcessHistory("","","","# $_") && next;
/^\s*$/ && ProcessHistory("","","","# $_") && next;
}
- return;
+ return(0);
}
# This routine parses "show chassis cfeb", "show chassis feb", "show
@@ -310,9 +336,9 @@ sub ShowChassisSCB {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
return if ($ShowChassisSCB);
/error: the chassis subsystem is not running/ && return;
@@ -321,7 +347,9 @@ sub ShowChassisSCB {
/command is not valid/ && return;
/^\s+\^/ && return;
/syntax error/ && return;
+
/ Temperature/ && next;
+ / temperature/ && next;
/ utilization/ && next;
/ Start time/ && next;
/ Uptime/ && next;
@@ -330,26 +358,115 @@ sub ShowChassisSCB {
ProcessHistory("","","","# $_");
}
$ShowChassisSCB = 1;
- return;
+ return(0);
}
-# This routine parses "show system boot-messages"
+# This routine parses "show chassis alarms"
sub ShowChassisAlarms {
print STDERR " In ShowChassisAlarms: $_" if ($debug);
+ s/^[a-z]+@//;
+ ProcessHistory("","","","# $_");
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
+
+ /Unrecognized command/ && return;
+ /command is not valid/ && return;
+ /^\s+\^/ && return;
+ /syntax error/ && return;
+
+ ProcessHistory("","","","# $_");
+ }
+ return(0);
+}
+
+# This routine parses "show system autoinstallation status"
+sub ShowSystemAutoinstall {
+ print STDERR " In ShowSystemAutoinstall: $_" if ($debug);
+
+ s/^[a-z]+@//;
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/Unrecognized command/ && return;
+ /command is not valid/ && return;
/^\s+\^/ && return;
/syntax error/ && return;
+
ProcessHistory("","","","# $_");
}
- return;
+ return(0);
+}
+
+sub ShowSystemCoreDumps {
+ print STDERR " In ShowSystemCoreDumps: $_" if ($debug);
+
+ s/^[a-z]+@//;
+ ProcessHistory("","","","# $_");
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+
+ /Unrecognized command/ && return(1);
+ /^\s+\^/ && return(1);
+ /syntax error/ && return(1);
+ /^JUNOS / && <INPUT> && next;
+ /No such file or directory$/ && next;
+
+ ProcessHistory("","","","# $_");
+ }
+ return(0);
+}
+
+# This routine parses "show system license"
+sub ShowSystemLicense {
+ print STDERR " In ShowSystemLicense: $_" if ($debug);
+
+ s/^[a-z]+@//;
+ ProcessHistory("","","","# $_");
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
+
+ /Unrecognized command/ && return;
+ /command is not valid/ && return;
+ /^\s+\^/ && return;
+ /syntax error/ && return;
+
+ ProcessHistory("","","","# $_");
+ }
+ return(0);
+}
+
+# This routine parses "show system license keys"
+sub ShowSystemLicenseKeys {
+ print STDERR " In ShowSystemLicenseKeys: $_" if ($debug);
+
+ s/^[a-z]+@//;
+ ProcessHistory("","","","# $_");
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
+
+ /Unrecognized command/ && return;
+ /command is not valid/ && return;
+ /^\s+\^/ && return;
+ /syntax error/ && return;
+
+ ProcessHistory("","","","# $_");
+ }
+ return(0);
}
# This routine parses "show system boot-messages"
@@ -360,13 +477,15 @@ sub ShowSystemBootMessages {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/Unrecognized command/ && return;
+ /command is not valid/ && return;
/^\s+\^/ && return;
/syntax error/ && return;
+
/^JUNOS / && <INPUT> && next;
/^Timecounter "TSC" / && next;
/^real memory / && next;
@@ -374,7 +493,7 @@ sub ShowSystemBootMessages {
/^\/dev\// && next;
ProcessHistory("","","","# $_");
}
- return;
+ return(0);
}
# This routine parses "show version"
@@ -385,17 +504,17 @@ sub ShowVersion {
ProcessHistory("","","","# $_");
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^\s*$/);
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ last if (/^$prompt/);
+ next if (/^\s*$/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
/^Juniper Networks is:/ && ProcessHistory("","","","# \n# $_") && next;
ProcessHistory("","","","# $_");
}
ProcessHistory("","","","#\n");
- return;
+ return(0);
}
# This routine parses "show configuration"
@@ -409,20 +528,21 @@ sub ShowConfiguration {
while (<INPUT>) {
tr/\015//d;
next if (/^\s*$/);
- # end of config - hopefully. juniper does not have a reliable
+ # end of config - hopefully. juniper does not have a reliable
# end-of-config tag. appears to end with "\nPROMPT>", but not sure.
- if(/^$prompt/) {
+ if (/^$prompt/) {
$found_end++;
last;
}
- next if(/^system (shutdown message from|going down )/i);
- next if(/^\{(master|backup)}/);
+ next if (/^system (shutdown message from|going down )/i);
+ next if (/^\{(master|backup)}/);
$lines++;
/^database header mismatch: / && return(-1);
/^version .*;\d+$/ && return(-1);
s/ # SECRET-DATA$//;
+ s/ ## SECRET-DATA$//;
# filter snmp community, when in snmp { stanza }
/^snmp/ && $snmp++;
/^}/ && ($snmp = 0);
@@ -435,6 +555,10 @@ sub ShowConfiguration {
ProcessHistory("","","","#$1<removed>$'");
next;
}
+ if (/(\s*md5 \d+ key )[^ ;]+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","#$1<removed>$'");
+ next;
+ }
if (/(\s*hello-authentication-key )[^ ;]+/ && $filter_pwds >= 1) {
ProcessHistory("","","","#$1<removed>$'");
next;
@@ -464,7 +588,7 @@ sub ShowConfiguration {
return(-1);
}
- return;
+ return(0);
}
###
@@ -475,44 +599,45 @@ sub ShowConfiguration {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- "show chassis clocks" => "ShowChassisClocks",
- "show chassis environment" => "ShowChassisEnvironment",
- "show chassis firmware" => "ShowChassisFirmware",
- "show chassis fpc detail" => "ShowChassisFpcDetail",
- "show chassis hardware detail" => "ShowChassisHardware",
- "show chassis routing-engine" => "ShowChassisRoutingEngine",
- "show chassis scb" => "ShowChassisSCB",
- "show chassis sfm detail" => "ShowChassisSCB",
- "show chassis ssb" => "ShowChassisSCB",
- "show chassis feb" => "ShowChassisSCB",
- "show chassis cfeb" => "ShowChassisSCB",
- "show chassis alarms" => "ShowChassisAlarms",
- "show system boot-messages" => "ShowSystemBootMessages",
- "show version detail" => "ShowVersion",
- "show configuration" => "ShowConfiguration"
-);
-@commands=(
- "show chassis clocks",
- "show chassis environment",
- "show chassis firmware",
- "show chassis fpc detail",
- "show chassis hardware detail",
- "show chassis routing-engine",
- "show chassis scb",
- "show chassis sfm detail",
- "show chassis ssb",
- "show chassis feb",
- "show chassis cfeb",
- "show chassis alarms",
- "show system boot-messages",
- "show version detail",
- "show configuration"
+@commandtable = (
+ {'show chassis clocks' => 'ShowChassisClocks'},
+ {'show chassis environment' => 'ShowChassisEnvironment'},
+ {'show chassis firmware' => 'ShowChassisFirmware'},
+ {'show chassis fpc detail' => 'ShowChassisFpcDetail'},
+ {'show chassis hardware detail' => 'ShowChassisHardware'},
+ {'show chassis routing-engine' => 'ShowChassisRoutingEngine'},
+ {'show chassis scb' => 'ShowChassisSCB'},
+ {'show chassis sfm detail' => 'ShowChassisSCB'},
+ {'show chassis ssb' => 'ShowChassisSCB'},
+ {'show chassis feb detail' => 'ShowChassisSCB'},
+ {'show chassis feb' => 'ShowChassisSCB'},
+ {'show chassis cfeb' => 'ShowChassisSCB'},
+ {'show chassis alarms' => 'ShowChassisAlarms'},
+# {'show system autoinstallation status' => 'ShowSystemAutoinstall'},
+ {'show system license' => 'ShowSystemLicense'},
+# {'show system license keys' => 'ShowSystemLicenseKeys'},
+ {'show system boot-messages' => 'ShowSystemBootMessages'},
+ {'show system core-dumps' => 'ShowSystemCoreDumps'},
+ {'show version detail' => 'ShowVersion'},
+ {'show configuration' => 'ShowConfiguration'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
$jnx_commands=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered
@@ -523,21 +648,21 @@ if ($file) {
print STDOUT "opening file $host\n" if ($log);
open(INPUT,"< $host") || die "open failed for $host: $!\n";
} else {
- print(STDERR "executing echo jlogin -c\"$jnx_commands\" $host\n") if ($debug);
- print(STDOUT "executing echo jlogin -c\"$jnx_commands\" $host\n") if ($debug);
+ print(STDERR "executing echo jlogin -t $timeo -c\"$jnx_commands\" $host\n") if ($debug);
+ print(STDOUT "executing echo jlogin -t $timeo -c\"$jnx_commands\" $host\n") if ($debug);
if (defined($ENV{NOPIPE})) {
- system "jlogin -c \"$jnx_commands\" $host </dev/null > $host.raw" || die "jlogin failed for $host: $!\n";
+ system "jlogin -t $timeo -c \"$jnx_commands\" $host </dev/null > $host.raw" || die "jlogin failed for $host: $!\n";
open(INPUT, "< $host.raw") || die "jlogin failed for $host: $!\n";
} else {
- open(INPUT,"jlogin -c \"$jnx_commands\" $host </dev/null |") || die "jlogin failed for $host: $!\n";
+ open(INPUT,"jlogin -t $timeo -c \"$jnx_commands\" $host </dev/null |") || die "jlogin failed for $host: $!\n";
}
}
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
@@ -545,7 +670,7 @@ if ($ENV{"FILTER_PWDS"} =~ /no/i) {
}
ProcessHistory("","","","# RANCID-CONTENT-TYPE: juniper\n#\n");
-TOP: while(<INPUT>) {
+TOP: while (<INPUT>) {
tr/\015//d;
if (/^Error:/) {
print STDOUT ("$host jlogin error: $_");
diff --git a/bin/lg.cgi.in b/bin/lg.cgi.in
index ad08c68..4ad6fdd 100644
--- a/bin/lg.cgi.in
+++ b/bin/lg.cgi.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: lg.cgi.in,v 1.47 2004/01/11 03:49:13 heas Exp $
+## $Id: lg.cgi.in,v 1.54 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -27,8 +28,8 @@
# vars: query, router, args
BEGIN {
-$me = $0;
-$me =~ s/.*\/(\S+)$/$1/;
+ $me = $0;
+ $me =~ s/.*\/(\S+)$/$1/;
}
use CGI qw/:standard escapeHTML/;
@@ -38,6 +39,7 @@ use LockFile::Simple qw(lock trylock unlock);
my($BASEDIR) = "@prefix@";
my($SYSCONFDIR) = "@sysconfdir@";
+my($LOCALSTATEDIR) = "@localstatedir@";
my($pingcmd) = "@LG_PING_CMD@";
my($query, $max_time_diff, $cache_dir, $cloginrc, @results);
@@ -134,23 +136,24 @@ sub readrouters
# if the router.db file does not exist, try to compile the list from
# the rancid group router.db files.
local(*DIR);
- if (! opendir(DIR, $BASEDIR)) {
- dolog(LOG_ERR, "ERROR: couldn\'t read $BASEDIR: $!\n");
+ if (! opendir(DIR, $LOCALSTATEDIR)) {
+ dolog(LOG_ERR, "ERROR: couldn\'t read $LOCALSTATEDIR: $!\n");
} else {
while ($dir = readdir(DIR)) {
- next if ($dir =~ /^(\.|\.\.|CVS|bin|etc|logs|util)$/);
- push(@dirs, $dir) if (-d "$BASEDIR/$dir");
+ next if ($dir =~ /^(\.|\.\.|\.ssh|CVS|bin|etc|logs|util)$/);
+ push(@dirs, $dir) if (-d "$LOCALSTATEDIR/$dir");
}
closedir(DIR);
foreach $dir (@dirs) {
- if (! opendir(DIR, "$BASEDIR/$dir")) {
- dolog(LOG_ERR, "ERROR: couldn\'t read $BASEDIR/$dir: $!\n");
+ if (! opendir(DIR, "$LOCALSTATEDIR/$dir")) {
+ dolog(LOG_ERR,
+ "ERROR: couldn\'t read $LOCALSTATEDIR/$dir: $!\n");
next;
}
closedir(DIR);
- next if (! -f "$BASEDIR/$dir/router.db");
- if (open(RTR, "< $BASEDIR/$dir/router.db")) {
+ next if (! -f "$LOCALSTATEDIR/$dir/router.db");
+ if (open(RTR, "< $LOCALSTATEDIR/$dir/router.db")) {
while (<RTR>) {
next if (/^\s*(#|$)/);
# fqdn:mfg:state
@@ -162,7 +165,7 @@ sub readrouters
close(RTR);
} else {
dolog(LOG_ERR, "ERROR: couldn\'t open the router.db " .
- "file: $BASEDIR/$dir/router.db: $!\n");
+ "file: $LOCALSTATEDIR/$dir/router.db: $!\n");
}
}
}
@@ -430,7 +433,7 @@ $max_lock_hold = 300;
if (defined($LG_CLOGINRC)) {
$cloginrc = $LG_CLOGINRC;
} else {
- $cloginrc = "$ENV(HOME)/.cloginrc";
+ $cloginrc = $ENV{HOME} . "/.cloginrc";
}
$query = new CGI;
@@ -451,7 +454,7 @@ if (!defined($type) || !defined($router) || $router eq "") {
"a clue.\n");
}
-if ($arg !~ /^[-A-Za-z0-9|_\/ \.^\$]*$/) {
+if ($arg !~ /^[-A-Za-z0-9|_\/: \.^\$]*$/) {
&Error("Funny characters in argument; ignoring.\n");
}
if (length($arg) >= 50) {
@@ -678,7 +681,7 @@ if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) {
if ($mfg =~ /cisco/i) {
$arg = " | include " . join(' ', @arg);
} elsif ($mfg =~ /juniper/i) {
- $arg = " | match \"" . join(' ', @arg) . "\"";
+ $arg = " | match \\\"" . join(' ', @arg) . "\\\"";
} else {
undef($arg);
}
@@ -736,7 +739,7 @@ if ($type eq "prefix" || $type eq "mbgp" || $type eq "route" ) {
} else {
$arg =~ s/[\$^]/ /g;
}
- $arg = "\"$arg\"";
+ $arg = "\\\"$arg\\\"";
}
# escape any ()s
$arg =~ s/([\(\)])/\\$1/g;
diff --git a/bin/lgform.cgi.in b/bin/lgform.cgi.in
index 461ae68..774d104 100644
--- a/bin/lgform.cgi.in
+++ b/bin/lgform.cgi.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: lgform.cgi.in,v 1.25 2004/01/11 03:49:13 heas Exp $
+## $Id: lgform.cgi.in,v 1.31 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -26,11 +27,19 @@
# lgform.cgi - Looking glass front-end
# produces html form for calling lg.cgi
+BEGIN {
+ $me = $0;
+ $me =~ s/.*\/(\S+)$/$1/;
+}
+
use CGI qw/:standard/;
+use POSIX qw(strftime);
+use Sys::Syslog;
my(@rtrlist, %rtrlabels);
my($BASEDIR) = "@prefix@";
my($SYSCONFDIR) = "@sysconfdir@";
+my($LOCALSTATEDIR) = "@localstatedir@";
# note: the following functions are duplicated between lgform.cgi and lg.cgi
# to avoid the need for module inclusion headaches from within a httpd context.
@@ -118,23 +127,24 @@ sub readrouters
# if the router.db file does not exist, try to compile the list from
# the rancid group router.db files.
local(*DIR);
- if (! opendir(DIR, $BASEDIR)) {
- dolog(LOG_ERR, "ERROR: couldn\'t read $BASEDIR: $!\n");
+ if (! opendir(DIR, $LOCALSTATEDIR)) {
+ dolog(LOG_ERR, "ERROR: couldn\'t read $LOCALSTATEDIR: $!\n");
} else {
while ($dir = readdir(DIR)) {
- next if ($dir =~ /^(\.|\.\.|CVS|bin|etc|logs|util)$/);
- push(@dirs, $dir) if (-d "$BASEDIR/$dir");
+ next if ($dir =~ /^(\.|\.\.|\.ssh|CVS|bin|etc|logs|util)$/);
+ push(@dirs, $dir) if (-d "$LOCALSTATEDIR/$dir");
}
closedir(DIR);
foreach $dir (@dirs) {
- if (! opendir(DIR, "$BASEDIR/$dir")) {
- dolog(LOG_ERR, "ERROR: couldn\'t read $BASEDIR/$dir: $!\n");
+ if (! opendir(DIR, "$LOCALSTATEDIR/$dir")) {
+ dolog(LOG_ERR,
+ "ERROR: couldn\'t read $LOCALSTATEDIR/$dir: $!\n");
next;
}
closedir(DIR);
- next if (! -f "$BASEDIR/$dir/router.db");
- if (open(RTR, "< $BASEDIR/$dir/router.db")) {
+ next if (! -f "$LOCALSTATEDIR/$dir/router.db");
+ if (open(RTR, "< $LOCALSTATEDIR/$dir/router.db")) {
while (<RTR>) {
next if (/^\s*(#|$)/);
# fqdn:mfg:state
@@ -146,7 +156,7 @@ sub readrouters
close(RTR);
} else {
dolog(LOG_ERR, "ERROR: couldn\'t open the router.db " .
- "file: $BASEDIR/$dir/router.db: $!\n");
+ "file: $LOCALSTATEDIR/$dir/router.db: $!\n");
}
}
}
diff --git a/bin/mrancid.in b/bin/mrancid.in
index 8d52c27..f77779e 100644
--- a/bin/mrancid.in
+++ b/bin/mrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: mrancid.in,v 1.11 2004/01/11 03:49:13 heas Exp $
+## $Id: mrancid.in,v 1.19 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,25 +25,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -64,10 +70,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -77,10 +83,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -90,10 +96,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -103,9 +109,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -119,7 +125,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -132,7 +138,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -292,7 +298,6 @@ sub WriteTerm {
ProcessHistory("IPHOST","numsort","$1","$_") && next;
# end of config
- #if (/^end(\n\[OK])?$/) {
if (/^(: )?end$/) {
$found_end = 1;
return(1);
@@ -305,19 +310,27 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'show config' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version",
- "show config"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'show config' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -340,7 +353,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
diff --git a/bin/nlogin.in b/bin/nlogin.in
index 685c759..53e8812 100644
--- a/bin/nlogin.in
+++ b/bin/nlogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: nlogin.in,v 1.14 2004/01/11 05:39:15 heas Exp $
+## $Id: nlogin.in,v 1.33 2006/12/08 21:28:26 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -20,16 +21,22 @@
##
#
# The login expect scripts were based on Erik Sherk's gwtn, by permission.
+# Netscreen hacks implemented by Stephen Gill <gillsr@yahoo.com>.
#
# nlogin - netscreen login
#
# Most options are intuitive for logging into a netscreen firewall.
#
+# Misc notes
+# netscreen does not have the concept of "enable", once logged in, a
+# users permissions can not change.
# Usage line
-set usage "Usage: $argv0 \[-c command\] \[-Evar=x\] \[-f cloginrc-file\]
-\[-s script-file\] \[-t timeout\] \[-u user\] \
-\[-p user-password\] \[-y ssh_cypher_type\] firewall \[firewall...\]\n"
+set usage "Usage: $argv0 \[-c command\] \[-Evar=x\] \[-f cloginrc-file\] \
+\[-p user-password\] \
+\[-s script-file\] \[-t timeout\] \[-u username\] \
+\[-v vty-password\] \[-x command-file\] \
+\[-y ssh_cypher_type\] router \[router...\]\n"
# env(CLOGIN) may contain:
# x == do not set xterm banner or name
@@ -39,18 +46,13 @@ set password_file $env(HOME)/.cloginrc
# Default is to login to the firewall
set do_command 0
set do_script 0
-# The default is to automatically enable
-set enable 0
-# The default is that you login non-enabled (tacacs can have you login already
-# enabled)
-set avautoenable 1
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
set do_enapasswd 1
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -63,9 +65,12 @@ if {[ info exists env(CISCO_USER) ] } {
if [ catch {exec id} reason ] {
send_error "\nError: could not exec id: $reason\n"
exit 1
- }
+ }
regexp {\(([^)]*)} "$reason" junk default_user
-}
+}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes firewall take awhile to answer (the default is 10 sec)
set timeout 45
@@ -154,7 +159,6 @@ for {set i 0} {$i < $argc} {incr i} {
# Does tacacs automatically enable us?
} -autoenable {
# ignore autoenable
- #set avautoenable 1
} -* {
send_user "\nError: Unknown argument! $arg\n"
send_user $usage
@@ -208,9 +212,9 @@ proc include {args} {
regsub -all "(^{|}$)" $args {} args
if { [ regexp "^/" $args ignore ] == 0 } {
set args $env(HOME)/$args
- }
+ }
source_password_file $args
-}
+}
proc find {var firewall} {
upvar int_$var list
@@ -228,7 +232,7 @@ proc find {var firewall} {
# it is sourced, the user better know what to put in there, as it
# could install more than just password info... I will assume however,
# that a "bad guy" could just as easy put such code in the clogin
-# script, so I will leave .cloginrc as just an extention of that script
+# script, so I will leave .cloginrc as just an extention of that script
proc source_password_file { password_file } {
global env
if { ! [file exists $password_file] } {
@@ -247,6 +251,7 @@ proc source_password_file { password_file } {
}
# Log into the firewall.
+# returns: 0 on success, 1 on failure
proc login { firewall user userpswd passwd enapasswd prompt cmethod
cyphertype } {
global spawn_id in_proc do_command do_script sshcmd
@@ -256,6 +261,7 @@ cyphertype } {
# Telnet to the firewall & try to login.
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
@@ -265,23 +271,23 @@ cyphertype } {
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
} elseif ![string compare $prog "ssh"] {
if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $firewall} reason ] {
send_user "\nError: $sshcmd failed: $reason\n"
- exit 1
- }
+ return 1
+ }
} elseif ![string compare $prog "rsh"] {
- if [ catch {spawn rsh -l $user $firewall} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- exit 1
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
}
+ continue;
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
@@ -314,10 +320,10 @@ cyphertype } {
# then it will just send the passwd.
# if telnet fails with connection refused, try ssh
expect {
- "Connection refused" {
+ "Connection refused" {
send_user "\nError: Connection Refused\n"; wait; return 1
} eof { send_user "\nError: Couldn't login\n"; wait; return 1
- } "Unknown host\r\n" {
+ } "Unknown host\r\n" {
expect eof
send_user "\nError: Unknown host\n"; wait; return 1
} "Host is unreachable" {
@@ -343,17 +349,17 @@ cyphertype } {
send "no\r"
send_user "\nError: host key mismatch for $firewall. Update the SSH known_hosts file accordingly.\n"
return 1 }
- denied { send_user "\nError: Check your passwd for $firewall\n"
+ denied { send_user "\nError: Check your passwd for $firewall\n"
catch {close}; wait; return 1
}
" ### Login failed" {send_user "\nError: Check your passwd for $firewall\n"; return 1 }
- -re "(login:)" {
+ -re "(login:)" {
sleep 1;
send "$user\r"
set uprompt_seen 1
exp_continue
}
- "@\[^\r\n]+\[Pp]assword:" {
+ -re "@\[^\r\n]+\[Pp]assword:" {
# ssh pwd prompt
sleep 1
send "$userpswd\r"
@@ -368,7 +374,7 @@ cyphertype } {
}
exp_continue
}
- "$prompt" { break; }
+ -- "$prompt" { break; }
}
}
set in_proc 0
@@ -381,7 +387,7 @@ proc run_commands { prompt command } {
set in_proc 1
send "set console page 0\r"
- expect $prompt {}
+ expect -re $prompt {}
# Is this a multi-command?
if [ string match "*\;*" "$command" ] {
@@ -391,26 +397,38 @@ proc run_commands { prompt command } {
for {set i 0} {$i < $num_commands} { incr i} {
send "[subst [lindex $commands $i]]\r"
expect {
- -re "$prompt" {}
+ -re "\[\n\r]+" { exp_continue }
+ -re "$prompt" {}
+ -gl "--- more ---" { send " "
+ exp_continue
+ }
}
}
} else {
send "[subst $command]\r"
expect {
- -re "$prompt" {}
+ -re "\[\n\r]+" { exp_continue }
+ -re "$prompt" {}
+ -gl "--- more ---" { send " "
+ exp_continue
+ }
}
}
send "exit\r"
expect {
- "\n" { exp_continue }
- -re "$prompt" {
- send "exit\r"
- exp_continue }
- -re "Configuration modified, save?" {
- send "n\r"
- exp_continue }
- timeout { return 0 }
- eof { return 0 }
+ -re "$prompt" {
+ send "exit\r"
+ exp_continue
+ }
+ -re "\[\n\r]+" { exp_continue }
+ -gl "Configuration modified, save?" {
+ send "n\r"
+ exp_continue
+ }
+ timeout { catch {close}; wait
+ return 0
+ }
+ eof { return 0 }
}
set in_proc 0
}
@@ -424,7 +442,7 @@ foreach firewall [lrange $argv $i end] {
set firewall [string tolower $firewall]
send_user "$firewall\n"
- set prompt ">"
+ set prompt {-> }
# Figure out passwords
if { $do_passwd || $do_enapasswd } {
@@ -432,19 +450,22 @@ foreach firewall [lrange $argv $i end] {
if { [llength $pswd] == 0 } {
send_user "\nError: no password for $firewall in $password_file.\n"
continue
- }
- set passwd [join [lindex $pswd 0]""]
+ }
+ set passwd [join [lindex $pswd 0] ""]
set enapasswd [join [lindex $pswd 1] ""]
+ } else {
+ set passwd $userpasswd
+ set enapasswd $enapasswd
}
# Figure out username
- if {[info exists username]} {
+ if {[info exists username]} {
# command line username
set ruser $username
} else {
set ruser [join [find user $firewall] ""]
if { "$ruser" == "" } { set ruser $default_user }
- }
+ }
# Figure out username's password (if different from the vty password)
if {[info exists userpasswd]} {
@@ -452,17 +473,9 @@ foreach firewall [lrange $argv $i end] {
set userpswd $userpasswd
} else {
set userpswd [join [find userpassword $firewall] ""]
- if { "$userpswd" == "" } { set userpswd $passwd }
- }
-
- # Figure out enable username
- if {[info exists enausername]} {
- # command line enausername
- set enauser $enausername
- } else {
- set enauser [join [find enauser $firewall] ""]
- if { "$enauser" == "" } { set enauser $ruser }
- }
+ if { "$userpswd" == "" } { set userpswd $passwd }
+ }
+
# Figure out cypher type
if {[info exists cypher]} {
@@ -477,28 +490,23 @@ foreach firewall [lrange $argv $i end] {
set cmethod [find method $firewall]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
- # Figure out the SSH executable name
- set sshcmd [find sshcmd $router]
- if { "$sshcmd" == "" } { set sshcmd {ssh} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $firewall]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
# Login to the firewall
if {[login $firewall $ruser $userpswd $passwd $enapasswd $prompt $cmethod $cyphertype]} {
continue
}
- if { $enable } {
- if {[do_enable $enauser $enapasswd]} {
- if { $do_command || $do_script } {
- close; wait
- continue
- }
- }
- }
+
# we are logged in, now figure out the full prompt
send "\r"
expect {
-re "\[\r\n]+" { exp_continue; }
- -re "^.+$prompt" { set junk $expect_out(0,string);
- regsub -all "\[\]\(\)\[]" $junk {\\&} prompt;
+ -re "^(.+$prompt)" { set junk $expect_out(0,string);
+ # if it has HA (high avail), the prompt will
+ # be "something-(.)->"
+ regsub -all "\[\]\)\(\[]" $junk {\\&} prompt;
}
}
@@ -508,11 +516,11 @@ foreach firewall [lrange $argv $i end] {
}
} elseif { $do_script } {
send "set console page 0\r"
- expect $prompt {}
+ expect -re $prompt {}
source $sfile
close
} else {
- label $firewall
+ label $firewall
log_user 1
interact
}
diff --git a/bin/nrancid.in b/bin/nrancid.in
index 9b965a2..940bdc8 100644
--- a/bin/nrancid.in
+++ b/bin/nrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: nrancid.in,v 1.13 2004/01/11 03:49:13 heas Exp $
+## $Id: nrancid.in,v 1.28 2006/11/10 21:40:48 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -21,29 +22,34 @@
#
# Amazingly hacked version of Hank's rancid - this one tries to
# deal with Netscreen firewalls
-#
+#
# Original Netscreen hacks implemented by Stephen Gill [gillsr@yahoo.com]
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$found_end = 0;
-$timeo = 90; # nlogin timeout in seconds
+$timeo = 90; # nlogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
-# This routine is used to print out the firewall configuration
+# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -65,10 +71,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -78,10 +84,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -91,22 +97,22 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
- $sorted_lines[$i] = $key;
- $i++;
+ $sorted_lines[$i] = $key;
+ $i++;
}
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -120,7 +126,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -133,7 +139,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -147,24 +153,26 @@ sub GetSystem {
tr/\015//d;
next if /^\s*$/;
last if(/$prompt/);
+ # throw away the pager lines
+ next if /^--- more ---/;
- /^Serial Number: (\d+), Control Number: \d+$/ &&
- ProcessHistory("SYSTEM","","", "!SN: $1\n") && next;
- /^Product Name: (\S+)$/ &&
- ProcessHistory("SYSTEM","","", "!Product: $1\n") && next;
- /^Hardware Version: (\S+), / &&
- ProcessHistory("SYSTEM","","", "!HW: $1\n") && next;
- /^Software Version: (\S+), Type: (\S+)$/ &&
- ProcessHistory("SYSTEM","","", "!Netscreen Type: $2\n!Software Version: $1\n") && next;
- /^Image: (\S+), / &&
- ProcessHistory("SYSTEM","","", "!Image: $1\n") && next;
- /^Feature: (\S+)$/ &&
- ProcessHistory("SYSTEM","","", "!Feature: $1\n") && next;
- /^File Name: (\S+), Checksum: (\S+)$/ &&
- ProcessHistory("SYSTEM","","", "!File Name: $1, Checksum: $2\n") && next;
+ /^Serial Number: (\d+), Control Number: \d+$/ &&
+ ProcessHistory("SYSTEM","","", "#SN: $1\n") && next;
+ /^Product Name: (\S+)$/ &&
+ ProcessHistory("SYSTEM","","", "#Product: $1\n") && next;
+ /^Hardware Version: (\S+), / &&
+ ProcessHistory("SYSTEM","","", "#HW: $1\n") && next;
+ /^Software Version: (\S+), Type: (\S+)$/ &&
+ ProcessHistory("SYSTEM","","", "#Netscreen Type: $2\n#Software Version: $1\n") && next;
+ /^Image: (\S+), / &&
+ ProcessHistory("SYSTEM","","", "#Image: $1\n") && next;
+ /^Feature: (\S+)$/ &&
+ ProcessHistory("SYSTEM","","", "#Feature: $1\n") && next;
+ /^File Name: (\S+), Checksum: (\S+)$/ &&
+ ProcessHistory("SYSTEM","","", "#File Name: $1, Checksum: $2\n") && next;
}
- ProcessHistory("SYSTEM","","","!\n");
+ ProcessHistory("SYSTEM","","","#\n");
return(0);
}
@@ -173,7 +181,7 @@ sub GetFile {
while (<INPUT>) {
last if(/$prompt/);
}
- ProcessHistory("FILE","","","!\n");
+ ProcessHistory("FILE","","","#\n");
return(0);
}
@@ -182,21 +190,48 @@ sub GetConf {
while (<INPUT>) {
tr/\015//d;
next if /^\s*$/;
+ next if /^Total Config.+$/i;
last if(/$prompt/);
+ # throw away the pager lines
+ next if /^--- more ---/;
if (/^set admin name "(\S+)"$/ && $filter_pwds >= 1) {
- ProcessHistory("ADMIN","","","!set admin name <removed>\n");
- next;
- }
+ ProcessHistory("ADMIN","","","#set admin name <removed>\n");
+ next;
+ }
if (/^set admin password (\S+)$/ && $filter_pwds >= 1) {
- ProcessHistory("ADMIN","","","!set admin password <removed>\n");
- next;
- }
+ ProcessHistory("ADMIN","","","#set admin password <removed>\n");
+ next;
+ }
if (/^set admin user (\S+) password (\S+) privilege (\S+)$/ &&
$filter_pwds >= 1) {
- ProcessHistory("ADMIN","","",
- "!set admin user $1 password <removed> privilege $3\n");
- next;
+ ProcessHistory("ADMIN","","",
+ "#set admin user $1 password <removed> privilege $3\n");
+ next;
+ }
+ if (/^set auth-server (\S+) radius secret / && $filter_pwds >= 1 ) {
+ ProcessHistory("ADMIN","","",
+ "#set auth-server $1 radius secret <removed>\n");
+ next;
+ }
+ if (/^set ike gateway (.*) username (\S+)(.*) password (\S+)(.*)$/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("ADMIN","","",
+ "#set ike gateway $1 username <removed>$3 password <removed>$5\n");
+ next;
+ }
+ if (/^set ike gateway (.*) preshare "(\S+)"(.*)$/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("ADMIN","","",
+ "#set ike gateway $1 preshare <removed>$3\n");
+ next;
+ }
+ if (/^set auth-server (.*) secret "(\S+)"(.*)$/ &&
+ $filter_pwds >= 1) {
+ ProcessHistory("ADMIN","","",
+ "#set auth-server $1 secret <removed>$3\n");
+ next;
+ }
ProcessHistory("","","","$_");
}
$found_end=1;
@@ -207,19 +242,27 @@ sub GetConf {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'get system' => "GetSystem",
- 'get conf' => "GetConf"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important. pita
-@commands=(
- "get system",
- "get conf"
+@commandtable = (
+ {'get system' => 'GetSystem'},
+ {'get conf' => 'GetConf'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -242,14 +285,14 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
- $filter_pwds = 2;
+ $filter_pwds = 2;
} else {
- $filter_pwds = 1;
+ $filter_pwds = 1;
}
-ProcessHistory("","","","!RANCID-CONTENT-TYPE: netscreen\n!\n");
+ProcessHistory("","","","#RANCID-CONTENT-TYPE: netscreen\n#\n");
TOP: while(<INPUT>) {
tr/\015//d;
if (/^Error:/) {
@@ -260,7 +303,8 @@ TOP: while(<INPUT>) {
while (/>\s*($cmds_regexp)\s*$/) {
$cmd = $1;
if (!defined($prompt)) {
- $prompt = "\-\>\s*";
+ $prompt = ($_ =~ /^([^>]+->)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}
print STDERR ("HIT COMMAND:$_") if ($debug);
@@ -293,7 +337,6 @@ if (scalar(%commands) || !$found_end) {
printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
}
if (!$found_end) {
- print STDOUT "$found_end: found end\n";
print STDOUT "$host: End of run not found\n";
print STDERR "$host: End of run not found\n" if ($debug);
system("/usr/bin/tail -1 $host.new");
diff --git a/bin/nslogin.in b/bin/nslogin.in
index 385f530..6cf4188 100644
--- a/bin/nslogin.in
+++ b/bin/nslogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: nslogin.in,v 1.10 2004/01/11 05:39:15 heas Exp $
+## $Id: nslogin.in,v 1.22 2006/12/08 21:28:26 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -49,7 +50,7 @@ set password_file $env(HOME)/.cloginrc
set do_command 1
set do_script 0
# The default is to automatically enable
-set enable 0
+set avenable 0
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
set avautoenable 0
@@ -61,7 +62,7 @@ set do_enapasswd 1
set platform ""
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -77,6 +78,9 @@ if {[ info exists env(CISCO_USER) ] } {
}
regexp {\(([^)]*)} "$reason" junk default_user
}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -191,11 +195,11 @@ for {set i 0} {$i < $argc} {incr i} {
set do_command 1
# Do we enable?
} -noenable {
- set enable 0
+ set avenable 0
# Does tacacs automatically enable us?
} -autoenable {
set avautoenable 1
- set enable 0
+ set avenable 0
} -* {
send_user "\nError: Unknown argument! $arg\n"
send_user $usage
@@ -288,6 +292,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
global spawn_id in_proc do_command do_script platform
global prompt u_prompt p_prompt e_prompt sshcmd
@@ -297,16 +302,28 @@ proc login { router user userpswd passwd enapasswd cmethod cyphertype } {
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if ![string compare $prog "ssh"] {
if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
send_user "\nError: $sshcmd failed: $reason\n"
- exit 1
+ return 1
+ }
+ } elseif ![string compare $prog "telnet"] {
+ send_error "\nError: unsupported method: telnet\n"
+ if { $progs == 0 } {
+ return 1
+ }
+ continue
+ } elseif ![string compare $prog "rsh"] {
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
}
+ continue
} else {
- puts "\nError: unknown connection method: $prog"
+ send_user "\nError: unknown connection method: $prog\n"
return 1
}
- incr progs -1
sleep 0.3
# This helps cleanup each expect clause.
@@ -487,7 +504,9 @@ proc run_commands { prompt command } {
exp_continue
}
"\n" { exp_continue }
- timeout { return 0 }
+ timeout { catch {close}; wait
+ return 0
+ }
eof { return 0 }
}
set in_proc 0
@@ -510,6 +529,8 @@ foreach router [lrange $argv $i end] {
# look for noenable option in .cloginrc
if { [find noenable $router] != "" } {
set enable 0
+ } else {
+ set enable $avenable
}
# Figure out passwords
@@ -525,6 +546,9 @@ foreach router [lrange $argv $i end] {
}
set passwd [join [lindex $pswd 0] ""]
set enapasswd [join [lindex $pswd 1] ""]
+ } else {
+ set passwd $userpasswd
+ set enapasswd $enapasswd
}
# Figure out username
@@ -587,9 +611,9 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
- # Figure out the SSH executable name
- set sshcmd [find sshcmd $router]
- if { "$sshcmd" == "" } { set sshcmd {ssh} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
# Login to the router
if {[login $router $ruser $userpswd $passwd $enapasswd $cmethod $cyphertype]} {
diff --git a/bin/nsrancid.in b/bin/nsrancid.in
index 40a286f..a74cce6 100644
--- a/bin/nsrancid.in
+++ b/bin/nsrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: nsrancid.in,v 1.7 2004/01/11 03:49:13 heas Exp $
+## $Id: nsrancid.in,v 1.14 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,30 +25,34 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # nslogin timeout in seconds
+$timeo = 90; # nslogin timeout in seconds
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
@temp1 = split (/\./,$host);
$prompt = "$temp1[0]#";
$prompt = "netscaler#";
-my(%filter_pwds); # password filtering mode
-
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -69,10 +74,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -82,10 +87,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -95,10 +100,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -108,9 +113,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -124,7 +129,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -137,7 +142,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -165,9 +170,9 @@ sub ShowConfig {
}
if (/exit$/) {
- $found_end = 1;
- $clean_run = 1;
- return(1);
+ $found_end = 1;
+ $clean_run = 1;
+ return(1);
}
return(0);
}
@@ -205,20 +210,27 @@ sub RunCommand {
sub DoNothing {print STDOUT;}
# Main
-#--------------------------------------------------
-%commands=(
- 'cat /etc/ns.conf' => "ShowConfig",
- 'get log setting' => "GetLogSet"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "cat /etc/ns.conf",
- "get log setting"
+@commandtable = (
+ {'cat /etc/ns.conf' => 'ShowConfig'},
+ {'get log setting' => 'GetLogSet'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -261,7 +273,7 @@ TOP: while(<INPUT>) {
# if ( (/netscaler#/) || $found_end ) {
#print STDOUT "\n\nhere1\n";
-# $clean_run=1;
+# $clean_run=1;
# last;
# }
diff --git a/bin/par.in b/bin/par.in
index b50bd05..408b36b 100644
--- a/bin/par.in
+++ b/bin/par.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: par.in,v 1.10 2004/01/11 03:49:13 heas Exp $
+## $Id: par.in,v 1.14 2006/11/28 21:21:28 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -44,7 +45,11 @@
# line is assumed to be a command to be run.
#
use Getopt::Std;
-getopts('p:n:l:c:fixedq');
+getopts('p:n:l:c:fixedqV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$procs=$opt_n; $procs=3 if(!$procs);
$command=$opt_c; #$command="{}" if(!$command);
$parlog=$opt_l; $parlog="par.log.".time() if(!$parlog);
@@ -59,7 +64,7 @@ if ($opt_q && ($opt_x || $opt_l)) {
$signalled=0;
-sub handler {
+sub handler {
$signalled++;
print STDERR "Received signal - ending run ($signalled).\n";
if($signalled>1) {
@@ -145,4 +150,4 @@ $procs=$i if ($i<$procs);
while($procs) {
$procs-- if(finish);
}
-print STDERR "Complete\n" if ($debug);
+print STDERR "Complete\n" if ($debug);
diff --git a/bin/prancid.in b/bin/prancid.in
index 7ded178..4777675 100755
--- a/bin/prancid.in
+++ b/bin/prancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: prancid.in,v 1.29 2004/01/11 03:49:13 heas Exp $
+## $Id: prancid.in,v 1.35 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -23,26 +24,31 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my($platform); # platform/cpu type
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
+my($platform); # platform/cpu type
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -64,10 +70,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -77,10 +83,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -90,10 +96,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -103,9 +109,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -119,7 +125,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -132,7 +138,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -460,25 +466,30 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version all' => "ShowVersion",
- 'show package' => "ShowPackage",
- 'show hardware' => "ShowHardware",
- 'show inventory' => "ShowInventory",
- 'write term' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version all",
- "show package",
- "show hardware",
- "show inventory",
- "write term"
+@commandtable = (
+ {'show version all' => 'ShowVersion'},
+ {'show package' => 'ShowPackage'},
+ {'show hardware' => 'ShowHardware'},
+ {'show inventory' => 'ShowInventory'},
+ {'write term' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
diff --git a/bin/rancid-cvs.in b/bin/rancid-cvs.in
index 22d5fd2..24d555a 100644
--- a/bin/rancid-cvs.in
+++ b/bin/rancid-cvs.in
@@ -1,8 +1,9 @@
#! /bin/sh
##
-## $Id: rancid-cvs.in,v 1.16 2004/01/11 03:49:13 heas Exp $
+## $Id: rancid-cvs.in,v 1.19 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -20,7 +21,7 @@
##
#
# Create all of the misc files & dirs needed for each group and import them
-# into CVS.
+# into CVS or Subversion.
#
# rancid-cvs
#
@@ -28,6 +29,32 @@
# Read in the environment
ENVFILE="@sysconfdir@/rancid.conf"
+# print a usage message to stderr
+pr_usage() {
+ echo "usage: $0 [-V] [group [group ...]]" >&2;
+}
+
+# command-line options
+# -V print version string
+if [ $# -ge 1 ] ; then
+ while [ 1 ] ; do
+ case $1 in
+ -V)
+ echo "@PACKAGE@ @VERSION@"
+ exit 0
+ ;;
+ -*)
+ echo "unknown option: $1" >&2
+ pr_usage
+ exit 1
+ ;;
+ *)
+ break;
+ ;;
+ esac
+ done
+fi
+
. $ENVFILE
# Base dir
@@ -38,9 +65,20 @@ fi
cd $BASEDIR
+# RCS system
+RCSSYS=${RCSSYS:=cvs};
+if [ $RCSSYS != "cvs" -a $RCSSYS != "svn" ] ; then
+ echo "$RCSSYS is not a valid value for RCSSYS."
+ exit 1
+fi
+
# Top level CVS stuff
if [ ! -d $CVSROOT ]; then
- cvs init
+ if [ $RCSSYS = cvs ]; then
+ cvs -d $CVSROOT init
+ else
+ svnadmin create $CVSROOT
+ fi
fi
# Log dir
@@ -65,15 +103,21 @@ do
if [ ! -d $DIR ]; then
mkdir -p $DIR
cd $DIR
- cvs import -m "$GROUP" $GROUP new rancid
- cd $BASEDIR
- cvs co $GROUP
+ if [ $RCSSYS = cvs ]; then
+ cvs import -m "$GROUP" $GROUP new rancid
+ cd $BASEDIR
+ cvs checkout $GROUP
+ else
+ svn import -m "$GROUP" . file://$CVSROOT/$GROUP
+ cd $BASEDIR
+ svn checkout file://$CVSROOT/$GROUP $GROUP
+ fi
fi
cd $DIR
if [ ! -d configs ]; then
mkdir configs
- cvs add configs
- cvs commit -m 'new' configs
+ $RCSSYS add configs
+ $RCSSYS commit -m 'new' configs
fi
# main files
@@ -88,7 +132,7 @@ do
fi
if [ ! -f router.db ]; then
touch router.db
- cvs add router.db
- cvs commit -m 'new' router.db
+ $RCSSYS add router.db
+ $RCSSYS commit -m 'new' router.db
fi
done
diff --git a/bin/rancid-fe.in b/bin/rancid-fe.in
index b80a194..bed4129 100644
--- a/bin/rancid-fe.in
+++ b/bin/rancid-fe.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: rancid-fe.in,v 1.36 2004/01/11 03:49:13 heas Exp $
+## $Id: rancid-fe.in,v 1.45 2007/01/13 22:01:53 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -19,7 +20,7 @@
## Henry Kilmer, John Heasley, Andrew Partan, Pete Whiting, and Austin Schutz.
##
#
-# rancid-FE - front-end to rancid/jrancid/etc. for use with par.
+# rancid-FE - front-end to rancid/jrancid/etc. for use with par.
#
# usage: rancid-fe <router>:<vendor>
#
@@ -27,32 +28,40 @@
require 5;
($router, $vendor) = split('\:', $ARGV[0]);
+$vendor =~ tr/[A-Z]/[a-z]/;
- if ($vendor =~ /^alteon$/i) { exec('arancid', $router); }
-elsif ($vendor =~ /^baynet$/i) { exec('brancid', $router); }
-elsif ($vendor =~ /^cat5$/i) { exec('cat5rancid', $router); }
-elsif ($vendor =~ /^cisco$/i) { exec('rancid', $router); }
-elsif ($vendor =~ /^css$/i) { exec('cssrancid', $router); }
-elsif ($vendor =~ /^enterasys$/i) { exec('rivrancid', $router); }
-elsif ($vendor =~ /^erx$/i) { exec('jerancid', $router); }
-elsif ($vendor =~ /^extreme$/i) { exec('xrancid', $router); }
-elsif ($vendor =~ /^ezt3$/i) { exec('erancid', $router); }
-elsif ($vendor =~ /^force10$/i) { exec('f10rancid', $router); }
-elsif ($vendor =~ /^foundry$/i) { exec('francid', $router); }
-elsif ($vendor =~ /^hitachi$/i) { exec('htrancid', $router); }
-elsif ($vendor =~ /^hp$/i) { exec('hrancid', $router); }
-elsif ($vendor =~ /^juniper$/i) { exec('jrancid', $router); }
-elsif ($vendor =~ /^mrtd$/i) { exec('mrancid', $router); }
-elsif ($vendor =~ /^netscaler$/i) { exec('nsrancid', $router); }
-elsif ($vendor =~ /^netscreen$/i) { exec('nrancid', $router); }
-elsif ($vendor =~ /^procket$/i) { exec('prancid', $router); }
-elsif ($vendor =~ /^redback$/i) { exec('rrancid', $router); }
-elsif ($vendor =~ /^riverstone$/i) { exec('rivrancid', $router); }
-elsif ($vendor =~ /^tnt$/i) { exec('tntrancid', $router); }
-elsif ($vendor =~ /^zebra$/i) { exec('zrancid', $router); }
-else {
+%vendortable = (
+ 'agm' => 'agmrancid',
+ 'alteon' => 'arancid',
+ 'baynet' => 'brancid',
+ 'cat5' => 'cat5rancid',
+ 'cisco' => 'rancid',
+ 'css' => 'cssrancid',
+ 'enterasys' => 'rivrancid',
+ 'erx' => 'jerancid',
+ 'extreme' => 'xrancid',
+ 'ezt3' => 'erancid',
+ 'force10' => 'f10rancid',
+ 'foundry' => 'francid',
+ 'hitachi' => 'htrancid',
+ 'hp' => 'hrancid',
+ 'juniper' => 'jrancid',
+ 'mrtd' => 'mrancid',
+ 'netscaler' => 'nsrancid',
+ 'netscreen' => 'nrancid',
+ 'procket' => 'prancid',
+ 'redback' => 'rrancid',
+ 'riverstone' => 'rivrancid',
+ 'smc' => 'srancid',
+ 'tnt' => 'tntrancid',
+ 'zebra' => 'zrancid'
+);
+
+if ($vendortable{$vendor} eq "") {
printf(STDERR "unknown router manufacturer for $router: $vendor\n");
exit(-1);
+} else {
+ exec($vendortable{$vendor} . " $router");
}
printf(STDERR "exec failed router manufacturer $vendor: $!\n");
diff --git a/bin/rancid-run.in b/bin/rancid-run.in
index b59b026..42e387a 100644
--- a/bin/rancid-run.in
+++ b/bin/rancid-run.in
@@ -1,8 +1,9 @@
#! /bin/sh
##
-## $Id: rancid-run.in,v 1.28 2004/01/11 06:11:23 hank Exp $
+## $Id: rancid-run.in,v 1.35 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -23,10 +24,9 @@
# @sysconfdir@/rancid.conf or those specified on the command-line.
#
+# Default ENVFILE, overrideable with -f flag.
ENVFILE="@sysconfdir@/rancid.conf"
-. $ENVFILE
-
TMPDIR=${TMPDIR:=/tmp}; export TMPDIR
# control_rancid argv
@@ -34,19 +34,30 @@ CR_ARGV=""; export CR_ARGV
# print a usage message to stderr
pr_usage() {
- echo "usage: $0 [-r device_name] [-m mail rcpt] [group [group ...]]" >&2;
+ echo "usage: $0 [-V] [-f config_file] [-r device_name] [-m mail rcpt] [group [group ...]]" >&2;
}
# command-line options
+# -V
+# -f <config file name>
+# -m <mailto address>
# -r <device name>
if [ $# -ge 1 ] ; then
while [ 1 ] ; do
case $1 in
- -r)
+ -V)
+ echo "@PACKAGE@ @VERSION@"
+ exit 0
+ ;;
+ -f)
shift
- # next arg is the device name
- CR_ARGV="$CR_ARGV -r $1"; export CR_ARGV
+ # next arg is the alternate config file name
+ ENVFILE="$1"
+ if [ -z $ENVFILE ]; then
+ pr_usage
+ exit 1
+ fi
shift
;;
-m)
@@ -55,6 +66,12 @@ if [ $# -ge 1 ] ; then
CR_ARGV="$CR_ARGV -m $1"; export CR_ARGV
shift
;;
+ -r)
+ shift
+ # next arg is the device name
+ CR_ARGV="$CR_ARGV -r $1"; export CR_ARGV
+ shift
+ ;;
--)
shift; break;
;;
@@ -74,6 +91,9 @@ if [ $# -ge 1 ] ; then
done
fi
+. $ENVFILE
+
+
if [ $# -ge 1 ] ; then
LIST_OF_GROUPS="$*"; export LIST_OF_GROUPS
elif [ "$LIST_OF_GROUPS" = "" ] ; then
@@ -88,49 +108,48 @@ fi
for GROUP in $LIST_OF_GROUPS
do
- LOCKFILE=$TMPDIR/.$GROUP.run.lock
-
- (
- echo starting: `date`
- echo
-
- if [ -f $LOCKFILE ]
- then
- echo hourly config diffs failed: $LOCKFILE exists
- ls -l $LOCKFILE
-
- # Send email if the lock file is old.
- if [ "X$LOCKTIME" = "X" ] ; then
- LOCKTIME=4
- fi
- @PERLV@ -e "\$t = (stat(\"$LOCKFILE\"))[9]; print \"OLD\\n\" if (time() - \$t >= $LOCKTIME*60*60);" > $TMPDIR/.$GROUP.old
- if [ -s $TMPDIR/.$GROUP.old ]
- then
- (
- echo "To: @ADMINMAILPLUS@$GROUP"
- echo "Subject: rancid hung - $GROUP"
- echo "Precedence: bulk"
- echo ""
-
- cat <<END
+ LOCKFILE=$TMPDIR/.$GROUP.run.lock
+
+ (
+ echo starting: `date`
+ echo
+
+ if [ -f $LOCKFILE ]
+ then
+ echo hourly config diffs failed: $LOCKFILE exists
+ ls -l $LOCKFILE
+
+ # Send email if the lock file is old.
+ if [ "X$LOCKTIME" = "X" ] ; then
+ LOCKTIME=4
+ fi
+ @PERLV@ -e "\$t = (stat(\"$LOCKFILE\"))[9]; print \"OLD\\n\" if (time() - \$t >= $LOCKTIME*60*60);" > $TMPDIR/.$GROUP.old
+ if [ -s $TMPDIR/.$GROUP.old ]
+ then
+ (
+ echo "To: @ADMINMAILPLUS@${GROUP}${MAILDOMAIN}"
+ echo "Subject: rancid hung - $GROUP"
+ echo "Precedence: bulk"
+ echo ""
+
+ cat <<END
rancid $GROUP hung on `hostname`? Old lockfile still exists:
`ls -l $LOCKFILE`
END
- ) | sendmail -t
- fi
- rm -f $TMPDIR/.$GROUP.old
-
- else
- trap 'rm -fr $LOCKFILE;exit 1' 1 2 3 6 10 15
- touch $LOCKFILE
- if [ $? -eq 0 ] ; then
- control_rancid $CR_ARGV $GROUP
- rm -f $LOCKFILE
- fi
- trap '' 1 2 3 6 10 15
- fi
-
- echo
- echo ending: `date`
- ) >$LOGDIR/$GROUP.`date +%Y%m%d.%H%M%S` 2>&1
+ ) | sendmail -t
+ fi
+ rm -f $TMPDIR/.$GROUP.old
+ else
+ trap 'rm -fr $LOCKFILE;exit 1' 1 2 3 6 10 15
+ touch $LOCKFILE
+ if [ $? -eq 0 ] ; then
+ control_rancid $CR_ARGV $GROUP
+ rm -f $LOCKFILE
+ fi
+ trap '' 1 2 3 6 10 15
+ fi
+
+ echo
+ echo ending: `date`
+ ) >$LOGDIR/$GROUP.`date +%Y%m%d.%H%M%S` 2>&1
done
diff --git a/bin/rancid.in b/bin/rancid.in
index 27a5a48..4b5b12a 100644
--- a/bin/rancid.in
+++ b/bin/rancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: rancid.in,v 1.168 2004/01/12 00:52:47 asp Exp $
+## $Id: rancid.in,v 1.218 2006/10/05 04:27:43 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -21,25 +22,33 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$found_version = 0;
+$found_env = 0;
+$found_diag = 0;
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -61,10 +70,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -74,10 +83,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -87,10 +96,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -100,9 +109,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -116,7 +125,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -129,7 +138,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -142,11 +151,18 @@ sub ShowVersion {
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^(\s*|\s*$cmd\s*)$/);
+ if (/^$prompt/) { $found_version=1; last};
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
+ return(0) if ($found_version); # Only do this routine once
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
if (/^Slave in slot (\d+) is running/) {
$slave = " Slave:";
$slaveslot = ", slot $1";
@@ -157,10 +173,11 @@ sub ShowVersion {
ProcessHistory("COMMENTS","keysort","F1", "!Image: $_") && next;
/^Cisco Secure PIX /i &&
ProcessHistory("COMMENTS","keysort","F1", "!Image: $_") && next;
- # PIX fail-over license
- /^This PIX has an?\s+(.*)$/ &&
- ProcessHistory("COMMENTS","keysort","C1", "!$_") && next;
- /^(Cisco )?IOS .* Software,? \(([A-Za-z-0-9]*)\), .*Version\s+(.*)$/ &&
+ # PIX 6 fail-over license, as in "This PIX has an Unrestricted (UR)
+ # license." PIX 7 as "his platform has ..."
+ /^This (PIX|platform) has an?\s+(.*)$/ &&
+ ProcessHistory("COMMENTS","keysort","D1", "!$_") && next;
+ /^(Cisco )?IOS .* Software,? \(([A-Za-z-0-9_]*)\), .*Version\s+(.*)$/ &&
ProcessHistory("COMMENTS","keysort","F1",
"!Image:$slave Software: $2, $3\n") && next;
/^([A-Za-z-0-9_]*) Synced to mainline version: (.*)$/ &&
@@ -181,6 +198,17 @@ sub ShowVersion {
}
/^Serial Number:\s+(.*)$/ &&
ProcessHistory("COMMENTS","keysort","C1", "!$_") && next;
+ # More PIX stuff
+ /^Encryption hardware device\s+:\s+(.*)/ &&
+ ProcessHistory("COMMENTS","keysort","A3", "!Encryption: $1\n") &&
+ next;
+ /^running activation key\s*:\s+(.*)/i &&
+ ProcessHistory("COMMENTS","keysort","D2", "!Key: $1\n") &&
+ next;
+ # Flash on the PIX or FWSM (FireWall Switch Module)
+ /^Flash(\s+\S+)+ \@ 0x\S+,\s+(\S+)/ &&
+ ProcessHistory("COMMENTS","keysort","B2", "!Memory: Flash $2\n") &&
+ next;
# CatOS 3500xl stuff
/^System serial number(:\s+.*)$/ &&
ProcessHistory("COMMENTS","keysort","C1", "!Serial Number$1\n") &&
@@ -211,7 +239,7 @@ sub ShowVersion {
next;
/^System image file is "([^\"]*)"$/ &&
ProcessHistory("COMMENTS","keysort","F5","!Image: $1\n") && next;
- if (/(\S+)\s+\((\S+)\)\s+processor.*with (\S+[kK]) bytes/) {
+ if (/(\S+)\s+(?:\((\S+)\)\s+processor|\(revision[^)]+\)).*\s+with (\S+k) bytes/i) {
my($proc) = $1;
my($cpu) = $2;
my($mem) = $3;
@@ -225,7 +253,17 @@ sub ShowVersion {
# incantations. for a slave, we dont get this info and its just a
# blank line.
$_ = <INPUT>;
- $_ = <INPUT> if (/processor board id/i);
+ if (/processor board id/i) {
+ my($sn);
+
+ if (/processor board id (\S+)/i) {
+ $sn = $1;
+ $sn =~ s/,$//;
+ ProcessHistory("COMMENTS","keysort","D9",
+ "!Processor ID: $sn\n");
+ }
+ $_ = <INPUT>;
+ }
$_ = "" if (! /(cpu at |processor: |$cpu processor,)/i);
tr/\015//d;
s/implementation/impl/i;
@@ -234,53 +272,57 @@ sub ShowVersion {
s/^/, /;
}
- if ( $proc eq "CSC") {
+ if ($proc eq "CSC") {
$type = "AGS";
- } elsif ( $proc eq "CSC4") {
+ } elsif ($proc eq "CSC4") {
$type = "AGS+";
- } elsif ( $proc =~ /^(AS)?25[12][12]/) {
+ } elsif ($proc =~ /^(AS)?25[12][12]/) {
$type = "2500";
- } elsif ( $proc =~ /261[01]/ || $proc =~ /262[01]/ ) {
+ } elsif ($proc =~ /261[01]/ || $proc =~ /262[01]/ ) {
$type = "2600";
- } elsif ( $proc =~ /^36[0246][0-9]/) {
+ } elsif ($proc =~ /^36[0246][0-9]/) {
$type = "3600";
- } elsif ( $proc =~ /^37/) {
+ } elsif ($proc =~ /^37/) {
$type = "3700";
- } elsif ( $proc eq "RSP7000") {
+ } elsif ($proc =~ /^38/) {
+ $type = "3800";
+ } elsif ($proc eq "RSP7000") {
$type = "7500";
- } elsif ( $proc =~ /RSP\d/) {
+ } elsif ($proc =~ /RSP\d/) {
$type = "7500";
- } elsif ( $proc eq "RP1") {
+ } elsif ($proc eq "RP1") {
$type = "7000";
- } elsif ( $proc eq "RP") {
+ } elsif ($proc eq "RP") {
$type = "7000";
- } elsif ( $proc =~ /720[246]/) {
+ } elsif ($proc =~ /720[246]/) {
$type = "7200";
- } elsif ( $proc =~ /1200[48]\/GRP/ || $proc =~ /1201[26]\/GRP/) {
+ } elsif ($proc =~ /1200[48]\/GRP/ || $proc =~ /1201[26]\/GRP/) {
$type = "12000";
- } elsif ( $proc =~ /1201[26]-8R\/GRP/) {
+ } elsif ($proc =~ /1201[26]-8R\/GRP/) {
$type = "12000";
- } elsif ( $proc =~ /WS-C29/) {
+ } elsif ($proc =~ /WS-C29/) {
$type = "2900XL";
$device = "switch";
- } elsif ( $proc =~ /WS-C355/) {
+ } elsif ($proc =~ /WS-C355/) {
$type = "3550";
$device = "switch";
- } elsif ( $proc =~ /WS-C35/) {
+ } elsif ($proc =~ /WS-C35/) {
$type = "3500XL";
$device = "switch";
- } elsif ( $proc =~ /WS-C45/) {
+ } elsif ($proc =~ /WS-C45/) {
$type = "4500";
$device = "switch";
- } elsif ( $proc =~ /6000/) {
+ } elsif ($proc =~ /6000/) {
$type = "6000";
$device = "switch";
- } elsif ( $proc =~ /CISCO76/) {
+ } elsif ($proc =~ /CISCO76/) {
$type = "7600";
$device = "router";
- } elsif ( $proc =~ /1900/) {
+ } elsif ($proc =~ /1900/) {
$type = "1900";
$device = "switch";
+ } elsif ( $proc =~ /^73/) {
+ $type = "7300";
} else {
$type = $proc;
}
@@ -289,7 +331,10 @@ sub ShowVersion {
"!Chassis type:$slave $proc - a $type $device\n");
ProcessHistory("COMMENTS","keysort","B1",
"!Memory:$slave main $mem\n");
- ProcessHistory("COMMENTS","keysort","A3","!CPU:$slave $cpu$_$slaveslot\n");
+ if (defined($cpu)) {
+ ProcessHistory("COMMENTS","keysort","A3",
+ "!CPU:$slave $cpu$_$slaveslot\n");
+ }
next;
}
if (/(\S+) Silicon\s*Switch Processor/) {
@@ -316,12 +361,12 @@ sub ShowVersion {
/^(\d+[kK]) bytes of Flash internal/ &&
ProcessHistory("COMMENTS","keysort","B4",
"!Memory: bootflash $1\n") && next;
- if(/^(\d+[kK]) bytes of (Flash|ATA)?.*PCMCIA .*(slot|disk) ?(\d)/i) {
+ if (/^(\d+[kK]) bytes of (Flash|ATA)?.*PCMCIA .*(slot|disk) ?(\d)/i) {
ProcessHistory("COMMENTS","keysort","B7",
"!Memory: pcmcia $2 $3$4 $1\n");
next;
}
- if(/^WARNING/) {
+ if (/^WARNING/) {
if (!defined($I0)) {
$I0=1;
ProcessHistory("COMMENTS","keysort","I0","!\n");
@@ -332,6 +377,10 @@ sub ShowVersion {
$config_register=$1;
next;
}
+ if (/^Configuration register on node \S+ is (.*)$/) {
+ $config_register=$1 if $config_register eq "";
+ next;
+ }
}
return(0);
}
@@ -342,12 +391,17 @@ sub ShowRedundancy {
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^(\s*|\s*$cmd\s*)$/);
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
- /^IOS .* Software \(([A-Za-z-0-9]*)\), .*Version\s+(.*)$/ &&
+ /^IOS .* Software \(([A-Za-z-0-9_]*)\), .*Version\s+(.*)$/ &&
ProcessHistory("COMMENTS","keysort","F1",
"!Image:$slave Software: $1, $2\n") && next;
/^Compiled (.*)$/ &&
@@ -365,14 +419,18 @@ sub ShowIDprom {
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
- next if(/^(\s*|\s*$cmd\s*)$/);
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
/FRU is .(.*)\'/ && ($tmp = $1);
/Product Number = .(.*)\'/ &&
- ProcessHistory("COMMENTS","keysort","D0","!\n") &&
ProcessHistory("COMMENTS","keysort","D0",
"!Catalyst Chassis type: $1, $tmp\n");
/Serial Number = .([0-9A-Za-z]+)/ &&
@@ -396,10 +454,15 @@ sub ShowInstallActive {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
ProcessHistory("COMMENTS","keysort","F5","!Image: $_") && next;
}
return(0);
@@ -412,12 +475,19 @@ sub ShowEnv {
while (<INPUT>) {
tr/\015//d;
- last if (/^$prompt/);
+ if (/^$prompt/) { $found_env=1; last};
next if (/^(\s*|\s*$cmd\s*)$/);
#return(1) if ($type !~ /^7/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
+ return(0) if ($found_env); # Only do this routine once
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
if (!defined($E0)) {
$E0=1;
ProcessHistory("COMMENTS","keysort","E0","!\n");
@@ -432,6 +502,8 @@ sub ShowEnv {
"!Chassis type: $2 backplane\n");
next;
}
+ /^Power Supply Information$/ && next;
+ /^\s*Power Module\s+Voltage\s+Current$/ && next;
/^\s*(Power [^:\n]+)$/ &&
ProcessHistory("COMMENTS","keysort","E1","!Power: $1\n") && next;
/^\s*(Lower Power .*)/i &&
@@ -457,11 +529,13 @@ sub ShowRSP {
return(-1) if (/command authorization failed/i);
# return(1) if ($type !~ /^12[40]/);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
/^$/ && next;
/^\s+Chassis model: (\S+)/ &&
- ProcessHistory("COMMENTS","keysort","D0","!\n") &&
ProcessHistory("COMMENTS","keysort","D1",
"!RSP Chassis model: $1\n") &&
next;
@@ -487,10 +561,13 @@ sub ShowGSR {
return(-1) if (/command authorization failed/i);
# return(1) if ($type !~ /^12[40]/);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
/^$/ && next;
+
/^\s+Chassis: type (\S+) Fab Ver: (\S+)/ &&
- ProcessHistory("COMMENTS","keysort","D0","!\n") &&
ProcessHistory("COMMENTS","keysort","D1",
"!GSR Chassis type: $1 Fab Ver: $2\n") &&
next;
@@ -522,12 +599,17 @@ sub ShowBoot {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
- return(-1) if (/command authorization failed/i);
- return(1) if /Ambiguous command/i;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
+ return(1) if /Ambiguous command/i;
return(1) if /(Open device \S+ failed|Error opening \S+:)/;
+ return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
next if /CONFGEN variable/;
if (!defined($H0)) {
$H0=1; ProcessHistory("COMMENTS","keysort","H0","!\n");
@@ -557,11 +639,17 @@ sub ShowFlash {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if ($type =~ /^(12[40]|7)/);
- return(-1) if (/command authorization failed/i);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
+ return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
+ /\s+(multiple-fs|nv_hdr|vlan\.dat)$/ && next;
ProcessHistory("FLASH","","","!Flash: $_");
}
ProcessHistory("","","","!\n");
@@ -581,6 +669,7 @@ sub DirSlotN {
next if (/^(\s*|\s*$cmd\s*)$/);
# return(1) if ($type !~ /^(12[40]|7|36)/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(1) if /(No such device|Error Sending Request)/i;
return(1) if /\%Error: No such file or directory/;
@@ -590,7 +679,11 @@ sub DirSlotN {
return(-1) if (/command authorization failed/i);
return(1) if /(Open device \S+ failed|Error opening \S+:)/;
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
ProcessHistory("FLASH","","","!Flash: $dev: $_");
}
ProcessHistory("","","","!\n");
@@ -609,7 +702,11 @@ sub ShowContAll {
# return(1) if ($type =~ /^(12[40]|7[05])/);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
if (/^Interface ([^ \n(]*)/) { $INT = "$1, "; next; }
/^(BRI unit \d)/ &&
ProcessHistory("INT","","","!Interface: $1\n") && next;
@@ -669,7 +766,11 @@ sub ShowContCbus {
#return(1) if ($type !~ /^7[05]0/);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
if (/^\s*slot(\d+): ([^,]+), hw (\S+), sw (\S+), ccb/) {
$slot = $1;
$board{$slot} = $2;
@@ -703,6 +804,34 @@ sub ShowContCbus {
return(0);
}
+# This routine parses "show debug"
+sub ShowDebug {
+ print STDERR " In ShowDebug: $_" if ($debug);
+ my($lines) = 0;
+
+ while (<INPUT>) {
+ tr/\015//d;
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
+ return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
+ /^No matching debug flags set$/ && next;
+ ProcessHistory("COMMENTS","keysort","J1","!DEBUG: $_");
+ $lines++;
+ }
+ if ($lines) {
+ ProcessHistory("COMMENTS","keysort","J0","!\n");
+ }
+ return(0);
+}
+
# This routine parses "show diagbus"
# This will create arrarys for hw info.
sub ShowDiagbus {
@@ -714,9 +843,15 @@ sub ShowDiagbus {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
#return(1) if ($type !~ /^7[05]/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
if (/^\s*Slot (\d+):/i) {
$slot = $1;
next;
@@ -798,14 +933,20 @@ sub ShowDiag {
print STDERR " In ShowDiag: $_" if ($debug);
while (<INPUT>) {
- tr/\015//d;
- last if (/^$prompt/);
+REDUX: tr/\015//d;
+ if (/^$prompt/) { $found_diag=1; last};
next if (/^(\s*|\s*$cmd\s*)$/);
# return(1) if ($type !~ /^(12[40]|720|36|26)/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
+ return(0) if ($found_diag); # Only do this routine once
/^$/ && next;
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
s/Port Packet Over SONET/POS/;
if (/^\s*SLOT\s+(\d+)\s+\((.*)\): (.*)/) {
@@ -814,8 +955,59 @@ sub ShowDiag {
ProcessHistory("SLOT","keysort","A","!Slot $slot: $3\n");
next;
}
- if (/^\s+MAIN:\s* type \d+,\s+(.*)/) {
- ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $1\n");
+ if (/^\s*NODE\s+(\S+) : (.*)/) {
+ $slot = $1;
+ ProcessHistory("SLOT","","","!\n");
+ ProcessHistory("SLOT","keysort","A","!Slot $slot: $2\n");
+ next;
+ }
+ if (/^\s*PLIM\s+(\S+) : (.*)/) {
+ $slot = $1 . " PLIM";
+ ProcessHistory("SLOT","","","!\n");
+ ProcessHistory("SLOT","keysort","A","!Slot $slot: $2\n");
+ next;
+ }
+ if (/^\s*RACK\s+(\S+) : (.*)/) {
+ $slot = "Rack/" . $1;
+ ProcessHistory("SLOT","","","!\n");
+ ProcessHistory("SLOT","keysort","A","!Slot $slot: $2\n");
+ next;
+ }
+ if (/^\s+MAIN:\s* type \S+,\s+(.*)/) {
+ local($part) = $1;
+ $_ = <INPUT>;
+ if (/^\s+(HW version|Design Release) (\S+)\s+S\/N (\S+)/i) {
+ ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $part, serial $3\n");
+ ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: hvers $2\n");
+ } else {
+ ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $part\n");
+ goto REDUX;
+ }
+ next;
+ }
+ if (/^\s+MAIN:\s* board type \S+$/) {
+ $_ = <INPUT>;
+ tr/\015//d;
+ if (/^\s+(.+)$/) {
+ local($part) = $1;
+ $_ = <INPUT>;
+ tr/\015//d;
+ if (/^\s+dev (.*)$/) {
+ local($dev) = $1;
+ $_ = <INPUT>;
+ if (/^\s+S\/N (\S+)/) {
+ ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $part, dev $dev, serial $1\n");
+ } else {
+ ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $part, dev $dev\n");
+ goto REDUX;
+ }
+ } else {
+ ProcessHistory("SLOT","keysort","AM","!Slot $slot/MAIN: part $part\n");
+ goto REDUX;
+ }
+ } else {
+ goto REDUX;
+ }
next;
}
if (/^c3700\s+(io-board|mid-plane)/i) {
@@ -831,12 +1023,24 @@ sub ShowDiag {
ProcessHistory("SLOT","keysort","AF","!Slot $slot/FRU: Linecard/Module: $1\n");
next;
}
+ if (/\s+Processor Memory:\s+(\S+)/) {
+ ProcessHistory("SLOT","keysort","AF","!Slot $slot/FRU: Processor Memory: $1\n");
+ next;
+ }
+ if (/\s+Packet Memory:\s+(\S+)/) {
+ ProcessHistory("SLOT","keysort","AF","!Slot $slot/FRU: Packet Memory: $1\n");
+ next;
+ }
if (/^\s+PCA:\s+(.*)/) {
local($part) = $1;
$_ = <INPUT>;
- /^\s+(HW version|design release) (\S+)\s+S\/N (\S+)/i &&
- ProcessHistory("SLOT","keysort","C1","!Slot $slot/PCA: part $part, serial $3\n") &&
+ if (/^\s+(HW version|design release) (\S+)\s+S\/N (\S+)/i) {
+ ProcessHistory("SLOT","keysort","C1","!Slot $slot/PCA: part $part, serial $3\n");
ProcessHistory("SLOT","keysort","C2","!Slot $slot/PCA: hvers $2\n");
+ } else {
+ ProcessHistory("SLOT","keysort","C1","!Slot $slot/PCA: part $part\n");
+ goto REDUX;
+ }
next;
}
if (/^\s+MBUS: .*\)\s+(.*)/) {
@@ -851,10 +1055,22 @@ sub ShowDiag {
ProcessHistory("SLOT","keysort","MB3","!Slot $slot/MBUS: software $1\n");
next;
}
+ if (/^\s+PLD: (.*)/) {
+ ProcessHistory("SLOT","keysort","P","!Slot $slot/PLD: $1\n");
+ next;
+ }
+ if (/^\s+MONLIB: (.*)/) {
+ ProcessHistory("SLOT","keysort","Q","!Slot $slot/MONLIB: $1\n");
+ next;
+ }
if (/^\s+ROM Monitor version (.*)/) {
ProcessHistory("SLOT","keysort","R","!Slot $slot/ROM Monitor: version $1\n");
next;
}
+ if (/^\s+ROMMON: Version (.*)/) {
+ ProcessHistory("SLOT","keysort","R","!Slot $slot/ROMMON: version $1\n");
+ next;
+ }
if (/^\s+Fabric Downloader version used (.*)/) {
ProcessHistory("SLOT","keysort","Z","!Slot $slot/Fabric Downloader: version $1\n");
next;
@@ -867,6 +1083,7 @@ sub ShowDiag {
. $1 / 1024 . " Kbytes SDRAM\n");
} else {
ProcessHistory("SLOT","keysort","MB4","!Slot $slot/MBUS: $dram Mbytes DRAM\n");
+ goto REDUX;
}
next;
}
@@ -880,6 +1097,8 @@ sub ShowDiag {
$WIC = "/$2";
} elsif ($1 eq "WIC/VIC") {
$WIC = "/$2";
+ } elsif ($1 eq "DSP") {
+ $WIC = "/$2";
} elsif ($1 eq "Encryption AIM") {
$slot = "$2";
undef($WIC);
@@ -915,6 +1134,15 @@ sub ShowDiag {
ProcessHistory("SLOT","keysort","B","!Slot $slot$WIC: type $_");
}
next;
+ } elsif (/^\s+(.* (DSP) Module) Slot (\d):/) {
+ # The 1760 (at least) has yet another format...where it has two
+ # dedicated DSP slots, and thus two slot 0s.
+ my($TYPE) = $1;
+ $WIC = "/$3";
+ ProcessHistory("SLOT","","","!\n");
+ ProcessHistory("SLOT","keysort","B",
+ "!Slot $slot$WIC: type $TYPE\n");
+ next;
}
# yet another format. seen on 2600s w/ 12.1, but appears to be all
# 12.1, including 7200s & 3700s. Sometimes the PCB serial appears
@@ -929,7 +1157,7 @@ sub ShowDiag {
while (<INPUT>) {
tr/\015//d;
- if (/0x..: /) {
+ if (/0x..: / || /^$/) {
# no effing idea why break does not work there
goto PerlSucks;
}
@@ -953,32 +1181,87 @@ PerlSucks:
return(0);
}
+# This routine parses "show inventory".
+sub ShowInventory {
+ print STDERR " In ShowInventory: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ return if (/^\s*\^$/);
+ last if (/^$prompt/);
+ next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if /(Invalid input detected|Type help or )/;
+ return(-1) if (/command authorization failed/i);
+ # the pager can not be disabled per-session on the PIX
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
+ if (/^(NAME: "[^"]*",) (DESCR: "[^"]+")/) {
+ ProcessHistory("INVENTORY","","", sprintf("!%-30s %s\n", $1, $2));
+ next;
+ }
+ # split PID/VID/SN line
+ if (/^PID: (\S*)\s*, VID: (\S*)\s*, SN: (\S*)\s*$/) {
+ my($entries) = "";
+ $entries .= "!PID: $1\n" if ($1);
+ $entries .= "!VID: $2\n" if ($2);
+ $entries .= "!SN: $3\n" if ($3);
+ ProcessHistory("INVENTORY","","", "$entries");
+ next;
+ }
+ ProcessHistory("INVENTORY","","","!$_");
+ }
+ ProcessHistory("INVENTORY","","","!\n");
+
+ return(0);
+}
+
# This routine parses "show module".
sub ShowModule {
print STDERR " In ShowModule: $_" if ($debug);
my(@lines);
- my($slot);
+ my($slot, $pa);
while (<INPUT>) {
tr/\015//d;
return if (/^\s*\^$/);
+ last if (/online diag status/i);
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
# match slot/card info line
if (/^ *(\d+)\s+(\d+)\s+(.*)\s+(\S+)\s+(\S+)\s*$/) {
- $lines[$1] .= "!Slot $1: type $3, $2 ports\n!Slot $1: part $4, serial $5\n";
- $lines[$1] =~ s/\s+,/,/g;
+ $lines[$1 * 1000] .= "!Slot $1: type $3, $2 ports\n!Slot $1: part $4, serial $5\n";
+ $lines[$1 * 1000] =~ s/\s+,/,/g;
+ next;
}
# now match the Revs in the second paragraph of o/p and stick it in
# the array with the previous bits...grumble.
if (/^ *(\d+)\s+\S+\s+to\s+\S+\s+(\S+)\s+(\S*)\s+(\S+)(\s+\S+)?\s*$/) {
- $lines[$1] .= "!Slot $1: hvers $2, firmware $3, sw $4\n";
- $lines[$1] =~ s/\s+,/,/g;
+ $lines[$1 * 1000] .= "!Slot $1: hvers $2, firmware $3, sw $4\n";
+ $lines[$1 * 1000] =~ s/\s+,/,/g;
+ next;
+ }
+ # grab the sub-modules, if any
+ if (/^\s+(\d+)\s(.*)\s+(\S+)\s+(\S+)\s+(\S+)\s+\S+\s*$/) {
+ my($idx);
+ $pa = 0 if ($1 != $slot);
+ $slot = $1;
+ $idx = $1 * 1000 + $1 * 10 + $pa;
+ $lines[$idx] .= "!Slot $1/$pa: type $2\n";
+ $lines[$idx] .= "!Slot $slot/$pa: part $3, serial $4\n";
+ $lines[$idx] .= "!Slot $slot/$pa: hvers $5\n";
+ $pa++;
}
}
foreach $slot (@lines) {
@@ -998,6 +1281,7 @@ sub ShowSpeVersion {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
return(-1) if (/command authorization failed/i);
@@ -1021,7 +1305,11 @@ sub ShowC7200 {
return(-1) if (/command authorization failed/i);
/^$/ && next;
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
if (/^(C7200 )?Midplane EEPROM:/) {
$_ = <INPUT>;
/revision\s+(\S+).*revision\s+(\S+)/;
@@ -1062,12 +1350,17 @@ sub ShowVTP {
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
#return(1) if ($type !~ /^(2900XL|3500XL|6000)$/);
return(-1) if (/command authorization failed/i);
next if (/^Configuration last modified by/);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
if (/^VTP Operating Mode\s+:\s+(Transparent|Server)/) {
$DO_SHOW_VLAN = 1;
}
@@ -1087,14 +1380,21 @@ sub ShowVLAN {
tr/\015//d;
last if (/^$prompt/);
next if (/^(\s*|\s*$cmd\s*)$/);
+ return(1) if /^\s*\^\s*$/;
+ return(1) if /Line has invalid autocommand /;
return(1) if /(Invalid input detected|Type help or )/;
+ return(1) if /Ambiguous command/i;
# newer releases (~12.1(9)) place the vlan config in the normal
# configuration (write term).
return(1) if ($type =~ /^(3550|4500|7600)$/);
#return(1) if ($type !~ /^(2900XL|3500XL|6000)$/);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
ProcessHistory("COMMENTS","keysort","IO","!VLAN: $_");
}
ProcessHistory("COMMENTS","keysort","IO","!\n");
@@ -1108,10 +1408,16 @@ sub WriteTerm {
while (<INPUT>) {
tr/\015//d;
- last if(/^$prompt/);
+ last if (/^$prompt/);
+ return(1) if /Line has invalid autocommand /;
+ return(1) if (/(Invalid input detected|Type help or )/i);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session on the PIX
- s/^<-+ More -+>\s*//;
+ if (/^(<-+ More -+>)/) {
+ my($len) = length($1);
+ s/^$1\s{$len}//;
+ }
+
/Non-Volatile memory is in use/ && return(-1); # NvRAM is locked
return(0) if ($found_end); # Only do this routine once
$linecnt++;
@@ -1152,8 +1458,8 @@ sub WriteTerm {
$lineauto = 1 if /^ modem auto/;
/^ speed / && $lineauto && next; # kill speed on serial lines
/^ clockrate / && next; # kill clockrate on serial interfaces
- if (/^(enable )?(password|passwd) / && $filter_pwds >= 1) {
- ProcessHistory("ENABLE","","","!$1$2 <removed>\n");
+ if (/^(enable )?(password|passwd)( level \d+)? / && $filter_pwds >= 1) {
+ ProcessHistory("ENABLE","","","!$1$2$3 <removed>\n");
next;
}
if (/^(enable secret) / && $filter_pwds >= 2) {
@@ -1169,15 +1475,24 @@ sub WriteTerm {
next;
}
if (/^username (\S+)(\s.*)? password ((\d) \S+|\S+)/) {
- if ($filter_pwds == 2) {
+ if ($filter_pwds >= 2) {
ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
- } elsif ($filter_pwds == 1 && $4 ne "5"){
+ } elsif ($filter_pwds >= 1 && $4 ne "5"){
ProcessHistory("USER","keysort","$1","!username $1$2 password <removed>\n");
} else {
ProcessHistory("USER","keysort","$1","$_");
}
next;
}
+ # cisco AP w/ IOS
+ if (/^(wlccp \S+ username (\S+)(\s.*)? password) (\d \S+|\S+)/) {
+ if ($filter_pwds >= 1) {
+ ProcessHistory("USER","keysort","$2","!$1 <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$2","$_");
+ }
+ next;
+ }
if (/^( set session-key (in|out)bound ah \d+ )/ && $filter_pwds >= 1) {
ProcessHistory("","","","!$1<removed>\n");
next;
@@ -1190,6 +1505,10 @@ sub WriteTerm {
ProcessHistory("LINE-PASS","","","!$1password <removed>\n");
next;
}
+ if (/^(\s*)secret / && $filter_pwds >= 2) {
+ ProcessHistory("LINE-PASS","","","!$1secret <removed>\n");
+ next;
+ }
if (/^\s*neighbor (\S*) password / && $filter_pwds >= 1) {
ProcessHistory("","","","! neighbor $1 password <removed>\n");
next;
@@ -1215,11 +1534,15 @@ sub WriteTerm {
if (/^( ip ospf message-digest-key \d+ md5) / && $filter_pwds >= 1) {
ProcessHistory("","","","!$1 <removed>\n"); next;
}
+ # this is also reversable, despite 'md5 encrypted' in the cmd
+ if (/^( message-digest-key \d+ md5 (7|encrypted)) / && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>\n"); next;
+ }
if (/^((crypto )?isakmp key) \S+ / && $filter_pwds >= 1) {
ProcessHistory("","","","!$1 <removed> $'"); next;
}
# filter HSRP passwords
- if (/^(\s+standby \d authentication) / && $filter_pwds >= 1) {
+ if (/^(\s+standby \d+ authentication) / && $filter_pwds >= 1) {
ProcessHistory("","","","!$1 <removed>\n"); next;
}
# this appears in "measurement/sla" images
@@ -1230,10 +1553,15 @@ sub WriteTerm {
ProcessHistory("","","","!$1 <removed>\n"); next;
}
# i am told these are plain-text on the PIX
- if (/^(vpdn username \S+ password)/ && $filter_pwds >= 1) {
- ProcessHistory("","","","!$1 <removed>\n"); next;
+ if (/^(vpdn username (\S+) password)/) {
+ if ($filter_pwds >= 1) {
+ ProcessHistory("USER","keysort","$2","!$1 <removed>\n");
+ } else {
+ ProcessHistory("USER","keysort","$2","$_");
+ }
+ next;
}
- if (/^( cable shared-secret ) / && $filter_pwds >= 1) {
+ if (/^( cable shared-secret )/ && $filter_pwds >= 1) {
ProcessHistory("","","","!$1 <removed>\n");
next;
}
@@ -1306,6 +1634,11 @@ sub WriteTerm {
while ($token = shift(@tokens)) {
if ($token eq 'version') {
$line .= " " . join(' ', ($token, shift(@tokens)));
+ if ($token eq '3') {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
+ }
+ } elsif ($token eq 'vrf') {
+ $line .= " " . join(' ', ($token, shift(@tokens)));
} elsif ($token =~ /^(informs?|traps?|(no)?auth)$/) {
$line .= " " . $token;
} else {
@@ -1327,12 +1660,9 @@ sub WriteTerm {
}
}
# prune tacacs/radius server keys
- if (/^(tacacs-server|radius-server) key / && $filter_pwds >= 1) {
- ProcessHistory("","","","!$1 key <removed>\n"); next;
- }
- if (/^((tacacs-server|radius-server) host \S+ key) / &&
- $filter_pwds >= 1) {
- ProcessHistory("","","","!$1 <removed>\n"); next;
+ if (/^((tacacs-server|radius-server)\s(\w*[-\s(\s\S+])*\s?key) \d \w+/
+ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
}
# order clns host statements
/^clns host \S+ (\S+)/ &&
@@ -1393,113 +1723,85 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'show redundancy secondary' => "ShowRedundancy",
- 'show idprom backplane', => "ShowIDprom",
- 'show install active' => "ShowInstallActive",
- 'show env all' => "ShowEnv",
- 'show rsp chassis-info',=> "ShowRSP",
- 'show gsr chassis' => "ShowGSR",
- 'show boot' => "ShowBoot",
- 'show bootvar' => "ShowBoot",
- 'show variables boot' => "ShowBoot",
- 'show flash' => "ShowFlash",
- 'dir /all nvram:' => "DirSlotN",
- 'dir /all bootflash:' => "DirSlotN",
- 'dir /all slot0:' => "DirSlotN",
- 'dir /all disk0:' => "DirSlotN",
- 'dir /all slot1:' => "DirSlotN",
- 'dir /all disk1:' => "DirSlotN",
- 'dir /all slot2:' => "DirSlotN",
- 'dir /all disk2:' => "DirSlotN",
- "dir /all sup-bootflash:"=> "DirSlotN", # cat 6500-ios
- "dir /all sup-microcode:"=> "DirSlotN", # cat 6500-ios
- 'dir /all slavenvram:' => "DirSlotN",
- 'dir /all slavebootflash:' => "DirSlotN",
- 'dir /all slaveslot0:' => "DirSlotN",
- 'dir /all slavedisk0:' => "DirSlotN",
- 'dir /all slaveslot1:' => "DirSlotN",
- 'dir /all slavedisk1:' => "DirSlotN",
- 'dir /all slaveslot2:' => "DirSlotN",
- 'dir /all slavedisk2:' => "DirSlotN",
- "dir /all slavesup-bootflash:"=> "DirSlotN", # cat 7609
- 'dir /all sec-nvram:' => "DirSlotN",
- 'dir /all sec-bootflash:' => "DirSlotN",
- 'dir /all sec-slot0:' => "DirSlotN",
- 'dir /all sec-disk0:' => "DirSlotN",
- 'dir /all sec-slot1:' => "DirSlotN",
- 'dir /all sec-disk1:' => "DirSlotN",
- 'dir /all sec-slot2:' => "DirSlotN",
- 'dir /all sec-disk2:' => "DirSlotN",
- 'show controllers' => "ShowContAll",
- 'show controllers cbus' => "ShowContCbus",
- 'show diagbus' => "ShowDiagbus",
- 'show diag' => "ShowDiag",
- 'show module' => "ShowModule", # cat 6500-ios
- 'show spe version' => "ShowSpeVersion",
- 'show c7200' => "ShowC7200",
- 'show vtp status' => "ShowVTP",
- 'show vlan' => "ShowVLAN",
- 'show running-config' => "WriteTerm",
- 'write term' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version",
- "show redundancy secondary",
- "show idprom backplane",
- "show install active",
- "show env all",
- "show rsp chassis-info",
- "show gsr chassis",
- "show boot",
- "show bootvar",
- "show variables boot",
- "show flash",
- "dir /all nvram:",
- "dir /all bootflash:",
- "dir /all slot0:",
- "dir /all disk0:",
- "dir /all slot1:",
- "dir /all disk1:",
- "dir /all slot2:",
- "dir /all disk2:",
- "dir /all sup-bootflash:",
- "dir /all sup-microcode:",
- "dir /all slavenvram:",
- "dir /all slavebootflash:",
- "dir /all slaveslot0:",
- "dir /all slavedisk0:",
- "dir /all slaveslot1:",
- "dir /all slavedisk1:",
- "dir /all slaveslot2:",
- "dir /all slavedisk2:",
- "dir /all slavesup-bootflash:",
- "dir /all sec-nvram:",
- "dir /all sec-bootflash:",
- "dir /all sec-slot0:",
- "dir /all sec-disk0:",
- "dir /all sec-slot1:",
- "dir /all sec-disk1:",
- "dir /all sec-slot2:",
- "dir /all sec-disk2:",
- "show controllers",
- "show controllers cbus",
- "show diagbus",
- "show diag",
- "show module",
- "show spe version",
- "show c7200",
- "show vtp status",
- "show vlan",
- "show running-config",
- "write term"
+@commandtable = (
+ {'admin show version' => 'ShowVersion'},
+ {'show version' => 'ShowVersion'},
+ {'show redundancy secondary' => 'ShowRedundancy'},
+ {'show idprom backplane', => 'ShowIDprom'},
+ {'show install active' => 'ShowInstallActive'},
+ {'admin show env all' => 'ShowEnv'},
+ {'show env all' => 'ShowEnv'},
+ {'show rsp chassis-info', => 'ShowRSP'},
+ {'show gsr chassis' => 'ShowGSR'},
+ {'show diag chassis-info' => 'ShowGSR'},
+ {'show boot' => 'ShowBoot'},
+ {'show bootvar' => 'ShowBoot'},
+ {'admin show variables boot' => 'ShowBoot'},
+ {'show variables boot' => 'ShowBoot'},
+ {'show flash' => 'ShowFlash'},
+ {'dir /all nvram:' => 'DirSlotN'},
+ {'dir /all bootflash:' => 'DirSlotN'},
+ {'dir /all slot0:' => 'DirSlotN'},
+ {'dir /all disk0:' => 'DirSlotN'},
+ {'dir /all slot1:' => 'DirSlotN'},
+ {'dir /all disk1:' => 'DirSlotN'},
+ {'dir /all slot2:' => 'DirSlotN'},
+ {'dir /all disk2:' => 'DirSlotN'},
+ {'dir /all harddisk:' => 'DirSlotN'},
+ {'dir /all harddiska:' => 'DirSlotN'},
+ {'dir /all harddiskb:' => 'DirSlotN'},
+ {'dir /all sup-bootflash:' => 'DirSlotN'}, # cat 6500-ios
+ {'dir /all sup-microcode:' => 'DirSlotN'}, # cat 6500-ios
+ {'dir /all slavenvram:' => 'DirSlotN'},
+ {'dir /all slavebootflash:' => 'DirSlotN'},
+ {'dir /all slaveslot0:' => 'DirSlotN'},
+ {'dir /all slavedisk0:' => 'DirSlotN'},
+ {'dir /all slaveslot1:' => 'DirSlotN'},
+ {'dir /all slavedisk1:' => 'DirSlotN'},
+ {'dir /all slaveslot2:' => 'DirSlotN'},
+ {'dir /all slavedisk2:' => 'DirSlotN'},
+ {'dir /all slavesup-bootflash:' => 'DirSlotN'}, # cat 7609
+ {'dir /all sec-nvram:' => 'DirSlotN'},
+ {'dir /all sec-bootflash:' => 'DirSlotN'},
+ {'dir /all sec-slot0:' => 'DirSlotN'},
+ {'dir /all sec-disk0:' => 'DirSlotN'},
+ {'dir /all sec-slot1:' => 'DirSlotN'},
+ {'dir /all sec-disk1:' => 'DirSlotN'},
+ {'dir /all sec-slot2:' => 'DirSlotN'},
+ {'dir /all sec-disk2:' => 'DirSlotN'},
+ {'show controllers' => 'ShowContAll'},
+ {'show controllers cbus' => 'ShowContCbus'},
+ {'show diagbus' => 'ShowDiagbus'},
+ {'admin show diag' => 'ShowDiag'},
+ {'show diag' => 'ShowDiag'},
+ {'show module' => 'ShowModule'}, # cat 6500-ios
+ {'show spe version' => 'ShowSpeVersion'},
+ {'show c7200' => 'ShowC7200'},
+ {'show inventory raw' => 'ShowInventory'},
+ {'show vtp status' => 'ShowVTP'},
+ {'show vlan' => 'ShowVLAN'},
+ {'show vlan-switch' => 'ShowVLAN'},
+ {'show debug' => 'ShowDebug'},
+ {'show running-config' => 'WriteTerm'},
+ {'write term' => 'WriteTerm'},
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -1522,15 +1824,16 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
- $filter_pwds = 2;
+ $filter_pwds = 2;
} else {
- $filter_pwds = 1;
+ $filter_pwds = 1;
}
ProcessHistory("","","","!RANCID-CONTENT-TYPE: cisco\n!\n");
ProcessHistory("COMMENTS","keysort","B0","!\n");
+ProcessHistory("COMMENTS","keysort","D0","!\n");
ProcessHistory("COMMENTS","keysort","F0","!\n");
ProcessHistory("COMMENTS","keysort","G0","!\n");
TOP: while(<INPUT>) {
diff --git a/bin/rivlogin.in b/bin/rivlogin.in
index 12554d5..2d80217 100644
--- a/bin/rivlogin.in
+++ b/bin/rivlogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: rivlogin.in,v 1.15 2004/01/11 05:39:15 heas Exp $
+## $Id: rivlogin.in,v 1.26 2006/12/08 21:28:26 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,24 +25,28 @@
# rivlogin - Riverstone (and Enterasys SSR) login
#
# Based upon rscmd (see nmops.org)
-# rscmd - Riverstone Networks Automated login
-# by Mike MacFaden, Kiran Addepalli
+# rscmd - Riverstone Networks Automated login
+# by Mike MacFaden, Kiran Addepalli
# Riverstone Networks, 2000
#
# Returned to the RANCID crowd by andrew fort
-# Global vars section
+# Usage line
+set usage "Error: Usage: $argv0 \[-noenable\] \
+\[-f cloginrc-file\] \[-c command\] \[-Evar=x\] \[-s script-file\] \
+\[-x command-file\] \[-t timeout\] \[-o output-file\] \
+router \[router...\]\n"
# program diagnostics
set verbose 0
set success 1
set config 0
-
+
# in seconds to wait for data back from device
set timeout 10
set tempfile "/tmp/rivlogin.[exec date]"
-# cli command prompt
+# cli command prompt
set my_prompt ">"
set enable_prompt "\#"
@@ -60,18 +65,35 @@ set do_script 0
set log_user 0
# The default CLI mode to login to is "enable" mode
-set enable 1
+set avenable 1
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
set do_enapasswd 1
-
-# cmd usage
-set usage "Error: Usage: $argv0 \[-noenable\] \
-\[-f cloginrc-file\] \[-c command\] \[-Evar=x\] \[-s script-file\] \
-\[-x command-file\] \[-t timeout\] \[-o output-file\] \
-router \[router...\]\n"
+#
+set send_human {.4 .4 .7 .3 5}
+
+# Find the user in the ENV, or use the unix userid.
+if {[ info exists env(CISCO_USER) ]} {
+ set default_user $env(CISCO_USER)
+} elseif {[ info exists env(USER) ]} {
+ set default_user $env(USER)
+} elseif {[ info exists env(LOGNAME) ]} {
+ set default_user $env(LOGNAME)
+} else {
+ # This uses "id" which I think is portable. At least it has existed
+ # (without options) on all machines/OSes I've been on recently -
+ # unlike whoami or id -nu.
+ if [ catch {exec id} reason ] {
+ send_error "\nError: could not exec id: $reason\n"
+ exit 1
+ }
+ regexp {\(([^)]*)} "$reason" junk default_user
+}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Procedures Section
@@ -79,7 +101,6 @@ router \[router...\]\n"
#
# Sets Xterm title if interactive...if its an xterm and the user cares
#
-
proc label { host } {
global env
@@ -97,35 +118,32 @@ proc label { host } {
}
}
-
# This is a helper function to make the password file easier to
# maintain.
# NOTES: Using this the password file has the form:
# add password sl* pete cow
# add password at* steve
# add password * hanky-pie
-
-proc add { var args } {
+proc add { var args } {
global $var
lappend $var $args
-}
+}
# Loads the password file. Note that as this file is tcl, and that
# it is sourced, the user better know what to put in there, as it
# could install more than just password info... I will assume however,
# that a "bad guy" could just as easy put such code in the clogin
-# script, so I will leave .cloginrc as just an extention of that script
-
+# script, so I will leave .cloginrc as just an extention of that script
proc source_password_file { } {
global env password_file read_password_file
- if { [info exists read_password_file] } {
+ if { [info exists read_password_file] } {
return 1
}
- if { [info exists password_file] == 0 } {
+ if { [info exists password_file] == 0 } {
set password_file $env(HOME)/.cloginrc
}
@@ -142,15 +160,14 @@ proc source_password_file { } {
# pre: var is x, router is y
# post: return routerr entry from database else null string
-
proc find { var router } {
if {[ source_password_file ] == 0 } {
return {}
}
- upvar $var list
- if { [info exists list] } {
+ upvar $var list
+ if { [info exists list] } {
foreach line $list {
if { [string match [lindex $line 0] $router ] } {
return [lrange $line 1 end]
@@ -160,13 +177,11 @@ proc find { var router } {
return {}
}
-
# pre: login completed ok
# post: terminate login session by closing tcp connection
-
proc auto_exit { } {
- global telnet_id
+ global telnet_id
if { $verbose == 1 } {
puts "DEBUG: auto_exit closing connection to pid $telnet_id\n"
@@ -179,8 +194,7 @@ proc auto_exit { } {
# post: return 0 on successful login, else 1
#
# NOTE: a number of globals are setup: my_prompt, telnet_id are key
-# and paging of cli output is disabled
-
+# and paging of cli output is disabled
proc login { router user userpswd passwd enapasswd } {
global login_array
@@ -212,7 +226,7 @@ proc login { router user userpswd passwd enapasswd } {
expect "*"
send "\r"
- # If password fails 3 times then expect again
+ # If password fails 3 times then expect again
set pass_attempt 0
expect {
@@ -220,7 +234,7 @@ proc login { router user userpswd passwd enapasswd } {
-re ".*> " { }
"Password:" {
- incr pass_attempt
+ incr pass_attempt
send "$passwd\r"
exp_continue
}
@@ -232,13 +246,13 @@ proc login { router user userpswd passwd enapasswd } {
send "$user\r"
expect {
- "Password: " {
+ "Password: " {
incr pattempt
if {$pattempt == 1} {
- send "$userpswd\r";
- } else {
- send "$enapasswd\r";
+ send "$userpswd\r";
+ } else {
+ send "$enapasswd\r";
}
exp_continue
}
@@ -246,8 +260,8 @@ proc login { router user userpswd passwd enapasswd } {
-re ".*> " { exp_continue;}
}
}
-
- "%TELNETD-W-BADPASSWD" {
+
+ "%TELNETD-W-BADPASSWD" {
puts "ERROR: bad userid or password to telnet."
return 1
}
@@ -266,7 +280,7 @@ proc login { router user userpswd passwd enapasswd } {
return 1
}
- "Connection closed *" {
+ "Connection closed *" {
if {$pass_attempt == 3} {
puts "ERROR: Maximum attempts for password reached. Check password. Exiting.";
puts $expect_out(0,string);
@@ -279,7 +293,7 @@ proc login { router user userpswd passwd enapasswd } {
return 1
}
- eof {
+ eof {
puts "ERROR: device closed telnet connection during login"
return 1
}
@@ -298,7 +312,6 @@ proc login { router user userpswd passwd enapasswd } {
# pre: login completed ok
# post: turn off paging of commands
-
proc disable_cli_paging { } {
global my_prompt
@@ -313,7 +326,6 @@ proc disable_cli_paging { } {
# pre: login returned 0, prompt at top level
# post: turn off command completion return 0
# on error, return 1
-
proc disable_cmd_autocomplete { } {
global my_prompt
@@ -322,9 +334,9 @@ proc disable_cmd_autocomplete { } {
$my_prompt { }
- timeout {
+ timeout {
puts "ERROR:disable_cmd_autocomplete(TIMEOUT)";
- return 0;
+ return 0;
}
}
@@ -333,8 +345,7 @@ proc disable_cmd_autocomplete { } {
}
# pre: login returned 0, do_enable returned 0, cli is in enable or config mode
-# post: issues logout cli to device, returns 0
-
+# post: issues logout cli to device, returns 0
proc logout { prompt } {
global config_mode enable_prompt
@@ -342,7 +353,7 @@ proc logout { prompt } {
# verify top level prompt state, move to it if necessary
if { $config_mode == 1 } {
-
+
send "exit\r"
expect {
@@ -370,7 +381,6 @@ proc logout { prompt } {
# pre: current mode allows transition to enable mode
# post: enable mode entered, my_prompt updated, return 0 else 1
-
proc do_enable { enauser enapasswd userpswd } {
global expect_out verbose
global my_prompt enable_prompt
@@ -380,19 +390,32 @@ proc do_enable { enauser enapasswd userpswd } {
if { $verbose == 1 } {
puts "DEBUG: do_enable: my_prompt = $my_prompt ena_prompt = $enable_prompt"
}
-
+
+ set uses_username 0;
+
send "enable\r"
expect {
- Username: { send "$enauser\r"; exp_continue }
- Password: { send "$userpswd\r"; exp_continue }
+ Username: {
+ set uses_username 1;
+ send "$enauser\r";
+ exp_continue
+ }
+ Password: {
+ if {$uses_username == 1} {
+ send "$userpswd\r";
+ } else {
+ send "$enapasswd\r";
+ }
+ exp_continue
+ }
"$my_prompt" {
puts "ERROR: do_enable failed to gain enable mode."
return 1
}
- "CONS-W-AUTH_PASSWD" { send "$enapasswd\r"; }
+ "CONS-W-AUTH_PASSWD" { send "$enapasswd\r"; }
"$enable_prompt " { }
"%SYS-W-NOPASSWD*" { }
@@ -402,14 +425,13 @@ proc do_enable { enauser enapasswd userpswd } {
return 1
}
}
-
+
set my_prompt $enable_prompt
return 0
}
# pre: current mode allows transition to enable mode
# post: enable mode entered, my_prompt updated, return 0 else 1
-
proc do_configure { } {
global expect_out verbose config_mode
global my_prompt
@@ -419,7 +441,7 @@ proc do_configure { } {
if { $verbose == 1 } {
puts "DEBUG: do_config: my_prompt = $my_prompt cfg_prompt = $config_prompt"
}
-
+
send "configure\r"
expect {
"$config_prompt " { }
@@ -438,15 +460,14 @@ proc do_configure { } {
# track sent/received from device to output_file
# pre: outut_file is valid filename w/write access
# post: logfile open, global var logging == 1, return 0 , else 1
-
proc start_logfile { output_file } {
- global logging
+ global logging
if { [ string length $output_file ] != 0 } {
- set rc [ catch {
+ set rc [ catch {
log_file -noappend $output_file
} errMsg ]
-
+
if { $rc != 0 } {
puts "ERROR: open file $output_file for write access failed. $errMsg\n"
return 1
@@ -458,7 +479,7 @@ proc start_logfile { output_file } {
}
proc run_commands { prompt cmdstring } {
- global sendstring
+ global sendstring
set commands [split $cmdstring \;]
set num_commands [llength $cmdstring]
@@ -474,13 +495,11 @@ proc run_commands { prompt cmdstring } {
return 0
}
-
# Run commands given on the command line
# pre: prompt is current system cli prompt, cmdstring is command to execute
# post: return 0 on success else 1
# NOTE: output from router ends up in output_file if specified
# expect internal input buffer is reset to "" after each command
-
proc run_single_command { prompt cmdstring } {
global verbose
set rc 0
@@ -498,7 +517,7 @@ proc run_single_command { prompt cmdstring } {
set need_ays 1
set delay 1
if {$verbose == 1} {
- puts "DEBUG: save startup cmd seen, set need_ays = 1"
+ puts "DEBUG: save startup cmd seen, set need_ays = 1"
}
}
@@ -511,7 +530,7 @@ proc run_single_command { prompt cmdstring } {
if { $delay == 1} {
sleep 1
- }
+ }
expect {
@@ -542,7 +561,7 @@ proc run_single_command { prompt cmdstring } {
"want to overwrite " {
send "yes\r"
if {$verbose == 1} {
- puts "DEBUG: got overwrite question, set need_ays to 0"
+ puts "DEBUG: got overwrite question, set need_ays to 0"
}
set need_ays 0
}
@@ -551,7 +570,7 @@ proc run_single_command { prompt cmdstring } {
"%CONFIG-E-DUPLICATE,*" {
}
- "$prompt" {
+ "$prompt" {
if { $seen_prompt == 0 } {
set seen_prompt 1
}
@@ -571,7 +590,7 @@ proc run_single_command { prompt cmdstring } {
}
- timeout {
+ timeout {
if {$verbose == 1} {
puts "DEBUG: timeout occured for the $seen_time time\n"
}
@@ -586,8 +605,8 @@ proc run_single_command { prompt cmdstring } {
set rc 1
}
- eof {
- puts "ERROR:run_commands(connection closed by device)\n"
+ eof {
+ puts "ERROR:run_commands(connection closed by device)\n"
set rc 1
}
@@ -602,15 +621,14 @@ proc run_single_command { prompt cmdstring } {
# pre: RSTONE_USER env var is set
# post: update global "default_user" to this string
-
proc init_userid { } {
global default_user
if {[ info exists env(RSTONE_USER) ] } {
set default_user $env(RSTONE_USER)
} else {
- # This uses "id" which I think is portable. At least it has existed
- # (without options) on all machines/OSes I've been on recently -
+ # This uses "id" which I think is portable. At least it has existed
+ # (without options) on all machines/OSes I've been on recently -
# unlike whoami or id -nu.
regexp {\(([^)]*)} [exec id] junk default_user
}
@@ -631,14 +649,13 @@ proc source_script_file { filename } {
# return 0 on success, return 1 on error
# NOTE: for scripts that begin with "configure", change the mode to configure
# before executing the following commands
-
proc process_script_file { filename } {
global my_prompt verbose
set rc 0
set ifile ""
- set rc [ catch {
+ set rc [ catch {
set ifile [ open $filename r]
} errMsg ]
@@ -650,16 +667,16 @@ proc process_script_file { filename } {
set line_cnt 0
while { [eof $ifile] != 1 } {
-
+
set bytes [ gets $ifile cmd ]
incr line_cnt
- if { $bytes < 0 } {
- break
+ if { $bytes < 0 } {
+ break
} elseif { $bytes == 0 } {
continue
}
-
+
if { $verbose == 1 } {
puts "DEBUG: line:$line_cnt cmd = $cmd\n"
}
@@ -693,12 +710,11 @@ proc process_script_file { filename } {
# post: remove extended ascii sequences and other cruft
# and prepend a header: rscmd: ip-addr : date
# TODO: should watch all file commands more closely
-
proc strip_log { filename router } {
global tempfile
- set rc [ catch {
+ set rc [ catch {
set ifile [ open $filename r]
} errMsg ]
@@ -706,7 +722,7 @@ proc strip_log { filename router } {
puts "ERROR: strip_log: open script file $filename for read access failed. $errMsg\n"
return 1
}
- set rc [ catch {
+ set rc [ catch {
set ofile [ open $tempfile w]
} errMsg ]
@@ -718,12 +734,11 @@ proc strip_log { filename router } {
set nl 0
puts $ofile "rscmd: $router : [exec date]"
-
+
while { [eof $ifile] != 1 } {
-
set bytes [ gets $ifile cmd ]
- if { $bytes <= 0 } {
- break
+ if { $bytes <= 0 } {
+ break
}
incr nl
if { $nl <= 2 } {
@@ -801,6 +816,10 @@ for {set idx 0} {$idx < $argc} {incr idx} {
}
set do_script 1
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Command file
} -x* -
-X {
@@ -832,22 +851,21 @@ for {set idx 0} {$idx < $argc} {incr idx} {
puts "DEBUG: output file: $output_file"
}
}
-
- } -t* -
- -T* {
- incr idx
- set timeout [ lindex $argv $idx ]
-
- } -noenable {
- set enable 0
- } -* {
- puts "ERROR:unkown argument passed: $arg\n"
- puts $usage
+ # Timeout
+ } -t* -
+ -T* {
+ incr idx
+ set timeout [ lindex $argv $idx ]
+ # Do we enable?
+ } -noenable {
+ set avenable 0
+ } -* {
+ send_user "Error: Unkown argument! $arg\n"
+ send_user $usage
exit 1
-
- } default {
+ } default {
break
- }
+ }
}
}
@@ -859,146 +877,139 @@ if { $idx == $argc } {
}
# main loop
-
foreach router [lrange $argv $idx end] {
set router [string tolower $router]
-# Figure out passwords
-if {$verbose == 1} {
- puts "DEBUG: do_passwd = $do_passwd\n"
- puts "DEBUG: do_enablepasswd = $do_enapasswd\n"
-}
-
-if { $do_passwd || $do_enapasswd } {
- set pswd [find password $router]
- if { [llength $pswd] == 0 } {
- puts "ERROR: - no password for $router in $password_file.\n"
- exit 1
- }
- if { $do_enapasswd && [llength $pswd] < 2 } {
- puts "ERROR: no enable password found for $router in $password_file."
- exit 1
- }
-
- set passwd [join [lindex $pswd 0] ""]
- set enapasswd [join [lindex $pswd 1] ""]
-}
-
-
-# Figure out user to login with if necessary
-
-if {[info exists username]} {
- # command line username
- set user $username
-} else {
- set user [join [find user $router] ""]
- if { "$user" == "" } { set user $default_user }
-}
-
-# Figure out username's password
-
-if {[info exists userpasswd]} {
- # command line username
- set userpswd $userpasswd
-} else {
- set userpswd [join [find userpassword $router] ""]
- if { "$userpswd" == "" } { set userpswd $passwd }
-}
+ # Figure out passwords
+ if {$verbose == 1} {
+ puts "DEBUG: do_passwd = $do_passwd\n"
+ puts "DEBUG: do_enablepasswd = $do_enapasswd\n"
+ }
-# Figure out enable username
+ # look for noenable option in .cloginrc
+ if { [find noenable $router] != "" } {
+ set enable 0
+ } else {
+ set enable $avenable
+ }
-if {[info exists enausername]} {
- # command line enausername
- set enauser $enausername
-} else {
- set enauser [join [find enauser $router] ""]
- if { "$enauser" == "" } { set enauser $user }
-}
+ if { $do_passwd || $do_enapasswd } {
+ set pswd [find password $router]
+ if { [llength $pswd] == 0 } {
+ puts "ERROR: - no password for $router in $password_file.\n"
+ exit 1
+ }
+ if { $do_enapasswd && [llength $pswd] < 2 } {
+ puts "ERROR: no enable password found for $router in $password_file."
+ exit 1
+ }
-# Login to the router, set my_prompt to router's cmd prompt
+ set passwd [join [lindex $pswd 0] ""]
+ set enapasswd [join [lindex $pswd 1] ""]
+ } else {
+ set passwd $userpasswd
+ set enapasswd $enapasswd
+ }
-if {[login $router $user $userpswd $passwd $enapasswd ]} {
- if { $verbose == 1 } {
- puts "DEBUG: login to $router failed\n"
+ # Figure out user to login with if necessary
+ if {[info exists username]} {
+ # command line username
+ set user $username
+ } else {
+ set user [join [find user $router] ""]
+ if { "$user" == "" } { set user $default_user }
}
- exit 1
-}
-if {$verbose == 1 } {
- puts "DEBUG: login completed ok\n"
-}
+ # Figure out username's password
+ if {[info exists userpasswd]} {
+ # command line username
+ set userpswd $userpasswd
+ } else {
+ set userpswd [join [find userpassword $router] ""]
+ if { "$userpswd" == "" } { set userpswd $passwd }
+ }
-if { $enable == 1 } {
+ # Figure out enable username
+ if {[info exists enausername]} {
+ # command line enausername
+ set enauser $enausername
+ } else {
+ set enauser [join [find enauser $router] ""]
+ if { "$enauser" == "" } { set enauser $user }
+ }
- if { [do_enable $enauser $enapasswd $userpswd] == 1} {
+ # Login to the router, set my_prompt to router's cmd prompt
+ if {[login $router $user $userpswd $passwd $enapasswd ]} {
if { $verbose == 1 } {
- puts "DEBUG: switch to enable mode on $router failed\n"
+ puts "DEBUG: login to $router failed\n"
}
exit 1
}
-}
-
-# run in one of three modes
-
-if { $do_command } {
- disable_cmd_autocomplete
- disable_cli_paging
-
- if {[ start_logfile $output_file] != 0 } {
- exit 1
+ if {$verbose == 1 } {
+ puts "DEBUG: login completed ok\n"
}
- if {[ run_commands $my_prompt $command ]} {
-
- log_file
- exit 1
+ if { $enable == 1 } {
+ if { [do_enable $enauser $enapasswd $userpswd] == 1} {
+ if { $verbose == 1 } {
+ puts "DEBUG: switch to enable mode on $router failed\n"
+ }
+ exit 1
+ }
+ }
- } else {
+ # run in one of three modes
+ if { $do_command } {
+ disable_cmd_autocomplete
+ disable_cli_paging
- logout $my_prompt
+ if { [start_logfile $output_file] != 0 } {
+ exit 1
+ }
- }
-
-} elseif { $do_script } {
-
- disable_cmd_autocomplete
- disable_cli_paging
-
- if {[ start_logfile $output_file] != 0 } {
- exit 1
- }
+ if {[ run_commands $my_prompt $command ]} {
+ log_file
+ exit 1
+ } else {
+ logout $my_prompt
+ }
+ } elseif { $do_script } {
+ disable_cmd_autocomplete
+ disable_cli_paging
- #if { [process_script_file $sfile] == 1} {
-# puts "DEBUG: logfile $output_file closed on error\n"
-# logout $my_prompt
-# exit 1
-# }
+ if {[ start_logfile $output_file] != 0 } {
+ exit 1
+ }
- source_script_file $sfile
+# if { [process_script_file $sfile] == 1} {
+# puts "DEBUG: logfile $output_file closed on error\n"
+# logout $my_prompt
+# exit 1
+# }
- logout $my_prompt
+ source_script_file $sfile
-} else {
-
- label $router
- log_user 1
+ logout $my_prompt
+ } else {
+ label $router
+ log_user 1
- if {[ start_logfile $output_file] != 0 } {
- exit 1
+ if {[ start_logfile $output_file] != 0 } {
+ exit 1
+ }
+ interact
+ log_file
}
- interact
- log_file
-}
-if { $verbose == 1 } {
- puts "DEBUG: exiting normally.\n"
-}
+ if { $verbose == 1 } {
+ puts "DEBUG: exiting normally.\n"
+ }
-if { $logging == 1} {
- log_file
- strip_log $output_file $router
-}
+ if { $logging == 1} {
+ log_file
+ strip_log $output_file $router
+ }
}
# puts "\n"
diff --git a/bin/rivrancid.in b/bin/rivrancid.in
index 8b9ae03..d6625b6 100644
--- a/bin/rivrancid.in
+++ b/bin/rivrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: rivrancid.in,v 1.9 2004/01/11 03:49:13 heas Exp $
+## $Id: rivrancid.in,v 1.17 2006/10/05 04:27:44 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -21,31 +22,36 @@
#
# Amazingly hacked version of Hank's rancid - this one tries to
# deal with Cabletron, Riverstone and Enterasys routers/switches
-#
+#
# 10/23/2002 -- Initial changes for Riverstone/Cabletron support
-# Jim Meehan -- jmeehan@vpizza.org
+# Jim Meehan -- jmeehan@vpizza.org
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rivrancid [-d] [-l] [-f filename | $host]
+# usage: rivrancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # flogin timeout in seconds
+$timeo = 90; # rivlogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -67,10 +73,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -80,10 +86,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -93,22 +99,22 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
- $sorted_lines[$i] = $key;
- $i++;
+ $sorted_lines[$i] = $key;
+ $i++;
}
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -122,7 +128,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -135,7 +141,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -179,7 +185,7 @@ sub ShowUptime {
tr/\015//d;
last if(/^$prompt/);
next if /^\s*$/;
- next if /System up/;
+ next if /System up/;
ProcessHistory("UPTIME","","","!UPTIME: $_");
}
ProcessHistory("","","","!\n");
@@ -197,13 +203,13 @@ sub ShowActive {
s/^\s*(\d+\D: )*//;
# Riverstone/Cabletron doesn't have an "end" line, so
- # we need to set $clean_run here
+ # we need to set $clean_run here
if (/^$prompt/) {
- $clean_run = 1;
- last;
- }
+ $clean_run = 1;
+ last;
+ }
- next if (/Running system configuration/);
+ next if (/Running system configuration/);
# filter out any RCS/CVS tags to avoid confusing local CVS storage
s/\$(Revision|Id):/ $1:/;
@@ -227,26 +233,29 @@ sub ShowActive {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'system show uptime' => "ShowUptime",
- 'system show version' => "ShowVersion",
- 'system show hardware' => "ShowHardware",
- 'system show active-config' => "ShowActive"
-);
-
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important. pita
-
-@commands=(
- "system show uptime",
- "system show version",
- "system show hardware",
- "system show active-config"
+@commandtable = (
+ {'system show uptime' => 'ShowUptime'},
+ {'system show version' => 'ShowVersion'},
+ {'system show hardware' => 'ShowHardware'},
+ {'system show active-config' => 'ShowActive'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -269,7 +278,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
diff --git a/bin/rrancid.in b/bin/rrancid.in
index 7674452..87ea7c4 100644
--- a/bin/rrancid.in
+++ b/bin/rrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: rrancid.in,v 1.18 2004/01/11 03:49:13 heas Exp $
+## $Id: rrancid.in,v 1.26 2006/10/05 04:27:44 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -23,25 +24,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -63,10 +69,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -76,10 +82,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -89,22 +95,22 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
- $sorted_lines[$i] = $key;
- $i++;
+ $sorted_lines[$i] = $key;
+ $i++;
}
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -118,7 +124,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -131,7 +137,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -245,7 +251,7 @@ sub WriteTerm {
s/\$(Revision|Id):/ $1:/;
# order access-lists
/^access-list\s+(\d\d?)\s+(\S+)\s+(\S+)/ &&
- ProcessHistory("ACL $1 $2","ipsort","$3","$_") && next;
+ ProcessHistory("ACL $1 $2","ipsort","$3","$_") && next;
# prune snmp community statements
if (/^snmp (group|community) (\S+)/) {
if (defined($ENV{'NOCOMMSTR'})) {
@@ -255,7 +261,7 @@ sub WriteTerm {
}
}
ProcessHistory("","","","$_");
- # end of config
+ # end of config
if (/^end$/) {
$found_end = 1;
last;
@@ -283,30 +289,33 @@ sub FlailHelplessly {
}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- "dir /flash" => "DirFlash",
- "dir /pcmcia0" => "DirFlash",
- "dir /pcmcia1" => "DirFlash",
- 'show hardware' => "ShowHardware",
- 'show chassis' => "ShowChassis",
- 'show slot table' => "ShowSlotTable",
- 'show config' => "WriteTerm"
-);
-@commands=(
- "show version",
- "dir /flash",
- "dir /pcmcia0",
- "dir /pcmcia1",
- "show hardware",
- "show chassis",
- "show slot table",
- "show config"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'dir /flash' => 'DirFlash'},
+ {'dir /pcmcia0' => 'DirFlash'},
+ {'dir /pcmcia1' => 'DirFlash'},
+ {'show hardware' => 'ShowHardware'},
+ {'show chassis' => 'ShowChassis'},
+ {'show slot table' => 'ShowSlotTable'},
+ {'show config' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
$redback_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered
@@ -330,7 +339,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
diff --git a/bin/srancid.in b/bin/srancid.in
new file mode 100755
index 0000000..63c2e92
--- /dev/null
+++ b/bin/srancid.in
@@ -0,0 +1,404 @@
+#! @PERLV_PATH@
+##
+## Pretty huge hack to take care of Dell Switch configs
+## d_pfleger@juniper.net
+##
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Henry Kilmer.
+## All rights reserved.
+##
+## This software may be freely copied, modified and redistributed
+## fee for non-commerical purposes provided that this copyright notice
+## preserved intact on all copies and modified copies.
+##
+## There is no warranty or other guarantee of fitness of this software.
+## It is provided solely "as is". The author(s) disclaim(s) all
+## responsibility and liability with respect to this software's usage
+## or its effect upon hardware, computer systems, other software, or
+## anything else.
+##
+##
+#
+# RANCID - Really Awesome New Cisco confIg Differ
+#
+# usage: rancid [-dV] [-l] [-f filename | hostname]
+#
+use Getopt::Std;
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
+$log = $opt_l;
+$debug = $opt_d;
+$file = $opt_f;
+$host = $ARGV[0];
+$found_end = 0;
+$timeo = 90; # hlogin timeout in seconds
+
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
+
+# This routine is used to print out the router configuration
+sub ProcessHistory {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
+ print eval "$command \%history";
+ undef %history;
+ }
+ if (($new_hist_tag) && ($new_command) && ($command_string)) {
+ if ($history{$command_string}) {
+ $history{$command_string} = "$history{$command_string}@string";
+ } else {
+ $history{$command_string} = "@string";
+ }
+ } elsif (($new_hist_tag) && ($new_command)) {
+ $history{++$#history} = "@string";
+ } else {
+ print "@string";
+ }
+ $hist_tag = $new_hist_tag;
+ $command = $new_command;
+ 1;
+}
+
+sub numerically { $a <=> $b; }
+
+# This is a sort routine that will sort numerically on the
+# keys of a hash as if it were a normal array.
+sub keynsort {
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort numerically keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# keys of a hash as if it were a normal array.
+sub keysort {
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort keys(%lines)) {
+ $sorted_lines[$i] = $lines{$key};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# values of a hash as if it were a normal array.
+sub valsort{
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $key (sort values %lines) {
+ $sorted_lines[$i] = $key;
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a numerical sort routine (ascending).
+sub numsort {
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $num (sort {$a <=> $b} keys %lines) {
+ $sorted_lines[$i] = $lines{$num};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# This is a sort routine that will sort on the
+# ip address when the ip address is anywhere in
+# the strings.
+sub ipsort {
+ local(%lines) = @_;
+ local($i) = 0;
+ local(@sorted_lines);
+ foreach $addr (sort sortbyipaddr keys %lines) {
+ $sorted_lines[$i] = $lines{$addr};
+ $i++;
+ }
+ @sorted_lines;
+}
+
+# These two routines will sort based upon IP addresses
+sub ipaddrval {
+ my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
+}
+sub sortbyipaddr {
+ &ipaddrval($a) <=> &ipaddrval($b);
+}
+
+# This routine parses "dir"
+sub Dir {
+ print STDERR " In Dir: $_" if ($debug);
+
+ while (<INPUT>) {
+ s/^\s+\015//g;
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+ # pager remnants like: ^H^H^H ^H^H^H content
+ s/[\b]+\s*[\b]*//g;
+
+ ProcessHistory("COMMENTS","keysort","D1","! $_");
+ }
+ return(0);
+}
+
+
+sub ShowVer {
+ print STDERR " In ShowVer: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+ # pager remnants like: ^H^H^H ^H^H^H content
+ s/[\b]+\s*[\b]*//g;
+
+ ProcessHistory("COMMENTS","keysort","B1","! $_");
+ }
+ return(0);
+}
+
+sub ShowSys {
+ print STDERR " In ShowSys: $_" if ($debug);
+
+ while (<INPUT>) {
+ s/^\s+\015//g;
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+ # pager remnants like: ^H^H^H ^H^H^H content
+ s/[\b]+\s*[\b]*//g;
+
+ # Remove Uptime
+ / Up time/ && next;
+
+ /system description: (.*)/i &&
+ ProcessHistory("COMMENTS","keysort","A1", "!Chassis type: $1\n") &&
+ next;
+
+ ProcessHistory("COMMENTS","keysort","C1","! $_");
+ }
+ return(0);
+}
+
+sub ShowVlan {
+ print STDERR " In ShowVlan: $_" if ($debug);
+
+ while (<INPUT>) {
+ s/^\s+\015//g;
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+ # pager remnants like: ^H^H^H ^H^H^H content
+ s/[\b]+\s*[\b]*//g;
+
+ # Remove Uptime
+ / Up time/ && next;
+ ProcessHistory("COMMENTS","keysort","D1","! $_");
+ }
+ return(0);
+}
+
+# This routine processes a "write term" (aka show running-configuration)
+sub WriteTerm {
+ my($comment) = (0);
+ print STDERR " In ShowRun: $_" if ($debug);
+
+ while (<INPUT>) {
+ tr/\015//d;
+ next if /^\s*$/;
+ last if(/$prompt/);
+ # pager remnants like: ^H^H^H ^H^H^H content
+ s/[\b]+\s*[\b]*//g;
+
+ # skip consecutive comment lines
+ if (/^!/) {
+ next if ($comment);
+ ProcessHistory("","","",$_);
+ $comment++;
+ next;
+ }
+ $comment = 0;
+
+ /^building running-config/ && next;
+ /^------+/ && ProcessHistory("","","","!$_") && next;
+ /^router configuration/i && ProcessHistory("","","","!$_") && next;
+ /^oob host config/i && ProcessHistory("","","","!$_") && next;
+ /^empty configuration/i && ProcessHistory("","","","!$_") && next;
+
+ if (/^password (\S+) encrypted/ && $filter_pwds > 1) {
+ ProcessHistory("","","","!password <removed> encrypted\n");
+ next;
+ }
+ if (/^password (\S+)$/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!password <removed>\n");
+ next;
+ }
+
+ if (/^(enable password level \d+) (\S+) encrypted/ && $filter_pwds > 1){
+ ProcessHistory("","","","!$1 <removed> encrypted\n");
+ next;
+ }
+ if (/^(enable password level \d+) (\S+)$/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed> $'\n");
+ next;
+ }
+
+ # order/prune snmp-server host statements
+ # we only prune lines of the form
+ # snmp-server host a.b.c.d <community>
+ if (/^(snmp-server host) (\d+\.\d+\.\d+\.\d+) (\S+)/) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ ProcessHistory("SNMPSERVERHOST","ipsort",
+ "$2","!$1 $2 <removed>$'");
+ } else {
+ ProcessHistory("SNMPSERVERHOST","ipsort","$2","$_");
+ }
+ next;
+ }
+ if (/^(snmp-server community) (\S+)/) {
+ if (defined($ENV{'NOCOMMSTR'})) {
+ ProcessHistory("SNMPSERVERCOMM","keysort",
+ "$_","!$1 <removed>$'") && next;
+ } else {
+ ProcessHistory("SNMPSERVERCOMM","keysort","$2","$_") && next;
+ }
+ }
+
+ # prune tacacs/radius server keys
+ if (/^(tacacs-server|radius-server) key \w+/ && $filter_pwds >= 1) {
+ ProcessHistory("","","","!$1 <removed>$'"); next;
+ }
+
+ ProcessHistory("","","","$_");
+ }
+ $found_end = 1;
+ return(1);
+}
+
+# dummy function
+sub DoNothing {print STDOUT;}
+
+# Main
+@commandtable = (
+ {'show system' => 'ShowSys'},
+ {'show version' => 'ShowVer'},
+ {'dir' => 'Dir'},
+ {'show vlan' => 'ShowVlan'},
+ {'show running-config' => 'WriteTerm'}
+);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
+$cisco_cmds=join(";",@commands);
+$cmds_regexp=join("|",@commands);
+
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
+open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
+select(OUTPUT);
+# make OUTPUT unbuffered if debugging
+if ($debug) { $| = 1; }
+
+if ($file) {
+ print STDERR "opening file $host\n" if ($debug);
+ print STDOUT "opening file $host\n" if ($log);
+ open(INPUT,"<$host") || die "open failed for $host: $!\n"; } else {
+ print STDERR "executing hlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($debug);
+ print STDOUT "executing hlogin -t $timeo -c\"$cisco_cmds\" $host\n" if ($log);
+ if (defined($ENV{NOPIPE})) {
+ system "hlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null > $host.raw 2>&1" || die "hlogin failed for $host: $!\n";
+ open(INPUT, "< $host.raw") || die "hlogin failed for $host: $!\n";
+ } else {
+ open(INPUT,"hlogin -t $timeo -c \"$cisco_cmds\" $host </dev/null |") || die "hlogin failed for $host: $!\n";
+ }
+}
+
+# determine password filtering mode
+if ($ENV{"FILTER_PWDS"} =~ /no/i) {
+ $filter_pwds = 0;
+} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
+ $filter_pwds = 2;
+} else {
+ $filter_pwds = 1;
+}
+
+ProcessHistory("","","","!RANCID-CONTENT-TYPE: dell\n!\n");
+ProcessHistory("COMMENTS","keysort","A0","!\n");
+ProcessHistory("COMMENTS","keysort","B0","!\n");
+ProcessHistory("COMMENTS","keysort","C0","!\n");
+ProcessHistory("COMMENTS","keysort","D0","!\n");
+TOP: while(<INPUT>) {
+ tr/\015//d;
+ if (/^Error:/) {
+ print STDOUT ("$host dlogin error: $_");
+ print STDERR ("$host dlogin error: $_") if ($debug);
+ last;
+ }
+ while (/#\s*($cmds_regexp)\s*$/) {
+ $cmd = $1;
+ if (!defined($prompt)) {
+ $prompt = ($_ =~ /^([^#]+#)/)[0];
+ $prompt =~ s/([][}{)(\\])/\\$1/g;
+ print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
+ }
+ print STDERR ("HIT COMMAND:$_") if ($debug);
+ if (!defined($commands{$cmd})) {
+ print STDERR "$host: found unexpected command - \"$cmd\"\n";
+ last TOP;
+ }
+ $rval = &{$commands{$cmd}};
+ delete($commands{$cmd});
+ if ($rval == -1) {
+ last TOP;
+ }
+ }
+}
+print STDOUT "Done $logincmd: $_\n" if ($log);
+# Flush History
+ProcessHistory("","","","");
+# Cleanup
+close(INPUT);
+close(OUTPUT);
+
+if (defined($ENV{NOPIPE})) {
+ unlink("$host.raw") if (! $debug);
+}
+
+# check for completeness
+if (scalar(%commands) || !$found_end) {
+ if (scalar(%commands)) {
+ printf(STDOUT "$host: missed cmd(s): %s\n", join(',', keys(%commands)));
+ printf(STDERR "$host: missed cmd(s): %s\n", join(',', keys(%commands))) if ($debug);
+ }
+ if (!$found_end) {
+ print STDOUT "$found_end: found end\n";
+ print STDOUT "$host: End of run not found\n";
+ print STDERR "$host: End of run not found\n" if ($debug);
+ system("/usr/bin/tail -1 $host.new");
+ }
+ unlink "$host.new" if (! $debug);
+}
diff --git a/bin/tntlogin.in b/bin/tntlogin.in
index 021f0d2..57fbfc0 100644
--- a/bin/tntlogin.in
+++ b/bin/tntlogin.in
@@ -1,8 +1,9 @@
#! @EXPECT_PATH@ --
##
-## $Id: tntlogin.in,v 1.11 2004/01/11 05:39:15 heas Exp $
+## $Id: tntlogin.in,v 1.22 2006/12/05 16:50:53 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -39,16 +40,16 @@ set password_file $env(HOME)/.cloginrc
set do_command 0
set do_script 0
# The default is to automatically enable
-set enable 0
+set avenable 0
# The default is that you login non-enabled (tacacs can have you login already
# enabled)
-set avautoenable 1
+set avautoenable 1
# The default is to look in the password file to find the passwords. This
# tracks if we receive them on the command line.
set do_passwd 1
# Find the user in the ENV, or use the unix userid.
-if {[ info exists env(CISCO_USER) ] } {
+if {[ info exists env(CISCO_USER) ]} {
set default_user $env(CISCO_USER)
} elseif {[ info exists env(USER) ]} {
set default_user $env(USER)
@@ -61,9 +62,12 @@ if {[ info exists env(CISCO_USER) ] } {
if [ catch {exec id} reason ] {
send_error "\nError: could not exec id: $reason\n"
exit 1
- }
+ }
regexp {\(([^)]*)} "$reason" junk default_user
-}
+}
+if {[ info exists env(CLOGINRC) ]} {
+ set password_file $env(CLOGINRC)
+}
# Sometimes routers take awhile to answer (the default is 10 sec)
set timeout 45
@@ -81,13 +85,16 @@ for {set i 0} {$i < $argc} {incr i} {
set username [ lindex $argv $i ]
}
# VTY Password
- } -v* -
- -v* {
+ } -v* {
if {! [ regexp .\[vV\](.+) $arg ignore passwd]} {
incr i
set passwd [ lindex $argv $i ]
}
set do_passwd 0
+ # Version string
+ } -V* {
+ send_user "@PACKAGE@ @VERSION@\n"
+ exit 0
# Enable Username
} -w* -
-W* {
@@ -260,6 +267,7 @@ proc source_password_file { password_file } {
}
# Log into the router.
+# returns: 0 on success, 1 on failure
proc login { router user userpswd passwd prompt cmethod cyphertype } {
global spawn_id in_proc do_command do_script
global u_prompt p_prompt sshcmd
@@ -269,6 +277,7 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
# try each of the connection methods in $cmethod until one is successful
set progs [llength $cmethod]
foreach prog [lrange $cmethod 0 end] {
+ incr progs -1
if [string match "telnet*" $prog] {
regexp {telnet(:([^[:space:]]+))*} $prog command suffix port
if {"$port" == ""} {
@@ -278,24 +287,24 @@ proc login { router user userpswd passwd prompt cmethod cyphertype } {
}
if { $retval } {
send_user "\nError: telnet failed: $reason\n"
- exit 1
+ return 1
}
- } elseif ![string compare $prog "ssh"] {
+ } elseif ![string compare $prog "ssh"] {
if [ catch {spawn $sshcmd -c $cyphertype -x -l $user $router} reason ] {
send_user "\nError: $sshcmd failed: $reason\n"
- exit 1
- }
- } elseif ![string compare $prog "rsh"] {
- if [ catch {spawn rsh -l $user $router} reason ] {
- send_user "\nError: rsh failed: $reason\n"
- exit 1
+ return 1
}
- } else {
- puts "\nError: unknown connection method: $prog"
+ } elseif ![string compare $prog "rsh"] {
+ send_error "\nError: unsupported method: rsh\n"
+ if { $progs == 0 } {
+ return 1
+ }
+ continue;
+ } else {
+ send_user "\nError: unknown connection method: $prog\n"
return 1
- }
- incr progs -1
- sleep 0.3
+ }
+ sleep 0.3
# This helps cleanup each expect clause.
expect_after {
@@ -387,7 +396,7 @@ proc run_commands { prompt command } {
send "lines 0\r"
expect -re $prompt {}
regsub -all "\[)(]" $prompt {\\&} reprompt
-
+
# Is this a multi-command?
if [ string match "*\;*" "$command" ] {
set commands [split $command \;]
@@ -409,7 +418,7 @@ proc run_commands { prompt command } {
-re "\[\n\r]+" { exp_continue }
}
}
-
+
send "quit\r"
# expect {
# -re "^WARNING: the current user has insufficient rights to view password fields. A configuration saved under this circumstance should not be used to restore profiles containing passwords. Save anyway? [y/n]"
@@ -417,10 +426,12 @@ proc run_commands { prompt command } {
# send "y\r"
exp_continue
}
- "\n" { exp_continue }
- "\[^\n\r *]*Session terminated" { return 0 }
- timeout { return 0 }
- eof { return 0 }
+ "\n" { exp_continue }
+ "\[^\n\r *]*Session terminated" { return 0 }
+ timeout { catch {close}; wait
+ return 0
+ }
+ eof { return 0 }
}
set in_proc 0
}
@@ -496,9 +507,9 @@ foreach router [lrange $argv $i end] {
set cmethod [find method $router]
if { "$cmethod" == "" } { set cmethod {{telnet} {ssh}} }
- # Figure out the SSH executable name
- set sshcmd [find sshcmd $router]
- if { "$sshcmd" == "" } { set sshcmd {ssh} }
+ # Figure out the SSH executable name
+ set sshcmd [find sshcmd $router]
+ if { "$sshcmd" == "" } { set sshcmd {ssh} }
# Login to the router
if {[login $router $ruser $userpswd $passwd $prompt $cmethod $cyphertype]} {
diff --git a/bin/tntrancid.in b/bin/tntrancid.in
index 88520fd..e16d57b 100644
--- a/bin/tntrancid.in
+++ b/bin/tntrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: tntrancid.in,v 1.8 2004/01/11 03:49:13 heas Exp $
+## $Id: tntrancid.in,v 1.17 2006/10/05 04:27:44 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -24,29 +25,33 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: tntrancid [-d] [-l] [-f filename | $host]
+# usage: tntrancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # tntlogin timeout in seconds
+$timeo = 90; # tntlogin timeout in seconds
$prompt = "admin> ";
-$always_y = "y"; # cause its a pain.
+$always_y = "y"; # cause its a pain.
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
- print eval "$always_y \%history";
undef %history;
}
if (($new_hist_tag) && ($new_command) && ($command_string)) {
@@ -67,10 +72,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -80,10 +85,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -93,10 +98,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -106,9 +111,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -122,7 +127,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -135,45 +140,40 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
}
-
# This routine processes a "save con"
sub SaveConf {
print STDERR " In SaveConf: $_" if ($debug);
- my($comment) = 1; # strip extra comments, esp to preserve chassis type
while (<INPUT>) {
tr/\015//d;
last if(/^$prompt/);
-# next if(/^\s*$/);
-
-### s/^\s*$/;/;
-
-# Leave software revision, but strip out saved date,
-# which causes rancid to think it changes each poll
+ # Leave software revision, but strip out saved date,
+ # which causes rancid to think it changes each poll
if (/^; saved from /) {
- ProcessHistory("","","","$_");
- next;
+ ProcessHistory("","","","$_");
+ next;
}
/^; saved / && next;
# catch anything that wasnt match above.
ProcessHistory("","","","$_");
+
# end of config
-# if (/^# End of configuration file/i) {
if (/; profiles saved$/) {
printf STDERR " End SaveConf: $_" if ($debug);
$found_end = 1;
print STDOUT "$found_end = found_end within test\n";
- return(1);
+ return(1);
}
- $found_end = 1;
+ # XXX what is the purpose of this?
+ $found_end = 1;
#### print STDOUT "$found_end = found_end at test\n";
}
$found_end = 1;
@@ -189,18 +189,26 @@ print STDOUT "$found_end = found_end at end test\n";
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'save con' => "SaveConf"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "save con"
+@commandtable = (
+ {'save con' => 'SaveConf'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$tnt_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
-$tnt_cmds="save con";
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -223,7 +231,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
@@ -234,8 +242,8 @@ ProcessHistory("","","","#RANCID-CONTENT-TYPE: tnt\n#\n");
ProcessHistory("COMMENTS","keysort","X0",";\n");
TOP: while(<INPUT>) {
tr/\015//d;
-
- if (/^Error:/) {
+
+ if (/^Error:/) {
print STDOUT ("$host tntlogin error: $_");
print STDERR ("$host tntlogin error: $_") if ($debug);
$clean_run=0;
diff --git a/bin/xrancid.in b/bin/xrancid.in
index 4aeb1d3..96b99ef 100644
--- a/bin/xrancid.in
+++ b/bin/xrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: xrancid.in,v 1.32 2004/01/11 03:49:13 heas Exp $
+## $Id: xrancid.in,v 1.41 2006/10/05 04:27:44 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -21,25 +22,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -61,10 +67,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -74,10 +80,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -87,10 +93,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -100,9 +106,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -116,7 +122,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -129,7 +135,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -180,7 +186,7 @@ sub ShowMemory {
return(0);
}
-# This routine parses "show diagnostics"
+# This routine parses "show diag"
sub ShowDiag {
print STDERR " In ShowDiag: $_" if ($debug);
@@ -373,29 +379,32 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'show memory' => "ShowMemory",
- 'show diagnostics' => "ShowDiag",
- 'show switch' => "ShowSwitch",
- 'show slot' => "ShowSlot",
- 'show configuration detail' => "WriteTerm",
- 'show configuration' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version",
- "show memory",
- "show diagnostics",
- "show switch",
- "show slot",
- "show configuration detail",
- "show configuration"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'show memory' => 'ShowMemory'},
+ {'show diag' => 'ShowDiag'},
+ {'show switch' => 'ShowSwitch'},
+ {'show slot' => 'ShowSlot'},
+ {'show configuration detail' => 'WriteTerm'},
+ {'show configuration' => 'WriteTerm'},
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
@@ -418,7 +427,7 @@ if ($file) {
# determine password filtering mode
if ($ENV{"FILTER_PWDS"} =~ /no/i) {
- $filter_pwds = 0;
+ $filter_pwds = 0;
} elsif ($ENV{"FILTER_PWDS"} =~ /all/i) {
$filter_pwds = 2;
} else {
@@ -453,7 +462,7 @@ TOP: while(<INPUT>) {
if (!defined($prompt)) {
$prompt = ($_ =~ /^([^#]+#)/)[0];
$prompt =~ s/([][}{)(\\])/\\$1/g;
- $prompt =~ s/:(\d+ ?)#/:\\d+ ?#/;
+ $prompt =~ s/[:.](\d+ ?)#/:\\d+ ?#/;
$prompt =~ s/\*/\\\*/;
print STDERR ("PROMPT MATCH: $prompt\n") if ($debug);
}
diff --git a/bin/zrancid.in b/bin/zrancid.in
index a969553..c8a926f 100755
--- a/bin/zrancid.in
+++ b/bin/zrancid.in
@@ -1,8 +1,9 @@
#! @PERLV_PATH@
##
-## $Id: zrancid.in,v 1.8 2004/01/11 03:49:13 heas Exp $
+## $Id: zrancid.in,v 1.14 2006/10/05 04:27:44 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## @PACKAGE@ @VERSION@
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -23,25 +24,30 @@
#
# RANCID - Really Awesome New Cisco confIg Differ
#
-# usage: rancid [-d] [-l] [-f filename | $host]
+# usage: rancid [-dV] [-l] [-f filename | hostname]
#
use Getopt::Std;
-getopts('dfl');
+getopts('dflV');
+if ($opt_V) {
+ print "@PACKAGE@ @VERSION@\n";
+ exit(0);
+}
$log = $opt_l;
$debug = $opt_d;
$file = $opt_f;
$host = $ARGV[0];
$clean_run = 0;
$found_end = 0;
-$timeo = 90; # clogin timeout in seconds
+$timeo = 90; # clogin timeout in seconds
-my(%filter_pwds); # password filtering mode
+my(@commandtable, %commands, @commands);# command lists
+my(%filter_pwds); # password filtering mode
# This routine is used to print out the router configuration
sub ProcessHistory {
- my($new_hist_tag,$new_command,$command_string,@string)=(@_);
- if((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
- && defined %history) {
+ my($new_hist_tag,$new_command,$command_string,@string) = (@_);
+ if ((($new_hist_tag ne $hist_tag) || ($new_command ne $command))
+ && defined %history) {
print eval "$command \%history";
undef %history;
}
@@ -63,10 +69,10 @@ sub ProcessHistory {
sub numerically { $a <=> $b; }
-# This is a sort routing that will sort numerically on the
+# This is a sort routine that will sort numerically on the
# keys of a hash as if it were a normal array.
sub keynsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort numerically keys(%lines)) {
@@ -76,10 +82,10 @@ sub keynsort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# keys of a hash as if it were a normal array.
sub keysort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort keys(%lines)) {
@@ -89,10 +95,10 @@ sub keysort {
@sorted_lines;
}
-# This is a sort routing that will sort on the
+# This is a sort routine that will sort on the
# values of a hash as if it were a normal array.
sub valsort{
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $key (sort values %lines) {
@@ -102,9 +108,9 @@ sub valsort{
@sorted_lines;
}
-# This is a numerical sort routing (ascending).
+# This is a numerical sort routine (ascending).
sub numsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $num (sort {$a <=> $b} keys %lines) {
@@ -118,7 +124,7 @@ sub numsort {
# ip address when the ip address is anywhere in
# the strings.
sub ipsort {
- local(%lines)=@_;
+ local(%lines) = @_;
local($i) = 0;
local(@sorted_lines);
foreach $addr (sort sortbyipaddr keys %lines) {
@@ -131,7 +137,7 @@ sub ipsort {
# These two routines will sort based upon IP addresses
sub ipaddrval {
my(@a) = ($_[0] =~ m#^(\d+)\.(\d+)\.(\d+)\.(\d+)$#);
- $a[3]+256*($a[2]+256*($a[1]+256*$a[0]));
+ $a[3] + 256 * ($a[2] + 256 * ($a[1] +256 * $a[0]));
}
sub sortbyipaddr {
&ipaddrval($a) <=> &ipaddrval($b);
@@ -306,19 +312,27 @@ sub WriteTerm {
sub DoNothing {print STDOUT;}
# Main
-%commands=(
- 'show version' => "ShowVersion",
- 'write term' => "WriteTerm"
-);
-# keys() doesnt return things in the order entered and the order of the
-# cmds is important (show version first and write term last). pita
-@commands=(
- "show version",
- "write term"
+@commandtable = (
+ {'show version' => 'ShowVersion'},
+ {'write term' => 'WriteTerm'}
);
+# Use an array to preserve the order of the commands and a hash for mapping
+# commands to the subroutine and track commands that have been completed.
+@commands = map(keys(%$_), @commandtable);
+%commands = map(%$_, @commandtable);
+
$cisco_cmds=join(";",@commands);
$cmds_regexp=join("|",@commands);
+if (length($host) == 0) {
+ if ($file) {
+ print(STDERR "Too few arguments: file name required\n");
+ exit(1);
+ } else {
+ print(STDERR "Too few arguments: host name required\n");
+ exit(1);
+ }
+}
open(OUTPUT,">$host.new") || die "Can't open $host.new for writing: $!\n";
select(OUTPUT);
# make OUTPUT unbuffered if debugging
diff --git a/configure b/configure
index ce3976d..45e9a91 100755
--- a/configure
+++ b/configure
@@ -1,25 +1,54 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.59.
+# Generated by GNU Autoconf 2.61.
#
-# Copyright (C) 2003 Free Software Foundation, Inc.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
## --------------------- ##
## M4sh Initialization. ##
## --------------------- ##
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
fi
-DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -29,8 +58,43 @@ else
fi
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
PS1='$ '
PS2='> '
PS4='+ '
@@ -44,18 +108,19 @@ do
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
- $as_unset $as_var
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
fi
done
# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
@@ -63,157 +128,388 @@ fi
# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+# CDPATH.
+$as_unset CDPATH
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
+if test "x$CONFIG_SHELL" = x; then
+ if (eval ":") 2>/dev/null; then
+ as_have_required=yes
+else
+ as_have_required=no
fi
+ if test $as_have_required = yes && (eval ":
+(as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+ as_lineno_1=\$LINENO
+ as_lineno_2=\$LINENO
+ test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+ test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+ :
+else
+ as_candidate_shells=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
+ case $as_dir in
/*)
- if ("$as_dir/$as_base" -c '
+ for as_base in sh bash ksh sh5; do
+ as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+ done;;
+ esac
+done
+IFS=$as_save_IFS
+
+
+ for as_shell in $as_candidate_shells $SHELL; do
+ # Try only shells that exist, to save several forks.
+ if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+ { ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+ CONFIG_SHELL=$as_shell
+ as_have_required=yes
+ if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+ (exit $1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
as_lineno_1=$LINENO
as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+ break
+fi
+
+fi
+
+ done
+
+ if test "x$CONFIG_SHELL" != x; then
+ for as_var in BASH_ENV ENV
+ do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+ done
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+ if test $as_have_required = no; then
+ echo This script requires a shell more modern than all the
+ echo shells that I found on your system. Please install a
+ echo modern shell, or manually run the script under such a
+ echo shell if you do have one.
+ { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+ (exit \$1)
+}
+as_func_success () {
+ as_func_return 0
+}
+as_func_failure () {
+ as_func_return 1
+}
+as_func_ret_success () {
+ return 0
+}
+as_func_ret_failure () {
+ return 1
+}
+
+exitcode=0
+if as_func_success; then
+ :
+else
+ exitcode=1
+ echo as_func_success failed.
+fi
+
+if as_func_failure; then
+ exitcode=1
+ echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+ :
+else
+ exitcode=1
+ echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+ exitcode=1
+ echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+ :
+else
+ exitcode=1
+ echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+ echo No shell found that supports shell functions.
+ echo Please tell autoconf@gnu.org about your system,
+ echo including any error possibly output before this
+ echo message
+}
+
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
+ s/-\n.*//
' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
+ chmod +x "$as_me.lineno" ||
{ echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
@@ -222,7 +518,28 @@ else
as_mkdir_p=false
fi
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -231,39 +548,27 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
+exec 7<&0 </dev/null 6>&1
# Name of the host.
# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
# so uname gets run too.
ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
-exec 6>&1
-
#
# Initializations.
#
ac_default_prefix=/usr/local
+ac_clean_files=
ac_config_libobj_dir=.
+LIBOBJS=
cross_compiling=no
subdirs=
MFLAGS=
MAKEFLAGS=
SHELL=${CONFIG_SHELL-/bin/sh}
-# Maximum number of lines to put in a shell here document.
-# This variable seems obsolete. It should probably be removed, and
-# only ac_max_sed_lines should be used.
-: ${ac_max_here_lines=38}
-
# Identity of this package.
PACKAGE_NAME=
PACKAGE_TARNAME=
@@ -276,42 +581,162 @@ ac_default_prefix=/usr/local/rancid
# Factoring default headers for most tests.
ac_includes_default="\
#include <stdio.h>
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
-#if HAVE_SYS_STAT_H
+#ifdef HAVE_SYS_STAT_H
# include <sys/stat.h>
#endif
-#if STDC_HEADERS
+#ifdef STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
-# if HAVE_STDLIB_H
+# ifdef HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
-#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#endif
-#if HAVE_STRINGS_H
+#ifdef HAVE_STRINGS_H
# include <strings.h>
#endif
-#if HAVE_INTTYPES_H
+#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
-#else
-# if HAVE_STDINT_H
-# include <stdint.h>
-# endif
#endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION PACKAGE INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot MAKE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CPP EGREP U ANSI2KNR MAILPLUS ADMINMAILPLUS DIRNAME DIFF DIFF_CMD SENDMAIL TAR PERLV_PATH PERLV EXPECT_PATH PING_PATH LG_PING_CMD CVS COMM FIND GREP ID MKDIR RSH SORT SSH TELNET TOUCH ENV_PATH LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+VERSION
+PACKAGE
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+am__isrc
+CYGPATH_W
+ACLOCAL
+AUTOCONF
+AUTOMAKE
+AUTOHEADER
+MAKEINFO
+install_sh
+STRIP
+INSTALL_STRIP_PROGRAM
+mkdir_p
+AWK
+SET_MAKE
+am__leading_dot
+AMTAR
+am__tar
+am__untar
+MAKE
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+DEPDIR
+am__include
+am__quote
+AMDEP_TRUE
+AMDEP_FALSE
+AMDEPBACKSLASH
+CCDEPMODE
+am__fastdepCC_TRUE
+am__fastdepCC_FALSE
+CPP
+GREP
+EGREP
+U
+ANSI2KNR
+MK_LCLSTATEDIR_TRUE
+MK_LCLSTATEDIR_FALSE
+CONF_INSTALL_TRUE
+CONF_INSTALL_FALSE
+RCSSYS
+MAILPLUS
+ADMINMAILPLUS
+DIRNAME
+DIFF
+DIFF_CMD
+SENDMAIL
+TAR
+PERLV_PATH
+PERLV
+EXPECT_PATH
+PING_PATH
+LG_PING_CMD
+CVS
+SVN
+COMM
+FIND
+ID
+MKDIR
+RSH
+SORT
+SSH
+TELNET
+TOUCH
+ENV_PATH
+LIBOBJS
+LTLIBOBJS'
ac_subst_files=''
+ ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
# Initialize some variables set by options.
ac_init_help=
@@ -338,34 +763,48 @@ x_libraries=NONE
# and all the variables that are supposed to be based on exec_prefix
# by default will actually change.
# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
-datadir='${prefix}/share'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
-libdir='${exec_prefix}/lib'
includedir='${prefix}/include'
oldincludedir='/usr/include'
-infodir='${prefix}/info'
-mandir='${prefix}/man'
+docdir='${datarootdir}/doc/${PACKAGE}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
ac_prev=
+ac_dashdash=
for ac_option
do
# If the previous option needs an argument, assign it.
if test -n "$ac_prev"; then
- eval "$ac_prev=\$ac_option"
+ eval $ac_prev=\$ac_option
ac_prev=
continue
fi
- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
+ case $ac_option in
+ *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+ *) ac_optarg=yes ;;
+ esac
# Accept the important Cygnus configure options, so we can diagnose typos.
- case $ac_option in
+ case $ac_dashdash$ac_option in
+ --)
+ ac_dashdash=yes ;;
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
@@ -387,33 +826,45 @@ do
--config-cache | -C)
cache_file=config.cache ;;
- -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+ -datadir | --datadir | --datadi | --datad)
ac_prev=datadir ;;
- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
- | --da=*)
+ -datadir=* | --datadir=* | --datadi=* | --datad=*)
datadir=$ac_optarg ;;
+ -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+ | --dataroo | --dataro | --datar)
+ ac_prev=datarootdir ;;
+ -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+ datarootdir=$ac_optarg ;;
+
-disable-* | --disable-*)
ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- eval "enable_$ac_feature=no" ;;
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=no ;;
+
+ -docdir | --docdir | --docdi | --doc | --do)
+ ac_prev=docdir ;;
+ -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+ docdir=$ac_optarg ;;
+
+ -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+ ac_prev=dvidir ;;
+ -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+ dvidir=$ac_optarg ;;
-enable-* | --enable-*)
ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid feature name: $ac_feature" >&2
{ (exit 1); exit 1; }; }
- ac_feature=`echo $ac_feature | sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "enable_$ac_feature='$ac_optarg'" ;;
+ ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+ eval enable_$ac_feature=\$ac_optarg ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -440,6 +891,12 @@ do
-host=* | --host=* | --hos=* | --ho=*)
host_alias=$ac_optarg ;;
+ -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+ ac_prev=htmldir ;;
+ -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+ | --ht=*)
+ htmldir=$ac_optarg ;;
+
-includedir | --includedir | --includedi | --included | --include \
| --includ | --inclu | --incl | --inc)
ac_prev=includedir ;;
@@ -464,13 +921,16 @@ do
| --libexe=* | --libex=* | --libe=*)
libexecdir=$ac_optarg ;;
+ -localedir | --localedir | --localedi | --localed | --locale)
+ ac_prev=localedir ;;
+ -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+ localedir=$ac_optarg ;;
+
-localstatedir | --localstatedir | --localstatedi | --localstated \
- | --localstate | --localstat | --localsta | --localst \
- | --locals | --local | --loca | --loc | --lo)
+ | --localstate | --localstat | --localsta | --localst | --locals)
ac_prev=localstatedir ;;
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
- | --localstate=* | --localstat=* | --localsta=* | --localst=* \
- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
@@ -535,6 +995,16 @@ do
| --progr-tra=* | --program-tr=* | --program-t=*)
program_transform_name=$ac_optarg ;;
+ -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+ ac_prev=pdfdir ;;
+ -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+ pdfdir=$ac_optarg ;;
+
+ -psdir | --psdir | --psdi | --psd | --ps)
+ ac_prev=psdir ;;
+ -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+ psdir=$ac_optarg ;;
+
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
@@ -587,24 +1057,20 @@ do
-with-* | --with-*)
ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
- ac_package=`echo $ac_package| sed 's/-/_/g'`
- case $ac_option in
- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
- *) ac_optarg=yes ;;
- esac
- eval "with_$ac_package='$ac_optarg'" ;;
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=\$ac_optarg ;;
-without-* | --without-*)
ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
# Reject names that are not valid shell variable names.
- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid package name: $ac_package" >&2
{ (exit 1); exit 1; }; }
- ac_package=`echo $ac_package | sed 's/-/_/g'`
- eval "with_$ac_package=no" ;;
+ ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+ eval with_$ac_package=no ;;
--x)
# Obsolete; use --with-x.
@@ -635,8 +1101,7 @@ Try \`$0 --help' for more information." >&2
expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
{ echo "$as_me: error: invalid variable name: $ac_envvar" >&2
{ (exit 1); exit 1; }; }
- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
- eval "$ac_envvar='$ac_optarg'"
+ eval $ac_envvar=\$ac_optarg
export $ac_envvar ;;
*)
@@ -656,27 +1121,19 @@ if test -n "$ac_prev"; then
{ (exit 1); exit 1; }; }
fi
-# Be sure to have absolute paths.
-for ac_var in exec_prefix prefix
-do
- eval ac_val=$`echo $ac_var`
- case $ac_val in
- [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
- esac
-done
-
-# Be sure to have absolute paths.
-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
- localstatedir libdir includedir oldincludedir infodir mandir
+# Be sure to have absolute directory names.
+for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
+ datadir sysconfdir sharedstatedir localstatedir includedir \
+ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+ libdir localedir mandir
do
- eval ac_val=$`echo $ac_var`
+ eval ac_val=\$$ac_var
case $ac_val in
- [\\/$]* | ?:[\\/]* ) ;;
- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
- { (exit 1); exit 1; }; };;
+ [\\/$]* | ?:[\\/]* ) continue;;
+ NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
esac
+ { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; }
done
# There might be people who depend on the old broken behavior: `$host'
@@ -703,74 +1160,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias-
test "$silent" = yes && exec 6>/dev/null
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+ { echo "$as_me: error: Working directory cannot be determined" >&2
+ { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+ { echo "$as_me: error: pwd does not report name of working directory" >&2
+ { (exit 1); exit 1; }; }
+
+
# Find the source files, if location was not specified.
if test -z "$srcdir"; then
ac_srcdir_defaulted=yes
- # Try the directory containing this script, then its parent.
- ac_confdir=`(dirname "$0") 2>/dev/null ||
+ # Try the directory containing this script, then the parent directory.
+ ac_confdir=`$as_dirname -- "$0" ||
$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$0" : 'X\(//\)[^/]' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$0" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
srcdir=$ac_confdir
- if test ! -r $srcdir/$ac_unique_file; then
+ if test ! -r "$srcdir/$ac_unique_file"; then
srcdir=..
fi
else
ac_srcdir_defaulted=no
fi
-if test ! -r $srcdir/$ac_unique_file; then
- if test "$ac_srcdir_defaulted" = yes; then
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
- { (exit 1); exit 1; }; }
- else
- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+if test ! -r "$srcdir/$ac_unique_file"; then
+ test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
{ (exit 1); exit 1; }; }
- fi
fi
-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+ cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
{ (exit 1); exit 1; }; }
-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
-ac_env_build_alias_set=${build_alias+set}
-ac_env_build_alias_value=$build_alias
-ac_cv_env_build_alias_set=${build_alias+set}
-ac_cv_env_build_alias_value=$build_alias
-ac_env_host_alias_set=${host_alias+set}
-ac_env_host_alias_value=$host_alias
-ac_cv_env_host_alias_set=${host_alias+set}
-ac_cv_env_host_alias_value=$host_alias
-ac_env_target_alias_set=${target_alias+set}
-ac_env_target_alias_value=$target_alias
-ac_cv_env_target_alias_set=${target_alias+set}
-ac_cv_env_target_alias_value=$target_alias
-ac_env_CC_set=${CC+set}
-ac_env_CC_value=$CC
-ac_cv_env_CC_set=${CC+set}
-ac_cv_env_CC_value=$CC
-ac_env_CFLAGS_set=${CFLAGS+set}
-ac_env_CFLAGS_value=$CFLAGS
-ac_cv_env_CFLAGS_set=${CFLAGS+set}
-ac_cv_env_CFLAGS_value=$CFLAGS
-ac_env_LDFLAGS_set=${LDFLAGS+set}
-ac_env_LDFLAGS_value=$LDFLAGS
-ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
-ac_cv_env_LDFLAGS_value=$LDFLAGS
-ac_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_env_CPPFLAGS_value=$CPPFLAGS
-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
-ac_cv_env_CPPFLAGS_value=$CPPFLAGS
-ac_env_CPP_set=${CPP+set}
-ac_env_CPP_value=$CPP
-ac_cv_env_CPP_set=${CPP+set}
-ac_cv_env_CPP_value=$CPP
+ pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+ srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+ eval ac_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_env_${ac_var}_value=\$${ac_var}
+ eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+ eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
#
# Report the --help message.
@@ -799,9 +1258,6 @@ Configuration:
-n, --no-create do not create output files
--srcdir=DIR find the sources in DIR [configure dir or \`..']
-_ACEOF
-
- cat <<_ACEOF
Installation directories:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
@@ -819,15 +1275,22 @@ Fine tuning of the installation directories:
--bindir=DIR user executables [EPREFIX/bin]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--libexecdir=DIR program executables [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data [PREFIX/share]
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
- --infodir=DIR info documentation [PREFIX/info]
- --mandir=DIR man documentation [PREFIX/man]
+ --datarootdir=DIR read-only arch.-independent data root [PREFIX/share]
+ --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
+ --infodir=DIR info documentation [DATAROOTDIR/info]
+ --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
+ --mandir=DIR man documentation [DATAROOTDIR/man]
+ --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
+ --htmldir=DIR html documentation [DOCDIR]
+ --dvidir=DIR dvi documentation [DOCDIR]
+ --pdfdir=DIR pdf documentation [DOCDIR]
+ --psdir=DIR ps documentation [DOCDIR]
_ACEOF
cat <<\_ACEOF
@@ -846,8 +1309,14 @@ if test -n "$ac_init_help"; then
Optional Features:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-dependency-tracking Speeds up one-time builds
- --enable-dependency-tracking Do not reject slow dependency extractors
+ --disable-dependency-tracking speeds up one-time build
+ --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-mk-localstatedir
+ enable creation of the local state directory at
+ install time (default: yes)
+ --enable-conf-install enable install of sample .conf files in sysconfdir
+ (default: yes)
+ --enable-svn enable use of subversion instead of cvs
--enable-mail-plus enable mail to rancid+ addresses, instead of rancid-
--enable-adminmail-plus enable mail to rancid-admin+ addresses, instead of
rancid-admin-
@@ -857,126 +1326,95 @@ Some influential environment variables:
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
- headers in a nonstandard directory <include dir>
+ LIBS libraries to pass to the linker, e.g. -l<library>
+ CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+ you have headers in a nonstandard directory <include dir>
CPP C preprocessor
Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.
_ACEOF
+ac_status=$?
fi
if test "$ac_init_help" = "recursive"; then
# If there are subdirs, report their specific --help.
- ac_popdir=`pwd`
for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
- test -d $ac_dir || continue
+ test -d "$ac_dir" || continue
ac_builddir=.
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
case $srcdir in
- .) # No --srcdir option. We are building in place.
+ .) # We are building in place.
ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
-
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
-
- cd $ac_dir
- # Check for guested configure; otherwise get Cygnus style configure.
- if test -f $ac_srcdir/configure.gnu; then
- echo
- $SHELL $ac_srcdir/configure.gnu --help=recursive
- elif test -f $ac_srcdir/configure; then
- echo
- $SHELL $ac_srcdir/configure --help=recursive
- elif test -f $ac_srcdir/configure.ac ||
- test -f $ac_srcdir/configure.in; then
- echo
- $ac_configure --help
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+ cd "$ac_dir" || { ac_status=$?; continue; }
+ # Check for guested configure.
+ if test -f "$ac_srcdir/configure.gnu"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+ elif test -f "$ac_srcdir/configure"; then
+ echo &&
+ $SHELL "$ac_srcdir/configure" --help=recursive
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
- fi
- cd $ac_popdir
+ fi || ac_status=$?
+ cd "$ac_pwd" || { ac_status=$?; break; }
done
fi
-test -n "$ac_init_help" && exit 0
+test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
+configure
+generated by GNU Autoconf 2.61
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
- exit 0
+ exit
fi
-exec 5>config.log
-cat >&5 <<_ACEOF
+cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
+generated by GNU Autoconf 2.61. Invocation command line was
$ $0 $@
_ACEOF
+exec 5>>config.log
{
cat <<_ASUNAME
## --------- ##
@@ -995,7 +1433,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
-hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
@@ -1009,6 +1447,7 @@ do
test -z "$as_dir" && as_dir=.
echo "PATH: $as_dir"
done
+IFS=$as_save_IFS
} >&5
@@ -1030,7 +1469,6 @@ _ACEOF
ac_configure_args=
ac_configure_args0=
ac_configure_args1=
-ac_sep=
ac_must_keep_next=false
for ac_pass in 1 2
do
@@ -1041,7 +1479,7 @@ do
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
continue ;;
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ *\'*)
ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
esac
case $ac_pass in
@@ -1063,9 +1501,7 @@ do
-* ) ac_must_keep_next=true ;;
esac
fi
- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
- # Get rid of the leading space.
- ac_sep=" "
+ ac_configure_args="$ac_configure_args '$ac_arg'"
;;
esac
done
@@ -1076,8 +1512,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_
# When interrupted or exit'd, cleanup temporary files, and complete
# config.log. We remove comments because anyway the quotes in there
# would cause problems or look ugly.
-# WARNING: Be sure not to use single quotes in there, as some shells,
-# such as our DU 5.0 friend, will then `close' the trap.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
trap 'exit_status=$?
# Save into config.log some information that might help in debugging.
{
@@ -1090,20 +1526,34 @@ trap 'exit_status=$?
_ASBOX
echo
# The following way of writing the cache mishandles newlines in values,
-{
+(
+ for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
(set) 2>&1 |
- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
+ case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
sed -n \
- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
- ;;
+ "s/'\''/'\''\\\\'\'''\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+ ;; #(
*)
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
- esac;
-}
+ esac |
+ sort
+)
echo
cat <<\_ASBOX
@@ -1114,22 +1564,28 @@ _ASBOX
echo
for ac_var in $ac_subst_vars
do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
done | sort
echo
if test -n "$ac_subst_files"; then
cat <<\_ASBOX
-## ------------- ##
-## Output files. ##
-## ------------- ##
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
_ASBOX
echo
for ac_var in $ac_subst_files
do
- eval ac_val=$`echo $ac_var`
- echo "$ac_var='"'"'$ac_val'"'"'"
+ eval ac_val=\$$ac_var
+ case $ac_val in
+ *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+ esac
+ echo "$ac_var='\''$ac_val'\''"
done | sort
echo
fi
@@ -1141,26 +1597,24 @@ _ASBOX
## ----------- ##
_ASBOX
echo
- sed "/^$/d" confdefs.h | sort
+ cat confdefs.h
echo
fi
test "$ac_signal" != 0 &&
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core *.core &&
- rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ rm -f core *.core core.conftest.* &&
+ rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
- ' 0
+' 0
for ac_signal in 1 2 13 15; do
trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
done
ac_signal=0
# confdefs.h avoids OS command line length limits that DEFS can exceed.
-rm -rf conftest* confdefs.h
-# AIX cpp loses on an empty file, so make sure it contains at least a newline.
-echo >confdefs.h
+rm -f -r conftest* confdefs.h
# Predefined preprocessor variables.
@@ -1191,14 +1645,17 @@ _ACEOF
# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
-if test -z "$CONFIG_SITE"; then
- if test "x$prefix" != xNONE; then
- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
- else
- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
- fi
+if test -n "$CONFIG_SITE"; then
+ set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+ set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+ set x "$ac_default_prefix/share/config.site" \
+ "$ac_default_prefix/etc/config.site"
fi
-for ac_site_file in $CONFIG_SITE; do
+shift
+for ac_site_file
+do
if test -r "$ac_site_file"; then
{ echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
echo "$as_me: loading site script $ac_site_file" >&6;}
@@ -1214,8 +1671,8 @@ if test -r "$cache_file"; then
{ echo "$as_me:$LINENO: loading cache $cache_file" >&5
echo "$as_me: loading cache $cache_file" >&6;}
case $cache_file in
- [\\/]* | ?:[\\/]* ) . $cache_file;;
- *) . ./$cache_file;;
+ [\\/]* | ?:[\\/]* ) . "$cache_file";;
+ *) . "./$cache_file";;
esac
fi
else
@@ -1227,12 +1684,11 @@ fi
# Check that the precious variables saved in the cache have kept the same
# value.
ac_cache_corrupted=false
-for ac_var in `(set) 2>&1 |
- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+for ac_var in $ac_precious_vars; do
eval ac_old_set=\$ac_cv_env_${ac_var}_set
eval ac_new_set=\$ac_env_${ac_var}_set
- eval ac_old_val="\$ac_cv_env_${ac_var}_value"
- eval ac_new_val="\$ac_env_${ac_var}_value"
+ eval ac_old_val=\$ac_cv_env_${ac_var}_value
+ eval ac_new_val=\$ac_env_${ac_var}_value
case $ac_old_set,$ac_new_set in
set,)
{ echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
@@ -1257,8 +1713,7 @@ echo "$as_me: current value: $ac_new_val" >&2;}
# Pass precious variables to config.status.
if test "$ac_new_set" = set; then
case $ac_new_val in
- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
*) ac_arg=$ac_var=$ac_new_val ;;
esac
case " $ac_configure_args " in
@@ -1275,12 +1730,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov
{ (exit 1); exit 1; }; }
fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
@@ -1297,6 +1746,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
@@ -1305,31 +1759,38 @@ PACKAGE=`sed -n 's/.*package.*"\(.*\)".*/\1/p' $srcdir/include/version.h.in|tr -
-am__api_version="1.8"
+am__api_version='1.10'
+
ac_aux_dir=
-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
- if test -f $ac_dir/install-sh; then
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+ if test -f "$ac_dir/install-sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install-sh -c"
break
- elif test -f $ac_dir/install.sh; then
+ elif test -f "$ac_dir/install.sh"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
- elif test -f $ac_dir/shtool; then
+ elif test -f "$ac_dir/shtool"; then
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/shtool install -c"
break
fi
done
if test -z "$ac_aux_dir"; then
- { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
-echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5
+echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;}
{ (exit 1); exit 1; }; }
fi
-ac_config_guess="$SHELL $ac_aux_dir/config.guess"
-ac_config_sub="$SHELL $ac_aux_dir/config.sub"
-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
+
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -1344,8 +1805,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -1367,7 +1828,7 @@ case $as_dir/ in
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -1386,21 +1847,22 @@ case $as_dir/ in
;;
esac
done
+IFS=$as_save_IFS
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
- # removed, or if the path is relative.
+ # removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -1410,8 +1872,8 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo "$as_me:$LINENO: checking whether build environment is sane" >&5
-echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; }
# Just in case
sleep 1
echo timestamp > conftest.file
@@ -1453,20 +1915,20 @@ echo "$as_me: error: newly created file is older than distributed files!
Check your system clock" >&2;}
{ (exit 1); exit 1; }; }
fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
test "$program_prefix" != NONE &&
- program_transform_name="s,^,$program_prefix,;$program_transform_name"
+ program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
test "$program_suffix" != NONE &&
- program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+ program_transform_name="s&\$&$program_suffix&;$program_transform_name"
# Double any \ or $. echo might interpret backslashes.
# By default was `s,x,x', remove it if useless.
cat <<\_ACEOF >conftest.sed
s/[\\$]/&&/g;s/;s,x,x,$//
_ACEOF
program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
-rm conftest.sed
+rm -f conftest.sed
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
@@ -1481,31 +1943,60 @@ else
echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
fi
-if mkdir -m 0755 -p -- . 2>/dev/null; then
- mkdir_p='mkdir -m 0755 -p --'
+{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5
+echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; }
+if test -z "$MKDIR_P"; then
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- # On NextStep and OpenStep, the `mkdir' command does not
- # recognize any option. It will interpret all options as
- # directories to create, and then abort because `.' already
- # exists.
- for d in ./-m ./0755 ./-p ./--;
- do
- test -d $d && rmdir $d
- done
- # $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
- if test -f "$ac_aux_dir/mkinstalldirs"; then
- mkdir_p='$(mkinstalldirs) -m 0755'
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in mkdir gmkdir; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+ 'mkdir (GNU coreutils) '* | \
+ 'mkdir (coreutils) '* | \
+ 'mkdir (fileutils) '4.1*)
+ ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+ break 3;;
+ esac
+ done
+ done
+done
+IFS=$as_save_IFS
+
+fi
+
+ if test "${ac_cv_path_mkdir+set}" = set; then
+ MKDIR_P="$ac_cv_path_mkdir -p"
else
- mkdir_p='$(install_sh) -m 0755 -d'
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for MKDIR_P within a source directory, because that will
+ # break other packages using the cache if that directory is
+ # removed, or if the value is a relative name.
+ test -d ./--version && rmdir ./--version
+ MKDIR_P="$ac_install_sh -d"
fi
fi
+{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5
+echo "${ECHO_T}$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+ [\\/$]* | ?:[\\/]*) ;;
+ */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_AWK+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1518,54 +2009,57 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AWK="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
AWK=$ac_cv_prog_AWK
if test -n "$AWK"; then
- echo "$as_me:$LINENO: result: $AWK" >&5
-echo "${ECHO_T}$AWK" >&6
+ { echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$AWK" && break
done
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
all:
- @echo 'ac_maketemp="$(MAKE)"'
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
rm -f conftest.make
fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
SET_MAKE=
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -1578,12 +2072,16 @@ else
fi
rmdir .tst 2>/dev/null
-# test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" &&
- test -f $srcdir/config.status; then
- { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+ # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+ # is not polluted with repeated "-I."
+ am__isrc=' -I$(srcdir)'
+ # test to see if srcdir already configured
+ if test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
{ (exit 1); exit 1; }; }
+ fi
fi
# test whether we have cygpath
@@ -1617,10 +2115,7 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
-
-AMTAR=${AMTAR-"${am_missing_run}tar"}
-
-install_sh=${install_sh-"$am_aux_dir/install-sh"}
+install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"}
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
@@ -1630,8 +2125,8 @@ if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_STRIP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1644,32 +2139,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
STRIP=$ac_cv_prog_STRIP
if test -n "$STRIP"; then
- echo "$as_me:$LINENO: result: $STRIP" >&5
-echo "${ECHO_T}$STRIP" >&6
+ { echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_STRIP"; then
ac_ct_STRIP=$STRIP
# Extract the first word of "strip", so it can be a program name with args.
set dummy strip; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1682,36 +2179,57 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_STRIP="strip"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
- test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
fi
fi
ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
if test -n "$ac_ct_STRIP"; then
- echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
-echo "${ECHO_T}$ac_ct_STRIP" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- STRIP=$ac_ct_STRIP
+ if test "x$ac_ct_STRIP" = x; then
+ STRIP=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ STRIP=$ac_ct_STRIP
+ fi
else
STRIP="$ac_cv_prog_STRIP"
fi
fi
-INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
+# Always define AMTAR for backward compatibility.
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
+
+
@@ -1723,8 +2241,8 @@ INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
# make sure MAKE sets ${MAKE}
# Extract the first word of "gmake", so it can be a program name with args.
set dummy gmake; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_MAKE+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1739,34 +2257,35 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="no"
;;
esac
fi
MAKE=$ac_cv_path_MAKE
-
if test -n "$MAKE"; then
- echo "$as_me:$LINENO: result: $MAKE" >&5
-echo "${ECHO_T}$MAKE" >&6
+ { echo "$as_me:$LINENO: result: $MAKE" >&5
+echo "${ECHO_T}$MAKE" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
if test $MAKE = no; then
unset ac_cv_path_MAKE
# Extract the first word of "make", so it can be a program name with args.
set dummy make; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_MAKE+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1781,28 +2300,29 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_MAKE="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_MAKE" && ac_cv_path_MAKE="no"
;;
esac
fi
MAKE=$ac_cv_path_MAKE
-
if test -n "$MAKE"; then
- echo "$as_me:$LINENO: result: $MAKE" >&5
-echo "${ECHO_T}$MAKE" >&6
+ { echo "$as_me:$LINENO: result: $MAKE" >&5
+echo "${ECHO_T}$MAKE" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
if test $MAKE = no; then
{ { echo "$as_me:$LINENO: error: can't locate a make." >&5
echo "$as_me: error: can't locate a make." >&2;}
@@ -1810,32 +2330,33 @@ echo "$as_me: error: can't locate a make." >&2;}
exit 1
fi
fi
-echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
-set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'`
-if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
all:
- @echo 'ac_maketemp="$(MAKE)"'
+ @echo '@@@%%%=$(MAKE)=@@@%%%'
_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=`
-if test -n "$ac_maketemp"; then
- eval ac_cv_prog_make_${ac_make}_set=yes
-else
- eval ac_cv_prog_make_${ac_make}_set=no
-fi
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+ *@@@%%%=?*=@@@%%%*)
+ eval ac_cv_prog_make_${ac_make}_set=yes;;
+ *)
+ eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
rm -f conftest.make
fi
-if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
SET_MAKE=
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
fi
@@ -1849,8 +2370,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
set dummy ${ac_tool_prefix}gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1863,32 +2384,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$ac_cv_prog_CC"; then
ac_ct_CC=$CC
# Extract the first word of "gcc", so it can be a program name with args.
set dummy gcc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1901,36 +2424,51 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="gcc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- CC=$ac_ct_CC
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
else
CC="$ac_cv_prog_CC"
fi
if test -z "$CC"; then
- if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
set dummy ${ac_tool_prefix}cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -1943,74 +2481,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-
-fi
-if test -z "$ac_cv_prog_CC"; then
- ac_ct_CC=$CC
- # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test -n "$ac_ct_CC"; then
- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_CC="cc"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
-fi
-fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
- CC=$ac_ct_CC
-else
- CC="$ac_cv_prog_CC"
-fi
+ fi
fi
if test -z "$CC"; then
# Extract the first word of "cc", so it can be a program name with args.
set dummy cc; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2024,7 +2522,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -2035,6 +2533,7 @@ do
fi
done
done
+IFS=$as_save_IFS
if test $ac_prog_rejected = yes; then
# We found a bogon in the path, so make sure we never use it.
@@ -2052,22 +2551,23 @@ fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
fi
if test -z "$CC"; then
if test -n "$ac_tool_prefix"; then
- for ac_prog in cl
+ for ac_prog in cl.exe
do
# Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2080,36 +2580,38 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$as_me:$LINENO: result: $CC" >&5
-echo "${ECHO_T}$CC" >&6
+ { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$CC" && break
done
fi
if test -z "$CC"; then
ac_ct_CC=$CC
- for ac_prog in cl
+ for ac_prog in cl.exe
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2122,29 +2624,45 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_ac_ct_CC="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
ac_ct_CC=$ac_cv_prog_ac_ct_CC
if test -n "$ac_ct_CC"; then
- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
-echo "${ECHO_T}$ac_ct_CC" >&6
+ { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$ac_ct_CC" && break
done
- CC=$ac_ct_CC
+ if test "x$ac_ct_CC" = x; then
+ CC=""
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet. If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+ CC=$ac_ct_CC
+ fi
fi
fi
@@ -2157,21 +2675,35 @@ See \`config.log' for more details." >&2;}
{ (exit 1); exit 1; }; }
# Provide some information about the compiler.
-echo "$as_me:$LINENO:" \
- "checking for C compiler version" >&5
+echo "$as_me:$LINENO: checking for C compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
- (eval $ac_compiler --version </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler --version >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
- (eval $ac_compiler -v </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -v >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
- (eval $ac_compiler -V </dev/null >&5) 2>&5
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compiler -V >&5") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }
@@ -2196,47 +2728,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out"
# Try to create an executable without -o first, disregard a.out.
# It will help us diagnose broken compilers, and finding out an intuition
# of exeext.
-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
- (eval $ac_link_default) 2>&5
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort. b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions. Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+ * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+ esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link_default") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- # Find the output, starting from the most likely. This scheme is
-# not robust to junk in `.', hence go to wildcards (a.*) only as a last
-# resort.
-
-# Be careful to initialize this variable, since it used to be cached.
-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
-ac_cv_exeext=
-# b.out is created by i960 compilers.
-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+ # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile. We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
- ;;
- conftest.$ac_ext )
- # This is the source file.
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
;;
[ab].out )
# We found the default executable, but exeext='' is most
# certainly right.
break;;
*.* )
- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- # FIXME: I believe we export ac_cv_exeext for Libtool,
- # but it would be cool to find out if it's true. Does anybody
- # maintain Libtool? --akim.
- export ac_cv_exeext
+ if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+ then :; else
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ fi
+ # We set ac_cv_exeext here because the later test for it is not
+ # safe: cross compilers may not add the suffix if given an `-o'
+ # argument, so we may need to know it at that point already.
+ # Even if this section looks crufty: it has the advantage of
+ # actually working.
break;;
* )
break;;
esac
done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
else
+ ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
@@ -2248,19 +2810,21 @@ See \`config.log' for more details." >&2;}
fi
ac_exeext=$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_file" >&5
-echo "${ECHO_T}$ac_file" >&6
-# Check the compiler produces executables we can run. If not, either
+# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether the C compiler works" >&5
-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; }
# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
# If not cross compiling, check that we can run a simple program.
if test "$cross_compiling" != yes; then
if { ac_try='./$ac_file'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -2279,22 +2843,27 @@ See \`config.log' for more details." >&2;}
fi
fi
fi
-echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
rm -f a.out a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
-# Check the compiler produces executables we can run. If not, either
+# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
-echo "$as_me:$LINENO: result: $cross_compiling" >&5
-echo "${ECHO_T}$cross_compiling" >&6
-
-echo "$as_me:$LINENO: checking for suffix of executables" >&5
-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
@@ -2305,9 +2874,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
for ac_file in conftest.exe conftest conftest.*; do
test -f "$ac_file" || continue
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
*.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
- export ac_cv_exeext
break;;
* ) break;;
esac
@@ -2321,14 +2889,14 @@ See \`config.log' for more details." >&2;}
fi
rm -f conftest$ac_cv_exeext
-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
-echo "${ECHO_T}$ac_cv_exeext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
-echo "$as_me:$LINENO: checking for suffix of object files" >&5
-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
if test "${ac_cv_objext+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2348,14 +2916,20 @@ main ()
}
_ACEOF
rm -f conftest.o conftest.obj
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; then
- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ for ac_file in conftest.o conftest.obj conftest.*; do
+ test -f "$ac_file" || continue;
case $ac_file in
- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
*) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
break;;
esac
@@ -2373,12 +2947,12 @@ fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
-echo "${ECHO_T}$ac_cv_objext" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; }
if test "${ac_cv_c_compiler_gnu+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2401,50 +2975,49 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_compiler_gnu=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_compiler_gnu=no
+ ac_compiler_gnu=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_cv_c_compiler_gnu=$ac_compiler_gnu
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; }
GCC=`test $ac_compiler_gnu = yes && echo yes`
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
-CFLAGS="-g"
-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; }
if test "${ac_cv_prog_cc_g+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat >conftest.$ac_ext <<_ACEOF
+ ac_save_c_werror_flag=$ac_c_werror_flag
+ ac_c_werror_flag=yes
+ ac_cv_prog_cc_g=no
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
@@ -2460,38 +3033,118 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ CFLAGS=""
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_c_werror_flag=$ac_save_c_werror_flag
+ CFLAGS="-g"
+ cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_prog_cc_g=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_prog_cc_g=no
+
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; }
if test "$ac_test_CFLAGS" = set; then
CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
@@ -2507,12 +3160,12 @@ else
CFLAGS=
fi
fi
-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
-if test "${ac_cv_prog_cc_stdc+set}" = set; then
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_cv_prog_cc_stdc=no
+ ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -2546,12 +3199,17 @@ static char *f (char * (*g) (char **, int), char **p, ...)
/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has
function prototypes and stuff, but not '\xHH' hex character constants.
These don't provoke an error unfortunately, instead are silently treated
- as 'x'. The following induces an error, until -std1 is added to get
+ as 'x'. The following induces an error, until -std is added to get
proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an
array size at least. It's necessary to write '\x00'==0 to get something
- that's true only with -std1. */
+ that's true only with -std. */
int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+ inside strings and character constants. */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
int test (int i, double x);
struct s1 {int (*f) (int a);};
struct s2 {int (*f) (double a);};
@@ -2566,205 +3224,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
return 0;
}
_ACEOF
-# Don't try gcc -ansi; that turns off useful extensions and
-# breaks some systems' header files.
-# AIX -qlanglvl=ansi
-# Ultrix and OSF/1 -std1
-# HP-UX 10.20 and later -Ae
-# HP-UX older versions -Aa -D_HPUX_SOURCE
-# SVR4 -Xc -D__EXTENSIONS__
-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
do
CC="$ac_save_CC $ac_arg"
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_prog_cc_stdc=$ac_arg
-break
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_prog_cc_c89=$ac_arg
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext
+
+rm -f core conftest.err conftest.$ac_objext
+ test "x$ac_cv_prog_cc_c89" != "xno" && break
done
-rm -f conftest.$ac_ext conftest.$ac_objext
+rm -f conftest.$ac_ext
CC=$ac_save_CC
fi
-
-case "x$ac_cv_prog_cc_stdc" in
- x|xno)
- echo "$as_me:$LINENO: result: none needed" >&5
-echo "${ECHO_T}none needed" >&6 ;;
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+ x)
+ { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+ xno)
+ { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
*)
- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
- CC="$CC $ac_cv_prog_cc_stdc" ;;
+ CC="$CC $ac_cv_prog_cc_c89"
+ { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
esac
-# Some people use a C++ compiler to compile C. Since we use `exit',
-# in C++ we need to declare it. In case someone uses the same compiler
-# for both compiling C and C++ we need to have the C++ compiler decide
-# the declaration of exit, since it's the most demanding environment.
-cat >conftest.$ac_ext <<_ACEOF
-#ifndef __cplusplus
- choke me
-#endif
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- for ac_declaration in \
- '' \
- 'extern "C" void std::exit (int) throw (); using std::exit;' \
- 'extern "C" void std::exit (int); using std::exit;' \
- 'extern "C" void exit (int) throw ();' \
- 'extern "C" void exit (int);' \
- 'void exit (int);'
-do
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-#include <stdlib.h>
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- :
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-continue
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
- cat >conftest.$ac_ext <<_ACEOF
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-$ac_declaration
-int
-main ()
-{
-exit (42);
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
- ac_status=$?
- grep -v '^ *+' conftest.er1 >conftest.err
- rm -f conftest.er1
- cat conftest.err >&5
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- break
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-done
-rm -f conftest*
-if test -n "$ac_declaration"; then
- echo '#ifdef __cplusplus' >>confdefs.h
- echo $ac_declaration >>confdefs.h
- echo '#endif' >>confdefs.h
-fi
-
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -2772,7 +3282,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
DEPDIR="${am__leading_dot}deps"
- ac_config_commands="$ac_config_commands depfiles"
+ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
@@ -2782,8 +3292,8 @@ am__doit:
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
-echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
-echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; }
am__include="#"
am__quote=
_am_result=none
@@ -2810,22 +3320,20 @@ if test "$am__include" = "#"; then
fi
-echo "$as_me:$LINENO: result: $_am_result" >&5
-echo "${ECHO_T}$_am_result" >&6
+{ echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6; }
rm -f confinc confmf
-# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+# Check whether --enable-dependency-tracking was given.
if test "${enable_dependency_tracking+set}" = set; then
- enableval="$enable_dependency_tracking"
+ enableval=$enable_dependency_tracking;
+fi
-fi;
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
-
-
-if test "x$enable_dependency_tracking" != xno; then
+ if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
AMDEP_FALSE='#'
else
@@ -2835,11 +3343,10 @@ fi
-
depcc="$CC" am_compiler_list=
-echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
-echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; }
if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -2877,7 +3384,9 @@ else
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- : > sub/conftst$i.h
+ # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+ # Solaris 8's {/usr,}/bin/sh.
+ touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
@@ -2901,13 +3410,19 @@ else
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
+ grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
- # (even with -Werror). So we grep stderr for any message
- # that says an option was ignored.
- if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ # or remarks (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored or not supported.
+ # When given -MP, icc 7.0 and 7.1 complain thusly:
+ # icc: Command line warning: ignoring option '-M'; no argument required
+ # The diagnosis changed in icc 8.0:
+ # icc: Command line remark: option '-MP' not supported
+ if (grep 'ignoring option' conftest.err ||
+ grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_CC_dependencies_compiler_type=$depmode
break
fi
@@ -2921,13 +3436,11 @@ else
fi
fi
-echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
-echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; }
CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
-
-
-if
+ if
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
am__fastdepCC_TRUE=
@@ -2938,11 +3451,11 @@ else
fi
-echo "$as_me:$LINENO: checking for function prototypes" >&5
-echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6
-if test "$ac_cv_prog_cc_stdc" != no; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+{ echo "$as_me:$LINENO: checking for function prototypes" >&5
+echo $ECHO_N "checking for function prototypes... $ECHO_C" >&6; }
+if test "$ac_cv_prog_cc_c89" != no; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
cat >>confdefs.h <<\_ACEOF
#define PROTOTYPES 1
@@ -2954,8 +3467,8 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
@@ -2964,8 +3477,8 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2999,24 +3512,22 @@ cat >>conftest.$ac_ext <<_ACEOF
#endif
Syntax error
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
:
else
echo "$as_me: failed program was:" >&5
@@ -3025,9 +3536,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
+
rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether non-existent headers
+ # OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -3037,24 +3549,22 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
# Broken: success on invalid input.
continue
else
@@ -3065,6 +3575,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_preproc_ok=:
break
fi
+
rm -f conftest.err conftest.$ac_ext
done
@@ -3082,8 +3593,8 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
@@ -3106,24 +3617,22 @@ cat >>conftest.$ac_ext <<_ACEOF
#endif
Syntax error
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
:
else
echo "$as_me: failed program was:" >&5
@@ -3132,9 +3641,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
+
rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether non-existent headers
+ # OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -3144,24 +3654,22 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
# Broken: success on invalid input.
continue
else
@@ -3172,6 +3680,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_preproc_ok=:
break
fi
+
rm -f conftest.err conftest.$ac_ext
done
@@ -3194,23 +3703,170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking for egrep" >&5
-echo $ECHO_N "checking for egrep... $ECHO_C" >&6
-if test "${ac_cv_prog_egrep+set}" = set; then
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if echo a | (grep -E '(a|b)') >/dev/null 2>&1
- then ac_cv_prog_egrep='grep -E'
- else ac_cv_prog_egrep='egrep'
+ ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in grep ggrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ # Check for GNU ac_path_GREP and select it if it is found.
+ # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+ ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ echo 'GREP' >> "conftest.nl"
+ "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_GREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_GREP="$ac_path_GREP"
+ ac_path_GREP_max=$ac_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_GREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+else
+ ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+ then ac_cv_path_EGREP="$GREP -E"
+ else
+ # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in egrep; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+ { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ # Check for GNU ac_path_EGREP and select it if it is found.
+ # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+ ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+ ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+ while :
+ do
+ cat "conftest.in" "conftest.in" >"conftest.tmp"
+ mv "conftest.tmp" "conftest.in"
+ cp "conftest.in" "conftest.nl"
+ echo 'EGREP' >> "conftest.nl"
+ "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+ diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+ ac_count=`expr $ac_count + 1`
+ if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+ # Best one so far, save it but keep looking for a better one
+ ac_cv_path_EGREP="$ac_path_EGREP"
+ ac_path_EGREP_max=$ac_count
fi
+ # 10*(2^10) chars as input seems more than enough
+ test $ac_count -gt 10 && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+ $ac_path_EGREP_found && break 3
+ done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+ { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
-echo "${ECHO_T}$ac_cv_prog_egrep" >&6
- EGREP=$ac_cv_prog_egrep
+else
+ ac_cv_path_EGREP=$EGREP
+fi
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+
+ fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
if test "${ac_cv_header_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3234,35 +3890,31 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_header_stdc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_header_stdc=no
+ ac_cv_header_stdc=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@@ -3318,6 +3970,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
+#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -3337,18 +3990,27 @@ main ()
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
+ return 2;
+ return 0;
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -3361,12 +4023,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+
+
fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -3389,9 +4053,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
inttypes.h stdint.h unistd.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -3405,38 +4069,35 @@ $ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
eval "$as_ac_Header=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-eval "$as_ac_Header=no"
+ eval "$as_ac_Header=no"
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_Header'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
@@ -3459,18 +4120,19 @@ fi
for ac_header in string.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -3481,41 +4143,37 @@ $ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_header_compiler=no
+ ac_header_compiler=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -3524,24 +4182,22 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
@@ -3549,9 +4205,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
+
rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -3575,25 +4232,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+
;;
esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -3611,8 +4262,8 @@ ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; }
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -3646,24 +4297,22 @@ cat >>conftest.$ac_ext <<_ACEOF
#endif
Syntax error
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
:
else
echo "$as_me: failed program was:" >&5
@@ -3672,9 +4321,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
+
rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether non-existent headers
+ # OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -3684,24 +4334,22 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
# Broken: success on invalid input.
continue
else
@@ -3712,6 +4360,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_preproc_ok=:
break
fi
+
rm -f conftest.err conftest.$ac_ext
done
@@ -3729,8 +4378,8 @@ fi
else
ac_cv_prog_CPP=$CPP
fi
-echo "$as_me:$LINENO: result: $CPP" >&5
-echo "${ECHO_T}$CPP" >&6
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
ac_preproc_ok=false
for ac_c_preproc_warn_flag in '' yes
do
@@ -3753,24 +4402,22 @@ cat >>conftest.$ac_ext <<_ACEOF
#endif
Syntax error
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
:
else
echo "$as_me: failed program was:" >&5
@@ -3779,9 +4426,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
# Broken: fails on valid input.
continue
fi
+
rm -f conftest.err conftest.$ac_ext
- # OK, works on sane cases. Now check whether non-existent headers
+ # OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
@@ -3791,24 +4439,22 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ac_nonexistent.h>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
# Broken: success on invalid input.
continue
else
@@ -3819,6 +4465,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_preproc_ok=:
break
fi
+
rm -f conftest.err conftest.$ac_ext
done
@@ -3840,8 +4487,8 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
if test "${ac_cv_c_const+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3859,10 +4506,10 @@ main ()
#ifndef __cplusplus
/* Ultrix mips cc rejects this. */
typedef int charset[2];
- const charset x;
+ const charset cs;
/* SunOS 4.1.1 cc rejects this. */
- char const *const *ccp;
- char **p;
+ char const *const *pcpcc;
+ char **ppc;
/* NEC SVR4.0.2 mips cc rejects this. */
struct point {int x, y;};
static struct point const zero = {0,0};
@@ -3871,16 +4518,17 @@ main ()
an arm of an if-expression whose if-part is not a constant
expression */
const char *g = "string";
- ccp = &g + (g ? g-g : 0);
+ pcpcc = &g + (g ? g-g : 0);
/* HPUX 7.0 cc rejects these. */
- ++ccp;
- p = (char**) ccp;
- ccp = (char const *const *) p;
+ ++pcpcc;
+ ppc = (char**) pcpcc;
+ pcpcc = (char const *const *) ppc;
{ /* SCO 3.2v4 cc rejects this. */
char *t;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
+ if (s) return 0;
}
{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
int x[] = {25, 17};
@@ -3899,7 +4547,9 @@ main ()
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
+ if (!foo) return 0;
}
+ return !cs[0] && !zero.x;
#endif
;
@@ -3907,38 +4557,34 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_c_const=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_c_const=no
+ ac_cv_c_const=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
-echo "${ECHO_T}$ac_cv_c_const" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6; }
if test $ac_cv_c_const = no; then
cat >>confdefs.h <<\_ACEOF
@@ -3947,8 +4593,8 @@ _ACEOF
fi
-echo "$as_me:$LINENO: checking for inline" >&5
-echo $ECHO_N "checking for inline... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6; }
if test "${ac_cv_c_inline+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -3968,39 +4614,37 @@ $ac_kw foo_t foo () {return 0; }
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_c_inline=$ac_kw; break
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_c_inline=$ac_kw
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ test "$ac_cv_c_inline" != no && break
done
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
-echo "${ECHO_T}$ac_cv_c_inline" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6; }
case $ac_cv_c_inline in
@@ -4018,8 +4662,8 @@ _ACEOF
;;
esac
-echo "$as_me:$LINENO: checking for preprocessor stringizing operator" >&5
-echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for preprocessor stringizing operator" >&5
+echo $ECHO_N "checking for preprocessor stringizing operator... $ECHO_C" >&6; }
if test "${ac_cv_c_stringize+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -4042,8 +4686,8 @@ fi
rm -f conftest*
fi
-echo "$as_me:$LINENO: result: $ac_cv_c_stringize" >&5
-echo "${ECHO_T}$ac_cv_c_stringize" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_c_stringize" >&5
+echo "${ECHO_T}$ac_cv_c_stringize" >&6; }
if test $ac_cv_c_stringize = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -4054,8 +4698,8 @@ fi
# check includes/headers
-echo "$as_me:$LINENO: checking for ANSI C header files" >&5
-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; }
if test "${ac_cv_header_stdc+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -4079,35 +4723,31 @@ main ()
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_header_stdc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_header_stdc=no
+ ac_cv_header_stdc=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_header_stdc = yes; then
# SunOS 4.x string.h does not declare mem*, contrary to ANSI.
@@ -4163,6 +4803,7 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <ctype.h>
+#include <stdlib.h>
#if ((' ' & 0x0FF) == 0x020)
# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
@@ -4182,18 +4823,27 @@ main ()
for (i = 0; i < 256; i++)
if (XOR (islower (i), ISLOWER (i))
|| toupper (i) != TOUPPER (i))
- exit(2);
- exit (0);
+ return 2;
+ return 0;
}
_ACEOF
rm -f conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && { ac_try='./conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
+ { (case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_try") 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
@@ -4206,12 +4856,14 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
+
+
fi
fi
-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
-echo "${ECHO_T}$ac_cv_header_stdc" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
cat >>confdefs.h <<\_ACEOF
@@ -4226,21 +4878,32 @@ fi
-for ac_header in limits.h memory.h siginfo.h string.h strings.h unistd.h
+
+
+
+
+
+
+
+
+for ac_header in errno.h fcntl.h limits.h pty.h malloc.h memory.h siginfo.h \
+ string.h strings.h stropts.h sys/types.h sys/wait.h unistd.h \
+ util.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -4251,41 +4914,37 @@ $ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_header_compiler=no
+ ac_header_compiler=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -4294,24 +4953,22 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
@@ -4319,9 +4976,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
+
rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -4345,25 +5003,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+
;;
esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -4376,25 +5028,22 @@ fi
done
-
-
-
-
-for ac_header in errno.h fcntl.h sys/types.h sys/wait.h
+for ac_header in sysexits.h
do
as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+ { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
else
# Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -4405,41 +5054,37 @@ $ac_includes_default
#include <$ac_header>
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_header_compiler=no
+ ac_header_compiler=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
@@ -4448,24 +5093,22 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <$ac_header>
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
+ (exit $ac_status); } >/dev/null && {
+ test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ }; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
@@ -4473,9 +5116,10 @@ sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
+
rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
@@ -4499,25 +5143,19 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\
echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
+
;;
esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
eval "$as_ac_Header=\$ac_header_preproc"
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+ac_res=`eval echo '${'$as_ac_Header'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
fi
if test `eval echo '${'$as_ac_Header'}'` = yes; then
@@ -4530,177 +5168,308 @@ fi
done
-for ac_header in sysexits.h
+# check functions
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_func in memcpy memmove memset strerror strchr \
+ strrchr strstr strtok strrtok index rindex unsetenv
do
-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
- # Is the header compilable?
-echo "$as_me:$LINENO: checking $ac_header usability" >&5
-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_includes_default
-#include <$ac_header>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_header_compiler=yes
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_header_compiler=no
+ eval "$as_ac_var=no"
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
-echo "${ECHO_T}$ac_header_compiler" >&6
-# Is the header present?
-echo "$as_me:$LINENO: checking $ac_header presence" >&5
-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
-cat >conftest.$ac_ext <<_ACEOF
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+for ac_func in openpty
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-#include <$ac_header>
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+ For example, HP-UX 11i <limits.h> declares gettimeofday. */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* The GNU C library defines this for functions which it implements
+ to always fail with ENOSYS. Some functions are actually named
+ something starting with __ and the normal name is an alias. */
+#if defined __stub_$ac_func || defined __stub___$ac_func
+choke me
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+ ;
+ return 0;
+}
_ACEOF
-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } >/dev/null; then
- if test -s conftest.err; then
- ac_cpp_err=$ac_c_preproc_warn_flag
- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
- else
- ac_cpp_err=
- fi
-else
- ac_cpp_err=yes
-fi
-if test -z "$ac_cpp_err"; then
- ac_header_preproc=yes
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
- ac_header_preproc=no
+ eval "$as_ac_var=no"
fi
-rm -f conftest.err conftest.$ac_ext
-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
-echo "${ECHO_T}$ac_header_preproc" >&6
-
-# So? What about this header?
-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
- yes:no: )
- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
- ac_header_preproc=yes
- ;;
- no:yes:* )
- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
- (
- cat <<\_ASBOX
-## ------------------------------------------ ##
-## Report this to the AC_PACKAGE_NAME lists. ##
-## ------------------------------------------ ##
-_ASBOX
- ) |
- sed "s/^/$as_me: WARNING: /" >&2
- ;;
-esac
-echo "$as_me:$LINENO: checking for $ac_header" >&5
-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
-if eval "test \"\${$as_ac_Header+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- eval "$as_ac_Header=\$ac_header_preproc"
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
fi
-if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-
+ openpty=1
+else
+ openpty=0
fi
-
done
+# openlog() is not in the default libraries. See if it is in some other lib.
+if test $openpty = 0; then
+ for lib in util; do
+ as_ac_Lib=`echo "ac_cv_lib_$lib''_openpty" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for openpty in -l$lib" >&5
+echo $ECHO_N "checking for openpty in -l$lib... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-# check functions
-
-
-
-
-
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char openpty ();
+int
+main ()
+{
+return openpty ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ eval "$as_ac_Lib=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_OPENPTY 1
+_ACEOF
+ LIBS="$LIBS -l$lib"; openpty=1; break
+fi
+ done
+fi
+# If we dont have openpty, then look for /dev/ptmx for use by our own
+# openpty().
+if test $openpty = 0; then
+ # This check (partially) comes from expect's configure
+ { echo "$as_me:$LINENO: checking for SVR4 style pty allocation" >&5
+echo $ECHO_N "checking for SVR4 style pty allocation... $ECHO_C" >&6; }
+ if test -r /dev/ptmx ; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTMX 1
+_ACEOF
+ # Some systems need libpt.a to use /dev/ptmx
-for ac_func in memcpy memmove memset bcopy bzero strerror strchr strrchr \
- strstr strtok strrtok index rindex
+for ac_func in ptsname
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
@@ -4726,68 +5495,60 @@ cat >>conftest.$ac_ext <<_ACEOF
#undef $ac_func
-/* Override any gcc2 internal prototype to avoid an error. */
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
-{
#endif
-/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
char $ac_func ();
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
+#if defined __stub_$ac_func || defined __stub___$ac_func
choke me
-#else
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
#endif
int
main ()
{
-return f != $ac_func;
+return $ac_func ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>conftest.er1
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-eval "$as_ac_var=no"
+ eval "$as_ac_var=no"
fi
-rm -f conftest.err conftest.$ac_objext \
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+ac_res=`eval echo '${'$as_ac_var'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
@@ -4796,10 +5557,105 @@ _ACEOF
fi
done
+ if test $ac_cv_func_ptsname+set != set; then
+ # ptsname is not in the default libraries.
+ for lib in pt; do
+ as_ac_Lib=`echo "ac_cv_lib_$lib''_ptsname" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for ptsname in -l$lib" >&5
+echo $ECHO_N "checking for ptsname in -l$lib... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$lib $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ptsname ();
+int
+main ()
+{
+return ptsname ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_link") 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest$ac_exeext &&
+ $as_test_x conftest$ac_exeext; then
+ eval "$as_ac_Lib=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ eval "$as_ac_Lib=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+ { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+ LIBS="$LIBS -l$lib"; break
+fi
+
+ done
+ fi
+ else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ fi
+ # In OSF/1 case, SVR4 are somewhat different.
+ # Gregory Depp <depp@osf.org> 17Aug93
+ { echo "$as_me:$LINENO: checking for OSF/1 style pty allocation" >&5
+echo $ECHO_N "checking for OSF/1 style pty allocation... $ECHO_C" >&6; }
+
+
+ if test -r /dev/ptmx_bsd ; then
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_PTMX_OSF 1
+_ACEOF
+
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ fi
+fi
+
# type checks
-echo "$as_me:$LINENO: checking return type of signal handlers" >&5
-echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5
+echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
if test "${ac_cv_type_signal+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -4811,64 +5667,52 @@ cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <signal.h>
-#ifdef signal
-# undef signal
-#endif
-#ifdef __cplusplus
-extern "C" void (*signal (int, void (*)(int)))(int);
-#else
-void (*signal ()) ();
-#endif
int
main ()
{
-int i;
+return *(signal (0, 0)) (0) == 1;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- ac_cv_type_signal=void
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
+ ac_cv_type_signal=int
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_type_signal=int
+ ac_cv_type_signal=void
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
-echo "${ECHO_T}$ac_cv_type_signal" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6; }
cat >>confdefs.h <<_ACEOF
#define RETSIGTYPE $ac_cv_type_signal
_ACEOF
-echo "$as_me:$LINENO: checking for size_t" >&5
-echo $ECHO_N "checking for size_t... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for size_t" >&5
+echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
if test "${ac_cv_type_size_t+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -4879,56 +5723,53 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
+typedef size_t ac__type_new_;
int
main ()
{
-if ((size_t *) 0)
+if ((ac__type_new_ *) 0)
return 0;
-if (sizeof (size_t))
+if (sizeof (ac__type_new_))
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>conftest.er1
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+ *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+ *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+ (eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -z "$ac_c_werror_flag"
- || test ! -s conftest.err'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
+ (exit $ac_status); } && {
+ test -z "$ac_c_werror_flag" ||
+ test ! -s conftest.err
+ } && test -s conftest.$ac_objext; then
ac_cv_type_size_t=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
-ac_cv_type_size_t=no
+ ac_cv_type_size_t=no
fi
-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
-echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
-echo "${ECHO_T}$ac_cv_type_size_t" >&6
+{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
+echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
if test $ac_cv_type_size_t = yes; then
:
else
cat >>confdefs.h <<_ACEOF
-#define size_t unsigned
+#define size_t unsigned int
_ACEOF
fi
@@ -4936,64 +5777,145 @@ fi
# Package-specific options/knobs
#
+# Check if user wants us to create LOCALSTATEDIR. If it's a package-system,
+# they might create it themselves for book-keeping sake; eg: NetBSD
+{ echo "$as_me:$LINENO: checking whether to create the local state directory at install time" >&5
+echo $ECHO_N "checking whether to create the local state directory at install time... $ECHO_C" >&6; }
+# Check whether --enable-mk-localstatedir was given.
+if test "${enable_mk_localstatedir+set}" = set; then
+ enableval=$enable_mk_localstatedir; if test "$enable_mk_localstatedir" = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+else
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ enable_mk_localstatedir="yes"
+
+fi
+
+ if test "${enable_mk_localstatedir}" = yes; then
+ MK_LCLSTATEDIR_TRUE=
+ MK_LCLSTATEDIR_FALSE='#'
+else
+ MK_LCLSTATEDIR_TRUE='#'
+ MK_LCLSTATEDIR_FALSE=
+fi
+
+
+# Check if user wants us to install sample configurations into the sysconfdir.
+{ echo "$as_me:$LINENO: checking whether to install sample .conf files in sysconfdir" >&5
+echo $ECHO_N "checking whether to install sample .conf files in sysconfdir... $ECHO_C" >&6; }
+# Check whether --enable-conf-install was given.
+if test "${enable_conf_install+set}" = set; then
+ enableval=$enable_conf_install; if test "$enable_conf_install" = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+else
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ enable_conf_install="yes"
+
+fi
+
+ if test "${enable_conf_install}" = yes; then
+ CONF_INSTALL_TRUE=
+ CONF_INSTALL_FALSE='#'
+else
+ CONF_INSTALL_TRUE='#'
+ CONF_INSTALL_FALSE=
+fi
+
+
+# Configure for subversion revision control system instead of CVS.
+{ echo "$as_me:$LINENO: checking whether subversion" >&5
+echo $ECHO_N "checking whether subversion... $ECHO_C" >&6; }
+# Check whether --enable-svn was given.
+if test "${enable_svn+set}" = set; then
+ enableval=$enable_svn; if test "$enable_svn" = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+ RCSSYS="svn"
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ RCSSYS="cvs"
+fi
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+ RCSSYS="cvs"
+
+fi
+
+
+rd_cv_RCSSYS=$RCSSYS
+
# Check for a preference for using mail addresses like rancid+group
# instead of the standard rancid-group
-echo "$as_me:$LINENO: checking whether mail addresses should be in the rancid+ form" >&5
-echo $ECHO_N "checking whether mail addresses should be in the rancid+ form... $ECHO_C" >&6
-# Check whether --enable-mail-plus or --disable-mail-plus was given.
+{ echo "$as_me:$LINENO: checking whether mail addresses should be in the rancid+ form" >&5
+echo $ECHO_N "checking whether mail addresses should be in the rancid+ form... $ECHO_C" >&6; }
+# Check whether --enable-mail-plus was given.
if test "${enable_mail_plus+set}" = set; then
- enableval="$enable_mail_plus"
- if test "$enable_mail_plus" = yes; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+ enableval=$enable_mail_plus; if test "$enable_mail_plus" = yes; then
+ { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
MAILPLUS="rancid+"
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
MAILPLUS="rancid-"
fi
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
MAILPLUS="rancid-"
-fi;
+fi
+
rd_cv_MAILPLUS=$MAILPLUS
# Check for a preference for using mail addresses like rancid+admin-group
# instead of the standard rancid-admin-group
-echo "$as_me:$LINENO: checking whether admin mail addresses should be in the rancid+ form" >&5
-echo $ECHO_N "checking whether admin mail addresses should be in the rancid+ form... $ECHO_C" >&6
-# Check whether --enable-adminmail-plus or --disable-adminmail-plus was given.
+{ echo "$as_me:$LINENO: checking whether admin mail addresses should be in the rancid-admin+ form" >&5
+echo $ECHO_N "checking whether admin mail addresses should be in the rancid-admin+ form... $ECHO_C" >&6; }
+# Check whether --enable-adminmail-plus was given.
if test "${enable_adminmail_plus+set}" = set; then
- enableval="$enable_adminmail_plus"
- if test "$enable_adminmail_plus" = yes; then
- echo "$as_me:$LINENO: result: yes" >&5
-echo "${ECHO_T}yes" >&6
+ enableval=$enable_adminmail_plus; if test "$enable_adminmail_plus" = yes; then
+ { echo "$as_me:$LINENO: result: rancid-admin+" >&5
+echo "${ECHO_T}rancid-admin+" >&6; }
ADMINMAILPLUS="rancid-admin+"
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: ${MAILPLUS}admin-" >&5
+echo "${ECHO_T}${MAILPLUS}admin-" >&6; }
ADMINMAILPLUS="${MAILPLUS}admin-"
fi
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: ${MAILPLUS}admin-" >&5
+echo "${ECHO_T}${MAILPLUS}admin-" >&6; }
ADMINMAILPLUS="${MAILPLUS}admin-"
-fi;
+fi
+
rd_cv_ADMINMAILPLUS=$ADMINMAILPLUS
# Extract the first word of "dirname", so it can be a program name with args.
set dummy dirname; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_DIRNAME+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5008,103 +5930,79 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_DIRNAME="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_DIRNAME" && ac_cv_path_DIRNAME="no"
;;
esac
fi
DIRNAME=$ac_cv_path_DIRNAME
-
if test -n "$DIRNAME"; then
- echo "$as_me:$LINENO: result: $DIRNAME" >&5
-echo "${ECHO_T}$DIRNAME" >&6
+ { echo "$as_me:$LINENO: result: $DIRNAME" >&5
+echo "${ECHO_T}$DIRNAME" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
-# locate GNU diff (one supporting the -u option)
-# Extract the first word of "diff", so it can be a program name with args.
-set dummy diff; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
-if test "${ac_cv_path_DIFF+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- case $DIFF in
- [\\/]* | ?:[\\/]*)
- ac_cv_path_DIFF="$DIFF" # Let the user override the test with a path.
- ;;
- *)
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-as_dummy="/usr/local/bin:/usr/gnu/bin:/usr/bin:/usr/contrib/bin"
-for as_dir in $as_dummy
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_path_DIFF="$as_dir/$ac_word$ac_exec_ext"
- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
- break 2
- fi
-done
-done
-
- test -z "$ac_cv_path_DIFF" && ac_cv_path_DIFF="no"
- ;;
-esac
-fi
-DIFF=$ac_cv_path_DIFF
-if test -n "$DIFF"; then
- echo "$as_me:$LINENO: result: $DIFF" >&5
-echo "${ECHO_T}$DIFF" >&6
-else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
-fi
-if test $DIFF = no; then
- unset ac_cv_path_DIFF
- { { echo "$as_me:$LINENO: error: can't locate diff." >&5
-echo "$as_me: error: can't locate diff." >&2;}
- { (exit 1); exit 1; }; }
-else
- $DIFF -u /dev/null /dev/null > /dev/null 2>&1
- if test $? -ne 0; then
- $DIFF -C 2 /dev/null /dev/null > /dev/null 2>&1
+# locate GNU diff (one supporting the -u option)
+{ echo "$as_me:$LINENO: checking for a diff(1) that supports -u" >&5
+echo $ECHO_N "checking for a diff(1) that supports -u... $ECHO_C" >&6; }
+_DIFF_PATH=`echo $PATH:${prefix}/bin:/usr/bin:/usr/pkg/bin:/usr/local/bin:/usr/gnu/bin:/usr/contrib/bin | sed -e 's/:/ /g'`
+for _diff in ${_DIFF_PATH} ;
+do
+ if test -e ${_diff}/diff ; then
+ ${_diff}/diff -u -4 /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
- $DIFF -c2 /dev/null /dev/null > /dev/null 2>&1
+ # linux/gnu shit has to change options that have been around
+ # since organized religion; see if -U 4 works.
+ ${_diff}/diff -U 4 /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
- { { echo "$as_me:$LINENO: error: can't locate a diff which accepts the -u option." >&5
-echo "$as_me: error: can't locate a diff which accepts the -u option." >&2;}
- { (exit 1); exit 1; }; }
- exit 1
+ if test "${ADIFF}" == "" ; then
+ ADIFF="${_diff}/diff"
+ ADIFF_CMD="diff -c -4"
+ fi
else
- DIFF_CMD="diff -c4"
+ DIFF="${_diff}/diff"
+ DIFF_CMD="diff -U 4"
+ break
fi
else
- DIFF_CMD="diff -C 4"
+ DIFF="${_diff}/diff"
+ DIFF_CMD="diff -u -4"
+ break
fi
- else
- DIFF_CMD="diff -u -4"
fi
+done
+if test "$DIFF" = "" ; then
+ DIFF=$ADIFF
+ DIFF_CMD=$ADIFF_CMD
fi
+if test "$DIFF" = "" ; then
+ { { echo "$as_me:$LINENO: error: can't locate diff." >&5
+echo "$as_me: error: can't locate diff." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+{ echo "$as_me:$LINENO: result: ${DIFF_CMD}" >&5
+echo "${ECHO_T}${DIFF_CMD}" >&6; }
+rd_cv_DIFF=$DIFF
+
rd_cv_DIFF_CMD=$DIFF_CMD
# Extract the first word of "sendmail", so it can be a program name with args.
set dummy sendmail; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_SENDMAIL+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5120,37 +6018,38 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_SENDMAIL="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_SENDMAIL" && ac_cv_path_SENDMAIL="no"
;;
esac
fi
SENDMAIL=$ac_cv_path_SENDMAIL
-
if test -n "$SENDMAIL"; then
- echo "$as_me:$LINENO: result: $SENDMAIL" >&5
-echo "${ECHO_T}$SENDMAIL" >&6
+ { echo "$as_me:$LINENO: result: $SENDMAIL" >&5
+echo "${ECHO_T}$SENDMAIL" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
# Find an appropriate tar for use in "dist" targets. A "best guess"
# is good enough -- if we can't find GNU tar, we don't really care.
for ac_prog in gnutar gtar tar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_TAR+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5163,25 +6062,27 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_TAR="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
TAR=$ac_cv_prog_TAR
if test -n "$TAR"; then
- echo "$as_me:$LINENO: result: $TAR" >&5
-echo "${ECHO_T}$TAR" >&6
+ { echo "$as_me:$LINENO: result: $TAR" >&5
+echo "${ECHO_T}$TAR" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$TAR" && break
done
@@ -5190,8 +6091,8 @@ for ac_prog in automake
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_prog_AUTOMAKE+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5204,25 +6105,27 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_prog_AUTOMAKE="$ac_prog"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
fi
fi
AUTOMAKE=$ac_cv_prog_AUTOMAKE
if test -n "$AUTOMAKE"; then
- echo "$as_me:$LINENO: result: $AUTOMAKE" >&5
-echo "${ECHO_T}$AUTOMAKE" >&6
+ { echo "$as_me:$LINENO: result: $AUTOMAKE" >&5
+echo "${ECHO_T}$AUTOMAKE" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
test -n "$AUTOMAKE" && break
done
@@ -5240,8 +6143,8 @@ done
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# OS/2's system install, which has a completely different semantic
# ./install, which can be erroneously created by make from ./install.sh.
-echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
-echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; }
if test -z "$INSTALL"; then
if test "${ac_cv_path_install+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -5263,7 +6166,7 @@ case $as_dir/ in
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -5282,21 +6185,22 @@ case $as_dir/ in
;;
esac
done
+IFS=$as_save_IFS
fi
if test "${ac_cv_path_install+set}" = set; then
INSTALL=$ac_cv_path_install
else
- # As a last resort, use the slow shell script. We don't cache a
- # path for INSTALL within a source directory, because that will
+ # As a last resort, use the slow shell script. Don't cache a
+ # value for INSTALL within a source directory, because that will
# break other packages using the cache if that directory is
- # removed, or if the path is relative.
+ # removed, or if the value is a relative name.
INSTALL=$ac_install_sh
fi
fi
-echo "$as_me:$LINENO: result: $INSTALL" >&5
-echo "${ECHO_T}$INSTALL" >&6
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
# It thinks the first close brace ends the variable substitution.
@@ -5308,8 +6212,8 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "perl5", so it can be a program name with args.
set dummy perl5; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_PERLV_PATH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5324,34 +6228,35 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_PERLV_PATH="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_PERLV_PATH" && ac_cv_path_PERLV_PATH="no"
;;
esac
fi
PERLV_PATH=$ac_cv_path_PERLV_PATH
-
if test -n "$PERLV_PATH"; then
- echo "$as_me:$LINENO: result: $PERLV_PATH" >&5
-echo "${ECHO_T}$PERLV_PATH" >&6
+ { echo "$as_me:$LINENO: result: $PERLV_PATH" >&5
+echo "${ECHO_T}$PERLV_PATH" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
if test $PERLV_PATH = no; then
unset ac_cv_path_PERLV_PATH
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_PERLV_PATH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5366,28 +6271,29 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_PERLV_PATH="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_PERLV_PATH" && ac_cv_path_PERLV_PATH="no"
;;
esac
fi
PERLV_PATH=$ac_cv_path_PERLV_PATH
-
if test -n "$PERLV_PATH"; then
- echo "$as_me:$LINENO: result: $PERLV_PATH" >&5
-echo "${ECHO_T}$PERLV_PATH" >&6
+ { echo "$as_me:$LINENO: result: $PERLV_PATH" >&5
+echo "${ECHO_T}$PERLV_PATH" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
if test $PERLV_PATH = no; then
{ { echo "$as_me:$LINENO: error: can't locate a suitable perl5." >&5
echo "$as_me: error: can't locate a suitable perl5." >&2;}
@@ -5409,8 +6315,8 @@ PERLV=`basename $PERLV_PATH`
# Extract the first word of "expect", so it can be a program name with args.
set dummy expect; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_EXPECT_PATH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5425,28 +6331,29 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_EXPECT_PATH="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_EXPECT_PATH" && ac_cv_path_EXPECT_PATH="no"
;;
esac
fi
EXPECT_PATH=$ac_cv_path_EXPECT_PATH
-
if test -n "$EXPECT_PATH"; then
- echo "$as_me:$LINENO: result: $EXPECT_PATH" >&5
-echo "${ECHO_T}$EXPECT_PATH" >&6
+ { echo "$as_me:$LINENO: result: $EXPECT_PATH" >&5
+echo "${ECHO_T}$EXPECT_PATH" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
if test $EXPECT_PATH = no; then
{ { echo "$as_me:$LINENO: error: can't locate expect." >&5
echo "$as_me: error: can't locate expect." >&2;}
@@ -5457,8 +6364,8 @@ fi
# locate ping and it's syntax
# Extract the first word of "ping", so it can be a program name with args.
set dummy ping; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_PING_PATH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5473,28 +6380,29 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_PING_PATH="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_PING_PATH" && ac_cv_path_PING_PATH="no"
;;
esac
fi
PING_PATH=$ac_cv_path_PING_PATH
-
if test -n "$PING_PATH"; then
- echo "$as_me:$LINENO: result: $PING_PATH" >&5
-echo "${ECHO_T}$PING_PATH" >&6
+ { echo "$as_me:$LINENO: result: $PING_PATH" >&5
+echo "${ECHO_T}$PING_PATH" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
if test $PING_PATH = no; then
{ { echo "$as_me:$LINENO: error: can't locate ping." >&5
echo "$as_me: error: can't locate ping." >&2;}
@@ -5528,10 +6436,11 @@ rd_cv_lg_ping_cmd=$LG_PING_CMD
ENV_PATH="`dirname $PERLV_PATH`:`dirname $EXPECT_PATH`:`dirname $SENDMAIL`"
ENV_PATH="$ENV_PATH:`dirname $DIRNAME`:`dirname $DIFF`"
-# Extract the first word of "cvs", so it can be a program name with args.
+if test $RCSSYS = "cvs" ; then
+ # Extract the first word of "cvs", so it can be a program name with args.
set dummy cvs; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_CVS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5546,33 +6455,78 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_CVS="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_CVS" && ac_cv_path_CVS="no"
;;
esac
fi
CVS=$ac_cv_path_CVS
-
if test -n "$CVS"; then
- echo "$as_me:$LINENO: result: $CVS" >&5
-echo "${ECHO_T}$CVS" >&6
+ { echo "$as_me:$LINENO: result: $CVS" >&5
+echo "${ECHO_T}$CVS" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
+else
+ # Extract the first word of "svn", so it can be a program name with args.
+set dummy svn; ac_word=$2
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
+if test "${ac_cv_path_SVN+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ case $SVN in
+ [\\/]* | ?:[\\/]*)
+ ac_cv_path_SVN="$SVN" # Let the user override the test with a path.
+ ;;
+ *)
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ ac_cv_path_SVN="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+IFS=$as_save_IFS
+
+ test -z "$ac_cv_path_SVN" && ac_cv_path_SVN="no"
+ ;;
+esac
+fi
+SVN=$ac_cv_path_SVN
+if test -n "$SVN"; then
+ { echo "$as_me:$LINENO: result: $SVN" >&5
+echo "${ECHO_T}$SVN" >&6; }
+else
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
-ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
+
+ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SVN`"
+fi
# Extract the first word of "comm", so it can be a program name with args.
set dummy comm; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_COMM+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5587,33 +6541,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_COMM="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_COMM" && ac_cv_path_COMM="no"
;;
esac
fi
COMM=$ac_cv_path_COMM
-
if test -n "$COMM"; then
- echo "$as_me:$LINENO: result: $COMM" >&5
-echo "${ECHO_T}$COMM" >&6
+ { echo "$as_me:$LINENO: result: $COMM" >&5
+echo "${ECHO_T}$COMM" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_COMM`"
# Extract the first word of "find", so it can be a program name with args.
set dummy find; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_FIND+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5628,33 +6583,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_FIND="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="no"
;;
esac
fi
FIND=$ac_cv_path_FIND
-
if test -n "$FIND"; then
- echo "$as_me:$LINENO: result: $FIND" >&5
-echo "${ECHO_T}$FIND" >&6
+ { echo "$as_me:$LINENO: result: $FIND" >&5
+echo "${ECHO_T}$FIND" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_FIND`"
# Extract the first word of "grep", so it can be a program name with args.
set dummy grep; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_GREP+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5669,33 +6625,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_GREP="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_GREP" && ac_cv_path_GREP="no"
;;
esac
fi
GREP=$ac_cv_path_GREP
-
if test -n "$GREP"; then
- echo "$as_me:$LINENO: result: $GREP" >&5
-echo "${ECHO_T}$GREP" >&6
+ { echo "$as_me:$LINENO: result: $GREP" >&5
+echo "${ECHO_T}$GREP" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_GREP`"
# Extract the first word of "id", so it can be a program name with args.
set dummy id; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_ID+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5710,33 +6667,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_ID="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_ID" && ac_cv_path_ID="no"
;;
esac
fi
ID=$ac_cv_path_ID
-
if test -n "$ID"; then
- echo "$as_me:$LINENO: result: $ID" >&5
-echo "${ECHO_T}$ID" >&6
+ { echo "$as_me:$LINENO: result: $ID" >&5
+echo "${ECHO_T}$ID" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_ID`"
# Extract the first word of "mkdir", so it can be a program name with args.
set dummy mkdir; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_MKDIR+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5751,33 +6709,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_MKDIR="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_MKDIR" && ac_cv_path_MKDIR="no"
;;
esac
fi
MKDIR=$ac_cv_path_MKDIR
-
if test -n "$MKDIR"; then
- echo "$as_me:$LINENO: result: $MKDIR" >&5
-echo "${ECHO_T}$MKDIR" >&6
+ { echo "$as_me:$LINENO: result: $MKDIR" >&5
+echo "${ECHO_T}$MKDIR" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_MKDIR`"
# Extract the first word of "rsh", so it can be a program name with args.
set dummy rsh; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_RSH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5792,33 +6751,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_RSH="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_RSH" && ac_cv_path_RSH="no"
;;
esac
fi
RSH=$ac_cv_path_RSH
-
if test -n "$RSH"; then
- echo "$as_me:$LINENO: result: $RSH" >&5
-echo "${ECHO_T}$RSH" >&6
+ { echo "$as_me:$LINENO: result: $RSH" >&5
+echo "${ECHO_T}$RSH" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_RSH`"
# Extract the first word of "sort", so it can be a program name with args.
set dummy sort; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_SORT+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5833,33 +6793,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_SORT="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_SORT" && ac_cv_path_SORT="no"
;;
esac
fi
SORT=$ac_cv_path_SORT
-
if test -n "$SORT"; then
- echo "$as_me:$LINENO: result: $SORT" >&5
-echo "${ECHO_T}$SORT" >&6
+ { echo "$as_me:$LINENO: result: $SORT" >&5
+echo "${ECHO_T}$SORT" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SORT`"
# Extract the first word of "ssh", so it can be a program name with args.
set dummy ssh; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_SSH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5874,36 +6835,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_SSH="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_SSH" && ac_cv_path_SSH="no"
;;
esac
fi
SSH=$ac_cv_path_SSH
-
if test -n "$SSH"; then
- echo "$as_me:$LINENO: result: $SSH" >&5
-echo "${ECHO_T}$SSH" >&6
+ { echo "$as_me:$LINENO: result: $SSH" >&5
+echo "${ECHO_T}$SSH" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
-if test $DIFF = no; then
- ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SSH`"
-fi
-unset ac_cv_path_SSH
+
+ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SSH`"
# Extract the first word of "telnet", so it can be a program name with args.
set dummy telnet; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_TELNET+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5918,33 +6877,34 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_TELNET="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_TELNET" && ac_cv_path_TELNET="no"
;;
esac
fi
TELNET=$ac_cv_path_TELNET
-
if test -n "$TELNET"; then
- echo "$as_me:$LINENO: result: $TELNET" >&5
-echo "${ECHO_T}$TELNET" >&6
+ { echo "$as_me:$LINENO: result: $TELNET" >&5
+echo "${ECHO_T}$TELNET" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_TELNET`"
# Extract the first word of "touch", so it can be a program name with args.
set dummy touch; ac_word=$2
-echo "$as_me:$LINENO: checking for $ac_word" >&5
-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+{ echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
if test "${ac_cv_path_TOUCH+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -5959,28 +6919,29 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
ac_cv_path_TOUCH="$as_dir/$ac_word$ac_exec_ext"
echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
+IFS=$as_save_IFS
test -z "$ac_cv_path_TOUCH" && ac_cv_path_TOUCH="no"
;;
esac
fi
TOUCH=$ac_cv_path_TOUCH
-
if test -n "$TOUCH"; then
- echo "$as_me:$LINENO: result: $TOUCH" >&5
-echo "${ECHO_T}$TOUCH" >&6
+ { echo "$as_me:$LINENO: result: $TOUCH" >&5
+echo "${ECHO_T}$TOUCH" >&6; }
else
- echo "$as_me:$LINENO: result: no" >&5
-echo "${ECHO_T}no" >&6
+ { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
fi
+
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_TOUCH`"
ENV_PATH="$ENV_PATH:/usr/local/bin:/usr/bin"
@@ -5990,66 +6951,76 @@ ac_cv_env_path=$ENV_PATH
- ac_config_files="$ac_config_files Makefile"
+ac_config_files="$ac_config_files Makefile"
- ac_config_files="$ac_config_files bin/Makefile"
+ac_config_files="$ac_config_files bin/Makefile"
- ac_config_files="$ac_config_files etc/Makefile"
+ac_config_files="$ac_config_files etc/Makefile"
- ac_config_files="$ac_config_files include/Makefile"
+ac_config_files="$ac_config_files include/Makefile"
- ac_config_files="$ac_config_files man/Makefile"
+ac_config_files="$ac_config_files man/Makefile"
- ac_config_files="$ac_config_files share/Makefile"
+ac_config_files="$ac_config_files share/Makefile"
- ac_config_files="$ac_config_files include/version.h"
+ac_config_files="$ac_config_files include/version.h"
# this is not a header in the sense of
# AC_CONFIG_HEADERS will cause
# autoheader to overwrite it, while all
# want is simple variable replacement
- ac_config_headers="$ac_config_headers include/config.h"
+# autoheader bits
+
+
+
+
+ac_config_headers="$ac_config_headers include/config.h"
+
- ac_config_files="$ac_config_files bin/control_rancid bin/par bin/rancid-fe"
+ac_config_files="$ac_config_files bin/control_rancid bin/par bin/rancid-fe"
- ac_config_files="$ac_config_files bin/alogin bin/arancid"
+ac_config_files="$ac_config_files bin/agmrancid"
- ac_config_files="$ac_config_files bin/blogin bin/brancid"
+ac_config_files="$ac_config_files bin/alogin bin/arancid"
- ac_config_files="$ac_config_files bin/cat5rancid bin/clogin bin/rancid"
+ac_config_files="$ac_config_files bin/blogin bin/brancid"
- ac_config_files="$ac_config_files bin/cssrancid"
+ac_config_files="$ac_config_files bin/cat5rancid bin/clogin bin/rancid"
- ac_config_files="$ac_config_files bin/elogin bin/erancid"
+ac_config_files="$ac_config_files bin/cssrancid"
- ac_config_files="$ac_config_files bin/f10rancid"
+ac_config_files="$ac_config_files bin/elogin bin/erancid"
- ac_config_files="$ac_config_files bin/flogin bin/francid"
+ac_config_files="$ac_config_files bin/f10rancid"
- ac_config_files="$ac_config_files bin/fnrancid"
+ac_config_files="$ac_config_files bin/flogin bin/francid"
- ac_config_files="$ac_config_files bin/jlogin bin/jrancid bin/jerancid"
+ac_config_files="$ac_config_files bin/fnrancid"
- ac_config_files="$ac_config_files bin/hlogin bin/hrancid"
+ac_config_files="$ac_config_files bin/jlogin bin/jrancid bin/jerancid"
- ac_config_files="$ac_config_files bin/htlogin bin/htrancid"
+ac_config_files="$ac_config_files bin/hlogin bin/hrancid"
- ac_config_files="$ac_config_files bin/mrancid"
+ac_config_files="$ac_config_files bin/htlogin bin/htrancid"
- ac_config_files="$ac_config_files bin/nlogin bin/nrancid"
+ac_config_files="$ac_config_files bin/mrancid"
- ac_config_files="$ac_config_files bin/nslogin bin/nsrancid"
+ac_config_files="$ac_config_files bin/nlogin bin/nrancid"
- ac_config_files="$ac_config_files bin/prancid"
+ac_config_files="$ac_config_files bin/nslogin bin/nsrancid"
- ac_config_files="$ac_config_files bin/rivlogin bin/rivrancid"
+ac_config_files="$ac_config_files bin/prancid"
- ac_config_files="$ac_config_files bin/rrancid"
+ac_config_files="$ac_config_files bin/rivlogin bin/rivrancid"
- ac_config_files="$ac_config_files bin/tntlogin bin/tntrancid"
+ac_config_files="$ac_config_files bin/rrancid"
- ac_config_files="$ac_config_files bin/xrancid bin/zrancid"
+ac_config_files="$ac_config_files bin/srancid"
- ac_config_files="$ac_config_files share/rtrfilter"
+ac_config_files="$ac_config_files bin/tntlogin bin/tntrancid"
+
+ac_config_files="$ac_config_files bin/xrancid bin/zrancid"
+
+ac_config_files="$ac_config_files share/rtrfilter"
cat >confcache <<\_ACEOF
@@ -6070,39 +7041,58 @@ _ACEOF
# The following way of writing the cache mishandles newlines in values,
# but we know of no workaround that is simple, portable, and efficient.
-# So, don't put newlines in cache variables' values.
+# So, we kill variables containing newlines.
# Ultrix sh set writes to stderr and can't be redirected directly,
# and sets the high bit in the cache file unless we assign to the vars.
-{
+(
+ for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+ eval ac_val=\$$ac_var
+ case $ac_val in #(
+ *${as_nl}*)
+ case $ac_var in #(
+ *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+ esac
+ case $ac_var in #(
+ _ | IFS | as_nl) ;; #(
+ *) $as_unset $ac_var ;;
+ esac ;;
+ esac
+ done
+
(set) 2>&1 |
- case `(ac_space=' '; set | grep ac_space) 2>&1` in
- *ac_space=\ *)
+ case $as_nl`(ac_space=' '; set) 2>&1` in #(
+ *${as_nl}ac_space=\ *)
# `set' does not quote correctly, so add quotes (double-quote
# substitution turns \\\\ into \\, and sed turns \\ into \).
sed -n \
"s/'/'\\\\''/g;
s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
- ;;
+ ;; #(
*)
# `set' quotes correctly as required by POSIX, so do not add quotes.
- sed -n \
- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
;;
- esac;
-} |
+ esac |
+ sort
+) |
sed '
+ /^ac_cv_env_/b end
t clear
- : clear
+ :clear
s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
t end
- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
- : end' >>confcache
-if diff $cache_file confcache >/dev/null 2>&1; then :; else
- if test -w $cache_file; then
- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file"
+ s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+ if test -w "$cache_file"; then
+ test "x$cache_file" != "x/dev/null" &&
+ { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
cat confcache >$cache_file
else
- echo "not updating unwritable cache $cache_file"
+ { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
fi
fi
rm -f confcache
@@ -6111,32 +7101,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix
# Let make expand exec_prefix.
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
-# VPATH may cause trouble with some makes, so we remove $(srcdir),
-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
-# trailing colons and then remove the whole line if VPATH becomes empty
-# (actually we leave an empty line to preserve line numbers).
-if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=/{
-s/:*\$(srcdir):*/:/;
-s/:*\${srcdir}:*/:/;
-s/:*@srcdir@:*/:/;
-s/^\([^=]*=[ ]*\):*/\1/;
-s/:*$//;
-s/^[^=]*=[ ]*$//;
-}'
-fi
-
DEFS=-DHAVE_CONFIG_H
ac_libobjs=
ac_ltlibobjs=
for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
# 1. Remove the extension, and $U if already installed.
- ac_i=`echo "$ac_i" |
- sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
- # 2. Add them.
- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+ ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+ ac_i=`echo "$ac_i" | sed "$ac_script"`
+ # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR
+ # will be set to the directory where LIBOBJS objects are built.
+ ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
done
LIBOBJS=$ac_libobjs
@@ -6157,6 +7133,20 @@ echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
+if test -z "${MK_LCLSTATEDIR_TRUE}" && test -z "${MK_LCLSTATEDIR_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MK_LCLSTATEDIR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MK_LCLSTATEDIR\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${CONF_INSTALL_TRUE}" && test -z "${CONF_INSTALL_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"CONF_INSTALL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"CONF_INSTALL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
: ${CONFIG_STATUS=./config.status}
ac_clean_files_save=$ac_clean_files
@@ -6181,17 +7171,45 @@ cat >>$CONFIG_STATUS <<\_ACEOF
## M4sh Initialization. ##
## --------------------- ##
-# Be Bourne compatible
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
emulate sh
NULLCMD=:
# Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
- set -o posix
+ setopt NO_GLOB_SUBST
+else
+ case `(set -o) 2>/dev/null` in
+ *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
fi
-DUALCASE=1; export DUALCASE # for MKS sh
# Support unset when possible.
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
@@ -6201,8 +7219,43 @@ else
fi
+# IFS
+# We need space, tab and new line, in precisely that order. Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" "" $as_nl"
+
+# Find who we are. Look in the path if we contain no directory separator.
+case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+ ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+ as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+ echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+ { (exit 1); exit 1; }
+fi
+
# Work around bugs in pre-3.0 UWIN ksh.
-$as_unset ENV MAIL MAILPATH
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
PS1='$ '
PS2='> '
PS4='+ '
@@ -6216,18 +7269,19 @@ do
if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
eval $as_var=C; export $as_var
else
- $as_unset $as_var
+ ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
fi
done
# Required to use basename.
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
@@ -6235,159 +7289,120 @@ fi
# Name of the executable.
-as_me=`$as_basename "$0" ||
+as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)$' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$0" : 'X\(/\)' \| . 2>/dev/null ||
echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
- /^X\/\(\/\/\)$/{ s//\1/; q; }
- /^X\/\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^.*\/\([^/][^/]*\)\/*$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\/\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+# CDPATH.
+$as_unset CDPATH
-# PATH needs CR, and LINENO needs CR and PATH.
-# Avoid depending upon Character Ranges.
-as_cr_letters='abcdefghijklmnopqrstuvwxyz'
-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
-as_cr_Letters=$as_cr_letters$as_cr_LETTERS
-as_cr_digits='0123456789'
-as_cr_alnum=$as_cr_Letters$as_cr_digits
-
-# The user is always right.
-if test "${PATH_SEPARATOR+set}" != set; then
- echo "#! /bin/sh" >conf$$.sh
- echo "exit 0" >>conf$$.sh
- chmod +x conf$$.sh
- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
- PATH_SEPARATOR=';'
- else
- PATH_SEPARATOR=:
- fi
- rm -f conf$$.sh
-fi
as_lineno_1=$LINENO
as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" || {
- # Find who we are. Look in the path if we contain no path at all
- # relative or not.
- case $0 in
- *[\\/]* ) as_myself=$0 ;;
- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
-done
-
- ;;
- esac
- # We did not find ourselves, most probably we were run as `sh COMMAND'
- # in which case we are not to be found in the path.
- if test "x$as_myself" = x; then
- as_myself=$0
- fi
- if test ! -f "$as_myself"; then
- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
- { (exit 1); exit 1; }; }
- fi
- case $CONFIG_SHELL in
- '')
- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
-do
- IFS=$as_save_IFS
- test -z "$as_dir" && as_dir=.
- for as_base in sh bash ksh sh5; do
- case $as_dir in
- /*)
- if ("$as_dir/$as_base" -c '
- as_lineno_1=$LINENO
- as_lineno_2=$LINENO
- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
- test "x$as_lineno_1" != "x$as_lineno_2" &&
- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
- CONFIG_SHELL=$as_dir/$as_base
- export CONFIG_SHELL
- exec "$CONFIG_SHELL" "$0" ${1+"$@"}
- fi;;
- esac
- done
-done
-;;
- esac
+ test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
# Create $as_me.lineno as a copy of $as_myself, but with $LINENO
# uniformly replaced by the line number. The first 'sed' inserts a
- # line-number line before each line; the second 'sed' does the real
- # work. The second script uses 'N' to pair each line-number line
- # with the numbered line, and appends trailing '-' during
- # substitution so that $LINENO is not a special case at line end.
+ # line-number line after each line using $LINENO; the second 'sed'
+ # does the real work. The second script uses 'N' to pair each
+ # line-number line with the line containing $LINENO, and appends
+ # trailing '-' during substitution so that $LINENO is not a special
+ # case at line end.
# (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
- sed '=' <$as_myself |
+ # scripts with optimization help from Paolo Bonzini. Blame Lee
+ # E. McMahon (1931-1989) for sed's syntax. :-)
+ sed -n '
+ p
+ /[$]LINENO/=
+ ' <$as_myself |
sed '
+ s/[$]LINENO.*/&-/
+ t lineno
+ b
+ :lineno
N
- s,$,-,
- : loop
- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ :loop
+ s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
- s,-$,,
- s,^['$as_cr_digits']*\n,,
+ s/-\n.*//
' >$as_me.lineno &&
- chmod +x $as_me.lineno ||
- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ chmod +x "$as_me.lineno" ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
{ (exit 1); exit 1; }; }
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensible to this).
- . ./$as_me.lineno
+ # original and so on. Autoconf is especially sensitive to this).
+ . "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
- *c*,-n*) ECHO_N= ECHO_C='
-' ECHO_T=' ' ;;
- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
- *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+ as_dirname=dirname
+else
+ as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+ case `echo 'x\c'` in
+ *c*) ECHO_T=' ';; # ECHO_T is single tab character.
+ *) ECHO_C='\c';;
+ esac;;
+*)
+ ECHO_N='-n';;
esac
-if expr a : '\(a\)' >/dev/null 2>&1; then
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+ test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+ rm -f conf$$.dir/conf$$.file
+else
+ rm -f conf$$.dir
+ mkdir conf$$.dir
+fi
echo >conf$$.file
if ln -s conf$$.file conf$$ 2>/dev/null; then
- # We could just check for DJGPP; but this test a) works b) is more generic
- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
- if test -f conf$$.exe; then
- # Don't use ln at all; we don't have any links
+ as_ln_s='ln -s'
+ # ... but there are two gotchas:
+ # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+ # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+ # In both cases, we have to default to `cp -p'.
+ ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -p'
- else
- as_ln_s='ln -s'
- fi
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -p'
fi
-rm -f conf$$ conf$$.exe conf$$.file
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p=:
@@ -6396,7 +7411,28 @@ else
as_mkdir_p=false
fi
-as_executable_p="test -f"
+if test -x / >/dev/null 2>&1; then
+ as_test_x='test -x'
+else
+ if ls -dL / >/dev/null 2>&1; then
+ as_ls_L_option=L
+ else
+ as_ls_L_option=
+ fi
+ as_test_x='
+ eval sh -c '\''
+ if test -d "$1"; then
+ test -d "$1/.";
+ else
+ case $1 in
+ -*)set "./$1";;
+ esac;
+ case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+ ???[sx]*):;;*)false;;esac;fi
+ '\'' sh
+ '
+fi
+as_executable_p=$as_test_x
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -6405,31 +7441,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
-# IFS
-# We need space, tab and new line, in precisely that order.
-as_nl='
-'
-IFS=" $as_nl"
-
-# CDPATH.
-$as_unset CDPATH
-
exec 6>&1
-# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# Save the log message, to keep $[0] and so on meaningful, and to
# report actual input values of CONFIG_FILES etc. instead of their
-# values after options handling. Logging --version etc. is OK.
-exec 5>>config.log
-{
- echo
- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
-## Running $as_me. ##
-_ASBOX
-} >&5
-cat >&5 <<_CSEOF
-
+# values after options handling.
+ac_log="
This file was extended by $as_me, which was
-generated by GNU Autoconf 2.59. Invocation command line was
+generated by GNU Autoconf 2.61. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -6437,30 +7456,20 @@ generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_COMMANDS = $CONFIG_COMMANDS
$ $0 $@
-_CSEOF
-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
-echo >&5
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
# Files that config.status was made for.
-if test -n "$ac_config_files"; then
- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_headers"; then
- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
-fi
-
-if test -n "$ac_config_links"; then
- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
-fi
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
-if test -n "$ac_config_commands"; then
- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
-fi
+_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
-
ac_cs_usage="\
\`$as_me' instantiates files from templates according to the
current configuration.
@@ -6468,7 +7477,7 @@ current configuration.
Usage: $0 [OPTIONS] [FILE]...
-h, --help print this help, then exit
- -V, --version print version number, then exit
+ -V, --version print version number and configuration settings, then exit
-q, --quiet do not print progress messages
-d, --debug don't remove temporary files
--recheck update $as_me by reconfiguring in the same conditions
@@ -6487,19 +7496,22 @@ Configuration commands:
$config_commands
Report bugs to <bug-autoconf@gnu.org>."
-_ACEOF
+_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
config.status
-configured by $0, generated by GNU Autoconf 2.59,
- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+configured by $0, generated by GNU Autoconf 2.61,
+ with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
-Copyright (C) 2003 Free Software Foundation, Inc.
+Copyright (C) 2006 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
-srcdir=$srcdir
-INSTALL="$INSTALL"
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
@@ -6510,39 +7522,24 @@ while test $# != 0
do
case $1 in
--*=*)
- ac_option=`expr "x$1" : 'x\([^=]*\)='`
- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_option=`expr "X$1" : 'X\([^=]*\)='`
+ ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
- -*)
+ *)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
- *) # This is not an option, so the user has probably given explicit
- # arguments.
- ac_option=$1
- ac_need_defaults=false;;
esac
case $ac_option in
# Handling of the options.
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
ac_cs_recheck=: ;;
- --version | --vers* | -V )
- echo "$ac_cs_version"; exit 0 ;;
- --he | --h)
- # Conflict between --help and --header
- { { echo "$as_me:$LINENO: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: ambiguous option: $1
-Try \`$0 --help' for more information." >&2;}
- { (exit 1); exit 1; }; };;
- --help | --hel | -h )
- echo "$ac_cs_usage"; exit 0 ;;
- --debug | --d* | -d )
+ --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+ echo "$ac_cs_version"; exit ;;
+ --debug | --debu | --deb | --de | --d | -d )
debug=: ;;
--file | --fil | --fi | --f )
$ac_shift
@@ -6552,18 +7549,24 @@ Try \`$0 --help' for more information." >&2;}
$ac_shift
CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
ac_need_defaults=false;;
+ --he | --h)
+ # Conflict between --help and --header
+ { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil | --si | --s)
ac_cs_silent=: ;;
# This is an error.
- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&5
-echo "$as_me: error: unrecognized option: $1
-Try \`$0 --help' for more information." >&2;}
+ -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; } ;;
- *) ac_config_targets="$ac_config_targets $1" ;;
+ *) ac_config_targets="$ac_config_targets $1"
+ ac_need_defaults=false ;;
esac
shift
@@ -6579,81 +7582,95 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
if \$ac_cs_recheck; then
- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ CONFIG_SHELL=$SHELL
+ export CONFIG_SHELL
+ exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
fi
_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+ echo "$ac_log"
+} >&5
+_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
#
-# INIT-COMMANDS section.
+# INIT-COMMANDS
#
-
AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
_ACEOF
-
-
cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
for ac_config_target in $ac_config_targets
do
- case "$ac_config_target" in
- # Handling of arguments.
- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
- "bin/Makefile" ) CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
- "etc/Makefile" ) CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;;
- "include/Makefile" ) CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
- "man/Makefile" ) CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
- "share/Makefile" ) CONFIG_FILES="$CONFIG_FILES share/Makefile" ;;
- "include/version.h" ) CONFIG_FILES="$CONFIG_FILES include/version.h" ;;
- "bin/control_rancid" ) CONFIG_FILES="$CONFIG_FILES bin/control_rancid" ;;
- "bin/par" ) CONFIG_FILES="$CONFIG_FILES bin/par" ;;
- "bin/rancid-fe" ) CONFIG_FILES="$CONFIG_FILES bin/rancid-fe" ;;
- "bin/alogin" ) CONFIG_FILES="$CONFIG_FILES bin/alogin" ;;
- "bin/arancid" ) CONFIG_FILES="$CONFIG_FILES bin/arancid" ;;
- "bin/blogin" ) CONFIG_FILES="$CONFIG_FILES bin/blogin" ;;
- "bin/brancid" ) CONFIG_FILES="$CONFIG_FILES bin/brancid" ;;
- "bin/cat5rancid" ) CONFIG_FILES="$CONFIG_FILES bin/cat5rancid" ;;
- "bin/clogin" ) CONFIG_FILES="$CONFIG_FILES bin/clogin" ;;
- "bin/rancid" ) CONFIG_FILES="$CONFIG_FILES bin/rancid" ;;
- "bin/cssrancid" ) CONFIG_FILES="$CONFIG_FILES bin/cssrancid" ;;
- "bin/elogin" ) CONFIG_FILES="$CONFIG_FILES bin/elogin" ;;
- "bin/erancid" ) CONFIG_FILES="$CONFIG_FILES bin/erancid" ;;
- "bin/f10rancid" ) CONFIG_FILES="$CONFIG_FILES bin/f10rancid" ;;
- "bin/flogin" ) CONFIG_FILES="$CONFIG_FILES bin/flogin" ;;
- "bin/francid" ) CONFIG_FILES="$CONFIG_FILES bin/francid" ;;
- "bin/fnrancid" ) CONFIG_FILES="$CONFIG_FILES bin/fnrancid" ;;
- "bin/jlogin" ) CONFIG_FILES="$CONFIG_FILES bin/jlogin" ;;
- "bin/jrancid" ) CONFIG_FILES="$CONFIG_FILES bin/jrancid" ;;
- "bin/jerancid" ) CONFIG_FILES="$CONFIG_FILES bin/jerancid" ;;
- "bin/hlogin" ) CONFIG_FILES="$CONFIG_FILES bin/hlogin" ;;
- "bin/hrancid" ) CONFIG_FILES="$CONFIG_FILES bin/hrancid" ;;
- "bin/htlogin" ) CONFIG_FILES="$CONFIG_FILES bin/htlogin" ;;
- "bin/htrancid" ) CONFIG_FILES="$CONFIG_FILES bin/htrancid" ;;
- "bin/mrancid" ) CONFIG_FILES="$CONFIG_FILES bin/mrancid" ;;
- "bin/nlogin" ) CONFIG_FILES="$CONFIG_FILES bin/nlogin" ;;
- "bin/nrancid" ) CONFIG_FILES="$CONFIG_FILES bin/nrancid" ;;
- "bin/nslogin" ) CONFIG_FILES="$CONFIG_FILES bin/nslogin" ;;
- "bin/nsrancid" ) CONFIG_FILES="$CONFIG_FILES bin/nsrancid" ;;
- "bin/prancid" ) CONFIG_FILES="$CONFIG_FILES bin/prancid" ;;
- "bin/rivlogin" ) CONFIG_FILES="$CONFIG_FILES bin/rivlogin" ;;
- "bin/rivrancid" ) CONFIG_FILES="$CONFIG_FILES bin/rivrancid" ;;
- "bin/rrancid" ) CONFIG_FILES="$CONFIG_FILES bin/rrancid" ;;
- "bin/tntlogin" ) CONFIG_FILES="$CONFIG_FILES bin/tntlogin" ;;
- "bin/tntrancid" ) CONFIG_FILES="$CONFIG_FILES bin/tntrancid" ;;
- "bin/xrancid" ) CONFIG_FILES="$CONFIG_FILES bin/xrancid" ;;
- "bin/zrancid" ) CONFIG_FILES="$CONFIG_FILES bin/zrancid" ;;
- "share/rtrfilter" ) CONFIG_FILES="$CONFIG_FILES share/rtrfilter" ;;
- "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
- "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
+ case $ac_config_target in
+ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
+ "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;;
+ "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+ "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+ "share/Makefile") CONFIG_FILES="$CONFIG_FILES share/Makefile" ;;
+ "include/version.h") CONFIG_FILES="$CONFIG_FILES include/version.h" ;;
+ "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
+ "bin/control_rancid") CONFIG_FILES="$CONFIG_FILES bin/control_rancid" ;;
+ "bin/par") CONFIG_FILES="$CONFIG_FILES bin/par" ;;
+ "bin/rancid-fe") CONFIG_FILES="$CONFIG_FILES bin/rancid-fe" ;;
+ "bin/agmrancid") CONFIG_FILES="$CONFIG_FILES bin/agmrancid" ;;
+ "bin/alogin") CONFIG_FILES="$CONFIG_FILES bin/alogin" ;;
+ "bin/arancid") CONFIG_FILES="$CONFIG_FILES bin/arancid" ;;
+ "bin/blogin") CONFIG_FILES="$CONFIG_FILES bin/blogin" ;;
+ "bin/brancid") CONFIG_FILES="$CONFIG_FILES bin/brancid" ;;
+ "bin/cat5rancid") CONFIG_FILES="$CONFIG_FILES bin/cat5rancid" ;;
+ "bin/clogin") CONFIG_FILES="$CONFIG_FILES bin/clogin" ;;
+ "bin/rancid") CONFIG_FILES="$CONFIG_FILES bin/rancid" ;;
+ "bin/cssrancid") CONFIG_FILES="$CONFIG_FILES bin/cssrancid" ;;
+ "bin/elogin") CONFIG_FILES="$CONFIG_FILES bin/elogin" ;;
+ "bin/erancid") CONFIG_FILES="$CONFIG_FILES bin/erancid" ;;
+ "bin/f10rancid") CONFIG_FILES="$CONFIG_FILES bin/f10rancid" ;;
+ "bin/flogin") CONFIG_FILES="$CONFIG_FILES bin/flogin" ;;
+ "bin/francid") CONFIG_FILES="$CONFIG_FILES bin/francid" ;;
+ "bin/fnrancid") CONFIG_FILES="$CONFIG_FILES bin/fnrancid" ;;
+ "bin/jlogin") CONFIG_FILES="$CONFIG_FILES bin/jlogin" ;;
+ "bin/jrancid") CONFIG_FILES="$CONFIG_FILES bin/jrancid" ;;
+ "bin/jerancid") CONFIG_FILES="$CONFIG_FILES bin/jerancid" ;;
+ "bin/hlogin") CONFIG_FILES="$CONFIG_FILES bin/hlogin" ;;
+ "bin/hrancid") CONFIG_FILES="$CONFIG_FILES bin/hrancid" ;;
+ "bin/htlogin") CONFIG_FILES="$CONFIG_FILES bin/htlogin" ;;
+ "bin/htrancid") CONFIG_FILES="$CONFIG_FILES bin/htrancid" ;;
+ "bin/mrancid") CONFIG_FILES="$CONFIG_FILES bin/mrancid" ;;
+ "bin/nlogin") CONFIG_FILES="$CONFIG_FILES bin/nlogin" ;;
+ "bin/nrancid") CONFIG_FILES="$CONFIG_FILES bin/nrancid" ;;
+ "bin/nslogin") CONFIG_FILES="$CONFIG_FILES bin/nslogin" ;;
+ "bin/nsrancid") CONFIG_FILES="$CONFIG_FILES bin/nsrancid" ;;
+ "bin/prancid") CONFIG_FILES="$CONFIG_FILES bin/prancid" ;;
+ "bin/rivlogin") CONFIG_FILES="$CONFIG_FILES bin/rivlogin" ;;
+ "bin/rivrancid") CONFIG_FILES="$CONFIG_FILES bin/rivrancid" ;;
+ "bin/rrancid") CONFIG_FILES="$CONFIG_FILES bin/rrancid" ;;
+ "bin/srancid") CONFIG_FILES="$CONFIG_FILES bin/srancid" ;;
+ "bin/tntlogin") CONFIG_FILES="$CONFIG_FILES bin/tntlogin" ;;
+ "bin/tntrancid") CONFIG_FILES="$CONFIG_FILES bin/tntrancid" ;;
+ "bin/xrancid") CONFIG_FILES="$CONFIG_FILES bin/xrancid" ;;
+ "bin/zrancid") CONFIG_FILES="$CONFIG_FILES bin/zrancid" ;;
+ "share/rtrfilter") CONFIG_FILES="$CONFIG_FILES share/rtrfilter" ;;
+
*) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
{ (exit 1); exit 1; }; };;
esac
done
+
# If the user did not use the arguments to specify the items to instantiate,
# then the envvar interface is used. Set only those that are not.
# We use the long form for the default assignment because of an extremely
@@ -6665,641 +7682,604 @@ if $ac_need_defaults; then
fi
# Have a temporary directory for convenience. Make it in the build tree
-# simply because there is no reason to put it here, and in addition,
+# simply because there is no reason against having it here, and in addition,
# creating and moving files from /tmp can sometimes cause problems.
-# Create a temporary directory, and hook for its removal unless debugging.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
$debug ||
{
- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ tmp=
+ trap 'exit_status=$?
+ { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
trap '{ (exit 1); exit 1; }' 1 2 13 15
}
-
# Create a (secure) tmp directory for tmp files.
{
- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
test -n "$tmp" && test -d "$tmp"
} ||
{
- tmp=./confstat$$-$RANDOM
- (umask 077 && mkdir $tmp)
+ tmp=./conf$$-$RANDOM
+ (umask 077 && mkdir "$tmp")
} ||
{
echo "$me: cannot create a temporary directory in ." >&2
{ (exit 1); exit 1; }
}
-_ACEOF
-
-cat >>$CONFIG_STATUS <<_ACEOF
-
#
-# CONFIG_FILES section.
+# Set up the sed scripts for CONFIG_FILES section.
#
# No need to generate the scripts if there are no CONFIG_FILES.
# This happens for instance when ./config.status config.h
-if test -n "\$CONFIG_FILES"; then
- # Protect against being on the right side of a sed subst in config.status.
- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
-s,@SHELL@,$SHELL,;t t
-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
-s,@exec_prefix@,$exec_prefix,;t t
-s,@prefix@,$prefix,;t t
-s,@program_transform_name@,$program_transform_name,;t t
-s,@bindir@,$bindir,;t t
-s,@sbindir@,$sbindir,;t t
-s,@libexecdir@,$libexecdir,;t t
-s,@datadir@,$datadir,;t t
-s,@sysconfdir@,$sysconfdir,;t t
-s,@sharedstatedir@,$sharedstatedir,;t t
-s,@localstatedir@,$localstatedir,;t t
-s,@libdir@,$libdir,;t t
-s,@includedir@,$includedir,;t t
-s,@oldincludedir@,$oldincludedir,;t t
-s,@infodir@,$infodir,;t t
-s,@mandir@,$mandir,;t t
-s,@build_alias@,$build_alias,;t t
-s,@host_alias@,$host_alias,;t t
-s,@target_alias@,$target_alias,;t t
-s,@DEFS@,$DEFS,;t t
-s,@ECHO_C@,$ECHO_C,;t t
-s,@ECHO_N@,$ECHO_N,;t t
-s,@ECHO_T@,$ECHO_T,;t t
-s,@LIBS@,$LIBS,;t t
-s,@VERSION@,$VERSION,;t t
-s,@PACKAGE@,$PACKAGE,;t t
-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
-s,@INSTALL_DATA@,$INSTALL_DATA,;t t
-s,@CYGPATH_W@,$CYGPATH_W,;t t
-s,@ACLOCAL@,$ACLOCAL,;t t
-s,@AUTOCONF@,$AUTOCONF,;t t
-s,@AUTOMAKE@,$AUTOMAKE,;t t
-s,@AUTOHEADER@,$AUTOHEADER,;t t
-s,@MAKEINFO@,$MAKEINFO,;t t
-s,@AMTAR@,$AMTAR,;t t
-s,@install_sh@,$install_sh,;t t
-s,@STRIP@,$STRIP,;t t
-s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
-s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
-s,@mkdir_p@,$mkdir_p,;t t
-s,@AWK@,$AWK,;t t
-s,@SET_MAKE@,$SET_MAKE,;t t
-s,@am__leading_dot@,$am__leading_dot,;t t
-s,@MAKE@,$MAKE,;t t
-s,@CC@,$CC,;t t
-s,@CFLAGS@,$CFLAGS,;t t
-s,@LDFLAGS@,$LDFLAGS,;t t
-s,@CPPFLAGS@,$CPPFLAGS,;t t
-s,@ac_ct_CC@,$ac_ct_CC,;t t
-s,@EXEEXT@,$EXEEXT,;t t
-s,@OBJEXT@,$OBJEXT,;t t
-s,@DEPDIR@,$DEPDIR,;t t
-s,@am__include@,$am__include,;t t
-s,@am__quote@,$am__quote,;t t
-s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
-s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
-s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
-s,@CCDEPMODE@,$CCDEPMODE,;t t
-s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
-s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s,@CPP@,$CPP,;t t
-s,@EGREP@,$EGREP,;t t
-s,@U@,$U,;t t
-s,@ANSI2KNR@,$ANSI2KNR,;t t
-s,@MAILPLUS@,$MAILPLUS,;t t
-s,@ADMINMAILPLUS@,$ADMINMAILPLUS,;t t
-s,@DIRNAME@,$DIRNAME,;t t
-s,@DIFF@,$DIFF,;t t
-s,@DIFF_CMD@,$DIFF_CMD,;t t
-s,@SENDMAIL@,$SENDMAIL,;t t
-s,@TAR@,$TAR,;t t
-s,@PERLV_PATH@,$PERLV_PATH,;t t
-s,@PERLV@,$PERLV,;t t
-s,@EXPECT_PATH@,$EXPECT_PATH,;t t
-s,@PING_PATH@,$PING_PATH,;t t
-s,@LG_PING_CMD@,$LG_PING_CMD,;t t
-s,@CVS@,$CVS,;t t
-s,@COMM@,$COMM,;t t
-s,@FIND@,$FIND,;t t
-s,@GREP@,$GREP,;t t
-s,@ID@,$ID,;t t
-s,@MKDIR@,$MKDIR,;t t
-s,@RSH@,$RSH,;t t
-s,@SORT@,$SORT,;t t
-s,@SSH@,$SSH,;t t
-s,@TELNET@,$TELNET,;t t
-s,@TOUCH@,$TOUCH,;t t
-s,@ENV_PATH@,$ENV_PATH,;t t
-s,@LIBOBJS@,$LIBOBJS,;t t
-s,@LTLIBOBJS@,$LTLIBOBJS,;t t
-CEOF
-
-_ACEOF
-
- cat >>$CONFIG_STATUS <<\_ACEOF
- # Split the substitutions into bite-sized pieces for seds with
- # small command number limits, like on Digital OSF/1 and HP-UX.
- ac_max_sed_lines=48
- ac_sed_frag=1 # Number of current file.
- ac_beg=1 # First line for current file.
- ac_end=$ac_max_sed_lines # Line after last line for current file.
- ac_more_lines=:
- ac_sed_cmds=
- while $ac_more_lines; do
- if test $ac_beg -gt 1; then
- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- else
- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
- fi
- if test ! -s $tmp/subs.frag; then
- ac_more_lines=false
- else
- # The purpose of the label and of the branching condition is to
- # speed up the sed processing (if there are no `@' at all, there
- # is no need to browse any of the substitutions).
- # These are the two extra sed commands mentioned above.
- (echo ':t
- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
- else
- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
- fi
- ac_sed_frag=`expr $ac_sed_frag + 1`
- ac_beg=$ac_end
- ac_end=`expr $ac_end + $ac_max_sed_lines`
- fi
- done
- if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+VERSION!$VERSION$ac_delim
+PACKAGE!$PACKAGE$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+am__isrc!$am__isrc$ac_delim
+CYGPATH_W!$CYGPATH_W$ac_delim
+ACLOCAL!$ACLOCAL$ac_delim
+AUTOCONF!$AUTOCONF$ac_delim
+AUTOMAKE!$AUTOMAKE$ac_delim
+AUTOHEADER!$AUTOHEADER$ac_delim
+MAKEINFO!$MAKEINFO$ac_delim
+install_sh!$install_sh$ac_delim
+STRIP!$STRIP$ac_delim
+INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim
+mkdir_p!$mkdir_p$ac_delim
+AWK!$AWK$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+am__leading_dot!$am__leading_dot$ac_delim
+AMTAR!$AMTAR$ac_delim
+am__tar!$am__tar$ac_delim
+am__untar!$am__untar$ac_delim
+MAKE!$MAKE$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+DEPDIR!$DEPDIR$ac_delim
+am__include!$am__include$ac_delim
+am__quote!$am__quote$ac_delim
+AMDEP_TRUE!$AMDEP_TRUE$ac_delim
+AMDEP_FALSE!$AMDEP_FALSE$ac_delim
+AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
+CCDEPMODE!$CCDEPMODE$ac_delim
+am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
+am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+U!$U$ac_delim
+ANSI2KNR!$ANSI2KNR$ac_delim
+MK_LCLSTATEDIR_TRUE!$MK_LCLSTATEDIR_TRUE$ac_delim
+MK_LCLSTATEDIR_FALSE!$MK_LCLSTATEDIR_FALSE$ac_delim
+CONF_INSTALL_TRUE!$CONF_INSTALL_TRUE$ac_delim
+CONF_INSTALL_FALSE!$CONF_INSTALL_FALSE$ac_delim
+RCSSYS!$RCSSYS$ac_delim
+MAILPLUS!$MAILPLUS$ac_delim
+ADMINMAILPLUS!$ADMINMAILPLUS$ac_delim
+DIRNAME!$DIRNAME$ac_delim
+DIFF!$DIFF$ac_delim
+DIFF_CMD!$DIFF_CMD$ac_delim
+SENDMAIL!$SENDMAIL$ac_delim
+TAR!$TAR$ac_delim
+PERLV_PATH!$PERLV_PATH$ac_delim
+PERLV!$PERLV$ac_delim
+EXPECT_PATH!$EXPECT_PATH$ac_delim
+PING_PATH!$PING_PATH$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
fi
-fi # test -n "$CONFIG_FILES"
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+CEOF$ac_eof
+_ACEOF
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+ cat >conf$$subs.sed <<_ACEOF
+LG_PING_CMD!$LG_PING_CMD$ac_delim
+CVS!$CVS$ac_delim
+SVN!$SVN$ac_delim
+COMM!$COMM$ac_delim
+FIND!$FIND$ac_delim
+ID!$ID$ac_delim
+MKDIR!$MKDIR$ac_delim
+RSH!$RSH$ac_delim
+SORT!$SORT$ac_delim
+SSH!$SSH$ac_delim
+TELNET!$TELNET$ac_delim
+TOUCH!$TOUCH$ac_delim
+ENV_PATH!$ENV_PATH$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+ if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 15; then
+ break
+ elif $ac_last_try; then
+ { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+ { (exit 1); exit 1; }; }
+ else
+ ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+ fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+ ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+ ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[ ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[ ]*$//
+}'
+fi
+
cat >>$CONFIG_STATUS <<\_ACEOF
-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS
+do
+ case $ac_tag in
+ :[FHLC]) ac_mode=$ac_tag; continue;;
+ esac
+ case $ac_mode$ac_tag in
+ :[FHL]*:*);;
+ :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+ { (exit 1); exit 1; }; };;
+ :[FH]-) ac_tag=-:-;;
+ :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+ esac
+ ac_save_IFS=$IFS
+ IFS=:
+ set x $ac_tag
+ IFS=$ac_save_IFS
+ shift
+ ac_file=$1
+ shift
+
+ case $ac_mode in
+ :L) ac_source=$1;;
+ :[FH])
+ ac_file_inputs=
+ for ac_f
+ do
+ case $ac_f in
+ -) ac_f="$tmp/stdin";;
+ *) # Look for the file first in the build tree, then in the source tree
+ # (if the path is not absolute). The absolute path cannot be DOS-style,
+ # because $ac_f cannot contain `:'.
+ test -f "$ac_f" ||
+ case $ac_f in
+ [\\/$]*) false;;
+ *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+ esac ||
+ { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+ { (exit 1); exit 1; }; };;
+ esac
+ ac_file_inputs="$ac_file_inputs $ac_f"
+ done
+
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ configure_input="Generated from "`IFS=:
+ echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+ if test x"$ac_file" != x-; then
+ configure_input="$ac_file. $configure_input"
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ fi
+
+ case $ac_tag in
+ *:-:* | *:-) cat >"$tmp/stdin";;
+ esac
+ ;;
esac
- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+ ac_dir=`$as_dirname -- "$ac_file" ||
$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$ac_file" : 'X\(//\)[^/]' \| \
X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir="$ac_dir"
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
-
ac_builddir=.
-if test "$ac_dir" != .; then
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
+ # A ".." for each directory in $ac_dir_suffix.
+ ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+ case $ac_top_builddir_sub in
+ "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+ *) ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+ esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
case $srcdir in
- .) # No --srcdir option. We are building in place.
+ .) # We are building in place.
ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_top_srcdir=$ac_top_builddir_sub
+ ac_abs_top_srcdir=$ac_pwd ;;
+ [\\/]* | ?:[\\/]* ) # Absolute name.
ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
+ ac_top_srcdir=$srcdir
+ ac_abs_top_srcdir=$srcdir ;;
+ *) # Relative name.
+ ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_build_prefix$srcdir
+ ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
+ case $ac_mode in
+ :F)
+ #
+ # CONFIG_FILE
+ #
case $INSTALL in
[\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
- *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
+ *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
esac
+ ac_MKDIR_P=$MKDIR_P
+ case $MKDIR_P in
+ [\\/$]* | ?:[\\/]* ) ;;
+ */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+ esac
+_ACEOF
- if test x"$ac_file" != x-; then
- { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
- rm -f "$ac_file"
- fi
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- configure_input=
- else
- configure_input="$ac_file. "
- fi
- configure_input=$configure_input"Generated from `echo $ac_file_in |
- sed 's,.*/,,'` by configure."
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+ p
+ q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+ { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
+ ac_datarootdir_hack='
+ s&@datadir@&$datadir&g
+ s&@docdir@&$docdir&g
+ s&@infodir@&$infodir&g
+ s&@localedir@&$localedir&g
+ s&@mandir@&$mandir&g
+ s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
sed "$ac_vpsub
$extrasub
_ACEOF
cat >>$CONFIG_STATUS <<\_ACEOF
:t
/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
-s,@configure_input@,$configure_input,;t t
-s,@srcdir@,$ac_srcdir,;t t
-s,@abs_srcdir@,$ac_abs_srcdir,;t t
-s,@top_srcdir@,$ac_top_srcdir,;t t
-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
-s,@builddir@,$ac_builddir,;t t
-s,@abs_builddir@,$ac_abs_builddir,;t t
-s,@top_builddir@,$ac_top_builddir,;t t
-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
-s,@INSTALL@,$ac_INSTALL,;t t
-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
- rm -f $tmp/stdin
- if test x"$ac_file" != x-; then
- mv $tmp/out $ac_file
- else
- cat $tmp/out
- rm -f $tmp/out
- fi
-
- # Run the commands associated with the file.
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+ { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+ { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+ { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined. Please make sure it is defined." >&2;}
+
+ rm -f "$tmp/stdin"
case $ac_file in
- bin/control_rancid ) chmod a+x $ac_file ;;
- bin/par ) chmod a+x $ac_file ;;
- bin/rancid-fe ) chmod a+x $ac_file ;;
- bin/alogin ) chmod a+x $ac_file ;;
- bin/arancid ) chmod a+x $ac_file ;;
- bin/blogin ) chmod a+x $ac_file ;;
- bin/brancid ) chmod a+x $ac_file ;;
- bin/cat5rancid ) chmod a+x $ac_file ;;
- bin/clogin ) chmod a+x $ac_file ;;
- bin/rancid ) chmod a+x $ac_file ;;
- bin/cssrancid ) chmod a+x $ac_file ;;
- bin/elogin ) chmod a+x $ac_file ;;
- bin/erancid ) chmod a+x $ac_file ;;
- bin/f10rancid ) chmod a+x $ac_file ;;
- bin/flogin ) chmod a+x $ac_file ;;
- bin/francid ) chmod a+x $ac_file ;;
- bin/fnrancid ) chmod a+x $ac_file ;;
- bin/jlogin ) chmod a+x $ac_file ;;
- bin/jrancid ) chmod a+x $ac_file ;;
- bin/jerancid ) chmod a+x $ac_file ;;
- bin/hlogin ) chmod a+x $ac_file ;;
- bin/hrancid ) chmod a+x $ac_file ;;
- bin/htlogin ) chmod a+x $ac_file ;;
- bin/htrancid ) chmod a+x $ac_file ;;
- bin/mrancid ) chmod a+x $ac_file ;;
- bin/nlogin ) chmod a+x $ac_file ;;
- bin/nrancid ) chmod a+x $ac_file ;;
- bin/nslogin ) chmod a+x $ac_file ;;
- bin/nsrancid ) chmod a+x $ac_file ;;
- bin/prancid ) chmod a+x $ac_file ;;
- bin/rivlogin ) chmod a+x $ac_file ;;
- bin/rivrancid ) chmod a+x $ac_file ;;
- bin/rrancid ) chmod a+x $ac_file ;;
- bin/tntlogin ) chmod a+x $ac_file ;;
- bin/tntrancid ) chmod a+x $ac_file ;;
- bin/xrancid ) chmod a+x $ac_file ;;
- bin/zrancid ) chmod a+x $ac_file ;;
- share/rtrfilter ) chmod a+x $ac_file ;;
+ -) cat "$tmp/out"; rm -f "$tmp/out";;
+ *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
esac
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_HEADER section.
-#
-
-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
-# NAME is the cpp macro being defined and VALUE is the value it is being given.
-#
-# ac_d sets the value in "#define NAME VALUE" lines.
-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
-ac_dB='[ ].*$,\1#\2'
+ ;;
+ :H)
+ #
+ # CONFIG_HEADER
+ #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status. If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless. But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*'
+ac_dB='\\)[ (].*,\\1define\\2'
ac_dC=' '
-ac_dD=',;t'
-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)'
-ac_uB='$,\1#\2define\3'
-ac_uC=' '
-ac_uD=',;t'
-
-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
- case $ac_file in
- - | *:- | *:-:* ) # input from stdin
- cat >$tmp/stdin
- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
- * ) ac_file_in=$ac_file.in ;;
- esac
-
- test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
-echo "$as_me: creating $ac_file" >&6;}
-
- # First look for the input files in the build tree, otherwise in the
- # src tree.
- ac_file_inputs=`IFS=:
- for f in $ac_file_in; do
- case $f in
- -) echo $tmp/stdin ;;
- [\\/$]*)
- # Absolute (can't be DOS-style, as IFS=:)
- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- # Do quote $f, to prevent DOS paths from being IFS'd.
- echo "$f";;
- *) # Relative
- if test -f "$f"; then
- # Build tree
- echo "$f"
- elif test -f "$srcdir/$f"; then
- # Source tree
- echo "$srcdir/$f"
- else
- # /dev/null tree
- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
-echo "$as_me: error: cannot find input file: $f" >&2;}
- { (exit 1); exit 1; }; }
- fi;;
- esac
- done` || { (exit 1); exit 1; }
- # Remove the trailing spaces.
- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
-
-_ACEOF
-
-# Transform confdefs.h into two sed scripts, `conftest.defines' and
-# `conftest.undefs', that substitutes the proper values into
-# config.h.in to produce config.h. The first handles `#define'
-# templates, and the second `#undef' templates.
-# And first: Protect against being on the right side of a sed subst in
-# config.status. Protect against being in an unquoted here document
-# in config.status.
-rm -f conftest.defines conftest.undefs
-# Using a here document instead of a string reduces the quoting nightmare.
-# Putting comments in sed scripts is not portable.
-#
-# `end' is used to avoid that the second main sed command (meant for
-# 0-ary CPP macros) applies to n-ary macro definitions.
-# See the Autoconf documentation for `clear'.
-cat >confdef2sed.sed <<\_ACEOF
-s/[\\&,]/\\&/g
-s,[\\$`],\\&,g
-t clear
-: clear
-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
-t end
-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
-: end
-_ACEOF
-# If some macros were called several times there might be several times
-# the same #defines, which is useless. Nevertheless, we may not want to
-# sort them, since we want the *last* AC-DEFINE to be honored.
-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
-rm -f confdef2sed.sed
-
-# This sed command replaces #undef with comments. This is necessary, for
+ac_dD=' ,'
+
+uniq confdefs.h |
+ sed -n '
+ t rset
+ :rset
+ s/^[ ]*#[ ]*define[ ][ ]*//
+ t ok
+ d
+ :ok
+ s/[\\&,]/\\&/g
+ s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+ s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+ ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments. This is necessary, for
# example, in the case of _POSIX_SOURCE, which is predefined and required
# on some systems where configure will not decide to define it.
-cat >>conftest.undefs <<\_ACEOF
-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
-_ACEOF
-
-# Break up conftest.defines because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
-echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
-echo ' :' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.defines >/dev/null
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[ #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
do
- # Write a limited-size here document to $tmp/defines.sed.
- echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
- # Speed up: don't consider the non `#define' lines.
- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
- # Work around the forget-to-reset-the-flag bug.
- echo 't clr' >>$CONFIG_STATUS
- echo ': clr' >>$CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ # Write a here document:
+ cat >>$CONFIG_STATUS <<_ACEOF
+ # First, check the format of the line:
+ cat >"\$tmp/defines.sed" <<\\CEOF
+/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def
+/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def
+b
+:def
+_ACEOF
+ sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
echo 'CEOF
- sed -f $tmp/defines.sed $tmp/in >$tmp/out
- rm -f $tmp/in
- mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+ ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+ sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+ grep . conftest.tail >/dev/null || break
rm -f conftest.defines
mv conftest.tail conftest.defines
done
-rm -f conftest.defines
-echo ' fi # grep' >>$CONFIG_STATUS
-echo >>$CONFIG_STATUS
-
-# Break up conftest.undefs because some shells have a limit on the size
-# of here documents, and old seds have small limits too (100 cmds).
-echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
-rm -f conftest.tail
-while grep . conftest.undefs >/dev/null
-do
- # Write a limited-size here document to $tmp/undefs.sed.
- echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
- # Speed up: don't consider the non `#undef'
- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
- # Work around the forget-to-reset-the-flag bug.
- echo 't clr' >>$CONFIG_STATUS
- echo ': clr' >>$CONFIG_STATUS
- sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS
- echo 'CEOF
- sed -f $tmp/undefs.sed $tmp/in >$tmp/out
- rm -f $tmp/in
- mv $tmp/out $tmp/in
-' >>$CONFIG_STATUS
- sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
- rm -f conftest.undefs
- mv conftest.tail conftest.undefs
-done
-rm -f conftest.undefs
+rm -f conftest.defines conftest.tail
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
cat >>$CONFIG_STATUS <<\_ACEOF
- # Let's still pretend it is `configure' which instantiates (i.e., don't
- # use $as_me), people would be surprised to read:
- # /* config.h. Generated by config.status. */
- if test x"$ac_file" = x-; then
- echo "/* Generated by configure. */" >$tmp/config.h
- else
- echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
- fi
- cat $tmp/in >>$tmp/config.h
- rm -f $tmp/in
if test x"$ac_file" != x-; then
- if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ echo "/* $configure_input */" >"$tmp/config.h"
+ cat "$ac_result" >>"$tmp/config.h"
+ if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
{ echo "$as_me:$LINENO: $ac_file is unchanged" >&5
echo "$as_me: $ac_file is unchanged" >&6;}
else
- ac_dir=`(dirname "$ac_file") 2>/dev/null ||
-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_file" : 'X\(//\)[^/]' \| \
- X"$ac_file" : 'X\(//\)$' \| \
- X"$ac_file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
rm -f $ac_file
- mv $tmp/config.h $ac_file
+ mv "$tmp/config.h" $ac_file
fi
else
- cat $tmp/config.h
- rm -f $tmp/config.h
+ echo "/* $configure_input */"
+ cat "$ac_result"
fi
+ rm -f "$tmp/out12"
# Compute $ac_file's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
@@ -7310,135 +8290,39 @@ for _am_header in $config_headers :; do
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
-echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+echo "timestamp for $ac_file" >`$as_dirname -- $ac_file ||
$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X$ac_file : 'X\(//\)[^/]' \| \
X$ac_file : 'X\(//\)$' \| \
- X$ac_file : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X$ac_file : 'X\(/\)' \| . 2>/dev/null ||
echo X$ac_file |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`/stamp-h$_am_stamp_count
-done
-_ACEOF
-cat >>$CONFIG_STATUS <<\_ACEOF
-
-#
-# CONFIG_COMMANDS section.
-#
-for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
- ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
- ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
- ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
-$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$ac_dest" : 'X\(//\)[^/]' \| \
- X"$ac_dest" : 'X\(//\)$' \| \
- X"$ac_dest" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$ac_dest" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p "$ac_dir"
- else
- as_dir="$ac_dir"
- as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$as_dir" : 'X\(//\)[^/]' \| \
- X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
-echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
- { (exit 1); exit 1; }; }; }
-
- ac_builddir=.
-
-if test "$ac_dir" != .; then
- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
- # A "../" for each directory in $ac_dir_suffix.
- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
-else
- ac_dir_suffix= ac_top_builddir=
-fi
-
-case $srcdir in
- .) # No --srcdir option. We are building in place.
- ac_srcdir=.
- if test -z "$ac_top_builddir"; then
- ac_top_srcdir=.
- else
- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
- fi ;;
- [\\/]* | ?:[\\/]* ) # Absolute path.
- ac_srcdir=$srcdir$ac_dir_suffix;
- ac_top_srcdir=$srcdir ;;
- *) # Relative path.
- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
- ac_top_srcdir=$ac_top_builddir$srcdir ;;
-esac
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
-# Do not use `cd foo && pwd` to compute absolute paths, because
-# the directories may not exist.
-case `pwd` in
-.) ac_abs_builddir="$ac_dir";;
-*)
- case "$ac_dir" in
- .) ac_abs_builddir=`pwd`;;
- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";;
- *) ac_abs_builddir=`pwd`/"$ac_dir";;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_builddir=${ac_top_builddir}.;;
-*)
- case ${ac_top_builddir}. in
- .) ac_abs_top_builddir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;;
- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_srcdir=$ac_srcdir;;
-*)
- case $ac_srcdir in
- .) ac_abs_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;;
- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;;
- esac;;
-esac
-case $ac_abs_builddir in
-.) ac_abs_top_srcdir=$ac_top_srcdir;;
-*)
- case $ac_top_srcdir in
- .) ac_abs_top_srcdir=$ac_abs_builddir;;
- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;;
- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;;
- esac;;
-esac
+ :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5
+echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+ esac
- { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
-echo "$as_me: executing $ac_dest commands" >&6;}
- case $ac_dest in
- depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ case $ac_file$ac_mode in
+ "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
@@ -7446,94 +8330,166 @@ echo "$as_me: executing $ac_dest commands" >&6;}
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
- # So let's grep whole file.
- if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
- dirpart=`(dirname "$mf") 2>/dev/null ||
+ # Grep'ing the whole file is not good either: AIX grep has a line
+ # limit of 2048, but all sed's we know have understand at least 4000.
+ if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then
+ dirpart=`$as_dirname -- "$mf" ||
$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$mf" : 'X\(//\)[^/]' \| \
X"$mf" : 'X\(//\)$' \| \
- X"$mf" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$mf" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
else
continue
fi
- grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
- # Extract the definition of DEP_FILES from the Makefile without
- # running `make'.
- DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ # Extract the definition of DEPDIR, am__include, and am__quote
+ # from the Makefile without running `make'.
+ DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
+ am__include=`sed -n 's/^am__include = //p' < "$mf"`
+ test -z "am__include" && continue
+ am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n -e '/^U = / s///p' < "$mf"`
- test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
- # We invoke sed twice because it is the simplest approach to
- # changing $(DEPDIR) to its actual value in the expansion.
- for file in `sed -n -e '
- /^DEP_FILES = .*\\\\$/ {
- s/^DEP_FILES = //
- :loop
- s/\\\\$//
- p
- n
- /\\\\$/ b loop
- p
- }
- /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ U=`sed -n 's/^U = //p' < "$mf"`
+ # Find all dependency output files, they are included files with
+ # $(DEPDIR) in their names. We invoke sed twice because it is the
+ # simplest approach to changing $(DEPDIR) to its actual value in the
+ # expansion.
+ for file in `sed -n "
+ s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
- fdir=`(dirname "$file") 2>/dev/null ||
+ fdir=`$as_dirname -- "$file" ||
$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$file" : 'X\(//\)[^/]' \| \
X"$file" : 'X\(//\)$' \| \
- X"$file" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$file" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$file" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
- { if $as_mkdir_p; then
- mkdir -p $dirpart/$fdir
- else
- as_dir=$dirpart/$fdir
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ { as_dir=$dirpart/$fdir
+ case $as_dir in #(
+ -*) as_dir=./$as_dir;;
+ esac
+ test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
as_dirs=
- while test ! -d "$as_dir"; do
- as_dirs="$as_dir $as_dirs"
- as_dir=`(dirname "$as_dir") 2>/dev/null ||
+ while :; do
+ case $as_dir in #(
+ *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+ *) as_qdir=$as_dir;;
+ esac
+ as_dirs="'$as_qdir' $as_dirs"
+ as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
- X"$as_dir" : 'X\(/\)' \| \
- . : '\(.\)' 2>/dev/null ||
+ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$as_dir" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
- /^X\(\/\/\)[^/].*/{ s//\1/; q; }
- /^X\(\/\/\)$/{ s//\1/; q; }
- /^X\(\/\).*/{ s//\1/; q; }
- s/.*/./; q'`
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'`
+ test -d "$as_dir" && break
done
- test ! -n "$as_dirs" || mkdir $as_dirs
- fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
-echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ test -z "$as_dirs" || eval "mkdir $as_dirs"
+ } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
{ (exit 1); exit 1; }; }; }
-
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
;;
+ "bin/control_rancid":F) chmod a+x $ac_file ;;
+ "bin/par":F) chmod a+x $ac_file ;;
+ "bin/rancid-fe":F) chmod a+x $ac_file ;;
+ "bin/agmrancid":F) chmod a+x $ac_file ;;
+ "bin/alogin":F) chmod a+x $ac_file ;;
+ "bin/arancid":F) chmod a+x $ac_file ;;
+ "bin/blogin":F) chmod a+x $ac_file ;;
+ "bin/brancid":F) chmod a+x $ac_file ;;
+ "bin/cat5rancid":F) chmod a+x $ac_file ;;
+ "bin/clogin":F) chmod a+x $ac_file ;;
+ "bin/rancid":F) chmod a+x $ac_file ;;
+ "bin/cssrancid":F) chmod a+x $ac_file ;;
+ "bin/elogin":F) chmod a+x $ac_file ;;
+ "bin/erancid":F) chmod a+x $ac_file ;;
+ "bin/f10rancid":F) chmod a+x $ac_file ;;
+ "bin/flogin":F) chmod a+x $ac_file ;;
+ "bin/francid":F) chmod a+x $ac_file ;;
+ "bin/fnrancid":F) chmod a+x $ac_file ;;
+ "bin/jlogin":F) chmod a+x $ac_file ;;
+ "bin/jrancid":F) chmod a+x $ac_file ;;
+ "bin/jerancid":F) chmod a+x $ac_file ;;
+ "bin/hlogin":F) chmod a+x $ac_file ;;
+ "bin/hrancid":F) chmod a+x $ac_file ;;
+ "bin/htlogin":F) chmod a+x $ac_file ;;
+ "bin/htrancid":F) chmod a+x $ac_file ;;
+ "bin/mrancid":F) chmod a+x $ac_file ;;
+ "bin/nlogin":F) chmod a+x $ac_file ;;
+ "bin/nrancid":F) chmod a+x $ac_file ;;
+ "bin/nslogin":F) chmod a+x $ac_file ;;
+ "bin/nsrancid":F) chmod a+x $ac_file ;;
+ "bin/prancid":F) chmod a+x $ac_file ;;
+ "bin/rivlogin":F) chmod a+x $ac_file ;;
+ "bin/rivrancid":F) chmod a+x $ac_file ;;
+ "bin/rrancid":F) chmod a+x $ac_file ;;
+ "bin/srancid":F) chmod a+x $ac_file ;;
+ "bin/tntlogin":F) chmod a+x $ac_file ;;
+ "bin/tntrancid":F) chmod a+x $ac_file ;;
+ "bin/xrancid":F) chmod a+x $ac_file ;;
+ "bin/zrancid":F) chmod a+x $ac_file ;;
+ "share/rtrfilter":F) chmod a+x $ac_file ;;
+
esac
-done
-_ACEOF
+done # for ac_tag
-cat >>$CONFIG_STATUS <<\_ACEOF
{ (exit 0); exit 0; }
_ACEOF
diff --git a/configure.in b/configure.in
index 597b49e..4636e94 100644
--- a/configure.in
+++ b/configure.in
@@ -41,16 +41,54 @@ AC_C_STRINGIZE
# check includes/headers
AC_HEADER_STDC
-AC_CHECK_HEADERS(limits.h memory.h siginfo.h string.h strings.h unistd.h)
-
-AC_CHECK_HEADERS(errno.h fcntl.h sys/types.h sys/wait.h)
-dnl AC_CHECK_HEADERS(errno.h stdlib.h sys/types.h sys/wait.h)
-dnl AC_CHECK_HEADERS(malloc.h)
+AC_CHECK_HEADERS(errno.h fcntl.h limits.h pty.h malloc.h memory.h siginfo.h \
+ string.h strings.h stropts.h sys/types.h sys/wait.h unistd.h \
+ util.h)
AC_CHECK_HEADERS(sysexits.h)
# check functions
-AC_CHECK_FUNCS(memcpy memmove memset bcopy bzero strerror strchr strrchr \
- strstr strtok strrtok index rindex)
+AC_CHECK_FUNCS(memcpy memmove memset strerror strchr \
+ strrchr strstr strtok strrtok index rindex unsetenv)
+AC_CHECK_FUNCS(openpty, openpty=1, openpty=0)
+# openlog() is not in the default libraries. See if it is in some other lib.
+if test $openpty = 0; then
+ for lib in util; do
+ AC_CHECK_LIB($lib, openpty, [AC_DEFINE(HAVE_OPENPTY)
+ LIBS="$LIBS -l$lib"; openpty=1; break])
+ done
+fi
+# If we dont have openpty, then look for /dev/ptmx for use by our own
+# openpty().
+if test $openpty = 0; then
+ # This check (partially) comes from expect's configure
+ AC_MSG_CHECKING([for SVR4 style pty allocation])
+ AH_TEMPLATE(HAVE_PTMX, "define this if your o/s has /dev/ptmx")
+ if test -r /dev/ptmx ; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_PTMX)
+ # Some systems need libpt.a to use /dev/ptmx
+ AC_CHECK_FUNCS(ptsname)
+ if test $ac_cv_func_ptsname+set != set; then
+ # ptsname is not in the default libraries.
+ for lib in pt; do
+ AC_CHECK_LIB($lib, ptsname, [LIBS="$LIBS -l$lib"; break])
+ done
+ fi
+ else
+ AC_MSG_RESULT(no)
+ fi
+ # In OSF/1 case, SVR4 are somewhat different.
+ # Gregory Depp <depp@osf.org> 17Aug93
+ AC_MSG_CHECKING([for OSF/1 style pty allocation])
+ AH_TEMPLATE(HAVE_PTMX_OSF, "define this for OSF/1 ptmx")
+ if test -r /dev/ptmx_bsd ; then
+ AC_DEFINE(HAVE_PTMX_OSF)
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+
dnl AC_FUNC_VPRINTF
# type checks
@@ -59,6 +97,52 @@ AC_TYPE_SIZE_T
# Package-specific options/knobs
#
+# Check if user wants us to create LOCALSTATEDIR. If it's a package-system,
+# they might create it themselves for book-keeping sake; eg: NetBSD
+AC_MSG_CHECKING([whether to create the local state directory at install time])
+AC_ARG_ENABLE(mk-localstatedir,
+ AS_HELP_STRING([--enable-mk-localstatedir], [enable creation of the local state directory at install time (default: yes)]),
+[if test "$enable_mk_localstatedir" = yes; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi],
+[AC_MSG_RESULT(yes)
+ enable_mk_localstatedir="yes"
+])
+AM_CONDITIONAL([MK_LCLSTATEDIR], [test "${enable_mk_localstatedir}" = yes])
+
+# Check if user wants us to install sample configurations into the sysconfdir.
+AC_MSG_CHECKING([whether to install sample .conf files in sysconfdir])
+AC_ARG_ENABLE(conf-install,
+ AS_HELP_STRING([--enable-conf-install], [enable install of sample .conf files in sysconfdir (default: yes)]),
+[if test "$enable_conf_install" = yes; then
+ AC_MSG_RESULT(yes)
+else
+ AC_MSG_RESULT(no)
+fi],
+[AC_MSG_RESULT(yes)
+ enable_conf_install="yes"
+])
+AM_CONDITIONAL([CONF_INSTALL], [test "${enable_conf_install}" = yes])
+
+# Configure for subversion revision control system instead of CVS.
+AC_MSG_CHECKING([whether subversion])
+AC_ARG_ENABLE(svn,
+ AS_HELP_STRING([--enable-svn], [enable use of subversion instead of cvs]),
+[if test "$enable_svn" = yes; then
+ AC_MSG_RESULT(yes)
+ RCSSYS="svn"
+else
+ AC_MSG_RESULT(no)
+ RCSSYS="cvs"
+fi],
+[AC_MSG_RESULT(no)
+ RCSSYS="cvs"
+])
+AC_SUBST(RCSSYS)
+rd_cv_RCSSYS=$RCSSYS
+
# Check for a preference for using mail addresses like rancid+group
# instead of the standard rancid-group
AC_MSG_CHECKING([whether mail addresses should be in the rancid+ form])
@@ -81,49 +165,64 @@ rd_cv_MAILPLUS=$MAILPLUS
# Check for a preference for using mail addresses like rancid+admin-group
# instead of the standard rancid-admin-group
-AC_MSG_CHECKING([whether admin mail addresses should be in the rancid+ form])
+AC_MSG_CHECKING([whether admin mail addresses should be in the rancid-admin+ form])
AC_ARG_ENABLE(adminmail-plus,
AS_HELP_STRING([--enable-adminmail-plus], [enable mail to rancid-admin+ addresses, instead of rancid-admin-]),
[if test "$enable_adminmail_plus" = yes; then
- AC_MSG_RESULT(yes)
+ AC_MSG_RESULT([rancid-admin+])
ADMINMAILPLUS="rancid-admin+"
AC_SUBST(ADMINMAILPLUS)
else
- AC_MSG_RESULT(no)
+ AC_MSG_RESULT([${MAILPLUS}admin-])
ADMINMAILPLUS="${MAILPLUS}admin-"
AC_SUBST(ADMINMAILPLUS)
fi],
-[AC_MSG_RESULT(no)
+[AC_MSG_RESULT([${MAILPLUS}admin-])
ADMINMAILPLUS="${MAILPLUS}admin-"
AC_SUBST(ADMINMAILPLUS)
])
rd_cv_ADMINMAILPLUS=$ADMINMAILPLUS
AC_PATH_PROG(DIRNAME,dirname,no)
+
# locate GNU diff (one supporting the -u option)
-AC_PATH_PROG(DIFF,diff,no, /usr/local/bin:/usr/gnu/bin:/usr/bin:/usr/contrib/bin)
-if test $DIFF = no; then
- unset ac_cv_path_DIFF
- AC_MSG_ERROR([can't locate diff.])
-else
- $DIFF -u /dev/null /dev/null > /dev/null 2>&1
- if test $? -ne 0; then
- $DIFF -C 2 /dev/null /dev/null > /dev/null 2>&1
+AC_MSG_CHECKING([for a diff(1) that supports -u])
+_DIFF_PATH=`echo $PATH:${prefix}/bin:/usr/bin:/usr/pkg/bin:/usr/local/bin:/usr/gnu/bin:/usr/contrib/bin | sed -e 's/:/ /g'`
+for _diff in ${_DIFF_PATH} ;
+do
+ if test -e ${_diff}/diff ; then
+ ${_diff}/diff -u -4 /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
- $DIFF -c2 /dev/null /dev/null > /dev/null 2>&1
+ # linux/gnu shit has to change options that have been around
+ # since organized religion; see if -U 4 works.
+ ${_diff}/diff -U 4 /dev/null /dev/null > /dev/null 2>&1
if test $? -ne 0; then
- AC_MSG_ERROR([can't locate a diff which accepts the -u option.])
- exit 1
+ if test "${ADIFF}" == "" ; then
+ ADIFF="${_diff}/diff"
+ ADIFF_CMD="diff -c -4"
+ fi
else
- DIFF_CMD="diff -c4"
+ DIFF="${_diff}/diff"
+ DIFF_CMD="diff -U 4"
+ break
fi
else
- DIFF_CMD="diff -C 4"
+ DIFF="${_diff}/diff"
+ DIFF_CMD="diff -u -4"
+ break
fi
- else
- DIFF_CMD="diff -u -4"
fi
+done
+if test "$DIFF" = "" ; then
+ DIFF=$ADIFF
+ DIFF_CMD=$ADIFF_CMD
fi
+if test "$DIFF" = "" ; then
+ AC_MSG_ERROR([can't locate diff.])
+fi
+AC_MSG_RESULT([${DIFF_CMD}])
+rd_cv_DIFF=$DIFF
+AC_SUBST(DIFF)
rd_cv_DIFF_CMD=$DIFF_CMD
AC_SUBST(DIFF_CMD)
@@ -193,8 +292,13 @@ rd_cv_lg_ping_cmd=$LG_PING_CMD
ENV_PATH="`dirname $PERLV_PATH`:`dirname $EXPECT_PATH`:`dirname $SENDMAIL`"
ENV_PATH="$ENV_PATH:`dirname $DIRNAME`:`dirname $DIFF`"
-AC_PATH_PROG(CVS,cvs,no)
-ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
+if test $RCSSYS = "cvs" ; then
+ AC_PATH_PROG(CVS,cvs,no)
+ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
+else
+ AC_PATH_PROG(SVN,svn,no)
+ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SVN`"
+fi
AC_PATH_PROG(COMM,comm,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_COMM`"
AC_PATH_PROG(FIND,find,no)
@@ -210,10 +314,7 @@ ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_RSH`"
AC_PATH_PROG(SORT,sort,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SORT`"
AC_PATH_PROG(SSH,ssh,no)
-if test $DIFF = no; then
- ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SSH`"
-fi
-unset ac_cv_path_SSH
+ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_SSH`"
AC_PATH_PROG(TELNET,telnet,no)
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_TELNET`"
AC_PATH_PROG(TOUCH,touch,no)
@@ -236,8 +337,92 @@ AC_CONFIG_FILES(include/version.h) # this is not a header in the sense of
# AC_CONFIG_HEADERS will cause
# autoheader to overwrite it, while all
# want is simple variable replacement
+# autoheader bits
+AH_TOP([
+#ifndef CONFIG_H
+#define CONFIG_H 1
+])
+AH_BOTTOM([
+
+/* damned linux... */
+#ifdef LINUX
+# define _GNU_SOURCE
+#endif
+
+#ifndef __P
+# if STDC_HEADERS
+# define __P(a) a
+# else
+# define __P(a) ()
+# endif
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
+#endif
+
+#if HAVE_UNISTD_H
+# include <unistd.h>
+# include <sys/types.h>
+#elif HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+
+#if HAVE_ERRNO_H
+# include <errno.h>
+#endif
+extern int errno;
+
+#if HAVE_STRING_H
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+
+#if ! HAVE_STRERROR
+# define strerror(n) sys_errlist[n];
+#endif
+
+#if HAVE_SYS_WAIT_H
+# include <sys/wait.h>
+#endif
+#ifndef WEXITSTATUS
+# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
+#endif
+#ifndef WIFEXITED
+# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
+#endif
+
+#if HAVE_MEMSET
+# define bzero(p,s) memset(p, 0, s)
+# define bcopy(s,d,l) memcpy(d, s, l)
+#endif
+
+#if HAVE_INDEX && ! HAVE_STRCHR
+# define index(s,c) strchr(s,c)
+#endif
+
+#if HAVE_SYSEXITS_H
+# include <sysexits.h>
+#else
+ /* missing sysexits.h */
+# define EX_OK 0
+# define EX_USAGE 64 /* command line usage error */
+# define EX_NOINPUT 66 /* cannot open input */
+# define EX_TEMPFAIL 75 /* temp failure */
+# define EX_OSERR 71 /* system error */
+# define EX_CANTCREAT 73 /* can't create (user) output file */
+# define EX_IOERR 74 /* input/output error */
+# define EX_CONFIG 78 /* configuration error */
+#endif
+
+#endif /* CONFIG_H */
+])
AC_CONFIG_HEADERS(include/config.h)
+
AC_CONFIG_FILES(bin/control_rancid bin/par bin/rancid-fe, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/agmrancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(bin/alogin bin/arancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(bin/blogin bin/brancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(bin/cat5rancid bin/clogin bin/rancid, [chmod a+x $ac_file])
@@ -255,6 +440,7 @@ AC_CONFIG_FILES(bin/nslogin bin/nsrancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(bin/prancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(bin/rivlogin bin/rivrancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(bin/rrancid, [chmod a+x $ac_file])
+AC_CONFIG_FILES(bin/srancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(bin/tntlogin bin/tntrancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(bin/xrancid bin/zrancid, [chmod a+x $ac_file])
AC_CONFIG_FILES(share/rtrfilter, [chmod a+x $ac_file])
diff --git a/depcomp b/depcomp
index 9e5522d..ca5ea4e 100755
--- a/depcomp
+++ b/depcomp
@@ -1,9 +1,10 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
-scriptversion=2003-11-08.23
+scriptversion=2006-10-15.18
-# Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 Free Software
+# Foundation, Inc.
# 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
@@ -17,8 +18,8 @@ scriptversion=2003-11-08.23
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -43,17 +44,18 @@ Environment variables:
depmode Dependency tracking mode.
source Source file read by `PROGRAMS ARGS'.
object Object file output by `PROGRAMS ARGS'.
+ DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputing dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to <bug-automake@gnu.org>.
EOF
- exit 0
+ exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
- exit 0
+ exit $?
;;
esac
@@ -61,18 +63,10 @@ if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
-# `libtool' can also be set to `yes' or `no'.
-
-if test -z "$depfile"; then
- base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
- dir=`echo "$object" | sed 's,/.*$,/,'`
- if test "$dir" = "$object"; then
- dir=
- fi
- # FIXME: should be _deps on DOS.
- depfile="$dir.deps/$base"
-fi
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+ sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
@@ -98,7 +92,20 @@ gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
- "$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am. Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+ for arg
+ do
+ case $arg in
+ -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+ *) set fnord "$@" "$arg" ;;
+ esac
+ shift # fnord
+ shift # $arg
+ done
+ "$@"
stat=$?
if test $stat -eq 0; then :
else
@@ -283,6 +290,46 @@ icc)
rm -f "$tmpdepfile"
;;
+hp2)
+ # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+ # compilers, which have integrated preprocessors. The correct option
+ # to use with these is +Maked; it writes dependencies to a file named
+ # 'foo.d', which lands next to the object file, wherever that
+ # happens to be.
+ # Much of this is similar to the tru64 case; see comments there.
+ dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+ test "x$dir" = "x$object" && dir=
+ base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+ if test "$libtool" = yes; then
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir.libs/$base.d
+ "$@" -Wc,+Maked
+ else
+ tmpdepfile1=$dir$base.d
+ tmpdepfile2=$dir$base.d
+ "$@" +Maked
+ fi
+ stat=$?
+ if test $stat -eq 0; then :
+ else
+ rm -f "$tmpdepfile1" "$tmpdepfile2"
+ exit $stat
+ fi
+
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+ do
+ test -f "$tmpdepfile" && break
+ done
+ if test -f "$tmpdepfile"; then
+ sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+ # Add `dependent.h:' lines.
+ sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile"
+ else
+ echo "#dummy" > "$depfile"
+ fi
+ rm -f "$tmpdepfile" "$tmpdepfile2"
+ ;;
+
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
@@ -294,27 +341,43 @@ tru64)
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
- tmpdepfile1="$dir.libs/$base.lo.d"
- tmpdepfile2="$dir.libs/$base.d"
+ # With Tru64 cc, shared objects can also be used to make a
+ # static library. This mechanism is used in libtool 1.4 series to
+ # handle both shared and static libraries in a single compilation.
+ # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+ #
+ # With libtool 1.5 this exception was removed, and libtool now
+ # generates 2 separate objects for the 2 libraries. These two
+ # compilations output dependencies in $dir.libs/$base.o.d and
+ # in $dir$base.o.d. We have to check for both files, because
+ # one of the two compilations can be disabled. We should prefer
+ # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+ # automatically cleaned when .libs/ is deleted, while ignoring
+ # the former would cause a distcleancheck panic.
+ tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4
+ tmpdepfile2=$dir$base.o.d # libtool 1.5
+ tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5
+ tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
- tmpdepfile1="$dir$base.o.d"
- tmpdepfile2="$dir$base.d"
+ tmpdepfile1=$dir$base.o.d
+ tmpdepfile2=$dir$base.d
+ tmpdepfile3=$dir$base.d
+ tmpdepfile4=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
- rm -f "$tmpdepfile1" "$tmpdepfile2"
+ rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
exit $stat
fi
- if test -f "$tmpdepfile1"; then
- tmpdepfile="$tmpdepfile1"
- else
- tmpdepfile="$tmpdepfile2"
- fi
+ for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+ do
+ test -f "$tmpdepfile" && break
+ done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a tab and a space in the [].
@@ -458,7 +521,8 @@ cpp)
done
"$@" -E |
- sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+ sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
diff --git a/etc/Makefile.am b/etc/Makefile.am
index e44e781..624ed76 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
## A Makefile.in is supplied, in case you do not have automake.
-## $Id: Makefile.am,v 1.10 2004/01/11 03:43:50 heas Exp $
+## $Id: Makefile.am,v 1.14 2006/10/05 04:27:49 heas Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -28,25 +28,31 @@ EXTRA_DIST= $(pkgdata_DATA:%=%.in)
CLEANFILES= $(pkgdata_DATA)
+if CONF_INSTALL
+DO_CONF_INSTALL=yes
+endif
+
install-data-local: all
- @if test -f $(sysconfdir)/rancid.conf ; then \
+ @if test "$(DO_CONF_INSTALL)" = "yes"; then \
+ if test -f $(DESTDIR)$(sysconfdir)/rancid.conf ; then \
echo ""; \
- echo "WARNING: *** $(sysconfdir)/rancid.conf exists. See "; \
+ echo "WARNING: *** $(DESTDIR)$(sysconfdir)/rancid.conf exists. See "; \
echo " *** $(pkgdatadir)/rancid.conf.sample for new"; \
echo " *** examples."; \
echo ""; \
else \
- $(INSTALL_DATA) rancid.conf.sample $(sysconfdir)/rancid.conf; \
+ $(INSTALL_DATA) rancid.conf.sample $(DESTDIR)$(sysconfdir)/rancid.conf; \
fi; \
- if test -f $(sysconfdir)/lg.conf ; then \
+ if test -f $(DESTDIR)$(sysconfdir)/lg.conf ; then \
echo ""; \
- echo "WARNING: *** $(sysconfdir)/lg.conf exists. See "; \
+ echo "WARNING: *** $(DESTDIR)$(sysconfdir)/lg.conf exists. See "; \
echo " *** $(pkgdatadir)/lg.conf.sample for new"; \
echo " *** examples."; \
echo ""; \
else \
- $(INSTALL_DATA) lg.conf.sample $(sysconfdir)/lg.conf; \
- fi;
+ $(INSTALL_DATA) lg.conf.sample $(DESTDIR)$(sysconfdir)/lg.conf; \
+ fi; \
+ fi
#clean:
# rm -f Makefile rancid.conf $(BIN_DATAS) $(BIN_PROGS)
@@ -64,7 +70,10 @@ auto_edit = sed \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
-e 's,@EXPECT_PATH\@,$(EXPECT_PATH),g' \
-e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
- -e 's,@ENV_PATH\@,$(ENV_PATH),g'
+ -e 's,@ENV_PATH\@,$(ENV_PATH),g' \
+ -e 's,@RCSSYS\@,$(RCSSYS),g' \
+ -e 's,@PACKAGE\@,$(PACKAGE),g' \
+ -e 's,@VERSION\@,$(VERSION),g'
lg.conf.sample: Makefile $(srcdir)/lg.conf.sample.in
rm -f lg.conf.sample lg.conf.sample.tmp; \
diff --git a/etc/Makefile.in b/etc/Makefile.in
index 7a52e35..b79e72d 100644
--- a/etc/Makefile.in
+++ b/etc/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.8 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,11 @@
@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -46,14 +42,18 @@ CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES =
SOURCES =
DIST_SOURCES =
-am__installdirs = $(DESTDIR)$(pkgdatadir)
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
+am__installdirs = "$(DESTDIR)$(pkgdatadir)"
pkgdataDATA_INSTALL = $(INSTALL_DATA)
DATA = $(pkgdata_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMINMAILPLUS = @ADMINMAILPLUS@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -82,6 +82,7 @@ EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -95,6 +96,7 @@ MAILPLUS = @MAILPLUS@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -106,6 +108,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -113,44 +116,60 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
#AUTOMAKE_OPTIONS=foreign no-dependencies
AUTOMAKE_OPTIONS = foreign
pkgdata_DATA = lg.conf.sample rancid.conf.sample
EXTRA_DIST = $(pkgdata_DATA:%=%.in)
CLEANFILES = $(pkgdata_DATA)
+@CONF_INSTALL_TRUE@DO_CONF_INSTALL = yes
#clean:
# rm -f Makefile rancid.conf $(BIN_DATAS) $(BIN_PROGS)
@@ -168,7 +187,10 @@ auto_edit = sed \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
-e 's,@EXPECT_PATH\@,$(EXPECT_PATH),g' \
-e 's,@PERLV_PATH\@,$(PERLV_PATH),g' \
- -e 's,@ENV_PATH\@,$(ENV_PATH),g'
+ -e 's,@ENV_PATH\@,$(ENV_PATH),g' \
+ -e 's,@RCSSYS\@,$(RCSSYS),g' \
+ -e 's,@PACKAGE\@,$(PACKAGE),g' \
+ -e 's,@VERSION\@,$(VERSION),g'
all: all-am
@@ -202,23 +224,22 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-uninstall-info-am:
install-pkgdataDATA: $(pkgdata_DATA)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(pkgdata_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
- $(pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ f=$(am__strip_dir) \
+ echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
uninstall-pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(pkgdata_DATA)'; for p in $$list; do \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
- rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
tags: TAGS
TAGS:
@@ -228,22 +249,21 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -258,7 +278,9 @@ check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
- $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ for dir in "$(DESTDIR)$(pkgdatadir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -279,7 +301,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -304,12 +326,20 @@ info-am:
install-data-am: install-data-local install-pkgdataDATA
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -328,38 +358,43 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am uninstall-pkgdataDATA
+uninstall-am: uninstall-pkgdataDATA
+
+.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am \
- install-data-local install-exec install-exec-am install-info \
- install-info-am install-man install-pkgdataDATA install-strip \
+ install-data-local install-dvi install-dvi-am install-exec \
+ install-exec-am install-html install-html-am install-info \
+ install-info-am install-man install-pdf install-pdf-am \
+ install-pkgdataDATA install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
- pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
- uninstall-pkgdataDATA
+ pdf-am ps ps-am uninstall uninstall-am uninstall-pkgdataDATA
install-data-local: all
- @if test -f $(sysconfdir)/rancid.conf ; then \
+ @if test "$(DO_CONF_INSTALL)" = "yes"; then \
+ if test -f $(DESTDIR)$(sysconfdir)/rancid.conf ; then \
echo ""; \
- echo "WARNING: *** $(sysconfdir)/rancid.conf exists. See "; \
+ echo "WARNING: *** $(DESTDIR)$(sysconfdir)/rancid.conf exists. See "; \
echo " *** $(pkgdatadir)/rancid.conf.sample for new"; \
echo " *** examples."; \
echo ""; \
else \
- $(INSTALL_DATA) rancid.conf.sample $(sysconfdir)/rancid.conf; \
+ $(INSTALL_DATA) rancid.conf.sample $(DESTDIR)$(sysconfdir)/rancid.conf; \
fi; \
- if test -f $(sysconfdir)/lg.conf ; then \
+ if test -f $(DESTDIR)$(sysconfdir)/lg.conf ; then \
echo ""; \
- echo "WARNING: *** $(sysconfdir)/lg.conf exists. See "; \
+ echo "WARNING: *** $(DESTDIR)$(sysconfdir)/lg.conf exists. See "; \
echo " *** $(pkgdatadir)/lg.conf.sample for new"; \
echo " *** examples."; \
echo ""; \
else \
- $(INSTALL_DATA) lg.conf.sample $(sysconfdir)/lg.conf; \
- fi;
+ $(INSTALL_DATA) lg.conf.sample $(DESTDIR)$(sysconfdir)/lg.conf; \
+ fi; \
+ fi
lg.conf.sample: Makefile $(srcdir)/lg.conf.sample.in
rm -f lg.conf.sample lg.conf.sample.tmp; \
diff --git a/etc/lg.conf.sample.in b/etc/lg.conf.sample.in
index 54e538a..8aaf3a9 100644
--- a/etc/lg.conf.sample.in
+++ b/etc/lg.conf.sample.in
@@ -1,7 +1,8 @@
+# @PACKAGE@ @VERSION@
# configuration file for the looking glass
#
# note: these are perl statements! Mind the syntax. "perl -c lg.conf"
-# should succeed.
+# should succeed.
#
# adjust the path to find [cfj]login, telnet, ssh, rsh, etc.
#
@@ -126,8 +127,8 @@ $queries = {};
#
# Interface queries
$queries->{"interface"} = {
- framerelay => "show frame-relay PVC [DLCI]",
- interface => "show interface [interface]"
+ framerelay => "show frame-relay PVC [DLCI]",
+ interface => "show interface [interface]"
};
#
# Routing queries
diff --git a/etc/rancid.conf.sample.in b/etc/rancid.conf.sample.in
index c550c74..42d876a 100644
--- a/etc/rancid.conf.sample.in
+++ b/etc/rancid.conf.sample.in
@@ -1,27 +1,35 @@
-#
+# @PACKAGE@ @VERSION@
# This file sets up the environment used for rancid. see rancid.conf(5)
#
# This will be site specific
#
TERM=network;export TERM
#
+# Create files w/o world read/write/exec permissions, but read/exec permissions
+# for group.
+umask 027
+#
# Under BASEDIR (i.e.: --localstatedir), there will be a "logs" directory for
# the logs from rancid and a directory for each group of routers defined in
# LIST_OF_GROUPS (below). In addition to these, there will be a "CVS"
-# directory which is the cvs repository.
+# directory which is the cvs (or Subversion) repository.
#
-# Use a full path (no sym-links) for BASEDIR. Some versions of CVS seem to
-# dislike sym-links.
+# Use a full path (no sym-links) for BASEDIR.
#
TMPDIR=/tmp; export TMPDIR
# Be careful changing this, it affects CVSROOT below.
BASEDIR=@localstatedir@; export BASEDIR
PATH=@bindir@:@ENV_PATH@; export PATH
-# Location of the CVS repository. Be careful changing this.
+# Location of the CVS/SVN repository. Be careful changing this.
CVSROOT=$BASEDIR/CVS; export CVSROOT
# Location of log files produced by rancid-run(1).
LOGDIR=$BASEDIR/logs; export LOGDIR
#
+# Select which RCS system to use, "cvs" (default) or "svn". Do not change
+# this after CVSROOT has been created with rancid-cvs. Changing between these
+# requires manual conversions.
+RCSSYS=@RCSSYS@; export RCSSYS
+#
# if NOPIPE is set, temp files will be used instead of a cmd pipe during
# collection from the router(s).
#NOPIPE=YES; export NOPIPE
@@ -33,6 +41,10 @@ LOGDIR=$BASEDIR/logs; export LOGDIR
# if NOCOMMSTR is set, snmp community strings will be stripped from the configs
#NOCOMMSTR=YES; export NOCOMMSTR
#
+# How many times failed collections are retried (for each run) before
+# giving up. Minimum: 1
+#MAX_ROUNDS=4; export MAX_ROUNDS
+#
# How many hours should pass before complaining about routers that
# can not be reached. The value should be greater than the number
# of hours between your rancid-run cron job.
@@ -53,7 +65,17 @@ OLDTIME=4; export OLDTIME
# For each group, define a list of people to receive the diffs.
# in sendmail's /etc/aliases.
# rancid-group: joe,moe@foo
-# rancid-group-admin: hostmaster
+# rancid-admin-group: hostmaster
# be sure to read ../README regarding aliases.
#
-umask 027
+# If your MTA configuration is broken or you want mail to be forwarded to a
+# domain not the same the local one, define that domain here. "@" must be
+# included, as this is simply appended to the usual recipients. It is NOT
+# appended to recipients specified in rancid-run's -m option.
+#MAILDOMAIN="@example.com"; export MAILDOMAIN
+#
+# By default, rancid mail is marked with precedence "bulk". This may be
+# changed by setting the MAILHEADERS variable; for example no header by setting
+# it to "" or adding X- style headers. Individual headers must be separated
+# by a \n.
+#MAILHEADERS="Precedence: bulk"; export MAILHEADERS
diff --git a/include/Makefile.in b/include/Makefile.in
index 1424aef..9edc016 100644
--- a/include/Makefile.in
+++ b/include/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.8 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -14,15 +14,11 @@
@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -54,8 +50,6 @@ CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMINMAILPLUS = @ADMINMAILPLUS@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -84,6 +78,7 @@ EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -97,6 +92,7 @@ MAILPLUS = @MAILPLUS@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -108,6 +104,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -115,38 +112,53 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
#AUTOMAKE_OPTIONS=foreign no-dependencies
AUTOMAKE_OPTIONS = foreign
@@ -191,13 +203,13 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
config.h: stamp-h1
@if test ! -f $@; then \
rm -f stamp-h1; \
- $(MAKE) stamp-h1; \
+ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
else :; fi
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status include/config.h
-$(srcdir)/config.h.in: $(am__configure_deps) $(top_srcdir)/acconfig.h
+$(srcdir)/config.h.in: $(am__configure_deps)
cd $(top_srcdir) && $(AUTOHEADER)
rm -f stamp-h1
touch $@
@@ -206,7 +218,6 @@ distclean-hdr:
-rm -f config.h stamp-h1
version.h: $(top_builddir)/config.status $(srcdir)/version.h.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
-uninstall-info-am:
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@@ -228,9 +239,11 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)$$tags$$unique" \
- || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
- $$tags $$unique
+ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
+ test -n "$$unique" || unique=$$empty_fix; \
+ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique; \
+ fi
ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
@@ -255,22 +268,21 @@ distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -305,7 +317,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -330,12 +342,20 @@ info-am:
install-data-am:
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -354,17 +374,21 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am
+uninstall-am:
+
+.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
ctags distclean distclean-generic distclean-hdr distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
- install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
+ install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \
- uninstall-am uninstall-info-am
+ uninstall-am
@SET_MAKE@
diff --git a/include/config.h b/include/config.h
index 5648d5d..fa01591 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1,15 +1,10 @@
-/* include/config.h. Generated by configure. */
+/* include/config.h. Generated from config.h.in by configure. */
/* include/config.h.in. Generated from configure.in by autoheader. */
-#ifndef CONFIG_H
-#define CONFIG_H 1
+#ifndef CONFIG_H
+#define CONFIG_H 1
-/* Define to 1 if you have the `bcopy' function. */
-#define HAVE_BCOPY 1
-
-/* Define to 1 if you have the `bzero' function. */
-#define HAVE_BZERO 1
/* Define to 1 if you have the <errno.h> header file. */
#define HAVE_ERRNO_H 1
@@ -26,6 +21,9 @@
/* Define to 1 if you have the <limits.h> header file. */
#define HAVE_LIMITS_H 1
+/* Define to 1 if you have the <malloc.h> header file. */
+#define HAVE_MALLOC_H 1
+
/* Define to 1 if you have the `memcpy' function. */
#define HAVE_MEMCPY 1
@@ -38,6 +36,21 @@
/* Define to 1 if you have the `memset' function. */
#define HAVE_MEMSET 1
+/* Define to 1 if you have the `openpty' function. */
+#define HAVE_OPENPTY 1
+
+/* "define this if your o/s has /dev/ptmx" */
+/* #undef HAVE_PTMX */
+
+/* "define this for OSF/1 ptmx" */
+/* #undef HAVE_PTMX_OSF */
+
+/* Define to 1 if you have the `ptsname' function. */
+/* #undef HAVE_PTSNAME */
+
+/* Define to 1 if you have the <pty.h> header file. */
+/* #undef HAVE_PTY_H */
+
/* Define to 1 if you have the `rindex' function. */
#define HAVE_RINDEX 1
@@ -65,6 +78,9 @@
/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1
+/* Define to 1 if you have the <stropts.h> header file. */
+/* #undef HAVE_STROPTS_H */
+
/* Define to 1 if you have the `strrchr' function. */
#define HAVE_STRRCHR 1
@@ -92,6 +108,12 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
+/* Define to 1 if you have the `unsetenv' function. */
+#define HAVE_UNSETENV 1
+
+/* Define to 1 if you have the <util.h> header file. */
+#define HAVE_UTIL_H 1
+
/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT ""
@@ -128,9 +150,16 @@
/* #undef inline */
#endif
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
/* #undef size_t */
+
+
+/* damned linux... */
+#ifdef LINUX
+# define _GNU_SOURCE
+#endif
+
#ifndef __P
# if STDC_HEADERS
# define __P(a) a
@@ -139,18 +168,16 @@
# endif
#endif
-#define BUF_SZ LINE_MAX /* (increments of) size of bufs */
-
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
-#if HAVE_UNISTD_H
-# include <unistd.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
# include <sys/types.h>
-#elif HAVE_SYS_TYPES_H
+#elif HAVE_SYS_TYPES_H
# include <sys/types.h>
-#endif
+#endif
#if HAVE_ERRNO_H
# include <errno.h>
@@ -158,25 +185,25 @@
extern int errno;
#if HAVE_STRING_H
-# include <string.h>
+# include <string.h>
#endif
-#if HAVE_STRINGS_H
+#if HAVE_STRINGS_H
# include <strings.h>
-#endif
+#endif
#if ! HAVE_STRERROR
# define strerror(n) sys_errlist[n];
#endif
-#if HAVE_SYS_WAIT_H
+#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
-#endif
+#endif
#ifndef WEXITSTATUS
# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
#endif
#ifndef WIFEXITED
# define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
-#endif
+#endif
#if HAVE_MEMSET
# define bzero(p,s) memset(p, 0, s)
@@ -201,4 +228,5 @@ extern int errno;
# define EX_CONFIG 78 /* configuration error */
#endif
-#endif /* CONFIG_H */
+#endif /* CONFIG_H */
+
diff --git a/include/config.h.in b/include/config.h.in
index 6a867fd..43f4e9f 100644
--- a/include/config.h.in
+++ b/include/config.h.in
@@ -1,14 +1,9 @@
/* include/config.h.in. Generated from configure.in by autoheader. */
-#ifndef CONFIG_H
-#define CONFIG_H 1
+#ifndef CONFIG_H
+#define CONFIG_H 1
-/* Define to 1 if you have the `bcopy' function. */
-#undef HAVE_BCOPY
-
-/* Define to 1 if you have the `bzero' function. */
-#undef HAVE_BZERO
/* Define to 1 if you have the <errno.h> header file. */
#undef HAVE_ERRNO_H
@@ -25,6 +20,9 @@
/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
/* Define to 1 if you have the `memcpy' function. */
#undef HAVE_MEMCPY
@@ -37,6 +35,21 @@
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
+/* Define to 1 if you have the `openpty' function. */
+#undef HAVE_OPENPTY
+
+/* "define this if your o/s has /dev/ptmx" */
+#undef HAVE_PTMX
+
+/* "define this for OSF/1 ptmx" */
+#undef HAVE_PTMX_OSF
+
+/* Define to 1 if you have the `ptsname' function. */
+#undef HAVE_PTSNAME
+
+/* Define to 1 if you have the <pty.h> header file. */
+#undef HAVE_PTY_H
+
/* Define to 1 if you have the `rindex' function. */
#undef HAVE_RINDEX
@@ -64,6 +77,9 @@
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
+/* Define to 1 if you have the <stropts.h> header file. */
+#undef HAVE_STROPTS_H
+
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
@@ -91,6 +107,12 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define to 1 if you have the `unsetenv' function. */
+#undef HAVE_UNSETENV
+
+/* Define to 1 if you have the <util.h> header file. */
+#undef HAVE_UTIL_H
+
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
@@ -127,9 +149,16 @@
#undef inline
#endif
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
+
+
+/* damned linux... */
+#ifdef LINUX
+# define _GNU_SOURCE
+#endif
+
#ifndef __P
# if STDC_HEADERS
# define __P(a) a
@@ -138,8 +167,6 @@
# endif
#endif
-#define BUF_SZ LINE_MAX /* (increments of) size of bufs */
-
#if HAVE_STDLIB_H
# include <stdlib.h>
#endif
@@ -200,4 +227,5 @@ extern int errno;
# define EX_CONFIG 78 /* configuration error */
#endif
-#endif /* CONFIG_H */
+#endif /* CONFIG_H */
+
diff --git a/include/version.h b/include/version.h
index 3cffb0b..b2a0ff1 100644
--- a/include/version.h
+++ b/include/version.h
@@ -4,6 +4,6 @@
/* pkg version */
char package[] = "rancid";
-char version[] = "2.3.rc1";
+char version[] = "2.3.2a7";
#endif
diff --git a/include/version.h.in b/include/version.h.in
index 3cffb0b..b2a0ff1 100644
--- a/include/version.h.in
+++ b/include/version.h.in
@@ -4,6 +4,6 @@
/* pkg version */
char package[] = "rancid";
-char version[] = "2.3.rc1";
+char version[] = "2.3.2a7";
#endif
diff --git a/install-sh b/install-sh
index f5061e7..4fbbae7 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2003-09-24.23
+scriptversion=2006-10-14.15
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -39,15 +39,24 @@ scriptversion=2003-09-24.23
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
-# from scratch. It can only install one file at a time, a restriction
-# shared with many OS's install programs.
+# from scratch.
+
+nl='
+'
+IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
+if test -z "$doit"; then
+ doit_exec=exec
+else
+ doit_exec=$doit
+fi
-# put in absolute paths if you don't have them in your path; or use env. vars.
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
@@ -58,10 +67,13 @@ stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
-transformbasename=
-transform_arg=
-instcmd="$mvprog"
-chmodcmd="$chmodprog 0755"
+posix_glob=
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chmodcmd=$chmodprog
chowncmd=
chgrpcmd=
stripcmd=
@@ -70,22 +82,27 @@ mvcmd="$mvprog"
src=
dst=
dir_arg=
+dstarg=
+no_target_directory=
-usage="Usage: $0 [OPTION]... SRCFILE DSTFILE
- or: $0 -d DIR1 DIR2...
+usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+ or: $0 [OPTION]... SRCFILES... DIRECTORY
+ or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+ or: $0 [OPTION]... -d DIRECTORIES...
-In the first form, install SRCFILE to DSTFILE, removing SRCFILE by default.
-In the second, create the directory path DIR.
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
Options:
--b=TRANSFORMBASENAME
--c copy source (using $cpprog) instead of moving (using $mvprog).
+-c (ignored)
-d create directories instead of installing files.
--g GROUP $chgrp installed files to GROUP.
--m MODE $chmod installed files to MODE.
--o USER $chown installed files to USER.
--s strip installed files (using $stripprog).
--t=TRANSFORM
+-g GROUP $chgrpprog installed files to GROUP.
+-m MODE $chmodprog installed files to MODE.
+-o USER $chownprog installed files to USER.
+-s $stripprog installed files.
+-t DIRECTORY install into DIRECTORY.
+-T report an error if DSTFILE is a directory.
--help display this help and exit.
--version display version info and exit.
@@ -93,14 +110,9 @@ Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG
"
-while test -n "$1"; do
+while test $# -ne 0; do
case $1 in
- -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
- shift
- continue;;
-
- -c) instcmd=$cpprog
- shift
+ -c) shift
continue;;
-d) dir_arg=true
@@ -112,11 +124,17 @@ while test -n "$1"; do
shift
continue;;
- --help) echo "$usage"; exit 0;;
+ --help) echo "$usage"; exit $?;;
- -m) chmodcmd="$chmodprog $2"
+ -m) mode=$2
shift
shift
+ case $mode in
+ *' '* | *' '* | *'
+'* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
continue;;
-o) chowncmd="$chownprog $2"
@@ -128,164 +146,358 @@ while test -n "$1"; do
shift
continue;;
- -t=*) transformarg=`echo $1 | sed 's/-t=//'`
- shift
- continue;;
+ -t) dstarg=$2
+ shift
+ shift
+ continue;;
- --version) echo "$0 $scriptversion"; exit 0;;
+ -T) no_target_directory=true
+ shift
+ continue;;
- *) if test -z "$src"; then
- src=$1
- else
- # this colon is to work around a 386BSD /bin/sh bug
- :
- dst=$1
- fi
- shift
- continue;;
- esac
-done
+ --version) echo "$0 $scriptversion"; exit $?;;
-if test -z "$src"; then
- echo "$0: no input file specified." >&2
- exit 1
-fi
+ --) shift
+ break;;
-# Protect names starting with `-'.
-case $src in
- -*) src=./$src ;;
-esac
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
-if test -n "$dir_arg"; then
- dst=$src
- src=
+ *) break;;
+ esac
+done
- if test -d "$dst"; then
- instcmd=:
- chmodcmd=
- else
- instcmd=$mkdirprog
- fi
-else
- # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
- # might cause directories to be created, which would be especially bad
- # if $src (and thus $dsttmp) contains '*'.
- if test ! -f "$src" && test ! -d "$src"; then
- echo "$0: $src does not exist." >&2
- exit 1
- fi
+if test $# -ne 0 && test -z "$dir_arg$dstarg"; then
+ # When -d is used, all remaining arguments are directories to create.
+ # When -t is used, the destination is already specified.
+ # Otherwise, the last argument is the destination. Remove it from $@.
+ for arg
+ do
+ if test -n "$dstarg"; then
+ # $@ is not empty: it contains at least $arg.
+ set fnord "$@" "$dstarg"
+ shift # fnord
+ fi
+ shift # arg
+ dstarg=$arg
+ done
+fi
- if test -z "$dst"; then
- echo "$0: no destination specified." >&2
+if test $# -eq 0; then
+ if test -z "$dir_arg"; then
+ echo "$0: no input file specified." >&2
exit 1
fi
-
- # Protect names starting with `-'.
- case $dst in
- -*) dst=./$dst ;;
- esac
-
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
- if test -d "$dst"; then
- dst=$dst/`basename "$src"`
- fi
+ # It's OK to call `install-sh -d' without argument.
+ # This can happen when creating conditional directories.
+ exit 0
fi
-# This sed command emulates the dirname command.
-dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
-
-# Make sure that the destination directory exists.
-
-# Skip lots of stat calls in the usual case.
-if test ! -d "$dstdir"; then
- defaultIFS='
- '
- IFS="${IFS-$defaultIFS}"
-
- oIFS=$IFS
- # Some sh's can't handle IFS=/ for some reason.
- IFS='%'
- set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
- IFS=$oIFS
-
- pathcomp=
+if test -z "$dir_arg"; then
+ trap '(exit $?); exit' 1 2 13 15
- while test $# -ne 0 ; do
- pathcomp=$pathcomp$1
- shift
- test -d "$pathcomp" || $mkdirprog "$pathcomp"
- pathcomp=$pathcomp/
- done
+ # Set umask so as not to create temps with too-generous modes.
+ # However, 'strip' requires both read and write access to temps.
+ case $mode in
+ # Optimize common cases.
+ *644) cp_umask=133;;
+ *755) cp_umask=22;;
+
+ *[0-7])
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw='% 200'
+ fi
+ cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+ *)
+ if test -z "$stripcmd"; then
+ u_plus_rw=
+ else
+ u_plus_rw=,u+rw
+ fi
+ cp_umask=$mode$u_plus_rw;;
+ esac
fi
-if test -n "$dir_arg"; then
- $doit $instcmd "$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"; }
+for src
+do
+ # Protect names starting with `-'.
+ case $src in
+ -*) src=./$src ;;
+ esac
-else
- # If we're going to rename the final executable, determine the name now.
- if test -z "$transformarg"; then
- dstfile=`basename "$dst"`
+ if test -n "$dir_arg"; then
+ dst=$src
+ dstdir=$dst
+ test -d "$dstdir"
+ dstdir_status=$?
else
- dstfile=`basename "$dst" $transformbasename \
- | sed $transformarg`$transformbasename
- fi
- # don't allow the sed command to completely eliminate the filename.
- test -z "$dstfile" && dstfile=`basename "$dst"`
+ # 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 '*'.
+ if test ! -f "$src" && test ! -d "$src"; then
+ echo "$0: $src does not exist." >&2
+ exit 1
+ fi
- # Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
+ if test -z "$dstarg"; then
+ echo "$0: no destination specified." >&2
+ exit 1
+ fi
- # Trap to clean up those temp files at exit.
- trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
- trap '(exit $?); exit' 1 2 13 15
+ dst=$dstarg
+ # Protect names starting with `-'.
+ case $dst in
+ -*) dst=./$dst ;;
+ esac
+
+ # If destination is a directory, append the input filename; won't work
+ # if double slashes aren't ignored.
+ if test -d "$dst"; then
+ if test -n "$no_target_directory"; then
+ echo "$0: $dstarg: Is a directory" >&2
+ exit 1
+ fi
+ dstdir=$dst
+ dst=$dstdir/`basename "$src"`
+ dstdir_status=0
+ else
+ # Prefer dirname, but fall back on a substitute if dirname fails.
+ dstdir=`
+ (dirname "$dst") 2>/dev/null ||
+ expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$dst" : 'X\(//\)[^/]' \| \
+ X"$dst" : 'X\(//\)$' \| \
+ X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+ echo X"$dst" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)[^/].*/{
+ s//\1/
+ q
+ }
+ /^X\(\/\/\)$/{
+ s//\1/
+ q
+ }
+ /^X\(\/\).*/{
+ s//\1/
+ q
+ }
+ s/.*/./; q'
+ `
+
+ test -d "$dstdir"
+ dstdir_status=$?
+ fi
+ fi
- # Move or copy the file name to the temp name
- $doit $instcmd "$src" "$dsttmp" &&
-
- # and set any options; do chmod last to preserve setuid bits.
- #
- # If any of these fail, we abort the whole thing. If we want to
- # ignore errors from any of these, just make sure not to ignore
- # errors from the above "$doit $instcmd $src $dsttmp" command.
- #
- { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \
- && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \
- && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \
- && { test -z "$chmodcmd" || $doit $chmodcmd "$dsttmp"; } &&
-
- # Now remove or move aside any old file at destination location. We
- # try this two ways since rm can't unlink itself on some systems and
- # the destination file might be busy for other 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
- }
+ obsolete_mkdir_used=false
+
+ if test $dstdir_status != 0; then
+ case $posix_mkdir in
+ '')
+ # Create intermediate dirs using mode 755 as modified by the umask.
+ # This is like FreeBSD 'install' as of 1997-10-28.
+ umask=`umask`
+ case $stripcmd.$umask in
+ # Optimize common cases.
+ *[2367][2367]) mkdir_umask=$umask;;
+ .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+ *[0-7])
+ mkdir_umask=`expr $umask + 22 \
+ - $umask % 100 % 40 + $umask % 20 \
+ - $umask % 10 % 4 + $umask % 2
+ `;;
+ *) mkdir_umask=$umask,go-w;;
+ esac
+
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ case $umask in
+ *[123567][0-7][0-7])
+ # POSIX mkdir -p sets u+wx bits regardless of umask, which
+ # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+ ;;
+ *)
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+ if (umask $mkdir_umask &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writeable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/d" "$tmpdir"
+ else
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ fi
+ trap '' 0;;
+ esac;;
+ esac
+
+ if
+ $posix_mkdir && (
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ )
+ then :
else
- :
+
+ # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # or it failed possibly due to a race condition. Create the
+ # directory the slow way, step by step, checking for races as we go.
+
+ case $dstdir in
+ /*) prefix=/ ;;
+ -*) prefix=./ ;;
+ *) prefix= ;;
+ esac
+
+ case $posix_glob in
+ '')
+ if (set -f) 2>/dev/null; then
+ posix_glob=true
+ else
+ posix_glob=false
+ fi ;;
+ esac
+
+ oIFS=$IFS
+ IFS=/
+ $posix_glob && set -f
+ set fnord $dstdir
+ shift
+ $posix_glob && set +f
+ IFS=$oIFS
+
+ prefixes=
+
+ for d
+ do
+ test -z "$d" && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask=$mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
+ done
+
+ if test -n "$prefixes"; then
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
+ fi
fi
- } &&
+ fi
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
-fi &&
+ if test -n "$dir_arg"; then
+ { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+ { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+ { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+ else
-# The final little trick to "correctly" pass the exit status to the exit trap.
-{
- (exit 0); exit
-}
+ # Make a couple of temp file names in the proper directory.
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+ # Trap to clean up those temp files at exit.
+ trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+ # Copy the file name to the temp name.
+ (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+ # and set any options; do chmod last to preserve setuid bits.
+ #
+ # If any of these fail, we abort the whole thing. If we want to
+ # ignore errors from any of these, just make sure not to ignore
+ # errors from the above "$doit $cpprog $src $dsttmp" command.
+ #
+ { 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
+ # support -f.
+
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # 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
+ :
+ fi
+ } &&
+
+ # 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)
diff --git a/man/Makefile.am b/man/Makefile.am
index 4be3c26..5cf66fc 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in
## A Makefile.in is supplied, in case you do not have automake.
-## $Id: Makefile.am,v 1.44 2004/01/11 06:12:35 hank Exp $
+## $Id: Makefile.am,v 1.46 2006/09/05 02:26:52 asp Exp $
##
## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
## All rights reserved.
@@ -25,15 +25,14 @@ AUTOMAKE_OPTIONS=foreign no-dependencies
@SET_MAKE@
man_gen_MANS = lg.conf.5 rancid.conf.5 lg_intro.1
-man_nogen_MANS = alogin.1 blogin.1 clogin.1 control_rancid.1 \
- cssrancid.1 rancid.1 \
- rancid_intro.1 cloginrc.5 router.db.5 \
- elogin.1 f10rancid.1 flogin.1 fnrancid.1 \
- hlogin.1 hrancid.1 htlogin.1 htrancid.1 jlogin.1 \
- jrancid.1 jerancid.1 f10rancid.1 francid.1 cat5rancid.1 \
- erancid.1 mrancid.1 nlogin.1 nrancid.1 nslogin.1 nsrancid.1 \
- par.1 prancid.1 \
- rancid-cvs.1 rancid-run.1 rivlogin.1 rivrancid.1 \
+man_nogen_MANS = alogin.1 arancid.1 blogin.1 brancid.1 cat5rancid.1 \
+ clogin.1 cloginrc.5 control_rancid.1 cssrancid.1 \
+ drancid.1 elogin.1 erancid.1 f10rancid.1 flogin.1 \
+ fnrancid.1 francid.1 hlogin.1 hrancid.1 htlogin.1 \
+ htrancid.1 jerancid.1 jlogin.1 jrancid.1 mrancid.1 \
+ nlogin.1 nrancid.1 nslogin.1 nsrancid.1 par.1 \
+ prancid.1 rancid-cvs.1 rancid-run.1 rancid.1 \
+ rancid_intro.1 rivlogin.1 rivrancid.1 router.db.5 \
tntlogin.1 tntrancid.1 xrancid.1 zrancid.1
man_MANS = $(man_nogen_MANS) $(man_gen_MANS)
@@ -53,7 +52,7 @@ auto_edit = sed \
-e 's,@bindir\@,$(bindir),g' \
-e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
- -e 's,@pkgdatadir\@,$(sysconfdir),g' \
+ -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
-e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
-e 's,@MAILPLUS\@,$(MAILPLUS),g'
diff --git a/man/Makefile.in b/man/Makefile.in
index 135c237..f95580a 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.8 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -13,15 +13,11 @@
# PARTICULAR PURPOSE.
@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -48,15 +44,13 @@ am__depfiles_maybe =
SOURCES =
DIST_SOURCES =
man1dir = $(mandir)/man1
-am__installdirs = $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir)
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"
man5dir = $(mandir)/man5
NROFF = nroff
MANS = $(man_MANS)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMINMAILPLUS = @ADMINMAILPLUS@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -85,6 +79,7 @@ EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -98,6 +93,7 @@ MAILPLUS = @MAILPLUS@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -109,6 +105,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -116,49 +113,63 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
AUTOMAKE_OPTIONS = foreign no-dependencies
man_gen_MANS = lg.conf.5 rancid.conf.5 lg_intro.1
-man_nogen_MANS = alogin.1 blogin.1 clogin.1 control_rancid.1 \
- cssrancid.1 rancid.1 \
- rancid_intro.1 cloginrc.5 router.db.5 \
- elogin.1 f10rancid.1 flogin.1 fnrancid.1 \
- hlogin.1 hrancid.1 htlogin.1 htrancid.1 jlogin.1 \
- jrancid.1 jerancid.1 f10rancid.1 francid.1 cat5rancid.1 \
- erancid.1 mrancid.1 nlogin.1 nrancid.1 nslogin.1 nsrancid.1 \
- par.1 prancid.1 \
- rancid-cvs.1 rancid-run.1 rivlogin.1 rivrancid.1 \
+man_nogen_MANS = alogin.1 arancid.1 blogin.1 brancid.1 cat5rancid.1 \
+ clogin.1 cloginrc.5 control_rancid.1 cssrancid.1 \
+ drancid.1 elogin.1 erancid.1 f10rancid.1 flogin.1 \
+ fnrancid.1 francid.1 hlogin.1 hrancid.1 htlogin.1 \
+ htrancid.1 jerancid.1 jlogin.1 jrancid.1 mrancid.1 \
+ nlogin.1 nrancid.1 nslogin.1 nsrancid.1 par.1 \
+ prancid.1 rancid-cvs.1 rancid-run.1 rancid.1 \
+ rancid_intro.1 rivlogin.1 rivrancid.1 router.db.5 \
tntlogin.1 tntrancid.1 xrancid.1 zrancid.1
man_MANS = $(man_nogen_MANS) $(man_gen_MANS)
@@ -176,7 +187,7 @@ auto_edit = sed \
-e 's,@bindir\@,$(bindir),g' \
-e 's,@localstatedir\@,$(localstatedir),g' \
-e 's,@sysconfdir\@,$(sysconfdir),g' \
- -e 's,@pkgdatadir\@,$(sysconfdir),g' \
+ -e 's,@pkgdatadir\@,$(pkgdatadir),g' \
-e 's,@ADMINMAILPLUS\@,$(ADMINMAILPLUS),g' \
-e 's,@MAILPLUS\@,$(MAILPLUS),g'
@@ -212,10 +223,9 @@ $(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
-uninstall-info-am:
install-man1: $(man1_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(man1dir)
+ test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
@list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
@@ -234,8 +244,8 @@ install-man1: $(man1_MANS) $(man_MANS)
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
- $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \
done
uninstall-man1:
@$(NORMAL_UNINSTALL)
@@ -255,12 +265,12 @@ uninstall-man1:
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
- rm -f $(DESTDIR)$(man1dir)/$$inst; \
+ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \
done
install-man5: $(man5_MANS) $(man_MANS)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(man5dir)
+ test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)"
@list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \
l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
for i in $$l2; do \
@@ -279,8 +289,8 @@ install-man5: $(man5_MANS) $(man_MANS)
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst"; \
- $(INSTALL_DATA) $$file $(DESTDIR)$(man5dir)/$$inst; \
+ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
+ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \
done
uninstall-man5:
@$(NORMAL_UNINSTALL)
@@ -300,8 +310,8 @@ uninstall-man5:
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
- echo " rm -f $(DESTDIR)$(man5dir)/$$inst"; \
- rm -f $(DESTDIR)$(man5dir)/$$inst; \
+ echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \
+ rm -f "$(DESTDIR)$(man5dir)/$$inst"; \
done
tags: TAGS
TAGS:
@@ -311,22 +321,21 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -341,7 +350,9 @@ check-am: all-am
check: check-am
all-am: Makefile $(MANS)
installdirs:
- $(mkdir_p) $(DESTDIR)$(man1dir) $(DESTDIR)$(man5dir)
+ for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man5dir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -362,7 +373,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -387,12 +398,20 @@ info-am:
install-data-am: install-man
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man: install-man1 install-man5
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -411,19 +430,23 @@ ps: ps-am
ps-am:
-uninstall-am: uninstall-info-am uninstall-man
+uninstall-am: uninstall-man
uninstall-man: uninstall-man1 uninstall-man5
+.MAKE: install-am install-strip
+
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
- install install-am install-data install-data-am install-exec \
- install-exec-am install-info install-info-am install-man \
- install-man1 install-man5 install-strip installcheck \
+ install install-am install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-man1 install-man5 install-pdf install-pdf-am \
+ install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
- pdf-am ps ps-am uninstall uninstall-am uninstall-info-am \
- uninstall-man uninstall-man1 uninstall-man5
+ pdf-am ps ps-am uninstall uninstall-am uninstall-man \
+ uninstall-man1 uninstall-man5
@SET_MAKE@
diff --git a/man/arancid.1 b/man/arancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/arancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/brancid.1 b/man/brancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/brancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/clogin.1 b/man/clogin.1
index 48e53ea..53f1971 100644
--- a/man/clogin.1
+++ b/man/clogin.1
@@ -1,12 +1,13 @@
.\"
.hys 50
-.TH "clogin" "1" "6 Jan 2004"
+.TH "clogin" "1" "23 November 2006"
.SH NAME
clogin \- Cisco/Foundry login script
.SH SYNOPSIS
.B clogin
[\fB\-autoenable\fP]
[\fB\-noenable\fP]
+[\fB\-V\fR]
[\c
.BI \-c\
command]
@@ -54,8 +55,9 @@ catalyst switch, Extreme switch, Juniper ERX/E-series, Procket Networks,
or Redback router.
There are complementary scripts for
Alteon,
-Bay Networks (nortel),
ADC-kentrox EZ-T3 mux,
+Bay Networks (nortel),
+Cisco AGM,
Foundry,
HP Procurve Switches,
Hitachi Routers,
@@ -83,13 +85,15 @@ respectively.
reads the
.IR .cloginrc
file for its configuration, then connects and logins into each of the
-routers specified on the command line in the order listed. Some command-line
-options exist to override directives found in the
+routers specified on the command line in the order listed. Command-line
+options exist to override some of the directives found in the
.IR .cloginrc
configuration file.
.PP
The command-line options are as follows:
-.PP
+.TP
+.B \-V
+Prints package name and version strings.
.TP
.B \-c
Command to be run on each router list on the command-line. Multiple
@@ -134,8 +138,10 @@ with the connection to the router intact, when it is done. Note that
disables
.IR log_user
of
-.BR expect (1).
-Example script(s) can be found in util/*.exp.
+.BR expect (1) when
+.B \-s
+is used.
+Example script(s) can be found in share/rancid/*.exp.
.\"
.TP
.B \-t
@@ -209,6 +215,12 @@ will not change the banner on your xterm window if this includes the
character 'x'.
.\"
.TP
+.B CLOGINRC
+Specifies an alternative location for the
+.IR .cloginrc
+file, like the \fB\-f\fP option.
+.\"
+.TP
.B HOME
Normally set by
.BR login (1)
@@ -227,6 +239,11 @@ configuration file.
.BR expect (1)
.\"
.SH CAVEATS
+.B clogin
+expects CatOS devices to have a prompt which includes a '>',
+such as "router> (enable)". It uses this to determine, for example,
+whether the command to disable the pager is "set length 0" or "term length 0".
+.PP
The HP Procurve switches that are Foundry OEMs use flogin, not hlogin.
.PP
The Extreme is supported by
@@ -245,13 +262,19 @@ when the device is ready for the next command.
All these login scripts for separate devices should be rolled into one.
This goal is exceedingly difficult.
.PP
-The HP Procurve switch CLI relies heavily upon curses for cursor/screen
-manipulation and assumes a vt100 terminal type. They do not provide a way
-to set a different terminal type or adjust this behavior. The resulting
-escape codes make automating interaction with these devices very difficult
-or impossible. Thus bin/hpuifilter, which must be found in the PATH, is used
-by hlogin to filter these. While this works for rancid's collection,
-there are side effects for interactive logins via hlogin; most of which are
-formatting annoyances that may be remedied by typing CTRL-R to reprint the
-current line.
+The HP Procurve switch and Cisco AGM CLIs rely heavily upon terminal escape
+codes for cursor/screen manipulation and assumes a vt100 terminal type.
+They do not provide a way to set a different terminal type or adjust this
+behavior.
+The resulting escape codes make automating interaction with these devices
+very difficult or impossible.
+Thus bin/hpuifilter, which must be found in the user's PATH, is used by
+hlogin to filter these escape sequences.
+While this works for rancid's collection, there are side effects for
+interactive logins via hlogin; most of which are formatting annoyances that
+may be remedied by typing CTRL-R to reprint the current line.
.PP
+WARNING: repeated ssh login failures to HP Procurves cause the switch's
+management interface to lock-up (this includes snmp, ping) and sometimes
+it will crash. This is with the latest firmware; 5.33 at the time of this
+writing.
diff --git a/man/cloginrc.5 b/man/cloginrc.5
index 36709c2..49553fd 100644
--- a/man/cloginrc.5
+++ b/man/cloginrc.5
@@ -1,8 +1,8 @@
.\"
-.\" $Id: cloginrc.5,v 1.31 2004/01/11 01:53:10 heas Exp $
+.\" $Id: cloginrc.5,v 1.37 2005/09/12 18:48:19 heas Exp $
.\"
.hys 50
-.TH "cloginrc" "5" "11 Jan 2004"
+.TH "cloginrc" "5" "12 September 2005"
.SH NAME
\.cloginrc \- clogin configuration file
.SH DESCRIPTION
@@ -42,12 +42,13 @@ include {<file>}
.PP
Note: the braces ({}) surrounding the values is significant when the values
include TCL meta-characters. Best common practice is to always enclose the
-values in braces. If a value includes a (left or right) brace, it must
-be backslash-escaped, as in:
+values in braces. If a value includes a (left or right) brace or space
+character, it must be backslash-escaped, as in:
.PP
.in +1i
.nf
add user <hostname glob> {foo\\}bar}
+add user <hostname glob> {foo\\ bar}
.fi
.in -1i
.PP
@@ -91,7 +92,7 @@ which is automatically enabled. This is, that user has enable privileges
without the need to execute the enable command. The router's prompt is
different for enabled mode, ending with a # rather than a >.
.sp
-Example: add autoenable * 1
+Example: add autoenable * {1}
.sp
Default: 0
.sp
@@ -100,6 +101,10 @@ the user is not automatically enabled and
.IR clogin
should execute the enable command to gain enable privileges, unless
negated by the noenable directive or \-noenable command\-line option.
+.sp
+Also see the
+.B noenable
+directive.
.\"
.TP
.B add cyphertype <router name glob> {<ssh encryption type>}
@@ -119,7 +124,7 @@ may be used to adjust the prompt that
should look for when trying to login. Note that enableprompt can be a Tcl
style regular expression.
.sp
-Example: add enableprompt rc*.example.net {"\\[Ee]nter the enable password:"}
+Example: add enableprompt rc*.example.net {"\\[Ee]nter\\ the\\ enable\\ password:"}
.sp
Default: "\\[Pp]assword:"
.\"
@@ -153,7 +158,7 @@ add "mode character" to .telnetrc. See
for more information on telnet command-line syntax, telnet options,
and .telnetrc.
.sp
-Example: add method * {ssh} {telnet:3000} {rsh}
+Example: add method * {ssh} {telnet:-3000} {rsh}
.sp
Which would cause
.IR clogin
@@ -166,13 +171,32 @@ Note that not all platforms support all of these connection methods.
Default: {telnet} {ssh}
.\"
.TP
-.B add noenable <router name glob>
+.B add noenable <router name glob> {1}
.IR clogin
will not try to gain enable privileges when noenable is matched for a
device. This is equivalent to
.IR "clogin" 's
--noenable command-line option. This does not apply to
-.BR jlogin (1).
+-noenable command-line option.
+.sp
+Note that this directive is meaningless for
+.BR jlogin (1),
+.BR nlogin (1)
+and
+.BR clogin (1)
+[for Extreme]
+which do not have the concept of "enabled" and/or no way to elevate
+privleges once logged in; a user either has the necessary privleges or
+doesn't.
+.\"
+.TP
+.B add passphrase <router name glob> {"<SSH passphrase>"}
+Specify the SSH passphrase. Note that this may be particular to an
+.B identity
+directive. The passphrase will default to the
+.B password
+for the given router.
+.sp
+Example: add passphrase rc*.example.net {the\\ bird\\ goes\\ tweet}
.\"
.TP
.B add passprompt <router name glob> {"<password prompt>"}
@@ -183,7 +207,7 @@ used to adjust the prompt that
should look for when trying to login. Note that passprompt can be a Tcl
style regular expression.
.sp
-Example: add passprompt rc*.example.net {"\\[Ee]nter the password:"}
+Example: add passprompt rc*.example.net {"\\[Ee]nter\\ the\\ password:"}
.sp
Default: "(\\[Pp]assword|passwd):"
.\"
@@ -194,6 +218,16 @@ to the router. The last argument is the enable password and need not be
specified if the device also has a matching noenable or autoenable
directive or the corresponding command-line options are used.
.\"
+.TP
+.B add sshcmd <router name glob> {<ssh>}
+<ssh> is the name of the ssh executable. OpenSSH uses a command-line
+option to specify the protocol version, but other implementations use
+a separate binary such as "ssh1".
+.B sshcmd
+allows this to be adjusted as necessary for the local environment.
+.sp
+Default: ssh
+.\"
.\" .TP
.\" .B add rc <router name glob> {<cmd;cmd>}
.\" rc is used to specifies a command that will be run by
@@ -227,7 +261,7 @@ used to adjust the prompt that
should look for when trying to login. Note that userprompt can be a Tcl
style regular expression.
.sp
-Example: add userprompt rc*.example.net {"\\[Ee]nter your username:"}
+Example: add userprompt rc*.example.net {"\\[Ee]nter\\ your\\ username:"}
.sp
Default: "(Username|login|user name):"
.\"
@@ -246,16 +280,6 @@ file that is shared among a group of folks.
If <file> is not a full pathname, $HOME/ will be prepended.
.sp
Example: include {.cloginrc.group}
-.\"
-.TP
-.B add sshcmd {<ssh>}
-<ssh> is the name of the ssh executable. OpenSSH uses a command-line
-option to specify the protocol version, but other implementations use
-a separate binary such as "ssh1".
-.B sshcmd
-allows this to be adjusted as necessary for the local environment.
-.sp
-Default: ssh
.El
.SH FILES
.br
diff --git a/man/control_rancid.1 b/man/control_rancid.1
index f502fb0..3dd34bf 100644
--- a/man/control_rancid.1
+++ b/man/control_rancid.1
@@ -1,11 +1,11 @@
.\"
.hys 50
-.TH "control_rancid" "1" "7 Jan 2004"
+.TH "control_rancid" "1" "5 October 2006"
.SH NAME
control_rancid \- run rancid for devices of a group
.SH SYNOPSIS
.B control_rancid
-[\c
+[\fB\-V\fR] [\c
.BI \-m\ \c
mail_rcpt]\ \c
[\c
@@ -18,13 +18,16 @@ is a
.IR sh (1)
script to parse a group's
.BR router.db (5),
-run rancid for each of the devices, possibly re-run rancid for missed devices,
-e-mail diffs, and e-mail error reports.
+run rancid for each of the devices, possibly re-run rancid for devices
+that failed collection, e-mail diffs, and e-mail error reports.
.\"
.PP
.\"
The command-line options are as follows:
.TP
+.B \-V
+Prints package name and version strings.
+.TP
.B \-m mail_rcpt
Specify the recipient of diff mail, which is normally rancid-<group>. The
argument may be a single address, multiple comma separated addresses, or
@@ -45,7 +48,8 @@ with <group name>/<device name> rather than just the group name alone.
.B control_rancid
is normally (and best) run via
.BR rancid-run (1)
-which provides a locking mechanism on a group basis.
+which provides a locking mechanism on a group basis and saves output
+in a log file for each group.
.\"
.SH "SEE ALSO"
.BR rancid-run (1),
diff --git a/man/drancid.1 b/man/drancid.1
new file mode 100644
index 0000000..b4633ee
--- /dev/null
+++ b/man/drancid.1
@@ -0,0 +1 @@
+.so man1/rancid.1
diff --git a/man/lg.conf.5.in b/man/lg.conf.5.in
index a2058d1..6e9f86c 100644
--- a/man/lg.conf.5.in
+++ b/man/lg.conf.5.in
@@ -9,7 +9,7 @@ contains configuration for the looking glass scripts.
.PP
The syntax is that of
.IR perl (1).
-It is used to set variables to affect run-time behavior and/or to locate
+It is used to set variables that affect run-time behavior and/or to locate
resources.
.\"
.SH VARIABLES
diff --git a/man/lg_intro.1.in b/man/lg_intro.1.in
index a9a72c4..2ce66e6 100644
--- a/man/lg_intro.1.in
+++ b/man/lg_intro.1.in
@@ -35,8 +35,8 @@ run.
.PP
lg.cgi begins by performing some basic checks on the
arguments passed to it. If these checks pass, lg.cgi either displays
-cached data from a previous invocation if that data exists and is
-within the cache interval or uses
+cached data from a previous invocation, if that data exists and is
+within the cache interval, or uses
.BR clogin (1)
to login to the device and execute the command. The
results of the command are cached if applicable and displayed for the
diff --git a/man/rancid-cvs.1 b/man/rancid-cvs.1
index 2cb34bd..41c68dd 100644
--- a/man/rancid-cvs.1
+++ b/man/rancid-cvs.1
@@ -1,29 +1,26 @@
.\"
.hys 50
-.TH "rancid-cvs" "1" "7 Jan 2004"
+.TH "rancid-cvs" "1" "5 October 2006"
.SH NAME
-rancid-cvs \- initialize CVS and rancid group files and directories
+rancid-cvs \- initialize CVS or Subversion and rancid group files and directories
.SH SYNOPSIS
.B rancid-cvs
-[group [group ...]]
+[\fB\-V\fR] [group [group ...]]
.SH DESCRIPTION
.B rancid-cvs
-is a
-.IR sh (1)
-script to create the directories,
-.BR router.db (5),
-and
-.BR cvs (1)
-directories necessary for a rancid group.
+creates the directories and
+.BR router.db (5)
+for each rancid group and handles the revision control system (CVS or
+Subversion) set-up.
+It must be run after installation and whenever a rancid group is added.
.\"
.PP
.B rancid-cvs
reads
.BR rancid.conf (5)
-to configure itself. Then proceeds with the initialization first of the
-.BR cvs (1)
-repository, if necessary, and then for each of the rancid groups listed on
-the command-line or those in the variable
+to configure itself, then proceeds with the initialization.
+First of the CVS or Subversion repository, if necessary, and then for each
+of the rancid groups listed on the command-line or those in the variable
.I LIST_OF_GROUPS
from
.BR rancid.conf (5),
@@ -33,11 +30,17 @@ if the argument is omitted.
Running
.B rancid-cvs
for groups which already exist will not cause problems. If the group's
-directory already exists, the
-.BR cvs (1)
-import will be skipped, and if it's
+directory already exists, the import into the revision control system
+will be skipped, and if it's
.BR router.db (5)
-already exists, it will be left as-is.
+already exists, it will not be altered.
+.\"
+.PP
+.\"
+The command-line options are as follows:
+.TP
+.B \-V
+Prints package name and version strings.
.\"
.PP
The best method for adding groups is add the group name to
@@ -51,4 +54,5 @@ to do it.
.SH "SEE ALSO"
.BR cvs (1),
.BR rancid.conf (5),
-.BR router.db (5)
+.BR router.db (5),
+.BR svn (1)
diff --git a/man/rancid-run.1 b/man/rancid-run.1
index 3e99b26..302bc72 100644
--- a/man/rancid-run.1
+++ b/man/rancid-run.1
@@ -1,10 +1,16 @@
.\"
.hys 50
-.TH "rancid-run" "1" "7 Jan 2004"
+.TH "rancid-run" "1" "5 October 2006"
.SH NAME
rancid-run \- run rancid for each of the groups
.SH SYNOPSIS
.B rancid-run
+[\fB\-V\fR] [\c
+.BI \-f\ \c
+rancid.conf]\ \c
+[\c
+.BI \-f\ \c
+rancid.conf]\ \c
[\c
.BI \-m\ \c
mail_rcpt]\ \c
@@ -63,6 +69,12 @@ For example:
.\"
The command-line options are as follows:
.TP
+.B \-V
+Prints package name and version strings.
+.TP
+.B \-f rancid.conf
+Specify an alternate configuration file.
+.TP
.B \-m mail_rcpt
Specify the recipient of diff mail, which is normally rancid-<group>. The
argument may be a single address, multiple comma separated addresses, or
@@ -71,10 +83,12 @@ may be specified multiple times.
.\"
.TP
.B \-r device_name
-Specify the name, as it appears in a group's router.db, of a particular
-device to collect and generate diffs for. The device must be marked "up".
-If a group is not specified on the command-line, rancid will be run
-against any group in which the device_name appears.
+Run rancid for a single device,
+.IR device_name .
+.IR device_name
+should be name, as it appears in a group's router.db. The device must be
+marked "up". If a group is not specified on the command-line, rancid will
+be run against any group in which the device_name appears.
.sp
The
.B \-r
@@ -88,7 +102,8 @@ utilizes the following environment variables from
.\"
.TP
.B BASEDIR
-Location of group directories, etc.
+Location of group directories, etc. This is set to the "localstatedir"
+by the configure script at installation time.
.\"
.TP
.B LIST_OF_GROUPS
@@ -104,11 +119,10 @@ Directory to hold temporary and lock files.
.SH ERRORS
If rancid fails to run or collect a device's configuration, the particular
group's log file (mentioned above) should be consulted. Any errors produced
-by
-.BR cvs (1)
-or any of the rancid scripts should be included, whether they be a botched
-cvs tree, login authentication failure, rancid configuration error, etc. If
-the log file produces no clues, the next debugging step should be run the
+by the revision control system (CVS or Subversion) or any of the rancid
+scripts should be included there, whether they be a botched cvs tree, login
+authentication failure, rancid configuration error, etc.
+If the log file produces no clues, the next debugging step should be run the
commands manually. For example, can the user who runs rancid login to the
device with 'clogin hostname', and so on.
.BR
diff --git a/man/rancid.1 b/man/rancid.1
index 15fca7d..934798c 100644
--- a/man/rancid.1
+++ b/man/rancid.1
@@ -1,77 +1,108 @@
.\"
.hys 50
-.TH "rancid" "1" "6 Jan 2004"
+.TH "rancid" "1" "8 January 2007"
.SH NAME
rancid \- Cisco configuration filter
.SH SYNOPSIS
.B rancid
-[\fB\-dl\fP]
-([\c
-.BI \-f\ \c
-filename]\ \c
-| hostname)
+[\fB\-dlV\fP]
+(\fB\-f\fP filename | hostname)
.SH DESCRIPTION
.B rancid
is a
.BR perl (1)
-script which uses
-.BR clogin (1)
-to login to a Cisco router, execute commands to display
-the configuration, etc, then filters the output for formatting, security,
-and so on.
+script which uses the login scripts (see
+.BR clogin (1))
+to login to a device, execute commands to display the configuration, etc,
+then filters the output for formatting, security, and so on.
.B rancid's
product is a file with the name of it's last argument plus the suffix .new.
-For example, hostname.new.
+For example,
+.IR hostname.new .
.PP
-There are complementary scripts for
-Alteon WebOS switches,
-Bay Networks (nortel),
-Cisco catalyst switches,
-Cisco content services switches,
-ADC-kentrox EZ-T3 mux,
-Force10,
-Foundry,
-HP Procurve Switches,
-Hitachi Routers,
-Juniper Networks E-series,
-Juniper Networks,
-MRTd,
-Procket Networks,
-Riverstone,
-Redback,
-Lucent TNT,
-Netscreen firewalls,
-Netscaler,
-Extreme,
-and Zebra routing software
-named
-.B arancid,
-.B brancid,
-.B cat5rancid,
-.B cssrancid,
-.B erancid,
-.B f10rancid,
-.B fnrancid,
-.B francid,
-.B hrancid,
-.B htrancid,
-.B jerancid,
-.B jrancid,
-.B mrancid,
-.B nrancid,
-.B nsrancid,
-.B prancid,
-.B rivrancid,
-.B rrancid,
-.B tntrancid,
-.B nrancid,
-.B xrancid,
-and
-.B zrancid,
-respectively.
+There are complementary scripts for other platforms and/or manufacturers
+that are supported by
+.BR rancid (1).
+Briefly, these are:
+.sp
+.TP 15
+.B agmrancid
+Cisco Anomaly Guard Module (AGM)
+.TP 15
+.B arancid
+Alteon WebOS switches
+.TP
+.B brancid
+Bay Networks (nortel)
+.TP
+.B cat5rancid
+Cisco catalyst switches
+.TP
+.B cssrancid
+Cisco content services switches
+.TP
+.B drancid
+Dell switches
+.TP
+.B erancid
+ADC-kentrox EZ-T3 mux
+.TP
+.B f10rancid
+Force10
+.TP
+.B fnrancid
+Fortinet Firewalls
+.TP
+.B francid
+Foundry and HP procurve OEMs of Foundry
+.TP
+.B hrancid
+HP Procurve Switches
+.TP
+.B htranicd
+Hitachi Routers
+.TP
+.B jerancid
+Juniper Networks E-series
+.TP
+.B jrancid
+Juniper Networks
+.TP
+.B mrancid
+MRTd
+.TP
+.B prancid
+Procket Networks
+.TP
+.B rivrancid
+Riverstone
+.TP
+.B rrancid
+Redback
+.TP
+.B srancid
+SMC switch (some Dell OEMs)
+.TP
+.B tntrancid
+Lucent TNT
+.TP
+.B nrancid
+Netscreen firewalls
+.TP
+.B nsrancid
+Netscaler
+.TP
+.B xrancid
+Extreme switches
+.TP
+.B zrancid
+Zebra routing software
.PP
The command-line options are as follows:
.TP
+.B \-V
+Prints package name and version strings.
+.TP
.B \-d
Display debugging information.
.\"
@@ -107,3 +138,8 @@ Password:
cat5k> (enable)
.fi
.in -1i
+.PP
+.B rancid
+works on Cisco Catalyst 1900 series switches that are running Enterprise
+Edition software. This software provides a menu at connection time that
+allows a command line interface to be used by entering 'K' at the prompt.
diff --git a/man/rancid.conf.5.in b/man/rancid.conf.5.in
index 75adc87..a3735eb 100644
--- a/man/rancid.conf.5.in
+++ b/man/rancid.conf.5.in
@@ -1,8 +1,8 @@
.\"
-.\" $Id: rancid.conf.5.in,v 1.9 2004/01/11 06:12:35 hank Exp $
+.\" $Id: rancid.conf.5.in,v 1.16 2005/09/27 16:39:27 heas Exp $
.\"
.hys 50
-.TH "rancid.conf" "5" "7 Jan 2004"
+.TH "rancid.conf" "5" "23 September 2005"
.SH NAME
rancid.conf \- rancid environment configuration file
.SH DESCRIPTION
@@ -10,10 +10,10 @@ rancid.conf \- rancid environment configuration file
contains environment configuration information for
.BR rancid-run (1)
and
-.BR rancid (1)
-including shell PATH, list of rancid groups, etc. and is read by
-.BR rancid-run (1)
-at run-time.
+.BR rancid-cvs (1),
+including shell PATH, list of rancid groups, etc.
+It is read by several scripts at run-time and others inherit the
+configration from a parent process which has read it.
.PP
The syntax of
.B rancid.conf
@@ -32,10 +32,12 @@ The following variables are used (listed alphabetically):
.B BASEDIR
BASEDIR is the directory where
.B rancid-run's
-log directory and where the CVS repository and rancid collection group
-directories will be placed. Its value is configure's localstatedir and
-should be modified if rancid is moved to a new location in the file
-system without re-installing from the distribution.
+log directory, the revision control system's repository, and rancid group
+directories will be placed.
+.sp
+Its value is configure's localstatedir and should be modified if rancid is
+moved to a new location in the file system without re-installing from the
+distribution.
.sp
Default: @localstatedir@
.\"
@@ -44,8 +46,9 @@ Default: @localstatedir@
.IR cvs (1)
and
.IR rancid-cvs (1)
-use this environment variable to locate the CVS repository. It should
-not be necessary to alter it.
+use this environment variable to locate the CVS repository.
+In some cases, and for Subversion, it is used as an argument to commands.
+It should not be necessary to alter it.
.sp
Default: $BASEDIR/CVS
.\"
@@ -115,6 +118,31 @@ places log files.
Default: $BASEDIR/logs
.\"
.TP
+.B MAILDOMAIN
+Define the domain part of addresses for administrative and diff e-mail.
+The value of this variable is simply appended to the normal mail addresses.
+For example @MAILPLUS@usfs@example.com, if
+.B MAILDOMAIN
+had been set to "@example.com".
+.\"
+.TP
+.B MAILHEADERS
+Define additional mail headers to be added to rancid mail, such as Precedence
+or X- style headers.
+Individual headers must be separated by a \\n (new line).
+.sp
+Default: Precedence: bulk
+.sp
+Example: Precedence: bulk\\nX-clamation: beef cake
+.\"
+.TP
+.B MAX_ROUNDS
+Defines how many times rancid should retry collection of devices that fail.
+The minimum is 1.
+.sp
+Default: 4.
+.\"
+.TP
.B NOCOMMSTR
If set,
.IR rancid (1)
@@ -127,10 +155,11 @@ this is not set.
If set,
.IR rancid (1)
will use temporary files to save the output from the router and then read
-these to build the file which will be saved in CVS. Otherwise, an IPC
-pipe will be used. We have found that the buffering mechanisms used in
-perl and expect are heinous. Using temporary files may result in a noticeable
-improvement in speed. By default, this is not set.
+these to build the file which will be saved in CVS (or Subversion).
+Otherwise, an IPC pipe will be used. We have found that the buffering
+mechanisms used in perl and expect are heinous.
+Using temporary files may result in a noticeable improvement in speed.
+By default, this is not set.
.\"
.TP
.B OLDTIME
@@ -171,6 +200,18 @@ Its value is set by configure. Should it be necessary to modify PATH,
note that it must include @bindir@.
.\"
.TP
+.B RCSSYS
+Sets which revision control system is in use.
+Valid values are
+.B cvs
+for CVS
+or
+.B svn
+for Subversion.
+.sp
+Default: cvs
+.\"
+.TP
.B TERM
Some Unix utilities require TERM, the terminal type, to be set to a sane
value. Some clients, such as
diff --git a/man/rancid_intro.1 b/man/rancid_intro.1
index cf4c571..1ccf463 100644
--- a/man/rancid_intro.1
+++ b/man/rancid_intro.1
@@ -1,18 +1,18 @@
.\"
-.\" $Id: rancid_intro.1,v 1.27 2004/01/11 00:43:19 heas Exp $
+.\" $Id: rancid_intro.1,v 1.30 2006/11/23 20:26:49 heas Exp $
.\"
.hys 50
-.TH "rancid_intro" "1" "7 Jan 2004"
+.TH "rancid_intro" "1" "23 November 2006"
.SH NAME
rancid_intro \- introduction to the Really Awesome New Cisco confIg Differ
.SH INTRODUCTION
.B rancid
is really more than just a Cisco configuration differ. It handles several
different device's configurations; currently including Alteon, Bay Networks
-(Nortel), Cisco, Extreme, Force10, Foundry, HP Procurve switches, Juniper
-Routers and edge (ERX) routers, Redback, MRTd daemon, Lucent TNT, Netscalar
-load balancers, Netscreen firewalls, Zebra routing software, and the
-ADC-Kentrox EZ-T3 mux.
+(Nortel), Cisco, Cisco AGM, Extreme, Force10, Foundry, HP Procurve switches,
+Juniper Routers and edge (ERX) routers, Redback, MRTd daemon, Lucent TNT,
+Netscalar load balancers, Netscreen firewalls, Zebra routing software, and
+the ADC-Kentrox EZ-T3 mux.
.PP
.B rancid
uses an expect script to login to each of a list of devices and run a set of
@@ -40,10 +40,12 @@ will also include any differences of the device list in the group's
configuration file,
.IR "router.db".
.PP
-Lastly, all the updated files are checked into the CVS repository.
+Lastly, all the updated files are checked into the revision control system
+(CVS or Subversion).
.PP
-Additional utilities, including a looking glass, can be found under
-the util sub-directory.
+Additional utilities, including a looking glass, come with rancid. See
+rancid's share directory (
+.IR share/rancid ).
.SH "EXAMPLE E-MAIL"
Below is a sample of a uni-diff produced from the group "shrubbery"
for the device named dfw.shrubbery.net, which happens to be a Cisco GSR.
@@ -88,7 +90,7 @@ below or follow the basic instructions included in the README file.
See http://www.shrubbery.net/rancid for information on new versions,
mail lists, etc.
.SH "ADDING NEW GROUPS"
-Follow this procdure for adding new groups:
+Follow this procedure for adding new groups:
.TP
o
Update the
diff --git a/man/router.db.5 b/man/router.db.5
index 8261556..d688440 100644
--- a/man/router.db.5
+++ b/man/router.db.5
@@ -1,6 +1,6 @@
.\"
.hys 50
-.TH "router.db" "5" "7 Jan 2004"
+.TH "router.db" "5" "8 January 2007"
.SH NAME
router.db \- rancid group configuration file
.SH DESCRIPTION
@@ -48,6 +48,11 @@ Domain Name) works best, as in the example above.
The type of device from the set:
.RS 8n
.TP
+.B agm
+A Cisco Anomoly Guard Module (aka Riverhead).
+We suspect that at some point the UI will become more cisco-like and it
+can be merged with the IOS rancid module.
+.TP
.B alteon
An Alteon WebOS switches.
.TP
@@ -119,6 +124,10 @@ A Redback router, NAS, etc.
A Riverstone NAS or Cabletron (starting with version ~9.0.3) router.
.TP
.ID 15n
+.B smc
+A SMC switch (some Dell OEMs)
+.TP
+.ID 15n
.B tnt
A lucent TNT.
.TP
@@ -160,12 +169,9 @@ file, then
.B rancid
will clean up by removing the device's config file from
\fI$BASEDIR/<group>/configs\fR.
-The
-.IR cvs (1)
-information for the device will be moved to
-.IR cvs (1)'s
-Attic directory (using
-.IR "cvs delete").
+The device will be removed from the revision control system.
+It is possible, in most cases, to resurrect or check-out copies of
+deleted device configurations.
.PP
.SH FILES
.ta \w'xBASEDIR/<group>/router.db 'u
diff --git a/missing b/missing
index e7ef83a..1c8ff70 100755
--- a/missing
+++ b/missing
@@ -1,9 +1,9 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-scriptversion=2003-09-02.23
+scriptversion=2006-05-10.23
-# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
@@ -19,8 +19,8 @@ scriptversion=2003-09-02.23
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+# 02110-1301, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -33,6 +33,8 @@ if test $# -eq 0; then
fi
run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
# In the cases where this matters, `missing' is being run in the
# srcdir already.
@@ -44,7 +46,7 @@ fi
msg="missing on your system"
-case "$1" in
+case $1 in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
@@ -60,11 +62,6 @@ case "$1" in
msg="probably too old"
fi
;;
-esac
-
-# If it does not exist, or fails to run (possibly an outdated version),
-# try to emulate it.
-case "$1" in
-h|--h|--he|--hel|--help)
echo "\
@@ -82,6 +79,7 @@ Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
+ autom4te touch the output file, or create a stub one
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
@@ -92,10 +90,12 @@ Supported PROGRAM values:
yacc create \`y.tab.[ch]', if possible, from existing .[ch]
Send bug reports to <bug-automake@gnu.org>."
+ exit $?
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing $scriptversion (GNU Automake)"
+ exit $?
;;
-*)
@@ -104,12 +104,42 @@ Send bug reports to <bug-automake@gnu.org>."
exit 1
;;
- aclocal*)
+esac
+
+# Now exit if we have it, but it failed. Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).
+case $1 in
+ lex|yacc)
+ # Not GNU programs, they don't have --version.
+ ;;
+
+ tar)
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ exit 1
+ fi
+ ;;
+
+ *)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+ # Could not run --version or --help. This is probably someone
+ # running `$TOOL --version' or `$TOOL --help' to check whether
+ # $TOOL exists and not knowing $TOOL uses missing.
+ exit 1
fi
+ ;;
+esac
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $1 in
+ aclocal*)
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
@@ -119,11 +149,6 @@ WARNING: \`$1' is $msg. You should only need it if
;;
autoconf)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`${configure_ac}'. You might want to install the
@@ -133,11 +158,6 @@ WARNING: \`$1' is $msg. You should only need it if
;;
autoheader)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
@@ -147,7 +167,7 @@ WARNING: \`$1' is $msg. You should only need it if
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
- case "$f" in
+ case $f in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
@@ -157,11 +177,6 @@ WARNING: \`$1' is $msg. You should only need it if
;;
automake*)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
@@ -173,11 +188,6 @@ WARNING: \`$1' is $msg. You should only need it if
;;
autom4te)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
WARNING: \`$1' is needed, but is $msg.
You might have modified some files without having the
@@ -185,8 +195,8 @@ WARNING: \`$1' is needed, but is $msg.
You can get \`$1' as part of \`Autoconf' from any GNU
archive site."
- file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
- test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -f "$file"; then
touch $file
else
@@ -207,25 +217,25 @@ WARNING: \`$1' $msg. You should only need it if
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
- if [ ! -f y.tab.h ]; then
+ if test ! -f y.tab.h; then
echo >y.tab.h
fi
- if [ ! -f y.tab.c ]; then
+ if test ! -f y.tab.c; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
@@ -237,39 +247,32 @@ WARNING: \`$1' is $msg. You should only need it if
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
- if [ $# -ne 1 ]; then
+ if test $# -ne 1; then
eval LASTARG="\${$#}"
- case "$LASTARG" in
+ case $LASTARG in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
- if [ -f "$SRCFILE" ]; then
+ if test -f "$SRCFILE"; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
- if [ ! -f lex.yy.c ]; then
+ if test ! -f lex.yy.c; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
- if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
- # We have it, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
- if test -z "$file"; then
- file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
- fi
- if [ -f "$file" ]; then
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+ if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
@@ -279,11 +282,6 @@ WARNING: \`$1' is $msg. You should only need it if
;;
makeinfo)
- if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
- # We have makeinfo, but it failed.
- exit 1
- fi
-
echo 1>&2 "\
WARNING: \`$1' is $msg. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
@@ -291,20 +289,29 @@ WARNING: \`$1' is $msg. You should only need it if
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
- file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ # The file to touch is that specified with -o ...
+ file=`echo "$*" | sed -n "$sed_output"`
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
if test -z "$file"; then
- file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
- file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
+ # ... or it is the one specified with @setfilename ...
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+ file=`sed -n '
+ /^@setfilename/{
+ s/.* \([^ ]*\) *$/\1/
+ p
+ q
+ }' $infile`
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
fi
+ # If the file does not exist, the user really needs makeinfo;
+ # let's fail without touching anything.
+ test -f $file || exit 1
touch $file
;;
tar)
shift
- if test -n "$run"; then
- echo 1>&2 "ERROR: \`tar' requires --run"
- exit 1
- fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
@@ -317,13 +324,13 @@ WARNING: \`$1' is $msg. You should only need it if
fi
firstarg="$1"
if shift; then
- case "$firstarg" in
+ case $firstarg in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
- case "$firstarg" in
+ case $firstarg in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
diff --git a/mkinstalldirs b/mkinstalldirs
index 6504b74..ef7e16f 100755
--- a/mkinstalldirs
+++ b/mkinstalldirs
@@ -1,7 +1,7 @@
#! /bin/sh
# mkinstalldirs --- make directory hierarchy
-scriptversion=2003-11-08.23
+scriptversion=2006-05-11.19
# Original author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
@@ -11,8 +11,11 @@ scriptversion=2003-11-08.23
# bugs to <bug-automake@gnu.org> or send patches to
# <automake-patches@gnu.org>.
+nl='
+'
+IFS=" "" $nl"
errstatus=0
-dirmode=""
+dirmode=
usage="\
Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
@@ -27,7 +30,7 @@ while test $# -gt 0 ; do
case $1 in
-h | --help | --h*) # -h for help
echo "$usage"
- exit 0
+ exit $?
;;
-m) # -m PERM arg
shift
@@ -37,7 +40,7 @@ while test $# -gt 0 ; do
;;
--version)
echo "$0 $scriptversion"
- exit 0
+ exit $?
;;
--) # stop option processing
shift
@@ -66,9 +69,15 @@ case $# in
0) exit 0 ;;
esac
+# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error. This is a problem when calling mkinstalldirs
+# from a parallel make. We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
case $dirmode in
'')
- if mkdir -p -- . 2>/dev/null; then
+ if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
echo "mkdir -p -- $*"
exec mkdir -p -- "$@"
else
@@ -77,16 +86,17 @@ case $dirmode in
# directories to create, and then abort because `.' already
# exists.
test -d ./-p && rmdir ./-p
- test -d ./-- && rmdir ./--
+ test -d ./--version && rmdir ./--version
fi
;;
*)
- if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
+ if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+ test ! -d ./--version; then
echo "mkdir -m $dirmode -p -- $*"
exec mkdir -m "$dirmode" -p -- "$@"
else
# Clean up after NextStep and OpenStep mkdir.
- for d in ./-m ./-p ./-- "./$dirmode";
+ for d in ./-m ./-p ./--version "./$dirmode";
do
test -d $d && rmdir $d
done
@@ -96,13 +106,21 @@ esac
for file
do
- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
+ case $file in
+ /*) pathcomp=/ ;;
+ *) pathcomp= ;;
+ esac
+ oIFS=$IFS
+ IFS=/
+ set fnord $file
shift
+ IFS=$oIFS
- pathcomp=
for d
do
- pathcomp="$pathcomp$d"
+ test "x$d" = x && continue
+
+ pathcomp=$pathcomp$d
case $pathcomp in
-*) pathcomp=./$pathcomp ;;
esac
@@ -117,7 +135,7 @@ do
else
if test ! -z "$dirmode"; then
echo "chmod $dirmode $pathcomp"
- lasterr=""
+ lasterr=
chmod "$dirmode" "$pathcomp" || lasterr=$?
if test ! -z "$lasterr"; then
@@ -127,7 +145,7 @@ do
fi
fi
- pathcomp="$pathcomp/"
+ pathcomp=$pathcomp/
done
done
diff --git a/share/Makefile.in b/share/Makefile.in
index 04c1dd1..3764839 100644
--- a/share/Makefile.in
+++ b/share/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.8 from Makefile.am.
+# Makefile.in generated by automake 1.10 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
-# Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -15,15 +15,11 @@
@SET_MAKE@
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
-top_builddir = ..
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
-INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
@@ -47,19 +43,24 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = $(top_builddir)/include/config.h
CONFIG_CLEAN_FILES = rtrfilter
-am__installdirs = $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdatadir)
+am__installdirs = "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)" \
+ "$(DESTDIR)$(pkgdatadir)"
dist_pkgdataSCRIPT_INSTALL = $(INSTALL_SCRIPT)
pkgdataSCRIPT_INSTALL = $(INSTALL_SCRIPT)
SCRIPTS = $(dist_pkgdata_SCRIPTS) $(pkgdata_SCRIPTS)
SOURCES =
DIST_SOURCES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+ *) f=$$p;; \
+ esac;
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
dist_pkgdataDATA_INSTALL = $(INSTALL_DATA)
DATA = $(dist_pkgdata_DATA)
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ADMINMAILPLUS = @ADMINMAILPLUS@
-AMDEP_FALSE = @AMDEP_FALSE@
-AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -88,6 +89,7 @@ EXPECT_PATH = @EXPECT_PATH@
FIND = @FIND@
GREP = @GREP@
ID = @ID@
+INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
@@ -101,6 +103,7 @@ MAILPLUS = @MAILPLUS@
MAKE = @MAKE@
MAKEINFO = @MAKEINFO@
MKDIR = @MKDIR@
+MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -112,6 +115,7 @@ PATH_SEPARATOR = @PATH_SEPARATOR@
PERLV = @PERLV@
PERLV_PATH = @PERLV_PATH@
PING_PATH = @PING_PATH@
+RCSSYS = @RCSSYS@
RSH = @RSH@
SENDMAIL = @SENDMAIL@
SET_MAKE = @SET_MAKE@
@@ -119,38 +123,53 @@ SHELL = @SHELL@
SORT = @SORT@
SSH = @SSH@
STRIP = @STRIP@
+SVN = @SVN@
TAR = @TAR@
TELNET = @TELNET@
TOUCH = @TOUCH@
U = @U@
VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
-ac_ct_STRIP = @ac_ct_STRIP@
-am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
-am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
+builddir = @builddir@
datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
+htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
+localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
+psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
#AUTOMAKE_OPTIONS=foreign no-dependencies
AUTOMAKE_OPTIONS = foreign
@@ -210,13 +229,13 @@ rtrfilter: $(top_builddir)/config.status $(srcdir)/rtrfilter.in
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
install-dist_pkgdataSCRIPTS: $(dist_pkgdata_SCRIPTS)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(dist_pkgdata_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(dist_pkgdataSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
- $(dist_pkgdataSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ echo " $(dist_pkgdataSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(dist_pkgdataSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
else :; fi; \
done
@@ -224,18 +243,18 @@ uninstall-dist_pkgdataSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(dist_pkgdata_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
- rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
install-pkgdataSCRIPTS: $(pkgdata_SCRIPTS)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(pkgdata_SCRIPTS)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f $$d$$p; then \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(pkgdataSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
- $(pkgdataSCRIPT_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ echo " $(pkgdataSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(pkgdataSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
else :; fi; \
done
@@ -243,26 +262,25 @@ uninstall-pkgdataSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(pkgdata_SCRIPTS)'; for p in $$list; do \
f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
- rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
-uninstall-info-am:
install-dist_pkgdataDATA: $(dist_pkgdata_DATA)
@$(NORMAL_INSTALL)
- $(mkdir_p) $(DESTDIR)$(pkgdatadir)
+ test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)"
@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " $(dist_pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f"; \
- $(dist_pkgdataDATA_INSTALL) $$d$$p $(DESTDIR)$(pkgdatadir)/$$f; \
+ f=$(am__strip_dir) \
+ echo " $(dist_pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ $(dist_pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
uninstall-dist_pkgdataDATA:
@$(NORMAL_UNINSTALL)
@list='$(dist_pkgdata_DATA)'; for p in $$list; do \
- f="`echo $$p | sed -e 's|^.*/||'`"; \
- echo " rm -f $(DESTDIR)$(pkgdatadir)/$$f"; \
- rm -f $(DESTDIR)$(pkgdatadir)/$$f; \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \
+ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \
done
tags: TAGS
TAGS:
@@ -272,22 +290,21 @@ CTAGS:
distdir: $(DISTFILES)
- @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
- topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
- list='$(DISTFILES)'; for file in $$list; do \
- case $$file in \
- $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
- $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
- esac; \
+ @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+ list='$(DISTFILES)'; \
+ dist_files=`for file in $$list; do echo $$file; done | \
+ sed -e "s|^$$srcdirstrip/||;t" \
+ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+ case $$dist_files in \
+ */*) $(MKDIR_P) `echo "$$dist_files" | \
+ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+ sort -u` ;; \
+ esac; \
+ for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
- dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
- if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- dir="/$$dir"; \
- $(mkdir_p) "$(distdir)$$dir"; \
- else \
- dir=''; \
- fi; \
if test -d $$d/$$file; then \
+ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
@@ -302,7 +319,9 @@ check-am: all-am
check: check-am
all-am: Makefile $(SCRIPTS) $(DATA)
installdirs:
- $(mkdir_p) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdatadir) $(DESTDIR)$(pkgdatadir)
+ for dir in "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgdatadir)"; do \
+ test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+ done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
@@ -323,7 +342,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f $(CONFIG_CLEAN_FILES)
+ -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -349,12 +368,20 @@ info-am:
install-data-am: install-dist_pkgdataDATA install-dist_pkgdataSCRIPTS \
install-pkgdataSCRIPTS
+install-dvi: install-dvi-am
+
install-exec-am:
+install-html: install-html-am
+
install-info: install-info-am
install-man:
+install-pdf: install-pdf-am
+
+install-ps: install-ps-am
+
installcheck-am:
maintainer-clean: maintainer-clean-am
@@ -374,19 +401,23 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-dist_pkgdataDATA uninstall-dist_pkgdataSCRIPTS \
- uninstall-info-am uninstall-pkgdataSCRIPTS
+ uninstall-pkgdataSCRIPTS
+
+.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic distclean \
distclean-generic distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am \
install-dist_pkgdataDATA install-dist_pkgdataSCRIPTS \
- install-exec install-exec-am install-info install-info-am \
- install-man install-pkgdataSCRIPTS install-strip installcheck \
+ install-dvi install-dvi-am install-exec install-exec-am \
+ install-html install-html-am install-info install-info-am \
+ install-man install-pdf install-pdf-am install-pkgdataSCRIPTS \
+ install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
pdf-am ps ps-am uninstall uninstall-am \
uninstall-dist_pkgdataDATA uninstall-dist_pkgdataSCRIPTS \
- uninstall-info-am uninstall-pkgdataSCRIPTS
+ uninstall-pkgdataSCRIPTS
all:
diff --git a/share/cisco-load.exp b/share/cisco-load.exp
index 0c28549..3f98478 100644
--- a/share/cisco-load.exp
+++ b/share/cisco-load.exp
@@ -1,8 +1,8 @@
##
-## $Id: cisco-load.exp,v 1.10 2004/01/11 03:43:50 heas Exp $
+## $Id: cisco-load.exp,v 1.12 2006/05/28 16:38:53 heas Exp $
##
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -46,8 +46,8 @@
# prompt cmd-line prompt as determined by clogin
#
# note: the tcl/expect parser is extremely stoopid. comment lines are NOT
-# completely ignored!! so, a '{' or '}' in a comment might produce
-# unexpected results.
+# completely ignored!! so, a '{' or '}' in a comment might produce
+# unexpected results.
##
# log_user 1
# exp_internal 1
@@ -72,11 +72,12 @@ proc logout { ecode } {
send "quit\r"
expect {
- "$prompt" { logout $ecode }
+ "$prompt" { logout $ecode }
timeout { send_error "Error: timeout waiting for EOF after quit\n"}
- eof {
- send_user "\n"
- exit $ecode }
+ eof {
+ send_user "\n"
+ exit $ecode
+ }
}
}
@@ -91,13 +92,15 @@ proc erase { } {
send "write erase\r"
expect {
-re " Continue\[^\n\]\*confirm\]" {
- send "\r"
- exp_continue }
- "$prompt" { }
- timeout {
- send_error "Error: timeout waiting for write erase.\n"
- logout 1 }
- eof { logout 1 }
+ send "\r"
+ exp_continue
+ }
+ "$prompt" { }
+ timeout {
+ send_error "Error: timeout waiting for write erase.\n"
+ logout 1
+ }
+ eof { logout 1 }
}
}
@@ -165,10 +168,10 @@ proc doload { confghost routername config retry } {
send_error "Error: timeout exceeded while loading config\n"
logout 1 }
-re "\[^\n\]*Connection refused" {
- send_error "Error: $expect_out(0,string)\n"
+ send_error "Error: $expect_out(0,string)\n"
logout 1 }
-re "\[^\n\]*Destination unreachable" {
- send_error "Error: $expect_out(0,string)\n"
+ send_error "Error: $expect_out(0,string)\n"
logout 1 }
-re "\[^\n\]*Permission denied" {
send_error "Error: $expect_out(0,string)\n"
@@ -203,9 +206,10 @@ proc doload { confghost routername config retry } {
-re "\[^\n]*Error (opening|copying).*\r" {
send_error "Error: $expect_out(0,string)\n"
logout 1 }
- -nocase -re "\[^\n]* error\[^a-z\n]+\[^\n]*" {
- send_error "$expect_out(0,string)\n"
- logout 1 }
+ -nocase -re "\[^\n]* error\[^a-z\n]+\[^\n]*" {
+ send_error "$expect_out(0,string)\n"
+ logout 1
+ }
"\n" { exp_continue }
-re "^\[^ ]*\#" {
send_user "load successful.\n"
@@ -245,25 +249,25 @@ logout 0
# these were my original transcripts of performing loads. it is a useful
# example of info you may collect to get an idea of what needs to be handled
# in the expect{}s
-#
+#
# pdx-oob#
# pdx-oob#copy rcp start
# Address of remote host [255.255.255.255]? 205.238.52.35
# Name of configuration file [a]? pdx-oob-confg
# Configure using pdx-oob-confg from 205.238.52.35? [confirm]
-#
+#
# Connected to 205.238.52.35
# Loading 8131 byte file pdx-oob-confg: !!!! [OK]
# Compressing configuration from 8131 bytes to 3886 bytes
# [OK]
# pdx-oob#
-#
+#
# 12.0S-isms
# pao2#cop rcp sta
# Address or name of remote host []? eng0
# Translating "eng0"...domain server (205.238.52.46) [OK]
-#
+#
# Source username [pao2]?
# Source filename []? pao2-confg
# Destination filename [startup-config]?
@@ -274,7 +278,7 @@ logout 0
# Accessing rcp://pao2@eng0/pao2-confg...
# Connected to 205.238.52.35
# Loading 30138 byte file pao2-confg: !!!!!! [OK]
-#
+#
# 30138 bytes copied in 2.576 secs (15069 bytes/sec)
# pao2#
# OR IS IT
@@ -292,7 +296,7 @@ logout 0
# Address of remote host [255.255.255.255]? 205.238.52.35
# Name of configuration file [a]? pdx-oob-confg
# Configure using pdx-oob-confg from 205.238.52.35? [confirm]
-#
+#
# Connected to 205.238.52.35
# Loading 8131 byte file pdx-oob-confg: !!!! [OK]
# Compressing configuration from 8131 bytes to 3886 bytes
@@ -301,17 +305,17 @@ logout 0
# Address of remote host [205.238.52.35]? 205.238.52.35
# Name of configuration file [pdx-oob-confg]? pdx-oob-confg
# Configure using pdx-oob-confg from 205.238.52.35? [confirm]
-#
+#
# Connected to 205.238.52.35
# %rcp: /tftpboot/pdx-oob-confg: No such file or directory
# pdx-oob#
-#
+#
# pdx-oob#copy rcp start
# Address of remote host [205.238.52.35]? 205.238.52.35
# Name of configuration file [pdx-oob-confg]? pdx-oob-confg
# Configure using pdx-oob-confg from 205.238.52.35? [confirm]
-#
+#
# Connected to 205.238.52.35
# %rcp: /tftpboot/pdx-oob-confg: Permission denied
# pdx-oob#
@@ -323,9 +327,9 @@ logout 0
# Name of configuration file [pdx-oob-confg]?
# Configure using pdx-oob-confg from 205.238.1.94? [confirm]
# % Destination unreachable; gateway or host down
-#
+#
# pdx-oob#
-#
+#
# *** response from host w/o rcp daemon
# pdx-oob#cop rcp sta
@@ -333,6 +337,6 @@ logout 0
# Name of configuration file [pdx-oob-confg]?
# Configure using pdx-oob-confg from 205.238.1.66? [confirm]
# % Connection refused by remote host
-#
+#
# pdx-oob#
-#
+#
diff --git a/share/cisco-reload.exp b/share/cisco-reload.exp
index 25880c1..c344c8f 100644
--- a/share/cisco-reload.exp
+++ b/share/cisco-reload.exp
@@ -1,7 +1,7 @@
##
-## $Id: cisco-reload.exp,v 1.9 2004/01/11 03:43:50 heas Exp $
+## $Id: cisco-reload.exp,v 1.11 2006/05/28 16:38:53 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -29,14 +29,14 @@
# e.g. usage:
# % clogin -s cisco-reload.exp -Ereload_arg='at 01:00' router
# router
-# Reload scheduled for 01:00:00 UTC Sat Jun 23 2001 (in 7 hours and 16 minutes)
+# Reload scheduled for 01:00:00 UTC Sat Jun 23 2001 (in 7 hours and 16 minutes)
# % clogin -s cisco-reload.exp -Ereload_arg='at cancel' router
# router
-# % Ambiguous command: "reload at cancel"
+# % Ambiguous command: "reload at cancel"
#
# % clogin -s cisco-reload.exp -Ereload_arg='cancel' router
# router
-# SHUTDOWN ABORTED
+# SHUTDOWN ABORTED
#
#
# keep in mind that it is important to NOT polute the global variable space.
@@ -49,8 +49,8 @@
# prompt cmd-line prompt as determined by clogin
#
# note: the tcl/expect parser is extremely stoopid. comment lines are NOT
-# completely ignored!! so, a '{' or '}' in a comment might produce
-# unexpected results.
+# completely ignored!! so, a '{' or '}' in a comment might produce
+# unexpected results.
##
# exp_internal 1
# log_user 1
@@ -68,7 +68,7 @@ if ([info exists Ereload_arg]) {
send "\r"
expect {
- timeout { send_error "Error: did not receive prompt\n"
+ timeout { send_error "Error: did not receive prompt\n"
exit }
-re "^.*$prompt" { send "$reloadcmd\r"
expect * {} }
@@ -133,15 +133,15 @@ expect {
## Proceed with reload? [confirm]
## ultra#reload can
## ultra#
-##
-##
+##
+##
## ***
## *** --- SHUTDOWN ABORTED ---
## ***
## ultra# reload at 8:10 10 dec
-##
+##
## System configuration has been modified. Save? [yes/no]: no
## Reload scheduled for 08:10:00 PST Thu Dec 10 1998 (in 296 hours and 17 minutes)
## Proceed with reload? [confirm]
## ultra#
-##
+##
diff --git a/share/downreport.in b/share/downreport.in
index a05a524..0033e18 100644
--- a/share/downreport.in
+++ b/share/downreport.in
@@ -1,8 +1,8 @@
#! /bin/sh
##
-## $Id: downreport.in,v 1.9 2004/01/11 03:43:50 heas Exp $
+## $Id: downreport.in,v 1.12 2006/05/28 16:38:53 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -40,19 +40,23 @@ elif [ "$LIST_OF_GROUPS" = "" ] ; then
exit 1
fi
+# mail variables
+set | grep MAILHEADERS= > /dev/null 2>&1
+if [ $? -ne 0 ] ; then
+ MAILHEADERS="Precedence: bulk\n"; export MAILHEADERS
+fi
for GROUP in $LIST_OF_GROUPS; do
(
echo "To: @MAILPLUS@admin-$GROUP"
echo "Subject: Down router report - $GROUP"
- echo "Precedence: bulk"
+ echo "$MAILHEADERS" | awk '{gsub(/\\n/,"\n");print;}'
echo ""
DIR=$BASEDIR/$GROUP
if [ -s $DIR/routers.down ]; then
(
-
- cat << EOM
-
+ cat << EOM
+
The following $GROUP routers are listed as other than up.
Routers listed as "up" in rancid's router.db are polled several
@@ -61,20 +65,17 @@ not polled.
EOM
- cat $DIR/routers.down;
-
+ cat $DIR/routers.down;
)
-
else
(
+ cat << EOM
- cat << EOM
-
- No routers are down/ticketed for router group $GROUP (yay).
+ No routers are down/ticketed for router group $GROUP (yay).
EOM
- )
+ )
fi
) | sendmail -t
diff --git a/share/lgnotes.html b/share/lgnotes.html
index 9f28ec3..502a51d 100644
--- a/share/lgnotes.html
+++ b/share/lgnotes.html
@@ -14,8 +14,7 @@ size=+3><strong>&nbsp;&nbsp;&nbsp;Looking Glass Notes
<p>
<ul>
Just a few straight forward notes on our implementation of
-Ed Kern's looking glass. See the original at
-<a href=http://nitrous.digex.net>http://nitrous.digex.net</a>.
+Ed Kern's looking glass (which was http://nitrous.digex.net).
</ul>
</p>
<p>
@@ -31,7 +30,7 @@ Ed Kern's looking glass. See the original at
<li>The looking glass will ping a router prior to querying it to avoid
trying to query routers which are down or otherwise inaccessible.</li>
<li>Login failures can be intermittent or permanent, either due to the
- router being inaccessible from the looking glass machine,
+ router being inaccessible from the looking glass machine,
or authorization failure(s). Contact your local network engineering
folks to resolve login failures.</li>
<li>Queries followed by &lt;something&gt; require an argument(s) in the text
diff --git a/share/rtrfilter.in b/share/rtrfilter.in
index 9807e1f..1dbd10f 100644
--- a/share/rtrfilter.in
+++ b/share/rtrfilter.in
@@ -1,8 +1,8 @@
#! @PERLV_PATH@
##
-## $Id: rtrfilter.in,v 1.13 2004/01/11 03:43:50 heas Exp $
+## $Id: rtrfilter.in,v 1.15 2006/05/28 16:38:53 heas Exp $
##
-## Copyright (C) 1997-2004 by Terrapin Communications, Inc.
+## Copyright (C) 1997-2006 by Terrapin Communications, Inc.
## All rights reserved.
##
## This software may be freely copied, modified and redistributed
@@ -43,7 +43,7 @@
#
# exclusion takes precedence and defaults to nothing. inclusion defaults to
# everything.
-#
+#
# this program requires the Mail::Mailer module which can be found on CPAN.
##
BEGIN {