Discussion:
[rancid] Several suggestions about rancid-3.2.p7
Tetsuo Handa
2015-06-03 13:16:09 UTC
Permalink
Hello.

I've just installed rancid-3.2p7 on CentOS 6.6.

(1) I noticed that while the configure script checks for Socket.pm >= 2.006 ,
it works for me with below patch. If below patch is correct (I'm not perl
user), we don't need to force users to upgrade package to a version which
is not included in RHEL 6 / CentOS 6 distribution.

----------------------------------------
patch -p0 << "EOF"
--- configure
+++ configure
@@ -5316,15 +5316,6 @@
PERLV=`basename $PERLV_PATH`


-# check Socket.pm version
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Socket.pm version" >&5
-$as_echo_n "checking Socket.pm version... " >&6; }
-$PERLV_PATH -e 'use 2.006 Socket qw(inet_pton);' 2>&1 >/dev/null
-if test $? -ne 0 ; then
- as_fn_error $? "Socket.pm is older than 2.006; upgrade from http://metacpan.org/pod/Socket" "$LINENO" 5
- exit 1
-fi
-
# Extract the first word of "expect", so it can be a program name with args.
set dummy expect; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
--- lib/rancid.pm.in
+++ lib/rancid.pm.in
@@ -48,7 +48,7 @@
use 5.010;
use strict 'vars';
use warnings;
-use 2.006 Socket qw(AF_INET AF_INET6 inet_pton);
+use Socket qw(AF_INET AF_INET6);
require(Exporter);
our @ISA = qw(Exporter);

@@ -351,6 +351,11 @@
@sorted_lines;
}

+sub inet_pton {
+ my($family, $addr) = @_;
+ return inet_pton($family, $addr);
+}
+
# ipaddrval(IPaddr) converts and IPv4/v6 address to a string for comparison.
# Some may ask why not use Net::IP; performance. We tried and it was horribly
# slow.
EOF
----------------------------------------

(2) I noticed that the shell variable SENDMAIL is defined in
bin/control_rancid.in like below

# SENDMAIL location
SENDMAIL=${SENDMAIL:=sendmail};

but this variable is never used because /usr/sbin/sendmail is
hard-coded like below

/usr/sbin/sendmail -t $MAILOPTS

I think you need to either remove this variable definition or
replace like below with variable definition updated.

-| /usr/sbin/sendmail -t $MAILOPTS
+| $SENDMAIL -t $MAILOPTS

(3) I noticed that bin/control_rancid.in forgot to exclude .cvsignore
file in the

# delete configs from RCS for routers not listed in routers.up.

block. As a result, "svn commit" fails and "Deleted .cvsignore" line
is printed (very confusing!) when I executed bin/rancid-run , possibly
the same problem reported at
http://www.shrubbery.net/pipermail/rancid-discuss/2015-May/008414.html .

I think you need to replace like below.

-for router in `find . \( -name \*.new -prune -o -name CVS -prune -o -name .svn -prune -o -name .gitignore -prune \) -o -type f -print | sed -e 's/^.\///'`
+for router in `find . \( -name \*.new -prune -o -name CVS -prune -o -name .svn -prune -o -name .gitignore -prune -o -name .cvsignore -prune \) -o -type f -print | sed -e 's/^.\///'`

(4) Usually, PATH environment variable should not contain "."
(current directory).

Regards.
heasley
2015-06-05 00:44:39 UTC
Permalink
Post by Tetsuo Handa
Hello.
I've just installed rancid-3.2p7 on CentOS 6.6.
(1) I noticed that while the configure script checks for Socket.pm >= 2.006 ,
it works for me with below patch. If below patch is correct (I'm not perl
user), we don't need to force users to upgrade package to a version which
is not included in RHEL 6 / CentOS 6 distribution.
I'm not sure what I'll do here. I'll poke the various suggestions folks
have sent to make sure that the change does not result in a regression.
Post by Tetsuo Handa
----------------------------------------
patch -p0 << "EOF"
--- configure
+++ configure
@@ -5316,15 +5316,6 @@
PERLV=`basename $PERLV_PATH`
-# check Socket.pm version
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking Socket.pm version" >&5
-$as_echo_n "checking Socket.pm version... " >&6; }
-$PERLV_PATH -e 'use 2.006 Socket qw(inet_pton);' 2>&1 >/dev/null
-if test $? -ne 0 ; then
- as_fn_error $? "Socket.pm is older than 2.006; upgrade from http://metacpan.org/pod/Socket" "$LINENO" 5
- exit 1
-fi
-
# Extract the first word of "expect", so it can be a program name with args.
set dummy expect; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
--- lib/rancid.pm.in
+++ lib/rancid.pm.in
@@ -48,7 +48,7 @@
use 5.010;
use strict 'vars';
use warnings;
-use 2.006 Socket qw(AF_INET AF_INET6 inet_pton);
+use Socket qw(AF_INET AF_INET6);
require(Exporter);
@@ -351,6 +351,11 @@
@sorted_lines;
}
+sub inet_pton {
+ return inet_pton($family, $addr);
+}
+
# ipaddrval(IPaddr) converts and IPv4/v6 address to a string for comparison.
# Some may ask why not use Net::IP; performance. We tried and it was horribly
# slow.
EOF
----------------------------------------
(2) I noticed that the shell variable SENDMAIL is defined in
bin/control_rancid.in like below
# SENDMAIL location
SENDMAIL=${SENDMAIL:=sendmail};
...

