Date: Tue, 11 Apr 2017 07:17:49 +0000 (UTC) From: Matthew Seaman <matthew@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r438250 - in head/net/rtg: . files Message-ID: <201704110717.v3B7HnSS099421@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: matthew Date: Tue Apr 11 07:17:49 2017 New Revision: 438250 URL: https://svnweb.freebsd.org/changeset/ports/438250 Log: Patch based off of revision 434135 Fix configuration paths in CGIs and reports to include /usr/local/etc/rtg. Affects common.php, reports.pl, and 95.pl. This will fix the CGIs to almost work out of the box. Improve rtgtargmkr.pl to skip unresponsive routers rather than dying. Add USES=ssl PR: 217108 Submitted by: andrew.fengler@scaleengine.com Approved by: maintainer timeout (15 days) Added: head/net/rtg/files/patch-etc_95.pl (contents, props changed) head/net/rtg/files/patch-etc_common.php.in (contents, props changed) head/net/rtg/files/patch-etc_report.pl (contents, props changed) Modified: head/net/rtg/Makefile head/net/rtg/files/patch-etc-rtgtargmkr.pl.in Modified: head/net/rtg/Makefile ============================================================================== --- head/net/rtg/Makefile Tue Apr 11 07:14:53 2017 (r438249) +++ head/net/rtg/Makefile Tue Apr 11 07:17:49 2017 (r438250) @@ -3,7 +3,7 @@ PORTNAME= rtg PORTVERSION= 0.7.4 -PORTREVISION= 13 +PORTREVISION= 14 CATEGORIES= net MASTER_SITES= SF \ ftp://ftpmirror.uk/freebsd-ports/rtg/ @@ -19,7 +19,7 @@ RUN_DEPENDS= p5-DBI>=0:databases/p5-DBI USE_RC_SUBR= rtgpoll WANT_PERL= yes -USES= shebangfix mysql:client +USES= shebangfix mysql:client ssl SHEBANG_FILES= etc/95.pl etc/report.pl etc/rtgtargmkr.pl.in SUB_FILES= pkg-message GNU_CONFIGURE= yes @@ -46,5 +46,8 @@ LDFLAGS+= -fstack-protector post-patch: @${MV} ${WRKSRC}/etc/rtg.conf ${WRKSRC}/etc/rtg.conf.sample @${MV} ${WRKSRC}/etc/routers ${WRKSRC}/etc/routers.sample + @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/etc/95.pl + @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/etc/report.pl + @${REINPLACE_CMD} -e "s|%%PREFIX%%|${PREFIX}|g" ${WRKSRC}/etc/common.php.in .include <bsd.port.mk> Modified: head/net/rtg/files/patch-etc-rtgtargmkr.pl.in ============================================================================== --- head/net/rtg/files/patch-etc-rtgtargmkr.pl.in Tue Apr 11 07:14:53 2017 (r438249) +++ head/net/rtg/files/patch-etc-rtgtargmkr.pl.in Tue Apr 11 07:17:49 2017 (r438250) @@ -1,4 +1,4 @@ ---- etc/rtgtargmkr.pl.in.orig 2016-10-25 16:28:59 UTC +--- etc/rtgtargmkr.pl.in.orig 2016-11-04 16:36:53 UTC +++ etc/rtgtargmkr.pl.in @@ -126,7 +126,7 @@ sub find_router_id { &sql_insert($sql); @@ -9,3 +9,21 @@ &sql_insert($sql); } } +@@ -289,7 +289,7 @@ sub main { + $year + 1900, $hour, $min; + print CFG "# Host\tOID\tBits\tCommunity\tTable\tID\tDescription\n"; + +- foreach $router (@routers) { ++ POKE: foreach $router (@routers) { + $bits = $counterBits{$router}; + # Sanity check bits + $bits = $defbits if ( ( $bits != 32 ) && ( $bits != 64 ) ); +@@ -304,7 +304,7 @@ sub main { + $system = join ( ' ', @result ); + print "System: $system\n" if $DEBUG; + $session = SNMP_Session->open( $router, $communities{$router}, 161 ) +- || die "Error opening SNMP session to $router"; ++ || ( print "Error opening SNMP session to $router" and next POKE ); + if ( $system =~ /.*Cisco.*WS-.*/ ) { + $system = "Catalyst"; + $session->map_table( $catalyst, \&process ); Added: head/net/rtg/files/patch-etc_95.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/rtg/files/patch-etc_95.pl Tue Apr 11 07:17:49 2017 (r438250) @@ -0,0 +1,11 @@ +--- etc/95.pl.orig 2016-11-04 16:36:01 UTC ++++ etc/95.pl +@@ -31,7 +31,7 @@ $pass="rtgdefault"; + $onedaysec=60*60*24; + + # Default locations to find RTG configuration file +-@configs = ("rtg.conf", "/usr/local/rtg/etc/rtg.conf", "/etc/rtg.conf"); ++@configs = ("rtg.conf", "%%PREFIX%%/etc/rtg/rtg.conf", "/usr/local/rtg/etc/rtg.conf", "/etc/rtg.conf"); + foreach $conf (@configs) { + if (open CONF, "<$conf") { + print "Reading [$conf].\n" if $DEBUG; Added: head/net/rtg/files/patch-etc_common.php.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/rtg/files/patch-etc_common.php.in Tue Apr 11 07:17:49 2017 (r438250) @@ -0,0 +1,16 @@ +--- etc/common.php.in.orig 2003-09-26 15:52:29 UTC ++++ etc/common.php.in +@@ -6,10 +6,13 @@ + $pass="rtgdefault"; + $db="rtg"; + $refresh=300; ++ ++ date_default_timezone_set ( 'UTC' ); + + /* Default locations to find RTG configuration file */ + $configs[] = 'rtg.conf'; + $configs[] = '@RTG_HOME@/etc/rtg.conf'; ++ $configs[] = '%%PREFIX%%/etc/rtg/rtg.conf'; + $configs[] = '/usr/local/rtg/etc/rtg.conf'; + $configs[] = '/etc/rtg.conf'; + Added: head/net/rtg/files/patch-etc_report.pl ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/rtg/files/patch-etc_report.pl Tue Apr 11 07:17:49 2017 (r438250) @@ -0,0 +1,11 @@ +--- etc/report.pl.orig 2016-11-04 16:36:08 UTC ++++ etc/report.pl +@@ -30,7 +30,7 @@ $pass="rtgdefault"; + $onedaysec=60*60*24; + + # Default locations to find RTG configuration file +-@configs = ("rtg.conf", "/usr/local/rtg/etc/rtg.conf", "/etc/rtg.conf"); ++@configs = ("rtg.conf", "%%PREFIX%%/etc/rtg/rtg.conf", "/usr/local/rtg/etc/rtg.conf", "/etc/rtg.conf"); + foreach $conf (@configs) { + if (open CONF, "<$conf") { + print "Reading [$conf].\n" if $DEBUG;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201704110717.v3B7HnSS099421>