aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/win-ldd.pl
diff options
context:
space:
mode:
authorGravatar Thiago Macieira <thiago@macieira.org>2013-10-11 11:05:43 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-11 12:05:55 -0700
commit4a213bba41982f311777310834024a4caece64bf (patch)
tree1bb0a49c4fb8e93310b919dd1ee0df0c1ebca613 /scripts/win-ldd.pl
parent336acb3e18d22bfdea1255cb9c1b0b549f01c17c (diff)
downloadsubsurface-4a213bba41982f311777310834024a4caece64bf.tar.gz
Tabify win-ldd.pl - subsurface coding style
Signed-off-by: Thiago Macieira <thiago@macieira.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'scripts/win-ldd.pl')
-rw-r--r--scripts/win-ldd.pl118
1 files changed, 59 insertions, 59 deletions
diff --git a/scripts/win-ldd.pl b/scripts/win-ldd.pl
index 8a25c3434..07ea7ea95 100644
--- a/scripts/win-ldd.pl
+++ b/scripts/win-ldd.pl
@@ -6,55 +6,55 @@ 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;
- while (<OBJDUMP>) {
- last if /^The Import Tables/;
- }
- while (<OBJDUMP>) {
- next unless /DLL Name: (.*)/;
- $deploy{$1} = 0 unless defined($deploy{$1});
- last if /^\w/;
- }
- close OBJDUMP;
+ open OBJDUMP, "-|", $objdump, "-p", $_[0] or die;
+ while (<OBJDUMP>) {
+ last if /^The Import Tables/;
+ }
+ while (<OBJDUMP>) {
+ next unless /DLL Name: (.*)/;
+ $deploy{$1} = 0 unless defined($deploy{$1});
+ last if /^\w/;
+ }
+ close OBJDUMP;
}
sub findMissingDependencies {
- for my $name (keys %deploy) {
- next if $deploy{$name};
- my $path;
- for my $dir (@searchdirs) {
- my $fpath = "$dir/$name";
- my $lcfpath = "$dir/" . lc($name);
- if (-e $fpath) {
- $path = $fpath;
- } elsif (-e $lcfpath) {
- $path = $lcfpath;
- } else {
- next;
- }
- addDependenciesFor($path);
- last;
- }
+ for my $name (keys %deploy) {
+ next if $deploy{$name};
+ my $path;
+ for my $dir (@searchdirs) {
+ my $fpath = "$dir/$name";
+ my $lcfpath = "$dir/" . lc($name);
+ if (-e $fpath) {
+ $path = $fpath;
+ } elsif (-e $lcfpath) {
+ $path = $lcfpath;
+ } else {
+ next;
+ }
+ addDependenciesFor($path);
+ last;
+ }
- $path = "/missing/file" unless $path;
- $deploy{$name} = $path;
- }
+ $path = "/missing/file" unless $path;
+ $deploy{$name} = $path;
+ }
}
for (@ARGV) {
- s/^-L//;
- next if /^-/;
- if (-d $_) {
- push @searchdirs, $_;
- } elsif (-f $_) {
- # Add $_'s path to the search list too
- my $dirname = $_;
- $dirname =~ s,/[^/]+$,,;
- push @searchdirs, $dirname;
+ s/^-L//;
+ next if /^-/;
+ if (-d $_) {
+ push @searchdirs, $_;
+ } elsif (-f $_) {
+ # Add $_'s path to the search list too
+ my $dirname = $_;
+ $dirname =~ s,/[^/]+$,,;
+ push @searchdirs, $dirname;
- $deploy{$_} = $_;
- addDependenciesFor($_);
- }
+ $deploy{$_} = $_;
+ addDependenciesFor($_);
+ }
}
# Append PATH to @searchdirs
@@ -62,29 +62,29 @@ for (@ARGV) {
# Remove system dirs from @searchdirs
@searchdirs = grep {
- my $sys = 0;
- for my $rx (@systemdirs) {
- if ($_ =~ $rx) {
- $sys = 1;
- last;
- }
- }
- !$sys;
+ my $sys = 0;
+ for my $rx (@systemdirs) {
+ if ($_ =~ $rx) {
+ $sys = 1;
+ last;
+ }
+ }
+ !$sys;
} @searchdirs;
while (1) {
- findMissingDependencies();
+ findMissingDependencies();
- my $i = 0;
- while (my ($name, $path) = each(%deploy)) {
- next if $path;
- ++$i;
- last;
- }
- last if $i == 0;
+ my $i = 0;
+ while (my ($name, $path) = each(%deploy)) {
+ next if $path;
+ ++$i;
+ last;
+ }
+ last if $i == 0;
}
for (sort values %deploy) {
- next if $_ eq "/missing/file";
- print "$_\n";
+ next if $_ eq "/missing/file";
+ print "$_\n";
}