Crap. Thanks
Post by Tetsuo Handa
(3) I noticed that bin/control_rancid.in forgot to exclude .cvsignore
file in the
# delete configs from RCS for routers not listed in routers.up.
...

I update 3.2p6 a few days ago for this. thanks
Post by Tetsuo Handa
(4) Usually, PATH environment variable should not contain "."
(current directory).
I presume that it inheritted this from your environment or whomever ran
configure.
Tetsuo Handa
2015-06-05 11:45:38 UTC
Permalink
Post by heasley
Post by Tetsuo Handa
(3) I noticed that bin/control_rancid.in forgot to exclude .cvsignore
file in the
# delete configs from RCS for routers not listed in routers.up.
...
I update 3.2p6 a few days ago for this. thanks
I expect that you do not tamper released files, or there will be confusion
between those who downloaded old version of file and those who downloaded
new version of file.
Post by heasley
Post by Tetsuo Handa
(4) Usually, PATH environment variable should not contain "."
(current directory).
I presume that it inheritted this from your environment or whomever ran
configure.
Unfortunately, the "." comes from the configure script when "dirname no" is
executed due to nonexistent program. I think you can remove "." at the later

ENV_PATH=`echo $ENV_PATH | $PERLV_PATH -e ...

line of the configure script.

----------
test -z "$ac_cv_path_CVS" && ac_cv_path_CVS="no"
;;
esac
fi
CVS=$ac_cv_path_CVS
if test -n "$CVS"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CVS" >&5
$as_echo "$CVS" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi


ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
----------

----------
+ test -z ''
+ ac_cv_path_CVS=no
+ CVS=no
+ test -n no
+ printf '%s\n' 'configure:5475: result: no'
+ printf '%s\n' no
no
++ dirname no
+ ENV_PATH=/usr/bin:/usr/bin:/usr/sbin:/usr/bin:/usr/bin:.
----------
heasley
2015-06-07 06:34:54 UTC
Permalink
Post by Tetsuo Handa
Post by heasley
Post by Tetsuo Handa
(3) I noticed that bin/control_rancid.in forgot to exclude .cvsignore
file in the
# delete configs from RCS for routers not listed in routers.up.
...
I update 3.2p6 a few days ago for this. thanks
I expect that you do not tamper released files, or there will be confusion
between those who downloaded old version of file and those who downloaded
new version of file.
sorry, thought i'd fixed the omission before anyone fetched it.
Post by Tetsuo Handa
Post by heasley
Post by Tetsuo Handa
(4) Usually, PATH environment variable should not contain "."
(current directory).
I presume that it inheritted this from your environment or whomever ran
configure.
Unfortunately, the "." comes from the configure script when "dirname no" is
executed due to nonexistent program. I think you can remove "." at the later
ENV_PATH=`echo $ENV_PATH | $PERLV_PATH -e ...
line of the configure script.
i dont see it, but ok, i'll remove it in the path compression
Post by Tetsuo Handa
----------
test -z "$ac_cv_path_CVS" && ac_cv_path_CVS="no"
;;
esac
fi
CVS=$ac_cv_path_CVS
if test -n "$CVS"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CVS" >&5
$as_echo "$CVS" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
ENV_PATH="$ENV_PATH:`dirname $ac_cv_path_CVS`"
----------
----------
+ test -z ''
+ ac_cv_path_CVS=no
+ CVS=no
+ test -n no
+ printf '%s\n' 'configure:5475: result: no'
+ printf '%s\n' no
no
++ dirname no
+ ENV_PATH=/usr/bin:/usr/bin:/usr/sbin:/usr/bin:/usr/bin:.
----------
Loading...