[rancid] modifying diff conditions
Wayne Eisenberg
Wayne.Eisenberg at CarolinasIT.com
Fri Nov 22 10:39:24 UTC 2013
OK, I wasn't off too much but I didn't trust my results due to my non-mastery in the linux world. The only other way I can see making this work is to leave the cvs diff alone, and modify the rancid script itself. This is a PaloAlto device, so it's actually a script called panlong. Here's the section :
# This routine parses "show system info"
sub ShowInfo {
my($slot);
print STDERR " In ShowInfo:: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
next if /^\s*$/;
last if (/^$prompt/);
next if (/^(time:|uptime:)/);
ProcessHistory("INFO","","","#$_");
}
ProcessHistory("INFO","","","#\n");
return(0);
}
If I add a line 'next if (/^(wildfire|av)/);' in the "while (<INPUT>)" section, that ought to skip retrieving those lines. If they're not retrieved, they can't be diff'ed, right?
-----Original Message-----
From: 'heasley' [mailto:heas at shrubbery.net]
Sent: Thursday, November 21, 2013 7:27 PM
To: Wayne Eisenberg
Cc: 'heasley'; 'rancid-discuss at shrubbery.net'
Subject: Re: [rancid] modifying diff conditions
Tue, Nov 19, 2013 at 09:07:38PM +0000, Wayne Eisenberg:
> if [ $RCSSYS = "cvs" ] ; then
> cvs -f diff -U 4 -ko --ignore-matching-lines='(.*av-.*|.*wildfire-.*|.*threat-.*|.*url-filtering-.*|.*app-.*|.*call-forwarding.*)' | sed -e '/^RCS file: /d' -e '/^--- /d' \ -e '/^+++ /d' -e 's/^\([-+ ]\)/\1 /' >$TMP.diff
I messed around with this option a bit. what i've discovered is that
1) is doesnt accept extended regexps
2) it does allow the option to appear more than once, or at least twice
3) http://www.delorie.com/gnu/docs/cvs/cvs_130.html implies that it will
only work for changes that affect one line. ie:
--ignore-matching-lines='foo'
will not filter a diff like:
> interface foo
> description foo to spamalot
4) it does not appear to appear to work with -U
YFMV (your frustration may vary).
________________________________
The information in this Internet e-mail (and any attachments) is confidential, may be legally privileged and is intended solely for the Addressee(s) named above. If you are not the intended recipient, or the employee or agent responsible for delivering it to the intended recipient, then any dissemination or copying of this e-mail (and any attachments) is prohibited and may be unlawful. If you received this e-mail in error, please immediately notify us by e-mail or telephone, then delete the message. Thank you.
More information about the Rancid-discuss
mailing list