From owner-freebsd-ports Mon Oct 21 13:50:10 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 23EE537B404 for ; Mon, 21 Oct 2002 13:50:04 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5667443E7B for ; Mon, 21 Oct 2002 13:50:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9LKo2x3009704 for ; Mon, 21 Oct 2002 13:50:02 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9LKo2nj009703; Mon, 21 Oct 2002 13:50:02 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7835937B401 for ; Mon, 21 Oct 2002 13:44:30 -0700 (PDT) Received: from woozle.rinet.ru (woozle.rinet.ru [195.54.192.68]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6C78A43E75 for ; Mon, 21 Oct 2002 13:44:29 -0700 (PDT) (envelope-from marck@woozle.rinet.ru) Received: from woozle.rinet.ru (localhost [127.0.0.1]) by woozle.rinet.ru (8.12.5/8.12.5) with ESMTP id g9LKiRTI030560 for ; Tue, 22 Oct 2002 00:44:27 +0400 (MSD) (envelope-from marck@woozle.rinet.ru) Received: (from marck@localhost) by woozle.rinet.ru (8.12.5/8.12.5/Submit) id g9LKiRke030559; Tue, 22 Oct 2002 00:44:27 +0400 (MSD) Message-Id: <200210212044.g9LKiRke030559@woozle.rinet.ru> Date: Tue, 22 Oct 2002 00:44:27 +0400 (MSD) From: Dmitry Morozovsky Reply-To: Dmitry Morozovsky To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/44357: net/ehnt: non-ASN update (0.3 -> 0.3_1) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 44357 >Category: ports >Synopsis: net/ehnt: non-ASN update (0.3 -> 0.3_1) >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Mon Oct 21 13:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Dmitry Morozovsky >Release: FreeBSD 4-STABLE i386 >Organization: Cronyx Plus LLC (RiNet ISP) >Environment: System: FreeBSD 4-STABLE >Description: Distributed with ehnt data file contains a bit outdated ASN list. Also, RIPE NCC had totally switched their database to RPSL, so new preparation logic should take place. Moreover, large part of traffic accounters don't need it ASN list all. So, provide a knob for ASN data download (still defaulted to yes), and patch for ASN list generation script. >How-To-Repeat: >Fix: Index: Makefile =================================================================== RCS file: /home/ncvs/ports/net/ehnt/Makefile,v retrieving revision 1.3 diff -u -r1.3 Makefile --- Makefile 5 Oct 2001 20:34:49 -0000 1.3 +++ Makefile 21 Oct 2002 20:36:00 -0000 @@ -7,16 +7,24 @@ PORTNAME= ehnt PORTVERSION= 0.3 +PORTREVISION= 1 CATEGORIES= net MASTER_SITES= ${MASTER_SITE_SOURCEFORGE} MASTER_SITE_SUBDIR= ${PORTNAME} -DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} \ - ${PORTNAME}_data-${PORTVERSION}${EXTRACT_SUFX} +DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} +.if !defined(NO_ASN_DATA) +DISTFILES+= ${PORTNAME}_data-${PORTVERSION}${EXTRACT_SUFX} +.endif MAINTAINER= marck@rinet.ru MAN1= ehnt.1 MAN8= ehntserv.8 + +.if defined(NO_ASN_DATA) +post-extract: + ${TOUCH} ${WRKSRC}/asnc.txt +.endif do-install: ${INSTALL_PROGRAM} ${WRKSRC}/ehnt ${PREFIX}/bin/ --- /dev/null Tue Oct 22 00:35:36 2002 +++ files/patch-ProcessASN.pl Tue Oct 22 00:22:21 2002 @@ -0,0 +1,128 @@ + +$FreeBSD$ + +--- ProcessASN.pl.orig Tue Oct 22 00:21:49 2002 ++++ ProcessASN.pl Tue Oct 22 00:21:53 2002 +@@ -4,7 +4,7 @@ + + #ftp://ftp.arin.net/netinfo/asn.txt + #ftp://ftp.apnic.net/pub/apnic/dbase/data/apnic.an.gz +-#ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz ++#ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz + + #and put them all in another file in a dumb format so they can + #be processed by my dumb C program. +@@ -51,28 +51,28 @@ + } + } + +-if (! -f "ripe.db.an" ) { +- if (-f "ripe.db.an.gz") { +- system "$gzip -d ripe.db.an.gz"; ++if (! -f "ripe.db.aut-num" ) { ++ if (-f "ripe.db.aut-num.gz") { ++ system "$gzip -d ripe.db.aut-num.gz"; + $r=$?; + if ($r > 0) { +- print "---> Retrieved ripe.db.an.gz, but could not run $gzip!\n"; ++ print "---> Retrieved ripe.db.aut-num.gz, but could not run $gzip!\n"; + print "---> Please get $gzip and try again\n"; + exit(1); + } + } else { +- if ( RetrieveFile("ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz","ripe.db.an.gz")) { +- system "$gzip -d ripe.db.an.gz"; ++ if ( RetrieveFile("ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz","ripe.db.aut-num.gz")) { ++ system "$gzip -d ripe.db.aut-num.gz"; + $r=$?; + if ($r > 0) { +- print "---> Retrieved ripe.db.an.gz, but could not run $gzip!\n"; ++ print "---> Retrieved ripe.db.aut-num.gz, but could not run $gzip!\n"; + print "---> Please get $gzip and try again\n"; + exit(1); + } + } else { +- print "---> Cannot retrieve ripe.db.an.gz\n"; ++ print "---> Cannot retrieve ripe.db.aut-num.gz\n"; + print "---> Please download it from\n"; +- print "---> ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.an.gz\n"; ++ print "---> ftp://ftp.ripe.net/ripe/dbase/split/ripe.db.aut-num.gz\n"; + $MissingFile=1; + } + } +@@ -109,7 +109,7 @@ + print "Processed $c ASes from asn.txt\n"; + + ProcessRipeDB("apnic.an"); +-ProcessRipeDB("ripe.db.an"); ++ProcessRipeDB("ripe.db.aut-num"); + + $c=0; + open OUTPUT,">asnc.txt"; +@@ -124,7 +124,7 @@ + $c=0; + open APNIC,"<$file"; + while () { +- if (/^\*an: AS(..*)/) { ++ if (/^(\*an|aut-num):\s+AS(..*)/) { + if ($an) { + if ($aa) { $ASNs{$an}=$aa; $c++; } + elsif ($mb) { $ASNs{$an}=$mb; $c++; } +@@ -133,25 +133,25 @@ + + undef $an; undef $aa; undef $mb; undef $de; + } +- $an=$1; ++ $an=$2; + } +- if (/^\*aa: (..*)/) { ++ if (/^(\*aa|as-name):\s+(..*)/) { + if (! $aa) { +- $aa=$1; ++ $aa=$2; + $aa=~ s/ /_/g; + if ($aa eq 'UNSPECIFIED') { + $aa="AS$an"; # 'an:' is always defined here + } + } + } +- if (/^\*mb: MAINT\-(..*)/) { ++ if (/^(\*mb|mnt-by):\s+MAINT\-(..*)/) { + if (! $mb) { +- $mb=$1; ++ $mb=$2; + $mb=~ s/ /_/g; + } +- } elsif (/^\*mb: (..*)/) { ++ } elsif (/^(\*mb|mnt-by):\s+(..*)/) { + if (! $mb) { +- $mb=$1; ++ $mb=$2; + $mb=~ s/ /_/g; + } + } +@@ -176,20 +176,12 @@ + + print "RetrieveFile: getting $location\n"; + +- $wget="wget"; +- $ncftp="ncftp"; +- $curl="curl"; +- system "$wget -q $location"; +- $r=$?; +- if ($r==0) { print "Got file with $wget.\n"; return 1; } ++ $fetch="fetch"; + +- system "$ncftp $location"; ++ system "$fetch $location"; + $r=$?; +- if ($r==0) { print "Got file with $ncftp.\n"; return 1; } ++ if ($r==0) { print "Got file with $fetch.\n"; return 1; } + +- system "$curl -o $filename $location"; +- $r=$?; +- if ($r==0) { print "Got file with $curl\n"; return 1; } +- if ($r > 0) { print "Could not get $filename with $curl, $wget or $ncftp.\n"; } ++ if ($r > 0) { print "Could not get $filename with $fetch, $curl, $wget or $ncftp.\n"; } + return 0; + } >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message