From 4dcd8c7af31e489ba7b62b5aa47d0e0e4d9df5d9 Mon Sep 17 00:00:00 2001 From: Mason James Date: Thu, 25 Apr 2013 20:16:05 +1200 Subject: [PATCH] Bug 9927 - tweak list-deps script to build a better ./debian/control file Content-Type: text/plain; charset="utf-8" to test... 1/ apply patch 2/ rename existing file mv ./debian/control ./debian/control.old 3/ run script ./debian/update-control 4/ compare files, to see improvements diff ./debian/control ./debian/control.old --- debian/list-deps | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/debian/list-deps b/debian/list-deps index dcb6fb8..e5ace5d 100755 --- a/debian/list-deps +++ b/debian/list-deps @@ -38,23 +38,32 @@ my $deps = $C4::Installer::PerlDependencies::PERL_DEPS; my $prefix = "^/usr/((lib|share)/perl5|(lib|share)/perl/[0-9.]+)"; + foreach my $module ( keys %$deps ) { next if $ignore{$module}; + my $ver = $deps->{$module}->{'min_ver'}; my $subpath = $module; $subpath =~ s,::,/,g; my $output = qx(apt-file -l -x search "$prefix/$subpath.pm\$"); + my @temp = split( /\n/, $output ); my @lines = (); # Remove packages that are required/essential and always installed on # a Debian system. Debian packages should not have unversioned # dependencies on such packages. - foreach my $line (@temp) { - if ( $line ne "perl-base" ) { + + #skip if module if its already satisfied by a base perl module + my @skip = grep( /^perl-base$|^perl-modules$|^perl$/, @temp); + next if scalar @skip > 0 ; + + # or else, add that module + my @temp2 = grep( !/^perl-base$|^perl-modules$|^perl$/, @temp); + foreach my $line (@temp2) { @lines = ( @lines, $line ); - } } + if ( scalar(@lines) == 1 && $lines[0] ne "" ) { my $pkg = $lines[0]; print "$pkg\n"; -- 1.7.2.5