/[ldap.old]/ldif2dot
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Annotation of /ldif2dot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Fri May 26 16:19:19 2000 UTC (19 years, 4 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +24 -6 lines
multi-line support, filter

1 dpavlin 1.1 #!/usr/local/bin/perl -w
2    
3 dpavlin 1.2 undef $filter;
4    
5     sub filter {
6     my ($dn) = @_;
7     return $dn =~ /o=agrokor.hr/i && $dn !~ /o=NetscapeRoot/;
8     }
9    
10 dpavlin 1.1 print "digraph ldif {\n";
11    
12 dpavlin 1.2 $line=<>; chomp $line;
13    
14     while($nline=<>) {
15     chomp $nline;
16     while ($nline=~/^ (.*)$/) {
17     $line.=$1;
18     $nline=<>; chomp $nline;
19     }
20     # print STDERR "$line\n\n";
21     if ($line =~ /^dn: *(.*)$/ && filter($1)) {
22     my $dn=$1;
23     $dn=~s/"//g; # nuke quotes
24     print STDERR "$dn\n";
25     @dn=split(/, */,$dn);
26 dpavlin 1.1 undef $lval; # last value
27     foreach (@dn) {
28     ($el,$val) = split (/= */,$_);
29     next if ($el eq "uid");
30     if (!defined($exist{$val})) {
31     $exist{$val}++;
32     }
33 dpavlin 1.2 if ($lval && !defined($conn{"$val,$lval"})) {
34 dpavlin 1.1 print "\"$val\" -> \"$lval\";\n";
35 dpavlin 1.2 $conn{"$val,$lval"}++;
36 dpavlin 1.1 }
37     $lval = $val;
38     }
39     }
40 dpavlin 1.2 $line=$nline;
41 dpavlin 1.1 }
42    
43     print "}\n";

  ViewVC Help
Powered by ViewVC 1.1.26