| 1 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use File::Basename (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use File::Spec; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use Cwd (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 1 | ▶ | use constant DEBUG_FIND_YATT_LIB => $ENV{DEBUG_FIND_YATT_LIB}; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 1 | my $thisdir = do { | |||||||||
| 10 | 1 | ▶ | if (-r __FILE__) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 11 | # detect where app.psgi is placed. | ||||||||||
| 12 | 1 | File::Basename::dirname(File::Spec->rel2abs(__FILE__)); | |||||||||
| 13 | } else { | ||||||||||
| 14 | # older uwsgi do not set __FILE__ correctly, so use cwd instead. | ||||||||||
| 15 | 0 | Cwd::cwd(); | |||||||||
| 16 | } | ||||||||||
| 17 | }; | ||||||||||
| 18 | 1 | print STDERR "# thisdir=$thisdir\n" if DEBUG_FIND_YATT_LIB; | |||||||||
| 19 | |||||||||||
| 20 | 1 | ▶ | my ($found) = $thisdir =~ m{^(.*?/)YATT/} | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | or return; | ||||||||||
| 22 | 0 | print STDERR "# found=$found\n" if DEBUG_FIND_YATT_LIB; | |||||||||
| 23 | |||||||||||
| 24 | 0 | my @libdir = $found; | |||||||||
| 25 | |||||||||||
| 26 | 0 | foreach my $d (qw(extlib local/lib/perl5)) { | |||||||||
| 27 | 0 | ▶ | -d (my $dn = File::Basename::dirname($found) . "/$d") | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | or next; | ||||||||||
| 29 | 0 | push @libdir, $dn; | |||||||||
| 30 | } | ||||||||||
| 31 | 0 | print STDERR "# libdir=@libdir\n" if DEBUG_FIND_YATT_LIB; | |||||||||
| 32 | |||||||||||
| 33 | 0 | return @libdir; | |||||||||