This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[cygport] pkg_info.cygport: correct search order for Perl dependencies


X-Git-Url: http://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 27b0696..a3d4d92 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 \


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]