Public

PmWiki e

Jak sem si maloval debianí závislosti

  
 use strict;
 use Parse::DebControl;
 use Data::Dumper;

 my $parser = new Parse::DebControl;
 $parser->DEBUG();
 my $data = $parser->parse_file(shift @ARGV ||die);

 #print Dumper($data) if $debug;

 my $tmp;
 my $dep;

 print("digraph First {\n");

 foreach my $tmp (@$data) {
 #       $tmp->{Package} =~ s/[\.-]/_/g;
         if($tmp->{Status} ne "install ok installed") { next; }

         print("\"".$tmp->{Package}."\"");
         if( defined($tmp->{Depends}) ){
                 print(" -> {");
                 foreach $dep (split(", ", $tmp->{Depends})) {
                         $dep =~ s/(\w*).*/$1/;
                         print($dep."; ");
                 }
                 print("}");
         }
         print(";\n");
 }

 print("}\n");

a prvni vysledek je zajimavej tim ze jsou akorat 4 vrstvy a libc6 je fakt dost strategicky .. ;)

 # dot -Tjpg first -o first.jpg
Edit - History - Print - Recent Changes - Search
Page last modified on August 14, 2005, at 05:59 PM
<