Changeset 461


Ignore:
Timestamp:
02/20/13 16:59:41 (12 years ago)
Author:
Kris Deugau
Message:

/trunk

Actually handle the -c option in tiny-import.pl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tiny-import.pl

    r396 r461  
    8585my %cnt;
    8686my @deferred;
     87my $converted = 0;
    8788my $errstr = '';
    8889
     
    167168
    168169  # .. but we can at least say how many records weren't imported.
    169   print "$ok OK, ".scalar(@deferred)." deferred records in $flatfile\n";
    170   $#deferred = -1;
    171 
     170  print "$ok OK, ".scalar(@deferred)." deferred, $converted downconverted records in $flatfile\n";
     171  undef @deferred;
     172  $converted = 0;
    172173
    173174  # Sub for various nonstandard types with lots of pure bytes expressed in octal
     
    273274        $recsth->execute($fparent, $rparent, $host, 65280, $ip, 0, 0, 0, $ttl, $loc);
    274275      } else {
    275         push @deferred, $rec unless $nodefer;
    276         $impok = 0;
    277         #  print "$tmporig deferred;  can't find both forward and reverse zone parents\n";
     276        if ($importcfg{conv}) {
     277          # downconvert A+PTR if forward zone is not found
     278          $recsth->execute(0, $rparent, $host, 12, $ip, 0, 0, 0, $ttl, $loc);
     279          $converted++;
     280        } else {
     281          push @deferred, $rec unless $nodefer;
     282          $impok = 0;
     283          #  print "$tmporig deferred;  can't find both forward and reverse zone parents\n";
     284        }
    278285      }
    279286
Note: See TracChangeset for help on using the changeset viewer.