From 14e738c59854432b05e92f1f44e2dfcd9cdecf92 Mon Sep 17 00:00:00 2001 From: Mason James Date: Thu, 25 Apr 2013 21:44:13 +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/ rename existing file mv ./debian/control ./debian/control.old 2/ apply patch 3/ run script ./debian/update-control 4/ compare control files, to see improvements diff ./debian/control ./debian/control.old --- debian/control | 28 ++++++++-------------------- debian/control.in | 10 ++++++---- debian/list-deps | 15 ++++++++++++--- 3 files changed, 26 insertions(+), 27 deletions(-) diff --git a/debian/control b/debian/control index fe69e1e..b6db880 100644 --- a/debian/control +++ b/debian/control @@ -7,7 +7,7 @@ Standards-Version: 3.8.4 # Do not manually edit "control" or your changes will be clobbered when you # run update-control # NOTA BENE: Build dependencies end up as runtime dependencies as well. -# See debian/rules, the override_dh_gencontrol rules. +# See debian/rules, the override_dh_gencontrol rules. # There are some exceptions. Build-Depends: libalgorithm-checkdigits-perl, libanyevent-http-perl, @@ -19,7 +19,6 @@ Build-Depends: libalgorithm-checkdigits-perl, libcache-fastmmap-perl, libcache-memcached-fast-perl, libcache-perl, - libcgi-pm-perl | perl-modules, libcgi-session-driver-memcached-perl, libcgi-session-perl, libcgi-session-serialize-yaml-perl, @@ -40,9 +39,8 @@ Build-Depends: libalgorithm-checkdigits-perl, libdbd-mysql-perl, libdbd-sqlite2-perl, libdbi-perl, - libdigest-sha-perl | perl, libemail-date-perl, - libfile-path-perl | perl-modules, + libfile-slurp-perl, libgd-barcode-perl, libgd-gd2-noxpm-perl | libgd-gd2-perl, libgraphics-magick-perl, @@ -66,7 +64,6 @@ Build-Depends: libalgorithm-checkdigits-perl, libmime-lite-perl, libmodern-perl-perl, libmodule-bundled-files-perl, - libmodule-load-conditional-perl | perl-modules, libmoose-perl, libmoosex-storage-perl, libmoosex-types-perl, @@ -82,7 +79,6 @@ Build-Depends: libalgorithm-checkdigits-perl, libpoe-perl, libreadonly-perl, libreadonly-xs-perl, - libscalar-list-utils-perl, libschedule-at-perl, libsms-send-perl, libstring-random-perl, @@ -91,7 +87,6 @@ Build-Depends: libalgorithm-checkdigits-perl, libtemplate-plugin-htmltotext-perl, libtest-deep-perl, libtest-mockmodule-perl, - libtest-simple-perl | perl-modules, libtest-strict-perl, libtest-warn-perl, libtest-yaml-valid-perl, @@ -113,10 +108,9 @@ Build-Depends: libalgorithm-checkdigits-perl, libxml-simple-perl, libyaml-perl, libyaml-syck-perl, - perl, - perl-modules, debhelper (>= 7.0.50), gettext, python, python-debian, xsltproc, docbook-xsl, - libxml2-utils + libxml2-utils, + perl Package: koha-common Architecture: all @@ -133,7 +127,7 @@ Depends: ${misc:Depends}, ${koha:Depends}, perl-doc, pwgen, sudo, - tinymce2, + tinymce2, unzip, xmlstarlet, yaz @@ -202,7 +196,6 @@ Depends: libalgorithm-checkdigits-perl, libcache-fastmmap-perl, libcache-memcached-fast-perl, libcache-perl, - libcgi-pm-perl | perl-modules, libcgi-session-driver-memcached-perl, libcgi-session-perl, libcgi-session-serialize-yaml-perl, @@ -223,9 +216,8 @@ Depends: libalgorithm-checkdigits-perl, libdbd-mysql-perl, libdbd-sqlite2-perl, libdbi-perl, - libdigest-sha-perl | perl, libemail-date-perl, - libfile-path-perl | perl-modules, + libfile-slurp-perl, libgd-barcode-perl, libgd-gd2-noxpm-perl | libgd-gd2-perl, libgraphics-magick-perl, @@ -249,7 +241,6 @@ Depends: libalgorithm-checkdigits-perl, libmime-lite-perl, libmodern-perl-perl, libmodule-bundled-files-perl, - libmodule-load-conditional-perl | perl-modules, libmoose-perl, libmoosex-storage-perl, libmoosex-types-perl, @@ -265,7 +256,6 @@ Depends: libalgorithm-checkdigits-perl, libpoe-perl, libreadonly-perl, libreadonly-xs-perl, - libscalar-list-utils-perl, libschedule-at-perl, libsms-send-perl, libstring-random-perl, @@ -274,7 +264,6 @@ Depends: libalgorithm-checkdigits-perl, libtemplate-plugin-htmltotext-perl, libtest-deep-perl, libtest-mockmodule-perl, - libtest-simple-perl | perl-modules, libtest-strict-perl, libtest-warn-perl, libtest-yaml-valid-perl, @@ -295,9 +284,8 @@ Depends: libalgorithm-checkdigits-perl, libxml-sax-writer-perl, libxml-simple-perl, libyaml-perl, - libyaml-syck-perl, - perl, - perl-modules + libyaml-syck-perl + perl Architecture: all Description: Perl dep. for koha Koha is an Integrated Library Managment system for real-world libraries diff --git a/debian/control.in b/debian/control.in index 0fd9d44..bbe4bb0 100644 --- a/debian/control.in +++ b/debian/control.in @@ -7,11 +7,12 @@ Standards-Version: 3.8.4 # Do not manually edit "control" or your changes will be clobbered when you # run update-control # NOTA BENE: Build dependencies end up as runtime dependencies as well. -# See debian/rules, the override_dh_gencontrol rules. +# See debian/rules, the override_dh_gencontrol rules. # There are some exceptions. -Build-Depends:__AUTODEPENDS__, +Build-Depends:__AUTODEPENDS__, debhelper (>= 7.0.50), gettext, python, python-debian, xsltproc, docbook-xsl, - libxml2-utils + libxml2-utils, + perl Package: koha-common Architecture: all @@ -28,7 +29,7 @@ Depends: ${misc:Depends}, ${koha:Depends}, perl-doc, pwgen, sudo, - tinymce2, + tinymce2, unzip, xmlstarlet, yaz @@ -88,6 +89,7 @@ Description: Other dep. for koha Package: koha-perldeps Depends:__AUTODEPENDS__ + perl Architecture: all Description: Perl dep. for koha Koha is an Integrated Library Managment system for real-world libraries 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