From 336acb3e18d22bfdea1255cb9c1b0b549f01c17c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 11 Oct 2013 11:05:42 -0700 Subject: Ignore the Windows system directories when searching for DLLs We don't want to deploy kernel32.dll or such. Signed-off-by: Thiago Macieira Signed-off-by: Dirk Hohndel --- scripts/win-ldd.pl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'scripts/win-ldd.pl') diff --git a/scripts/win-ldd.pl b/scripts/win-ldd.pl index 6907016bb..8a25c3434 100644 --- a/scripts/win-ldd.pl +++ b/scripts/win-ldd.pl @@ -3,6 +3,7 @@ use strict; my %deploy; my $objdump = $ENV{objdump} ? $ENV{objdump} : "objdump"; my @searchdirs; +my @systemdirs = (qr|^c:/windows|i, qr|^c:/winnt|i, qr|/c/windows|i, qr|/c/winnt|); sub addDependenciesFor($) { open OBJDUMP, "-|", $objdump, "-p", $_[0] or die; @@ -59,6 +60,18 @@ for (@ARGV) { # Append PATH to @searchdirs @searchdirs = (@searchdirs, split(/:/, $ENV{PATH})); +# Remove system dirs from @searchdirs +@searchdirs = grep { + my $sys = 0; + for my $rx (@systemdirs) { + if ($_ =~ $rx) { + $sys = 1; + last; + } + } + !$sys; +} @searchdirs; + while (1) { findMissingDependencies(); -- cgit v1.2.3-70-g09d2