rev 12783 - scripts

Modestas Vainius modax-guest at alioth.debian.org
Sat Nov 29 22:06:54 UTC 2008


Author: modax-guest
Date: 2008-11-29 22:06:54 +0000 (Sat, 29 Nov 2008)
New Revision: 12783

Added:
   scripts/cmake-install-tracer
Removed:
   scripts/symbols-helper
Modified:
   scripts/autofixtll
   scripts/dh_installgen
Log:
Commiting some scripts which I have been using

Modified: scripts/autofixtll
===================================================================
--- scripts/autofixtll	2008-11-29 21:12:33 UTC (rev 12782)
+++ scripts/autofixtll	2008-11-29 22:06:54 UTC (rev 12783)
@@ -527,6 +527,7 @@
 #    print $MSG_PREFIX, $islderror, $bdir, $btarget, @undefrefs;
     if ($islderror && $bdir && $btarget && @undefrefs) {
         my $libs = determine_needed_libs(\@LIBS, \@undefrefs);
+        $bdir = File::Spec->rel2abs($bdir, $builddir);
         if (@$libs) {
             if (write_target_link_libs($bdir, $btarget, $libs, $do_backups)) {
                 return 0; # again

Added: scripts/cmake-install-tracer
===================================================================
--- scripts/cmake-install-tracer	                        (rev 0)
+++ scripts/cmake-install-tracer	2008-11-29 22:06:54 UTC (rev 12783)
@@ -0,0 +1,236 @@
+#!/usr/bin/perl -w
+
+# strace -f -e trace=open,symlink,chdir,execve,fork,vfork -o file
+
+use strict;
+use Cwd qw(abs_path getcwd);
+use File::Spec;
+use Getopt::Long;
+use POSIX ":sys_wait_h";
+
+my $opt_input;
+my $opt_output = "-";
+my $opt_command;
+my $opt_straceout;
+
+my $child;
+my $child_exit;
+my $fifo;
+
+exit 2 unless (GetOptions(
+    "input|i=s" => \$opt_input,
+    "output|o=s" => \$opt_output,
+    "command|c=s" => \$opt_command,
+    "strace-output|so=s" => \$opt_straceout,
+));
+
+if ($opt_command) {
+    $fifo = `mktemp -u`;
+    chomp $fifo;
+    system("mkfifo '$fifo'") and die "mkfifo '$fifo' failed";
+    if ($child = fork()) {
+        open(INPUT, $fifo) or die "Unable to read from strace FIFO";
+    } else {
+        exec("strace -f -e trace=open,symlink,chdir,execve,fork,vfork,clone,exit_group -o '$fifo' -- $opt_command");
+    }
+    if ($opt_straceout) {
+        open(STRACE_OUT, ">", $opt_straceout) or die "Unable to open $opt_straceout for sctrace output writing";
+    }
+} elsif ($opt_input) {
+    open(INPUT, $opt_input) or die "Unable to open file '$opt_input'";
+} else {
+    die "Please specify input file (--input) or command (--command)";
+}
+
+my $mark_file = "cmake_install.cmake";
+my $mark_regexp = qr(\Q$mark_file\E);
+
+my %pids;
+my %origins;
+
+my $last_fork_pid = -1;
+my $our_cwd = Cwd->getcwd();
+my $first_pid;
+
+sub is_ours($) {
+    return shift() =~ m/^\Q$our_cwd\E/;
+}
+while (<INPUT>) {
+    print STRACE_OUT $_ if ($opt_straceout);
+    chomp;
+    if (m/^(\d+)\s+([^(]+)\((.+)\)\s*=\s*(\d+|\?)(.*)$/) {
+        my $pid = $1;
+        my $cmd = $2;
+        my $argstr = $3;
+        my $status = $4;
+        my $status_comment = $5;
+
+        my @_args = split(/,/, $argstr);
+        my @args = ();
+        my $cur_arg = "";
+
+        # Remember the pid of the first process
+        $first_pid = $pid if (!defined $first_pid);
+        if ($status eq "?") {
+            if ($cmd eq "exit_group" && $first_pid eq $pid) {
+                $child_exit = $argstr;
+            }
+            next;
+        } elsif ($status < 0) {
+            # Syscall failed
+            next;
+        }
+
+        # Split quoted arguments properly
+        foreach my $arg (@_args) {
+            my @quotes = split(/"/, $arg);
+            if (scalar(@quotes) % 2 == 1) {
+                $cur_arg .= $arg . ",";
+                next;
+            } else {
+                $cur_arg = $arg;
+            }
+            $cur_arg =~ s/^[\s"']+//;
+            $cur_arg =~ s/[\s"']+$//;
+            push(@args, "$cur_arg");
+            $cur_arg = "";
+        }
+
+        my $opid = $pids{$pid};
+
+        if ($cmd eq "vfork" || $cmd eq "fork") {
+            $last_fork_pid = $pid;
+        } elsif ($cmd eq "clone") {
+            my $new_pid = $status;
+            $pids{$new_pid} = new PID($new_pid, $pid, $pids{$pid}->cwd());
+        } elsif ($cmd eq "execve") {
+            # The PID could have been created by clone above
+            if (! exists $pids{$pid}) {
+                $pids{$pid} = new PID($pid, $last_fork_pid, ($last_fork_pid >= 0) ? $pids{$last_fork_pid}->cwd() : undef);
+            }
+        } else {
+            if (!defined $opid) {
+#                print STDERR "The process ($pid $cmd()) has not been created yet!: $_\n";
+                next;
+            }
+            if ($cmd eq "chdir") {
+                # chdir("obj-x86_64-linux-gnu") = 0
+                my $prev_cwd = $opid->cwd();
+                my $new_cwd = $opid->chdir($args[0]);
+                if (!defined $new_cwd) {
+                    print "chdir() followup problem for $pid from '$prev_cwd' to '$args[0]': ", $_, "\n";
+                }
+            } elsif ($cmd eq "open" || $cmd eq "symlink") {
+                my $path;
+                if ($cmd eq "open") {
+                    # open("/etc/ld.so.cache", O_RDONLY) = 3
+                    $path = $opid->resolve_path($args[0]);
+                    #my $flags = $args[1];
+                } else {
+                    # symlink("libsolidcontrol.so.4.2.0", "libsolidcontrol.so.4")
+                    $path = $opid->absolute_path($args[1]);
+                }
+
+                if ($path && is_ours($path)) {
+                    if ($cmd eq "open" && $path =~ m/$mark_regexp/) {
+                        my $origin = $path;
+                        $origin =~ s/$mark_regexp//;
+                        $origin = File::Spec->abs2rel($origin, $our_cwd);
+
+                        $opid->set_origin($origin);
+
+                        $origins{$origin} = [] if (!exists $origins{$origin});
+                    } else {
+                        my $origin = $opid->get_origin(\%pids);
+                        # If origin is not defined yet, we are not interested in this file
+                        push @{$origins{$origin}}, File::Spec->abs2rel($path, $our_cwd) if (defined $origin);
+                    }
+                }
+            }
+        }
+    }
+}
+
+close(STRACE_OUT) if ($opt_straceout);
+close(INPUT);
+
+open(OUTPUT, ">", $opt_output) or die "Unable to open file '$opt_output' for writing";
+for my $o (keys(%origins)) {
+    print OUTPUT "$o/:\n";
+    for my $file (@{$origins{$o}}) {
+        print OUTPUT "  $file\n";
+    }
+}
+close(OUTPUT);
+
+# Terminate
+if (defined $fifo) {
+    unlink $fifo;
+}
+
+if ($child) {
+    kill 15, $child;
+    waitpid($child, 0);
+    if (WIFSIGNALED($?)) {
+        exit WTERMSIG($?);
+    } elsif (WEXITSTATUS($?)) {
+        exit WEXITSTATUS($?);
+    } elsif (defined $child_exit) {
+        exit $child_exit;
+    } else {
+        exit 101;
+    }
+} else {
+    exit 0;
+}
+
+sub PID::new {
+    my ($cls, $pid, $parent_pid, $curdir) = @_;
+    $curdir = Cwd->getcwd() unless defined $curdir;
+    return bless( { pid => "$pid",
+                    parent_pid => "$parent_pid",
+                    dir => "$curdir",
+                    origin => undef }, $cls);
+}
+
+sub PID::chdir {
+    my ($self, $dir) = @_;
+    my $path = File::Spec->rel2abs($dir, $self->{dir});
+    if (-d $path) {
+        $self->{dir} = $path;
+        return $path;
+    } else {
+        return undef;
+    }
+}
+
+sub PID::cwd {
+    return shift()->{dir};
+}
+
+sub PID::absolute_path {
+    my ($self, $path) = @_;
+    return File::Spec->rel2abs($path, $self->{dir});
+    return (-f $path) ? $path : undef;
+}
+
+sub PID::resolve_path {
+    my ($self, $path) = @_;
+    $path = $self->absolute_path($path);
+    return (defined $path) ? abs_path($path) : undef;
+}
+
+sub PID::set_origin {
+    my ($self, $origin) = @_;
+    $self->{origin} = $origin;
+}
+
+sub PID::get_origin {
+    my ($self, $pids) = @_;
+    if ($self->{origin}) {
+        return $self->{origin};
+    } elsif (defined $pids && exists $pids->{$self->{parent_pid}}) {
+        return $pids->{$self->{parent_pid}}->get_origin($pids);
+    }
+    return undef;
+}


Property changes on: scripts/cmake-install-tracer
___________________________________________________________________
Name: svn:executable
   + *

Modified: scripts/dh_installgen
===================================================================
--- scripts/dh_installgen	2008-11-29 21:12:33 UTC (rev 12782)
+++ scripts/dh_installgen	2008-11-29 22:06:54 UTC (rev 12783)
@@ -9,6 +9,8 @@
 use strict;
 use File::Find;
 use File::Temp ':mktemp';
+use File::Spec;
+use Digest::MD5;
 
 use Debian::Debhelper::Dh_Lib;
 use Getopt::Long;
@@ -209,14 +211,17 @@
     $path = $self->get_path() if (! defined $path);
 
     if ($path) {
-        open (CMD, "md5sum '$path'|") || error("md5sum '$path' failed: $!");
-        my $sum;
-        $_ = <CMD>;
-        $sum = (split)[0];
-        close CMD;
+        my $md5 = new Digest::MD5;
+
+        open (FILE, $path) or main::error("Unable to open '$path' for checksuming: $!");
+        binmode(FILE);
+        $md5->addfile(*FILE)->hexdigest;
+        my $sum = $md5->hexdigest;
+        close(FILE);
+
         return $sum;
     } else {
-        error("Unable to find/open file '$path'");
+        main::error("Unable to find/open file '$path'");
     }
 }
 
@@ -408,6 +413,31 @@
     return $self->_match_filename($file->{dst});
 }
 
+package DH::InstGen::Pattern::External;
+our @ISA = qw( DH::InstGen::Pattern::Src );
+
+sub new {
+    my ($cls, $negated, $value, $type, $desc) = @_;
+    my $self = DH::InstGen::Pattern::Src::new(@_);
+    $self->{type} = $type;
+    $self->{desc} = $desc;
+    return $self;
+}
+
+sub type {
+    return shift()->{type};
+}
+
+sub _match {
+    my ($self, $file) = @_;
+    
+    if (my $d = $self->{desc}{$file->{dst}}) {
+        return $self->_match_filename($d);
+    } else {
+        return 0;
+    }
+}
+
 package DH::InstGen::Pattern::Link;
 our @ISA = qw( DH::InstGen::Pattern::Src );
 
@@ -467,12 +497,15 @@
 ###############################################################################
 package DH::InstGen::Pattern;
 
+my %externals;
+my $externals_re;
+
 sub new {
     my ($cls, $pattern) = @_;
     my $p = $pattern->[0];
     my $action;
 
-    if ($p =~ m/^(inst|miss|stop)(?:all|ing)?$/) {
+    if ($p =~ m/^(inst|miss|stop|skip)(?:all|ing)?$/) {
         $action = $1;
         shift @$pattern;
     } elsif ($p =~ m/^depends$/) {
@@ -495,12 +528,19 @@
         }
         if ($p =~ m/^dst:(.*)$/) {
             $self->add_pattern(new DH::InstGen::Pattern::Dst($negated,$1));
-        } elsif ($p =~ m/^src:(.*)$/){
+        } elsif ($p =~ m/^src:(.*)$/) {
             $self->add_pattern(new DH::InstGen::Pattern::Src($negated, $1));
         } elsif ($p =~ m/^link:(.*)$/) {
             $self->add_pattern(new DH::InstGen::Pattern::Link($negated, $1));
         } elsif ($p =~ m/^mime:(.*)$/) {
             $self->add_pattern(new DH::InstGen::Pattern::Magic($negated, $1));
+        } elsif ((defined $externals_re && $p =~ m/^($externals_re):(.*)$/) ||
+                 ($p =~ m/^([^:]+):(.+)$/ && -f "$1.ig-external")) {
+            my ($type, $value) = ($1, $2);
+            if (! exists $externals{$type}) {
+                DH::InstGen::Pattern->load_external($type);
+            }
+            $self->add_pattern(new DH::InstGen::Pattern::External($negated, $2, $1, $externals{$1}));
         } else {
             # Default is src
             $self->add_pattern(new DH::InstGen::Pattern::Src($negated, $p));
@@ -541,22 +581,204 @@
     return shift()->{action};
 }
 
+sub load_external {
+    my ($cls, $desc) = @_;
+    my @desc = split(/:/, $desc);
+    my ($type, $file);
+    if (scalar(@desc) == 1) {
+        $type = shift @desc;
+        $file = "$type.ig-external";
+    } else {
+        ($type, $file) = @desc;
+        $file = File::Spec->catfile($file, "$type.ig-external") if (-d $file);
+    }
+
+    my %desc;
+    my $last_key;
+    open(FILE, $file) or main::error("Unable to open external '$type' file '$file' for reading");
+    while (<FILE>) {
+        chomp;
+        if (defined $last_key && m/^\s+(.*)$/) {
+            $desc{$1} = $last_key;
+        } elsif (m/^(.*):$/) {
+            $last_key = $1;
+        } else {
+            main::error("Invalid syntax of the external '$type' file '$file' at line $.");
+        }
+    }
+    close(FILE);
+    if (scalar(keys %externals)) {
+        $externals_re .= "|" . $type;
+    } else {
+        $externals_re = $type;
+    }
+    $externals{$type} = \%desc;
+    return 1;
+}
+
+###############################################################################
+package DH::InstGen::Installgen;
+
+sub new {
+    my ($cls, $srcdir, $builddir) = @_;
+    return bless( { srcdir => $srcdir,
+                    builddir => $builddir,
+                    rules => [],
+                    processed => {},
+                    autoadd => {} }, $cls);
+}
+
+sub rules {
+    return @{shift()->{rules}};
+}
+
+sub is_package_virtual {
+    my ($self, $package) = @_;
+    return $package =~ /_virtual$/;
+}
+
+sub autoadd {
+    my ($self, $package) = @_;
+    return (exists $self->{autoadd}{$package}) ? $self->{autoadd}{$package} : [];
+}
+
+sub add_package {
+    my ($self, $package, $patterns) = @_;
+    push @{$self->{rules}}, { package => $package, patterns => $patterns };
+}
+
+sub parse_installgen($$) {
+    my ($self, $file) = @_;
+    my $patterns = [];
+    my $package;
+    my $is_virtual;
+    $file = "debian/installgen" unless ($file);
+
+    return undef if (! -r $file);
+
+    open(INSTALLGEN, $file) or main::error("Unable to open installgen rule file $file");
+    while (<INSTALLGEN>) {
+        if (/^\s*#/ || /^\s*$/) {
+            next; # Comment
+        } elsif (/^\s*\[\s*(.*)\s*\]\s*$/) {
+            if (defined $package && @$patterns && $package ne $1) {
+                $self->add_package($package, $patterns);
+                $patterns = [];
+            }
+            $package = $1; # new package name
+            $is_virtual = $self->is_package_virtual($package);
+        } else {
+            if (defined $package) {
+                my @patternset = split(/\s+/);
+                my $pattern = new DH::InstGen::Pattern(\@patternset);
+                if ($is_virtual && $pattern->action() eq "inst") {
+                    main::error("install action is forbidden in virtual package ($package) at ${file}:$.");
+                } else {
+                    push @$patterns, $pattern;
+                }
+            } else {
+                main::error("Expected package name at ${file}:$.");
+            }
+        }
+    }
+    if (defined $package && @$patterns) {
+        $self->add_package($package, $patterns);
+    }
+    close(INSTALLGEN);
+}
+
+sub verify_against_packagelist {
+    my $self = shift;
+
+    # Check if all packages specified in the rule file exist
+    my %packages;
+    map { $packages{$_} = 1 } @_;
+    for my $rule (@{$self->{rules}}) {
+        main::error("Package '". $rule->{package} . "' is not defined and is not virtual")
+            if (!exists $packages{$rule->{package}} &&
+                !$self->is_package_virtual($rule->{package}));
+    }
+}
+
+sub process_rule {
+    my ($self, $rule, $missing) = @_;
+    my ($package, $patterns) = ($rule->{package}, $rule->{patterns});
+    my @autoadd;
+
+    # Load additional package patterns from $package.installgen
+    my $gfile = "debian/$package.installgen";
+    if (! exists $self->{processed}{$package} && -r $gfile) {
+        my @patternset = Debian::Debhelper::Dh_Lib::filedoublearray($gfile);
+        for my $pattern (@patternset) {
+            push @{$patterns}, new DH::InstGen::Pattern($pattern);
+        }
+    }
+    $self->{processed}{$package} = 1;
+
+    if (@$missing && @$patterns) {
+        for my $pattern (@$patterns) {
+            # Search for the missing files in the source/build tree
+            foreach my $miss (@$missing) {
+                next if $miss->{st_found};
+                next if $miss->{st_stop};
+                next if (exists $miss->{st_skip} && $miss->{st_skip} eq $package);
+
+                if ($pattern->has_type("src") && ! defined($miss->{src})) {
+                    $miss->locate($self->{builddir});
+                }
+                my $match = $pattern->match($miss);
+                if (defined $match) {
+                    if ($match eq "skip") {
+                        $miss->{st_skip} = $package;
+                        next;
+                    } elsif ($match eq "stop") {
+                        $miss->{st_stop} = 1;
+                    } else {
+                        if ($match eq "inst") {
+                            push @autoadd, $miss->stripped_dstpath($self->{srcdir});
+                        }
+                        # Otherwise the file was defined as missing on purpose
+                        $miss->{st_found} = 1;
+                    }
+                }
+            }
+        }
+    }
+    push @{$self->{autoadd}{$package}}, @autoadd;
+}
+
+sub process {
+    my $self = shift;
+    my $missing = shift;
+    my %dopackages;
+
+    map { $dopackages{$_} = 1 } @_;
+
+    foreach my $rule (@{$self->{rules}}) {
+        if (  exists $dopackages{$rule->{package}} ||
+              $self->is_package_virtual($rule->{package})  ) {
+            $self->process_rule($rule, $missing);
+        }
+    }
+}
+
 ###########################################################################
 package main;
 
 my %autoremove;
-my %autoadd;
 my %instgen_opts;
 
 # Parse installgen specific command line options first
 my $prevconfig = Getopt::Long::Configure("pass_through", "no_auto_abbrev");
 $instgen_opts{SORT} = 1;
 $instgen_opts{MANPAGES} = 1;
+$instgen_opts{EXTERNALS} = [];
 exit 1 unless (GetOptions(
     "builddir|b=s" => \$instgen_opts{BUILDDIR},
     "validate|test|t" => \$instgen_opts{VALIDATE},
     "sort!" => \$instgen_opts{SORT},
     "manpages!" => \$instgen_opts{MANPAGES},
+    "external|e=s" => $instgen_opts{EXTERNALS},
 ));
 
 # Get global debhelper options
@@ -584,7 +806,7 @@
 
         # Read. Remove non-matching patterns
         if (-r $file && !$instgen_opts{VALIDATE}) {
-            open (DH_INSTALL, "<$file") || error("cannot read $file: $!");
+            open (DH_INSTALL, "<$file") or main::error("cannot read $file: $!");
             while ($again || ($_ = <DH_INSTALL>)) {
                 if (defined $p && !m/^#/ && m/(?:^|\s+)\Q$p\E(?:\s+|$)/) {
                     my @set = split;
@@ -643,7 +865,7 @@
         push @lines, map { "$_\n" } @$add if (@$add);
         @lines = sort(@lines) if ($instgen_opts{SORT});
 
-        open (DH_INSTALL, ">$tmpfile") || error("cannot write to $tmpfile: $!");
+        open (DH_INSTALL, ">$tmpfile") or main::error("cannot write to $tmpfile: $!");
         for (@lines) {
             print DH_INSTALL $_;
         }
@@ -657,67 +879,6 @@
     }
 }
 
-sub installgen_process {
-    my ($package, $pdepends, $pdone, $missing) = @_;
-
-    return if (!exists $pdone->{$package} || $pdone->{$package});
-
-    # Process dependencies first
-    $pdone->{$package} = 2; # Processing
-    foreach my $dep (@{$pdepends->{$package}}) {
-        next if ($dep eq $package); # might happen in case of 'last'
-        
-        my $depdone = (exists $pdone->{$dep}) ? $pdone->{$dep} : 0;
-        if ($depdone == 2) {
-                verbose_print("installgen dependency loop for the package $dep detected. Breaking it...");
-        } elsif ($depdone == 0) {
-                installgen_process($dep, $pdepends, $pdone, $missing);
-        }
-    }
-
-    # Handle our *.installgen
-    my $gfile=pkgfile($package, "installgen");
-
-    my @installgen;
-    if ($gfile) {
-        @installgen=filedoublearray($gfile);
-    }
-
-    my @autoadd;
-
-    if (@$missing && @installgen) {
-        for my $set (@installgen) {
-            my $pattern = new DH::InstGen::Pattern($set);
-
-            # Search for the missing files in the source/build tree
-            foreach my $miss (@$missing) {
-                next if $miss->{found};
-                next if $miss->{stop};
-
-                if ($pattern->has_type("src") && ! defined($miss->{src})) {
-                    $miss->locate($builddir);
-                }
-                my $match = $pattern->match($miss);
-                if (defined $match) {
-                    if ($match eq "stop") {
-                        $miss->{stop} = 1;
-                    } else {
-                        if ($match eq "inst") {
-                            push @autoadd, $miss->stripped_dstpath($srcdir);
-                        }                    
-                        # Otherwise the file was defined as missing on purpose
-                        $miss->{found} = 1;
-                    }
-                }
-            }
-        }
-    }
-
-    $autoadd{$package} = \@autoadd;
-
-    $pdone->{$package} = 1; # Complete
-}
-
 sub check_for_autoremove {
     my ($package, $type, $fileset, $sdir) = @_;
     $sdir = "." if (! defined $sdir);
@@ -750,6 +911,11 @@
     $autoremove{$package}{manpages} = [];
 }
 
+# Initialize externals
+for my $external (@{$instgen_opts{EXTERNALS}}) {
+    DH::InstGen::Pattern->load_external($external);
+}
+
 # Read and process *.install unless dh_installgen was started in the
 # validate mode. In that case, assume none of the files are installed.
 if (!$instgen_opts{VALIDATE}) {
@@ -796,63 +962,34 @@
     $srcdir='debian/tmp';
 }
 
+main::error("Unable to find sourcedir: '$srcdir'") unless (-d $srcdir);
+
 my @missing = ();
+my $found_file;
 
 find( { wanted => sub {
+    $found_file = 1;
     -f || -l || return;
     if (! excludefile($_) && ! $installed->check($_) ) {
         push @missing, new DH::InstGen::File($_);
     }
 }, no_chdir => 1 }, $srcdir);
 
-# We need to determine package processing order
-my %pdepends;
-my %pdone;
-my @pkgs;
-foreach my $package (@{$dh{DOPACKAGES}}) {
-    my $gfile=pkgfile($package, "installgen");
+main::error("Sorry, but '$srcdir' appears to be empty") unless ($found_file);
 
-    if (-r $gfile) {
-        open(GFILE, $gfile);
-        while (<GFILE>) {
-            last if (!m/^(?:#|\s*$)/);
-        }
-        close GFILE;
+# Process packages with installgen
+my $installgen = new DH::InstGen::Installgen($srcdir, $builddir);
+$installgen->parse_installgen("debian/installgen");
 
-        my @parts = split;
-        my $p = shift @parts;
-        if (defined $p && $p eq "depends") {
-            if (@parts > 0) {
-                if ($parts[0] eq "first") {
-                    unshift @pkgs, $package;
-                    $pdepends{$package} = [];
-                } elsif ($parts[0] eq "last") {
-                    push @pkgs, $package;
-                    $pdepends{$package} = \@pkgs;
-                } else {
-                    push @pkgs, $package;
-                    $pdepends{$package} = \@parts;
-                }
-            }
-        }
-        
-        if (!exists $pdepends{$package}) {
-            push @pkgs, $package;
-            $pdepends{$package} = [];
-        } 
-        $pdone{$package} = 0;
-    }
+if ($installgen->rules()) {
+    $installgen->verify_against_packagelist(getpackages());
+    $installgen->process(\@missing, @{$dh{DOPACKAGES}});
 }
 
-# Process all packages for installgen (recursively)
-foreach my $package (@pkgs) {
-    installgen_process($package, \%pdepends, \%pdone, \@missing);
-}
-
 if ($dh{LIST_MISSING} || $dh{FAIL_MISSING}) {
     my $unmatched = 0;
     foreach (@missing) {
-        unless ($_->{found}) {
+        unless ($_->{st_found}) {
             $unmatched++;
             warning "Not installed files are listed below:" if ($unmatched == 1 && $dh{LIST_MISSING});
             print STDERR $_->stripped_dstpath($srcdir), "\n" if ($dh{LIST_MISSING});
@@ -861,7 +998,7 @@
         }
     }
     if ($dh{FAIL_MISSING} && $unmatched) {
-        error("missing files ($unmatched), aborting");
+        main::error("missing files ($unmatched), aborting");
     }
 }
 
@@ -869,9 +1006,10 @@
     # Handle *.install files
     my $file=pkgfile($package, "install");
     $file = "debian/$package.install" if (! -r $file);
+    
+    rewrite_install_file($file, @{$autoremove{$package}{install}},
+        @{$installgen->autoadd($package)});
 
-    rewrite_install_file($file, @{$autoremove{$package}{install}}, @{$autoadd{$package}});
-
     # Handle *.manpages file (TODO; improve)
     $file=pkgfile($package, "manpages");
     if ($file && exists $autoremove{$package}) {

Deleted: scripts/symbols-helper




More information about the pkg-kde-commits mailing list