Ignore the Windows system directories when searching for DLLs

We don't want to deploy kernel32.dll or such.

Signed-off-by: Thiago Macieira <thiago@macieira.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Thiago Macieira 2013-10-11 11:05:42 -07:00 committed by Dirk Hohndel
parent 1fdbc2eaa4
commit 336acb3e18

View file

@ -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();