From: Achim Gratz Date: Sun, 18 May 2014 15:52:10 +0000 (+0200) Subject: pkg_info.cygport: correct search order for Perl dependencies X-Git-Url: https://repo.or.cz/w/cygport/rpm-style.git/commitdiff_plain/f238f9c846690ba0d3ba259dee6c301f1ff98648 pkg_info.cygport: correct search order for Perl dependencies * lib/pkg_info.cygpart: Correct search order for Perl dependencies and suppress auto-generation of Perl dependencies when NO_PERL_DEPSĀ is defined. Dependency generation for Perl at least is too simplistic and doesn't take into account that some modules required or used might actually be optional. It tends to generate too long dependency lists that vary with the Perl distributions already installed. For starters, the search order should be the reverse of @INC to skip dependencies that are built-in to perl already, but that doesn't pick up those modules that are needed with a higher version since only the presence of the module is detected. Files in site_perl shoud never be searched since these are local installs. Files in vendor_perl might be useful to check, however due to the version problem it is better to inject the module dpenedencies from the cygport file. So skip those searches when NO_PERL_DEPS is defined, which it will be for auto-generated cygport files for Perl distributions (the information is pulled from CPAN/MetaCPAN). --- diff --git a/lib/pkg_info.cygpart b/lib/pkg_info.cygpart index 27b06964..a3d4d920 100644 --- a/lib/pkg_info.cygpart +++ b/lib/pkg_info.cygpart @@ -332,7 +332,12 @@ __list_deps() { if check_prog perl then - pldirs=($(perl -e 'print join(" ",@INC)')) + if defined NO_PERL_DEPS + then + pldirs=($(perl -e 'print join(" ",reverse grep !/(vendor|site)_perl/,@INC)')) + else + pldirs=($(perl -e 'print join(" ",reverse grep !/site_perl/,@INC)')) + fi pldirs+=" ${DEPS_PATH//:/ }" for pldep in $(find "${@//^_^/ }" -path 'usr/share/doc/*' -prune \ -o -path 'usr/share/help/*' -prune \