Changeset 859 for trunk/cgi-bin/extras


Ignore:
Timestamp:
04/17/16 12:55:28 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Refine and correct handling of master and allocation create/modify stamps;
use separate variables for the master blocks vs allocations. Previous
behaviour may have been incorrect in a few cases.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/extras/db2rwhois.pl

    r858 r859  
    33# ipdb/cgi-bin/extras/db2rwhois.pl
    44# Pull data from ipdb and mangle it into RWHOIS
    5 # Initial version 03/26/2004 kdeugau against IPDB v1
    65###
    76# Revision info
     
    102101  $masterblocks[$i] = new NetAddr::IP $master;
    103102  my ($ctime,undef) = split /\s/, $mcreate;
    104   ($mmod,undef) = split /\s/, $mmod;
    105 
    106   print "$masterblocks[$i] $ctime $mmod\n";
     103  my ($mtime,undef) = split /\s/, $mmod;
     104
     105  print "$masterblocks[$i] $ctime $mtime\n";
    107106
    108107  my $date = strftime("%Y-%m-%d", localtime);
     
    213212        "Tech-Contact: $IPDB::org_techhandle\n".
    214213        "Created: $ctime\n".
    215         "Updated: $mmod\n".
     214        "Updated: $mtime\n".
    216215        "Updated-By: $IPDB::org_email\n";
    217216
    218217  # And now the subblocks
    219218  $ssth->execute($mid, $master) or die "nosubs: $!\n".$dbh->errstr."\n";
    220   while (my ($cidr, $custid, $type, $city, $desc, $ctime, $mtime, $swip, $defcust) = $ssth->fetchrow_array) {
     219  while (my ($cidr, $custid, $type, $city, $desc, $bctime, $bmtime, $swip, $defcust) = $ssth->fetchrow_array) {
    221220
    222221# We get master block info from @masterblocks.
     
    245244
    246245    # Fix up datestamps.  We don't *really* need sub-microsecond resolution on our exports...
    247     ($ctime) = ($ctime =~ /^(\d+-\d+-\d+)\s+/);
    248     ($mtime) = ($mtime =~ /^(\d+-\d+-\d+)\s+/);
     246    ($bctime) = ($bctime =~ /^(\d+-\d+-\d+)\s+/);
     247    ($bmtime) = ($bmtime =~ /^(\d+-\d+-\d+)\s+/);
    249248
    250249# Notes:
     
    280279        "Country-Code: $IPDB::org_country\n".
    281280        "Tech-Contact: $IPDB::org_techhandle\n".
    282         "Created: $ctime\n".
    283         "Updated: $mtime\n".
     281        "Created: $bctime\n".
     282        "Updated: $bmtime\n".
    284283        "Updated-By: $IPDB::org_email\n";
    285284    } else {
     
    304303        "Country-Code: ".($country ? $country : $IPDB::org_country)."\n".
    305304        "Tech-Contact: ".($tech ? $tech : $IPDB::org_techhandle)."\n".
    306         "Created: $ctime\n".
    307         "Updated: $mtime\n".
     305        "Created: $bctime\n".
     306        "Updated: $bmtime\n".
    308307        "Updated-By: $IPDB::org_email\n";
    309308    } # swip
Note: See TracChangeset for help on using the changeset viewer.