From 537faf42b24d09c94932747e0006baa8c2c816bf Mon Sep 17 00:00:00 2001 From: David Brown Date: May 30 2015 16:59:03 +0000 Subject: add some upstream patches --- diff --git a/rancid-3.2.p1 b/rancid-3.2.p1 new file mode 100644 index 0000000..2c140a7 --- /dev/null +++ b/rancid-3.2.p1 @@ -0,0 +1,26 @@ +Index: lib/rancid.pm.in +=================================================================== +--- lib/rancid.pm.in (revision 3066) ++++ lib/rancid.pm.in (revision 3067) +@@ -366,7 +366,9 @@ + $l = 128; + } + $norder = inet_pton(AF_INET6, $a); +- return unpack("H*", $norder) . unpack("H*", pack("C", $l)); ++ if (defined($norder)) { ++ return unpack("H*", $norder) . unpack("H*", pack("C", $l)); ++ } + } else { + my($l); + if ($a =~ /\//) { +@@ -375,7 +377,9 @@ + $l = 32; + } + $norder = inet_pton(AF_INET, $a); +- return(unpack("H*", $norder) . unpack("H*", pack("C", $l))); ++ if (defined($norder)) { ++ return(unpack("H*", $norder) . unpack("H*", pack("C", $l))); ++ } + } + + # otherwise return the original key value, so as not to sort on null diff --git a/rancid-3.2.p2 b/rancid-3.2.p2 new file mode 100644 index 0000000..a42447b --- /dev/null +++ b/rancid-3.2.p2 @@ -0,0 +1,26 @@ +Index: lib/junos.pm.in +=================================================================== +--- lib/junos.pm.in (revision 3067) ++++ lib/junos.pm.in (revision 3068) +@@ -439,13 +439,18 @@ + + # licenses used changes constantly. distill it to a percentage. + if (/^(\s+scale-subscriber)(\s+)(\d+)(\s+\d+)(.*$)/) { +- my($a, $sp, $used, $avail, $rem) = ($1, $2, $3, $4, $'); ++ my($a, $sp, $used, $avail, $rem) = ($1, $2, $3, $4, $5); + my($spl, $usedl) = (length($sp), length($used)); +- my($pcnt) = int(($used + 0.0) / ($avail + 0.0) * 100); ++ my($pcnt); ++ if ($avail < 1) { ++ $pcnt = ">100"; ++ } else { ++ $pcnt = int(($used + 0.0) / ($avail + 0.0) * 100); ++ } + my($pcntl) = length($pcnt) + 1; + $spl = $spl + $usedl - $pcntl; + +- my($fmt) = "%s%-" . $spl . "s%d%%%s%s"; ++ my($fmt) = "%s%-" . $spl . "s%s%%%s%s\n"; + $_ = sprintf($fmt, $a, "", $pcnt, $avail, $rem); + } + diff --git a/rancid-3.2.p3 b/rancid-3.2.p3 new file mode 100644 index 0000000..6627b74 --- /dev/null +++ b/rancid-3.2.p3 @@ -0,0 +1,70 @@ +Index: configure.ac +=================================================================== +--- configure.ac (revision 3070) ++++ configure.ac (working copy) +@@ -275,7 +275,7 @@ + else + $PERLV_PATH -e 'require 5;' + if test $? -ne 0 ; then +- AC_MSG_ERROR([can't locate a suitable perl5.]) ++ AC_MSG_ERROR([can't locate a suitable perl5.]) + exit 1 + fi + fi +@@ -284,6 +284,14 @@ + PERLV=`basename $PERLV_PATH` + AC_SUBST(PERLV) + ++# check Socket.pm version ++AC_MSG_CHECKING([Socket.pm version]) ++$PERLV_PATH -e 'use 2.006 Socket qw(inet_pton);' 2>&1 >/dev/null ++if test $? -ne 0 ; then ++ AC_MSG_ERROR([Socket.pm is older than 2.006; upgrade from http://metacpan.org/pod/Socket]) ++ exit 1 ++fi ++ + AC_PATH_PROG(EXPECT_PATH,expect,no) + if test $EXPECT_PATH = no; then + AC_MSG_ERROR([can't locate expect.]) +Index: lib/rancid.pm.in +=================================================================== +--- lib/rancid.pm.in (revision 3070) ++++ lib/rancid.pm.in (working copy) +@@ -48,7 +48,7 @@ + use 5.010; + use strict 'vars'; + use warnings; +-use Socket qw(AF_INET AF_INET6 inet_pton); ++use 2.006 Socket qw(AF_INET AF_INET6 inet_pton); + require(Exporter); + our @ISA = qw(Exporter); + +Index: configure +=================================================================== +--- configure (revision 3070) ++++ configure (working copy) +@@ -5307,7 +5307,7 @@ + else + $PERLV_PATH -e 'require 5;' + if test $? -ne 0 ; then +- as_fn_error $? "can't locate a suitable perl5." "$LINENO" 5 ++ as_fn_error $? "can't locate a suitable perl5." "$LINENO" 5 + exit 1 + fi + fi +@@ -5316,6 +5316,15 @@ + 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 diff --git a/rancid-3.2.p4 b/rancid-3.2.p4 new file mode 100644 index 0000000..b7cb5be --- /dev/null +++ b/rancid-3.2.p4 @@ -0,0 +1,42 @@ +Index: etc/rancid.types.base +=================================================================== +--- etc/rancid.types.base (revision 3076) ++++ etc/rancid.types.base (working copy) +@@ -7,22 +7,23 @@ + # + agm;script;agmrancid + # +-adtran;script;rancid -t adtran +-adtran;module;adtran +-adtran;inloop;adtran::inloop +-adtran;login;clogin ++# XXX This was the start of support for adtran, but it is incomplete. ++#adtran;script;rancid -t adtran ++#adtran;module;adtran ++#adtran;inloop;adtran::inloop ++#adtran;login;clogin + # TA5000 +-adtran;command;adtran::ShowVersion;show version +-adtran;command;adtran::ShowSystemInventory;show system inventory +-adtran;command;adtran::ShowTableInterfaces;show table interfaces +-adtran;command;adtran::ShowEvc;show evc +-adtran;command;adtran::ShowEvcmap;show evc-map +-adtran;command;adtran::ShowEfmgroup;show efm-group 1 +-adtran;command;adtran::ShowInterfacesShdsl;show interfaces shdsl +-adtran;command;adtran::ShowInterfacesAdsl;show interfaces adsl ++#adtran;command;adtran::ShowVersion;show version ++#adtran;command;adtran::ShowSystemInventory;show system inventory ++#adtran;command;adtran::ShowTableInterfaces;show table interfaces ++#adtran;command;adtran::ShowEvc;show evc ++#adtran;command;adtran::ShowEvcmap;show evc-map ++#adtran;command;adtran::ShowEfmgroup;show efm-group 1 ++#adtran;command;adtran::ShowInterfacesShdsl;show interfaces shdsl ++#adtran;command;adtran::ShowInterfacesAdsl;show interfaces adsl + # EFM NTU +-adtran;command;adtran::ShowInterfaces;show interfaces +-adtran;command;adtran::WriteTerm;show running-config ++#adtran;command;adtran::ShowInterfaces;show interfaces ++#adtran;command;adtran::WriteTerm;show running-config + # + alteon;script;arancid + alteon;login;alogin diff --git a/rancid-3.2.p5 b/rancid-3.2.p5 new file mode 100644 index 0000000..9475e10 --- /dev/null +++ b/rancid-3.2.p5 @@ -0,0 +1,10 @@ +Index: lib/panos.pm.in +=================================================================== +--- lib/panos.pm.in (revision 3112) ++++ lib/panos.pm.in (working copy) +@@ -1,4 +1,4 @@ +-package ios; ++package panos; + ## + ## $Id: panos.pm.in 3019 2015-01-11 05:54:59Z heas $ + ## diff --git a/rancid-3.2.p6 b/rancid-3.2.p6 new file mode 100644 index 0000000..6f47b61 --- /dev/null +++ b/rancid-3.2.p6 @@ -0,0 +1,42 @@ +Index: bin/control_rancid.in +=================================================================== +--- bin/control_rancid.in (revision 3116) ++++ bin/control_rancid.in (working copy) +@@ -206,13 +206,14 @@ + routers.down + routers.up + EOF ++ fi + if [ ! -f configs/.cvsignore ] ; then + rm -rf configs/.cvsignore +- cat > configs/.cvsignore < configs/.cvsignore < /dev/null 2>&1 + if [ $? -eq 1 ] ; then + rm -f $router diff --git a/rancid-3.2.p7 b/rancid-3.2.p7 new file mode 100644 index 0000000..ff66b86 --- /dev/null +++ b/rancid-3.2.p7 @@ -0,0 +1,12 @@ +Index: bin/control_rancid.in +=================================================================== +--- bin/control_rancid.in (revision 3119) ++++ bin/control_rancid.in (working copy) +@@ -236,6 +236,7 @@ + ;; + git ) + git status -s rancid.conf | grep '^?' ++ if [ $? -eq 0 ] ; then LN=1; else LN=0; fi + ;; + esac + if [ $LN -eq 0 ] ; then diff --git a/rancid.spec b/rancid.spec index 800286a..da19339 100644 --- a/rancid.spec +++ b/rancid.spec @@ -1,6 +1,6 @@ Name: rancid Version: 3.2 -Release: 1%{?dist} +Release: 2%{?dist} Summary: Really Awesome New Cisco confIg Differ Group: Applications/Internet @@ -11,6 +11,14 @@ Source1: %{name}.cron Source2: %{name}.logrotate Patch0: %{name}-conf.patch Patch1: %{name}-Makefile.patch +# Upstream Patches +Patch20: %{name}-%{version}.p1 +Patch21: %{name}-%{version}.p2 +Patch22: %{name}-%{version}.p3 +Patch23: %{name}-%{version}.p4 +Patch24: %{name}-%{version}.p5 +Patch25: %{name}-%{version}.p6 +Patch26: %{name}-%{version}.p7 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -42,6 +50,13 @@ including software and hardware (cards, serial numbers, etc) and uses CVS %setup -q -n %{name}-%{version} %patch0 -p1 %patch1 -p1 +%patch20 -p0 +%patch21 -p0 +%patch22 -p0 +%patch23 -p0 +%patch24 -p0 +%patch25 -p0 +%patch26 -p0 %build %configure \ @@ -120,6 +135,9 @@ exit 0 %changelog +* Sat May 30 2014 David Brown - 3.2-2 +- Add upstream patches + * Wed Nov 19 2014 David Brown - 3.2-1 - New Upstream Version - Fix Bugzilla #1165738