ELF4,4 (44 e ̈̈xPdd /usr/lib/ld.so.1;8t  "#$&'()*+-01245689<=>@ABDFHIJKLMNPRSTVXYZ\]_`bfghkmnpqs !%,./37:;?CEGOQUW[^acdeijlor )  ?  KR!g  `w, j4- uD-; - 3. .i 60 0 29 G PĒPHH$5A LSTF X t{@̈n7> 4# hp,F( hH)0BPQYؒp{7 PP   H!0H #$)2 :̒JPpX"pȒv0KP 8_  5     .@ԒM[ܒe02$ lz7" p0@ 5 C В`%4=2 J`QpYa r@ v `EX `parfsr.scrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummymain.csha_transform__findenvpar_getenvpar_unsetenvS_procself_valpar_redo_stackpar_rmtmpdirisWritableDirpar_setenvpar_xs_init__do_global_ctors_auxcrtn.sstrncmpatexitperl_freememsetPL_op_fini_environPerl_newXS_flagsPerl_mg_setreaddir64lstat64main__register_frame_info_basesgetpidmkdir_DYNAMICpar_env_cleanpar_basename___ArgvmemchrPerl_av_shiftXS_Internals_PAR_CLEARSTACK_lib_version_edatamy_par_pl_endPerl_gv_fetchpvgetuid__stack_chk_failmemcpy__stack_chk_guard__environ_locksprintfPL_perl_destruct_levelPerl_newXSPerl_safesysmallocperl_constructpar_setup_libpathfprintfPerl_save_destructor_x__deregister_frame_info_basesPL_tainted_mcountread_Jv_RegisterClassesPL_top_env__iobpar_current_execPL_curstackinfocloserealloc_get_exit_frame_monitorerrno__fpstartexecvp_exitboot_DynaLoaderpar_mktmpdirstrcmppar_init_envPL_memory_wrap_startstrdupget_username_from_getpwuid__1cG__CrunMdo_exit_code6F_v__PROCEDURE_LINKAGE_TABLE_Perl_sv_2pv_flagsPL_do_undumpperl_destructPL_parserstrstrPerl_sys_term__longdouble_usedstrncpyperl_allocPerl_sv_setpvPL_in_evalPL_exit_flagsclosedirrmdirPerl_newSVpvpar_dirnameXS_Internals_PAR_BOOTPL_eval_rootreadlinkperl_parsePerl_sv_setpvnperl_runpar_findprogopen64lseek64opendir__fsr_init_valuePerl_dounwindPerl_croakmemmovestrchrPerl_av_fetch_etext__fsraccesspar_cleanupPerl_sys_init3_GLOBAL_OFFSET_TABLE_strtokunlinklibc.so.1SUNW_1.1SUNW_0.7SYSVABI_1.3SUNWprivate_1.1libperl.solibsocket.so.1libnsl.so.1libdl.so.1libm.so.2libssp.so.0/usr/local/lib/perl5/5.20.0/i86pc-solaris/CORE'= (= 7qN #^ZA eIx(qX'h<Vr,"D-&B6)g/GlOJs`8b5@FYm0Ēԇ ؒ"̇)*܇/0̒4CpGԒJܒLVWВ]tf1Ȓ9:ć>ȇ=Ї)؇ ^`UZeN! s XY <$n(6,i0?4#8<j@rDAHELSPTFXM\`'dchdl-pt5x|kI h;g(pT%$_aK8ĈPȈ75%%h%h%ćh%ȇh%Їh %؇h(%h0%h8p%h@`%hHP%hP@%hX0%h` %hh%hp%hx%h% h%h%h%h%h% h%$hp%(h`%,hP%0h@%4h0%8h %<h%@h%Dh%Hh%Lh%Ph%Th%Xh %\h(%`h0%dh8p%hh@`%lhHP%phP@%thX0%xh` %|hh%hp%hx%h%h%h%h%h%h%h%hp%h`%hP%h@%h0%h %h%h%Ĉh%Ȉhjj̈t RhPHltpt PEHu THRU hRP#(&$D$D$$URQ t tX<$уx $t$$у`tƒ 3f$$f $tf$$f $,$YZ]ÐÐUVSÆgu])9s 9r拃t$ƃ[^]US\g$t$D$\$ D$$`t,t $Ѓ[]Ë$ÐUWVSXD$ƃ ˉ с ʉTuɍD$L$LP33P3PP 9uD$D$T$RT$ \$[\$t$v t$|$<$T$yZL$ !#T$ э t$ D$D$\$#\$T$! ڍyZ‹\$|$|$ yZ!! t$$!݉! 鍴yZ \$(yZ!! |$,!! 荼yZt$0yZ!݉! \$4!! ꍜyZ|$8yZ!! t$n47\$p11Ǎ;nL$t119n T$x11ߍ:nD$|11ύ8n$11׍>n47$11Ǎ;n$119n $11ߍ:n$11ύ8n$11׍>n47$11Ǎ;n$119n $11ߍ:n$11ύ8n$11׍>n47$11Ǎ;n$119n $11ߍ:n$ !͉! 8ܼ$ !Չ! >ܼ47$ !ʼn! ;ܼ$ !! 9ܼ $ !݉! :ܼ$ !͉! 8ܼ$ !Չ! >ܼ47$ !ʼn! ;ܼ$ !! 9ܼ $ !݉! :ܼ$ !͉! 8ܼ$ !Չ! >ܼ47$ !ʼn! ;ܼ$ !! 9ܼ $ !݉! :ܼ$ !͉! 8ܼ$ !Չ! >ܼ$ !ʼn! 3ܼ$ !! 덜ܼˉ$ !! :ܼ$11ڍbʉ$ 11bʉ$11Ǎ>bʉ47$11׍;bʉ$119bʉ$11ٍbʉ$ 11bʉ$$11ʍbʉ$(11ލ0bʉ$,11Ѝbʉ$0119bʉ$411 bʉ $811bʉ$<11ʍbʉ$@11ލ0bʉ$D11Ѝbʉ$H119bʉ $L11Ǎ;bʉ$P11ύ:bʉ|$$T>bʉ11ߍ<>47|$7T$ WT$WL$O $GX[^_]U8]u}EUظ}HEܸ}tyUt<=tփt <=uu+uE܋tE}܉ut$UT$$Uu<3=u+}E؉8UDuø]u}]UU5UVSÍuEHPuuۃ[^]U8]u}ƉסE1D$D$$HÅ~Gu~6\$D$/$t\$D$4$x |$4$zE3tz]u}]US̒@ĒJ fP̒XD$$H5C̒P ВJ X ܒtQpS$PB(PB@P,[]UWVS@E1@%@9 $DXH޹8H8@։߉։4$IƉ\$ @D$D$H4$9TL$4$7tl%=@u 4$4$'D$)!D $#@$%M3 tu[^_]USáE1dD$$¸u4|@tuD$$U3tĴ[]UWVS~. ~t8t $Cuu É߸эD $p~;t$D$D$J4$;uދ~t-~Åt28t-t$$ƅu\~tM;u Fuߍ~t $sut;u۾ ƺӋp~ҍ$t~d~p~D$D$#JD$ It$D$ It~$D$t~ $uGȒt=D$t~D$ l~D$D$|J$ Džp~:D$t~ $7%=@!]9%=$h~p~IEt"$D$l~$Åul~߸эA~kt(J8uQt|/uEl~Pt8׸эAv t-J(D&D$$l~D$ D$D$$D$~D$l~$u~~C~A~C~H~EuD$ D$D$l~ $D$)~\$l~$D$H\$D$ It~T$D$2Jh~ $D$ D$D$l~$vDžD#EgDžHDžLܺDžPvT2DžTDžXDž\EjX9\X\E~tR@)9N`t$~L$$EE@)~40D=?`DdDhD lDpDtDxD|D ED$ED(ED,ED0ED4ED8ED 'tmpXXXXX', DIR => File::Basename::dirname($topdir), SUFFIX => '.cmd', UNLINK => 0, ); print $tmp "#!/bin/sh x=1; while [ \$x -lt 10 ]; do rm -rf '$par_temp' if [ \! -d '$par_temp' ]; then break fi sleep 1 x=`expr \$x + 1` done rm '" . $tmp->filename . "' "; chmod 0700,$tmp->filename; my $cmd = $tmp->filename . ' >/dev/null 2>&1 &'; close $tmp; system($cmd); outs(qq(Spawned background process to perform cleanup: ) . $tmp->filename); } } } BEGIN { Internals::PAR::BOOT() if defined &Internals::PAR::BOOT; eval { _par_init_env(); if (exists $ENV{PAR_ARGV_0} and $ENV{PAR_ARGV_0} ) { @ARGV = map $ENV{"PAR_ARGV_$_"}, (1 .. $ENV{PAR_ARGC} - 1); $0 = $ENV{PAR_ARGV_0}; } else { for (keys %ENV) { delete $ENV{$_} if /^PAR_ARGV_/; } } my $quiet = !$ENV{PAR_DEBUG}; my %Config = ( path_sep => ($^O =~ /^MSWin/ ? ';' : ':'), _exe => ($^O =~ /^(?:MSWin|OS2|cygwin)/ ? '.exe' : ''), _delim => ($^O =~ /^MSWin|OS2/ ? '\\' : '/'), ); _set_progname(); _set_par_temp(); my ($start_pos, $data_pos); { local $SIG{__WARN__} = sub {}; open _FH, '<', $progname or last; binmode(_FH); my $buf; seek _FH, -8, 2; read _FH, $buf, 8; last unless $buf eq "\nPAR.pm\n"; seek _FH, -12, 2; read _FH, $buf, 4; seek _FH, -12 - unpack("N", $buf), 2; read _FH, $buf, 4; $data_pos = (tell _FH) - 4; my %require_list; while ($buf eq "FILE") { read _FH, $buf, 4; read _FH, $buf, unpack("N", $buf); my $fullname = $buf; outs(qq(Unpacking file "$fullname"...)); my $crc = ( $fullname =~ s|^([a-f\d]{8})/|| ) ? $1 : undef; my ($basename, $ext) = ($buf =~ m|(?:.*/)?(.*)(\..*)|); read _FH, $buf, 4; read _FH, $buf, unpack("N", $buf); if (defined($ext) and $ext !~ /\.(?:pm|pl|ix|al)$/i) { my ($out, $filename) = _tempfile($ext, $crc); if ($out) { binmode($out); print $out $buf; close $out; chmod 0755, $filename; } $PAR::Heavy::FullCache{$fullname} = $filename; $PAR::Heavy::FullCache{$filename} = $fullname; } elsif ( $fullname =~ m|^/?shlib/| and defined $ENV{PAR_TEMP} ) { my $filename = "$ENV{PAR_TEMP}/$basename$ext"; outs("SHLIB: $filename\n"); open my $out, '>', $filename or die $!; binmode($out); print $out $buf; close $out; } else { $require_list{$fullname} = $PAR::Heavy::ModuleCache{$fullname} = { buf => $buf, crc => $crc, name => $fullname, }; } read _FH, $buf, 4; } local @INC = (sub { my ($self, $module) = @_; return if ref $module or !$module; my $filename = delete $require_list{$module} || do { my $key; foreach (keys %require_list) { next unless /\Q$module\E$/; $key = $_; last; } delete $require_list{$key} if defined($key); } or return; $INC{$module} = "/loader/$filename/$module"; if ($ENV{PAR_CLEAN} and defined(&IO::File::new)) { my $fh = IO::File->new_tmpfile or die $!; binmode($fh); print $fh $filename->{buf}; seek($fh, 0, 0); return $fh; } else { my ($out, $name) = _tempfile('.pm', $filename->{crc}); if ($out) { binmode($out); print $out $filename->{buf}; close $out; } open my $fh, '<', $name or die $!; binmode($fh); return $fh; } die "Bootstrapping failed: cannot find $module!\n"; }, @INC); require XSLoader; require PAR::Heavy; require Carp::Heavy; require Exporter::Heavy; PAR::Heavy::_init_dynaloader(); require IO::File; while (my $filename = (sort keys %require_list)[0]) { unless ($INC{$filename} or $filename =~ /BSDPAN/) { if ($filename =~ /\.pmc?$/i) { require $filename; } else { do $filename unless $filename =~ /sitecustomize\.pl$/; } } delete $require_list{$filename}; } last unless $buf eq "PK\003\004"; $start_pos = (tell _FH) - 4; } my @par_args; my ($out, $bundle, $logfh, $cache_name); delete $ENV{PAR_APP_REUSE}; # sanitize (REUSE may be a security problem) $quiet = 0 unless $ENV{PAR_DEBUG}; if (!$start_pos or ($ARGV[0] eq '--par-options' && shift)) { my %dist_cmd = qw( p blib_to_par i install_par u uninstall_par s sign_par v verify_par ); if (@ARGV and $ARGV[0] eq '--reuse') { shift @ARGV; $ENV{PAR_APP_REUSE} = shift @ARGV; } else { # normal parl behaviour my @add_to_inc; while (@ARGV) { $ARGV[0] =~ /^-([AIMOBLbqpiusTv])(.*)/ or last; if ($1 eq 'I') { push @add_to_inc, $2; } elsif ($1 eq 'M') { eval "use $2"; } elsif ($1 eq 'A') { unshift @par_args, $2; } elsif ($1 eq 'O') { $out = $2; } elsif ($1 eq 'b') { $bundle = 'site'; } elsif ($1 eq 'B') { $bundle = 'all'; } elsif ($1 eq 'q') { $quiet = 1; } elsif ($1 eq 'L') { open $logfh, ">>", $2 or die "XXX: Cannot open log: $!"; } elsif ($1 eq 'T') { $cache_name = $2; } shift(@ARGV); if (my $cmd = $dist_cmd{$1}) { delete $ENV{'PAR_TEMP'}; init_inc(); require PAR::Dist; &{"PAR::Dist::$cmd"}() unless @ARGV; &{"PAR::Dist::$cmd"}($_) for @ARGV; exit; } } unshift @INC, @add_to_inc; } } if ($out) { { require IO::File; require Archive::Zip; } my $par = shift(@ARGV); my $zip; if (defined $par) { open my $fh, '<', $par or die "Cannot find '$par': $!"; binmode($fh); bless($fh, 'IO::File'); $zip = Archive::Zip->new; ( $zip->readFromFileHandle($fh, $par) == Archive::Zip::AZ_OK() ) or die "Read '$par' error: $!"; } my %env = do { if ($zip and my $meta = $zip->contents('META.yml')) { $meta =~ s/.*^par:$//ms; $meta =~ s/^\S.*//ms; $meta =~ /^ ([^:]+): (.+)$/mg; } }; local $/ = \4; if (defined $par) { open PAR, '<', $par or die "$!: $par"; binmode(PAR); die "$par is not a PAR file" unless eq "PK\003\004"; } CreatePath($out) ; my $fh = IO::File->new( $out, IO::File::O_CREAT() | IO::File::O_WRONLY() | IO::File::O_TRUNC(), 0777, ) or die $!; binmode($fh); $/ = (defined $data_pos) ? \$data_pos : undef; seek _FH, 0, 0; my $loader = scalar <_FH>; if (!$ENV{PAR_VERBATIM} and $loader =~ /^(?:#!|\@rem)/) { require PAR::Filter::PodStrip; PAR::Filter::PodStrip->new->apply(\$loader, $0) } foreach my $key (sort keys %env) { my $val = $env{$key} or next; $val = eval $val if $val =~ /^['"]/; my $magic = "__ENV_PAR_" . uc($key) . "__"; my $set = "PAR_" . uc($key) . "=$val"; $loader =~ s{$magic( +)}{ $magic . $set . (' ' x (length($1) - length($set))) }eg; } $fh->print($loader); $/ = undef; if ($bundle) { require PAR::Heavy; PAR::Heavy::_init_dynaloader(); init_inc(); require_modules(); my @inc = sort { length($b) <=> length($a) } grep { !/BSDPAN/ } grep { ($bundle ne 'site') or ($_ ne $Config::Config{archlibexp} and $_ ne $Config::Config{privlibexp}); } @INC; my %files; /^_<(.+)$/ and -e $1 and $files{$1}++ for keys %::; $files{$_}++ for values %INC; my $lib_ext = $Config::Config{lib_ext}; my %written; foreach (sort keys %files) { my ($name, $file); foreach my $dir (@inc) { if ($name = $PAR::Heavy::FullCache{$_}) { $file = $_; last; } elsif (/^(\Q$dir\E\/(.*[^Cc]))\Z/i) { ($file, $name) = ($1, $2); last; } elsif (m!^/loader/[^/]+/(.*[^Cc])\Z!) { if (my $ref = $PAR::Heavy::ModuleCache{$1}) { ($file, $name) = ($ref, $1); last; } elsif (-f "$dir/$1") { ($file, $name) = ("$dir/$1", $1); last; } } } next unless defined $name and not $written{$name}++; next if !ref($file) and $file =~ /\.\Q$lib_ext\E$/; outs( join "", qq(Packing "), ref $file ? $file->{name} : $file, qq("...) ); my $content; if (ref($file)) { $content = $file->{buf}; } else { open FILE, '<', $file or die "Can't open $file: $!"; binmode(FILE); $content = ; close FILE; PAR::Filter::PodStrip->new->apply(\$content, $file) if !$ENV{PAR_VERBATIM} and $name =~ /\.(?:pm|ix|al)$/i; PAR::Filter::PatchContent->new->apply(\$content, $file, $name); } outs(qq(Written as "$name")); $fh->print("FILE"); $fh->print(pack('N', length($name) + 9)); $fh->print(sprintf( "%08x/%s", Archive::Zip::computeCRC32($content), $name )); $fh->print(pack('N', length($content))); $fh->print($content); } } $zip->writeToFileHandle($fh) if $zip; $cache_name = substr $cache_name, 0, 40; if (!$cache_name and my $mtime = (stat($out))[9]) { my $ctx = eval { require Digest::SHA; Digest::SHA->new(1) } || eval { require Digest::SHA1; Digest::SHA1->new } || eval { require Digest::MD5; Digest::MD5->new }; my $sha_version = eval { $Digest::SHA::VERSION } || 0; if ($sha_version eq '5.38' or $sha_version eq '5.39') { $ctx->addfile($out, "b") if ($ctx); } else { if ($ctx and open(my $fh, "<$out")) { binmode($fh); $ctx->addfile($fh); close($fh); } } $cache_name = $ctx ? $ctx->hexdigest : $mtime; } $cache_name .= "\0" x (41 - length $cache_name); $cache_name .= "CACHE"; $fh->print($cache_name); $fh->print(pack('N', $fh->tell - length($loader))); $fh->print("\nPAR.pm\n"); $fh->close; chmod 0755, $out; exit; } { last unless defined $start_pos; _fix_progname(); require PAR; PAR::Heavy::_init_dynaloader(); { require File::Find; require Archive::Zip; } my $zip = Archive::Zip->new; my $fh = IO::File->new; $fh->fdopen(fileno(_FH), 'r') or die "$!: $@"; $zip->readFromFileHandle($fh, $progname) == Archive::Zip::AZ_OK() or die "$!: $@"; push @PAR::LibCache, $zip; $PAR::LibCache{$progname} = $zip; $quiet = !$ENV{PAR_DEBUG}; outs(qq(\$ENV{PAR_TEMP} = "$ENV{PAR_TEMP}")); if (defined $ENV{PAR_TEMP}) { # should be set at this point! foreach my $member ( $zip->members ) { next if $member->isDirectory; my $member_name = $member->fileName; next unless $member_name =~ m{ ^ /?shlib/ (?:$Config::Config{version}/)? (?:$Config::Config{archname}/)? ([^/]+) $ }x; my $extract_name = $1; my $dest_name = File::Spec->catfile($ENV{PAR_TEMP}, $extract_name); if (-f $dest_name && -s _ == $member->uncompressedSize()) { outs(qq(Skipping "$member_name" since it already exists at "$dest_name")); } else { outs(qq(Extracting "$member_name" to "$dest_name")); $member->extractToFileNamed($dest_name); chmod(0555, $dest_name) if $^O eq "hpux"; } } } } unless ($PAR::LibCache{$progname}) { die << "." unless @ARGV; Usage: $0 [ -Alib.par ] [ -Idir ] [ -Mmodule ] [ src.par ] [ program.pl ] $0 [ -B|-b ] [-Ooutfile] src.par . $ENV{PAR_PROGNAME} = $progname = $0 = shift(@ARGV); } sub CreatePath { my ($name) = @_; require File::Basename; my ($basename, $path, $ext) = File::Basename::fileparse($name, ('\..*')); require File::Path; File::Path::mkpath($path) unless(-e $path); # mkpath dies with error } sub require_modules { require lib; require DynaLoader; require integer; require strict; require warnings; require vars; require Carp; require Carp::Heavy; require Errno; require Exporter::Heavy; require Exporter; require Fcntl; require File::Temp; require File::Spec; require XSLoader; require Config; require IO::Handle; require IO::File; require Compress::Zlib; require Archive::Zip; require PAR; require PAR::Heavy; require PAR::Dist; require PAR::Filter::PodStrip; require PAR::Filter::PatchContent; require attributes; eval { require Cwd }; eval { require Win32 }; eval { require Scalar::Util }; eval { require Archive::Unzip::Burst }; eval { require Tie::Hash::NamedCapture }; eval { require PerlIO; require PerlIO::scalar }; } sub _set_par_temp { if (defined $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/) { $par_temp = $1; return; } foreach my $path ( (map $ENV{$_}, qw( PAR_TMPDIR TMPDIR TEMPDIR TEMP TMP )), qw( C:\\TEMP /tmp . ) ) { next unless defined $path and -d $path and -w $path; my $username; my $pwuid; eval {($pwuid) = getpwuid($>) if defined $>;}; if ( defined(&Win32::LoginName) ) { $username = &Win32::LoginName; } elsif (defined $pwuid) { $username = $pwuid; } else { $username = $ENV{USERNAME} || $ENV{USER} || 'SYSTEM'; } $username =~ s/\W/_/g; my $stmpdir = "$path$Config{_delim}par-".unpack("H*", $username); mkdir $stmpdir, 0755; if (!$ENV{PAR_CLEAN} and my $mtime = (stat($progname))[9]) { open (my $fh, "<". $progname); seek $fh, -18, 2; sysread $fh, my $buf, 6; if ($buf eq "\0CACHE") { seek $fh, -58, 2; sysread $fh, $buf, 41; $buf =~ s/\0//g; $stmpdir .= "$Config{_delim}cache-" . $buf; } else { my $ctx = eval { require Digest::SHA; Digest::SHA->new(1) } || eval { require Digest::SHA1; Digest::SHA1->new } || eval { require Digest::MD5; Digest::MD5->new }; my $sha_version = eval { $Digest::SHA::VERSION } || 0; if ($sha_version eq '5.38' or $sha_version eq '5.39') { $ctx->addfile($progname, "b") if ($ctx); } else { if ($ctx and open(my $fh, "<$progname")) { binmode($fh); $ctx->addfile($fh); close($fh); } } $stmpdir .= "$Config{_delim}cache-" . ( $ctx ? $ctx->hexdigest : $mtime ); } close($fh); } else { $ENV{PAR_CLEAN} = 1; $stmpdir .= "$Config{_delim}temp-$$"; } $ENV{PAR_TEMP} = $stmpdir; mkdir $stmpdir, 0755; last; } $par_temp = $1 if $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/; } sub _tempfile { my ($ext, $crc) = @_; my ($fh, $filename); $filename = "$par_temp/$crc$ext"; if ($ENV{PAR_CLEAN}) { unlink $filename if -e $filename; push @tmpfile, $filename; } else { return (undef, $filename) if (-r $filename); } open $fh, '>', $filename or die $!; binmode($fh); return($fh, $filename); } sub _set_progname { if (defined $ENV{PAR_PROGNAME} and $ENV{PAR_PROGNAME} =~ /(.+)/) { $progname = $1; } $progname ||= $0; if ($ENV{PAR_TEMP} and index($progname, $ENV{PAR_TEMP}) >= 0) { $progname = substr($progname, rindex($progname, $Config{_delim}) + 1); } if (!$ENV{PAR_PROGNAME} or index($progname, $Config{_delim}) >= 0) { if (open my $fh, '<', $progname) { return if -s $fh; } if (-s "$progname$Config{_exe}") { $progname .= $Config{_exe}; return; } } foreach my $dir (split /\Q$Config{path_sep}\E/, $ENV{PATH}) { next if exists $ENV{PAR_TEMP} and $dir eq $ENV{PAR_TEMP}; $dir =~ s/\Q$Config{_delim}\E$//; (($progname = "$dir$Config{_delim}$progname$Config{_exe}"), last) if -s "$dir$Config{_delim}$progname$Config{_exe}"; (($progname = "$dir$Config{_delim}$progname"), last) if -s "$dir$Config{_delim}$progname"; } } sub _fix_progname { $0 = $progname ||= $ENV{PAR_PROGNAME}; if (index($progname, $Config{_delim}) < 0) { $progname = ".$Config{_delim}$progname"; } my $pwd = (defined &Cwd::getcwd) ? Cwd::getcwd() : ((defined &Win32::GetCwd) ? Win32::GetCwd() : `pwd`); chomp($pwd); $progname =~ s/^(?=\.\.?\Q$Config{_delim}\E)/$pwd$Config{_delim}/; $ENV{PAR_PROGNAME} = $progname; } sub _par_init_env { if ( $ENV{PAR_INITIALIZED}++ == 1 ) { return; } else { $ENV{PAR_INITIALIZED} = 2; } for (qw( SPAWNED TEMP CLEAN DEBUG CACHE PROGNAME ARGC ARGV_0 ) ) { delete $ENV{'PAR_'.$_}; } for (qw/ TMPDIR TEMP CLEAN DEBUG /) { $ENV{'PAR_'.$_} = $ENV{'PAR_GLOBAL_'.$_} if exists $ENV{'PAR_GLOBAL_'.$_}; } my $par_clean = "__ENV_PAR_CLEAN__ "; if ($ENV{PAR_TEMP}) { delete $ENV{PAR_CLEAN}; } elsif (!exists $ENV{PAR_GLOBAL_CLEAN}) { my $value = substr($par_clean, 12 + length("CLEAN")); $ENV{PAR_CLEAN} = $1 if $value =~ /^PAR_CLEAN=(\S+)/; } } sub outs { return if $quiet; if ($logfh) { print $logfh "@_\n"; } else { print "@_\n"; } } sub init_inc { require Config; push @INC, grep defined, map $Config::Config{$_}, qw( archlibexp privlibexp sitearchexp sitelibexp vendorarchexp vendorlibexp ); } package main; require PAR; unshift @INC, \&PAR::find_par; PAR->import(@par_args); die qq(par.pl: Can't open perl script "$progname": No such file or directory\n) unless -e $progname; do $progname; CORE::exit($1) if ($@ =~/^_TK_EXIT_\((\d+)\)/); die $@ if $@; }; $::__ERROR = $@ if $@; } CORE::exit($1) if ($::__ERROR =~/^_TK_EXIT_\((\d+)\)/); die $::__ERROR if $::__ERROR; 1; __END__ Ä&6FVfv&6FVfv&6FVfv&6FVfv3>MYdn 0H PHzz  H ````l`oǙo4o@o``>KGCC: (GNU) 4.5.2ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2432.interp.eh_frame_hdr.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_version.SUNW_versym.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.rodata.str1.1.rodata.str1.4.rodata.cst4.rodata.cst8.got.dynamic.eh_frame.data.ctors.dtors.jcr.bss.comment.shstrtab  o`+ HH@3"  ;o44PIoVollg @@s Bw |,)0H0HPHPHhHhH02HH2|J|J$=̈̈xDDHH`U@0X  FILE59d6d215/PAR/Filter.pmg#line 1 "../blib/lib/PAR/Filter.pm" package PAR::Filter; use 5.006; use strict; use warnings; our $VERSION = '0.03'; #line 64 sub new { my $class = shift; require "PAR/Filter/$_.pm" foreach @_; bless(\@_, $class); } sub apply { my ($self, $ref, $name) = @_; my $filename = $name || '-e'; if (!ref $ref) { $name ||= $filename = $ref; local $/; open my $fh, $ref or die $!; binmode($fh); my $content = <$fh>; $ref = \$content; return $ref unless length($content); } "PAR::Filter::$_"->new->apply( $ref, $filename, $name ) foreach @$self; return $ref; } 1; #line 106 FILE#4039ecd4/PAR/Filter/PatchContent.pm#line 1 "../blib/lib/PAR/Filter/PatchContent.pm" package PAR::Filter::PatchContent; use 5.006; use strict; use warnings; use base 'PAR::Filter'; #line 22 sub PATCH_CONTENT () { +{ map { ref($_) ? $_ : lc($_) } 'AutoLoader.pm' => [ '$is_dosish = ' => '$is_dosish = $^O eq \'cygwin\' || ', ], 'Pod/Usage.pm' => [ ' = $0' => ' = $ENV{PAR_0} || $0', ], # Some versions of Spreadsheet::ParseExcel have a weird non-POD construct =cmmt # that is used to comment out a block of code. perl treats it as POD and strips it. # Since it's not POD, POD parsers ignore it. # PAR::Filter::PodStrip only strips valid POD. Hence we remove it here. 'Spreadsheet/ParseExcel.pm' => [ qr/^=cmmt\s+.*?^=cut\s*/sm => '', ], 'SQL/Parser.pm' => [ 'my @dialects;' => 'require PAR; my @dialects = (); foreach my $member ( $PAR::LastAccessedPAR->members ) { next unless $member->fileName =~ m!\bSQL/Dialects/([^/]+)\.pm$!; push @dialects, $1; } ', ], 'Tk.pm' => [ 'foreach $dir (@INC)' => 'require PAR; if (my $member = PAR::unpar($0, $file, 1)) { $file =~ s![/\\\\]!_!g; return PAR::Heavy::_dl_extract($member,$file,$file); } if (my $member = PAR::unpar($0, my $name = $_[1], 1)) { $name =~ s![/\\\\]!_!g; return PAR::Heavy::_dl_extract($member,$name,$name); } foreach $dir (@INC)', ], 'Tk/Widget.pm' => [ 'if (defined($name=$INC{"$pkg.pm"}))' => 'if (defined($name=$INC{"$pkg.pm"}) and !ref($name) and $name !~ m!^/loader/!)', ], 'Win32/API/Type.pm' => [ 'INIT ' => '', ], 'Win32/SystemInfo.pm' => [ '$dll .= "cpuspd.dll";' => 'require PAR; $dll = "lib/Win32/cpuspd.dll"; if (my $member = PAR::unpar($0, $dll, 1)) { $dll = PAR::Heavy::_dl_extract($member,"cpuspd.dll","cpuspd.dll"); $dll =~ s!\\\\!/!g; } else { die $! }', ], 'XSLoader.pm' => [ 'goto retry unless $module and defined &dl_load_file;' => 'goto retry;', # XSLoader <= 0.10 'goto \&XSLoader::bootstrap_inherit unless $module and defined &dl_load_file;' => 'goto \&XSLoader::bootstrap_inherit;', # XSLoader >= 0.14 ], 'diagnostics.pm' => [ 'CONFIG: ' => 'CONFIG: if (0) ', 'if (eof(POD_DIAG)) ' => 'if (0 and eof(POD_DIAG)) ', 'close POD_DIAG' => '# close POD_DIAG', 'while () ' => 'require PAR; use Config; my @files = ( "lib/pod/perldiag.pod", "lib/Pod/perldiag.pod", "lib/pod/perldiag-$Config{version}.pod", "lib/Pod/perldiag-$Config{version}.pod", "lib/pods/perldiag.pod", "lib/pods/perldiag-$Config{version}.pod", ); my $contents; foreach my $file (@files) { $contents = PAR::read_file($file); last if defined $contents; } for(map "$_\\n\\n", split/(?:\\r?\\n){2,}/, $contents) ', ], 'utf8_heavy.pl' => [ '$list ||= eval { $caller->$type(); }' => '$list = eval { $caller->$type(); }', '|| croak("Can\'t find $encoding character property definition via $caller->$type or $file.pl")' => '|| croak("Can\'t find $encoding character property definition via $caller->$type or $file.pl") unless $list;' ], } }; sub apply { my ($class, $ref, $filename, $name) = @_; { use bytes; $$ref =~ s/^\xEF\xBB\xBF//; } # remove utf8 BOM my @rule = @{PATCH_CONTENT->{lc($name)}||[]} or return $$ref; while (my ($from, $to) = splice(@rule, 0, 2)) { if (ref($from) eq 'Regexp') { $$ref =~ s/$from/$to/g; } else { $$ref =~ s/\Q$from\E/$to/g; } } return $$ref; } 1; #line 157 FILE16b10910/PAR/Filter/PodStrip.pm#line 1 "../blib/lib/PAR/Filter/PodStrip.pm" package PAR::Filter::PodStrip; use 5.006; use strict; use warnings; use base 'PAR::Filter'; #line 22 sub apply { my ($class, $ref, $filename, $name) = @_; no warnings 'uninitialized'; my $data = ''; $data = $1 if $$ref =~ s/((?:^__DATA__\r?\n).*)//ms; my $line = 1; if ($$ref =~ /^=(?:head\d|pod|begin|item|over|for|back|end|cut)\b/) { $$ref = "\n$$ref"; $line--; } $$ref =~ s{( (.*?\n) (?:=(?:head\d|pod|begin|item|over|for|back|end)\b .*?\n) (?:=cut[\t ]*[\r\n]*?|\Z) (\r?\n)? )}{ my ($pre, $post) = ($2, $3); "$pre#line " . ( $line += ( () = ( $1 =~ /\n/g ) ) ) . $post; }gsex; $$ref =~ s{^=encoding\s+\S+\s*$}{\n}mg; $$ref = '#line 1 "' . ($filename) . "\"\n" . $$ref if length $filename; $$ref =~ s/^#line 1 (.*\n)(#!.*\n)/$2#line 2 $1/g; $$ref .= $data; } 1; #line 85 FILEc0aec9b6/Carp.pmF#line 1 "/usr/local/lib/perl5/5.20.0/Carp.pm" package Carp; { use 5.006; } use strict; use warnings; BEGIN { # Very old versions of warnings.pm load Carp. This can go wrong due # to the circular dependency. If warnings is invoked before Carp, # then warnings starts by loading Carp, then Carp (above) tries to # invoke warnings, and gets nothing because warnings is in the process # of loading and hasn't defined its import method yet. If we were # only turning on warnings ("use warnings" above) this wouldn't be too # bad, because Carp would just gets the state of the -w switch and so # might not get some warnings that it wanted. The real problem is # that we then want to turn off Unicode warnings, but "no warnings # 'utf8'" won't be effective if we're in this circular-dependency # situation. So, if warnings.pm is an affected version, we turn # off all warnings ourselves by directly setting ${^WARNING_BITS}. # On unaffected versions, we turn off just Unicode warnings, via # the proper API. if(!defined($warnings::VERSION) || eval($warnings::VERSION) < 1.06) { ${^WARNING_BITS} = ""; } else { "warnings"->unimport("utf8"); } } sub _fetch_sub { # fetch sub without autovivifying my($pack, $sub) = @_; $pack .= '::'; # only works with top-level packages return unless exists($::{$pack}); for ($::{$pack}) { return unless ref \$_ eq 'GLOB' && *$_{HASH} && exists $$_{$sub}; for ($$_{$sub}) { return ref \$_ eq 'GLOB' ? *$_{CODE} : undef } } } # UTF8_REGEXP_PROBLEM is a compile-time constant indicating whether Carp # must avoid applying a regular expression to an upgraded (is_utf8) # string. There are multiple problems, on different Perl versions, # that require this to be avoided. All versions prior to 5.13.8 will # load utf8_heavy.pl for the swash system, even if the regexp doesn't # use character classes. Perl 5.6 and Perls [5.11.2, 5.13.11) exhibit # specific problems when Carp is being invoked in the aftermath of a # syntax error. BEGIN { if("$]" < 5.013011) { *UTF8_REGEXP_PROBLEM = sub () { 1 }; } else { *UTF8_REGEXP_PROBLEM = sub () { 0 }; } } # is_utf8() is essentially the utf8::is_utf8() function, which indicates # whether a string is represented in the upgraded form (using UTF-8 # internally). As utf8::is_utf8() is only available from Perl 5.8 # onwards, extra effort is required here to make it work on Perl 5.6. BEGIN { if(defined(my $sub = _fetch_sub utf8 => 'is_utf8')) { *is_utf8 = $sub; } else { # black magic for perl 5.6 *is_utf8 = sub { unpack("C", "\xaa".$_[0]) != 170 }; } } # The downgrade() function defined here is to be used for attempts to # downgrade where it is acceptable to fail. It must be called with a # second argument that is a true value. BEGIN { if(defined(my $sub = _fetch_sub utf8 => 'downgrade')) { *downgrade = \&{"utf8::downgrade"}; } else { *downgrade = sub { my $r = ""; my $l = length($_[0]); for(my $i = 0; $i != $l; $i++) { my $o = ord(substr($_[0], $i, 1)); return if $o > 255; $r .= chr($o); } $_[0] = $r; }; } } our $VERSION = '1.3301'; our $MaxEvalLen = 0; our $Verbose = 0; our $CarpLevel = 0; our $MaxArgLen = 64; # How much of each argument to print. 0 = all. our $MaxArgNums = 8; # How many arguments to print. 0 = all. our $RefArgFormatter = undef; # allow caller to format reference arguments require Exporter; our @ISA = ('Exporter'); our @EXPORT = qw(confess croak carp); our @EXPORT_OK = qw(cluck verbose longmess shortmess); our @EXPORT_FAIL = qw(verbose); # hook to enable verbose mode # The members of %Internal are packages that are internal to perl. # Carp will not report errors from within these packages if it # can. The members of %CarpInternal are internal to Perl's warning # system. Carp will not report errors from within these packages # either, and will not report calls *to* these packages for carp and # croak. They replace $CarpLevel, which is deprecated. The # $Max(EvalLen|(Arg(Len|Nums)) variables are used to specify how the eval # text and function arguments should be formatted when printed. our %CarpInternal; our %Internal; # disable these by default, so they can live w/o require Carp $CarpInternal{Carp}++; $CarpInternal{warnings}++; $Internal{Exporter}++; $Internal{'Exporter::Heavy'}++; # if the caller specifies verbose usage ("perl -MCarp=verbose script.pl") # then the following method will be called by the Exporter which knows # to do this thanks to @EXPORT_FAIL, above. $_[1] will contain the word # 'verbose'. sub export_fail { shift; $Verbose = shift if $_[0] eq 'verbose'; @_ } sub _cgc { no strict 'refs'; return \&{"CORE::GLOBAL::caller"} if defined &{"CORE::GLOBAL::caller"}; return; } sub longmess { local($!, $^E); # Icky backwards compatibility wrapper. :-( # # The story is that the original implementation hard-coded the # number of call levels to go back, so calls to longmess were off # by one. Other code began calling longmess and expecting this # behaviour, so the replacement has to emulate that behaviour. my $cgc = _cgc(); my $call_pack = $cgc ? $cgc->() : caller(); if ( $Internal{$call_pack} or $CarpInternal{$call_pack} ) { return longmess_heavy(@_); } else { local $CarpLevel = $CarpLevel + 1; return longmess_heavy(@_); } } our @CARP_NOT; sub shortmess { local($!, $^E); my $cgc = _cgc(); # Icky backwards compatibility wrapper. :-( local @CARP_NOT = $cgc ? $cgc->() : caller(); shortmess_heavy(@_); } sub croak { die shortmess @_ } sub confess { die longmess @_ } sub carp { warn shortmess @_ } sub cluck { warn longmess @_ } BEGIN { if("$]" >= 5.015002 || ("$]" >= 5.014002 && "$]" < 5.015) || ("$]" >= 5.012005 && "$]" < 5.013)) { *CALLER_OVERRIDE_CHECK_OK = sub () { 1 }; } else { *CALLER_OVERRIDE_CHECK_OK = sub () { 0 }; } } sub caller_info { my $i = shift(@_) + 1; my %call_info; my $cgc = _cgc(); { # Some things override caller() but forget to implement the # @DB::args part of it, which we need. We check for this by # pre-populating @DB::args with a sentinel which no-one else # has the address of, so that we can detect whether @DB::args # has been properly populated. However, on earlier versions # of perl this check tickles a bug in CORE::caller() which # leaks memory. So we only check on fixed perls. @DB::args = \$i if CALLER_OVERRIDE_CHECK_OK; package DB; @call_info{ qw(pack file line sub has_args wantarray evaltext is_require) } = $cgc ? $cgc->($i) : caller($i); } unless ( defined $call_info{file} ) { return (); } my $sub_name = Carp::get_subname( \%call_info ); if ( $call_info{has_args} ) { my @args; if (CALLER_OVERRIDE_CHECK_OK && @DB::args == 1 && ref $DB::args[0] eq ref \$i && $DB::args[0] == \$i ) { @DB::args = (); # Don't let anyone see the address of $i local $@; my $where = eval { my $func = $cgc or return ''; my $gv = (_fetch_sub B => 'svref_2object' or return '') ->($func)->GV; my $package = $gv->STASH->NAME; my $subname = $gv->NAME; return unless defined $package && defined $subname; # returning CORE::GLOBAL::caller isn't useful for tracing the cause: return if $package eq 'CORE::GLOBAL' && $subname eq 'caller'; " in &${package}::$subname"; } || ''; @args = "** Incomplete caller override detected$where; \@DB::args were not set **"; } else { @args = @DB::args; my $overflow; if ( $MaxArgNums and @args > $MaxArgNums ) { # More than we want to show? $#args = $MaxArgNums; $overflow = 1; } @args = map { Carp::format_arg($_) } @args; if ($overflow) { push @args, '...'; } } # Push the args onto the subroutine $sub_name .= '(' . join( ', ', @args ) . ')'; } $call_info{sub_name} = $sub_name; return wantarray() ? %call_info : \%call_info; } # Transform an argument to a function into a string. our $in_recurse; sub format_arg { my $arg = shift; if ( ref($arg) ) { # legitimate, let's not leak it. if (!$in_recurse && do { local $@; local $in_recurse = 1; local $SIG{__DIE__} = sub{}; eval {$arg->can('CARP_TRACE') } }) { return $arg->CARP_TRACE(); } elsif (!$in_recurse && defined($RefArgFormatter) && do { local $@; local $in_recurse = 1; local $SIG{__DIE__} = sub{}; eval {$arg = $RefArgFormatter->($arg); 1} }) { return $arg; } else { my $sub = _fetch_sub(overload => 'StrVal'); return $sub ? &$sub($arg) : "$arg"; } } return "undef" if !defined($arg); downgrade($arg, 1); return $arg if !(UTF8_REGEXP_PROBLEM && is_utf8($arg)) && $arg =~ /\A-?[0-9]+(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?\z/; my $suffix = ""; if ( 2 < $MaxArgLen and $MaxArgLen < length($arg) ) { substr ( $arg, $MaxArgLen - 3 ) = ""; $suffix = "..."; } if(UTF8_REGEXP_PROBLEM && is_utf8($arg)) { for(my $i = length($arg); $i--; ) { my $c = substr($arg, $i, 1); my $x = substr($arg, 0, 0); # work around bug on Perl 5.8.{1,2} if($c eq "\"" || $c eq "\\" || $c eq "\$" || $c eq "\@") { substr $arg, $i, 0, "\\"; next; } my $o = ord($c); substr $arg, $i, 1, sprintf("\\x{%x}", $o) if $o < 0x20 || $o > 0x7f; } } else { $arg =~ s/([\"\\\$\@])/\\$1/g; $arg =~ s/([^ -~])/sprintf("\\x{%x}",ord($1))/eg; } downgrade($arg, 1); return "\"".$arg."\"".$suffix; } sub Regexp::CARP_TRACE { my $arg = "$_[0]"; downgrade($arg, 1); if(UTF8_REGEXP_PROBLEM && is_utf8($arg)) { for(my $i = length($arg); $i--; ) { my $o = ord(substr($arg, $i, 1)); my $x = substr($arg, 0, 0); # work around bug on Perl 5.8.{1,2} substr $arg, $i, 1, sprintf("\\x{%x}", $o) if $o < 0x20 || $o > 0x7f; } } else { $arg =~ s/([^ -~])/sprintf("\\x{%x}",ord($1))/eg; } downgrade($arg, 1); my $suffix = ""; if($arg =~ /\A\(\?\^?([a-z]*)(?:-[a-z]*)?:(.*)\)\z/s) { ($suffix, $arg) = ($1, $2); } if ( 2 < $MaxArgLen and $MaxArgLen < length($arg) ) { substr ( $arg, $MaxArgLen - 3 ) = ""; $suffix = "...".$suffix; } return "qr($arg)$suffix"; } # Takes an inheritance cache and a package and returns # an anon hash of known inheritances and anon array of # inheritances which consequences have not been figured # for. sub get_status { my $cache = shift; my $pkg = shift; $cache->{$pkg} ||= [ { $pkg => $pkg }, [ trusts_directly($pkg) ] ]; return @{ $cache->{$pkg} }; } # Takes the info from caller() and figures out the name of # the sub/require/eval sub get_subname { my $info = shift; if ( defined( $info->{evaltext} ) ) { my $eval = $info->{evaltext}; if ( $info->{is_require} ) { return "require $eval"; } else { $eval =~ s/([\\\'])/\\$1/g; return "eval '" . str_len_trim( $eval, $MaxEvalLen ) . "'"; } } # this can happen on older perls when the sub (or the stash containing it) # has been deleted if ( !defined( $info->{sub} ) ) { return '__ANON__::__ANON__'; } return ( $info->{sub} eq '(eval)' ) ? 'eval {...}' : $info->{sub}; } # Figures out what call (from the point of view of the caller) # the long error backtrace should start at. sub long_error_loc { my $i; my $lvl = $CarpLevel; { ++$i; my $cgc = _cgc(); my @caller = $cgc ? $cgc->($i) : caller($i); my $pkg = $caller[0]; unless ( defined($pkg) ) { # This *shouldn't* happen. if (%Internal) { local %Internal; $i = long_error_loc(); last; } elsif (defined $caller[2]) { # this can happen when the stash has been deleted # in that case, just assume that it's a reasonable place to # stop (the file and line data will still be intact in any # case) - the only issue is that we can't detect if the # deleted package was internal (so don't do that then) # -doy redo unless 0 > --$lvl; last; } else { return 2; } } redo if $CarpInternal{$pkg}; redo unless 0 > --$lvl; redo if $Internal{$pkg}; } return $i - 1; } sub longmess_heavy { return @_ if ref( $_[0] ); # don't break references as exceptions my $i = long_error_loc(); return ret_backtrace( $i, @_ ); } # Returns a full stack backtrace starting from where it is # told. sub ret_backtrace { my ( $i, @error ) = @_; my $mess; my $err = join '', @error; $i++; my $tid_msg = ''; if ( defined &threads::tid ) { my $tid = threads->tid; $tid_msg = " thread $tid" if $tid; } my %i = caller_info($i); $mess = "$err at $i{file} line $i{line}$tid_msg"; if( defined $. ) { local $@ = ''; local $SIG{__DIE__}; eval { CORE::die; }; if($@ =~ /^Died at .*(, <.*?> line \d+).$/ ) { $mess .= $1; } } $mess .= "\.\n"; while ( my %i = caller_info( ++$i ) ) { $mess .= "\t$i{sub_name} called at $i{file} line $i{line}$tid_msg\n"; } return $mess; } sub ret_summary { my ( $i, @error ) = @_; my $err = join '', @error; $i++; my $tid_msg = ''; if ( defined &threads::tid ) { my $tid = threads->tid; $tid_msg = " thread $tid" if $tid; } my %i = caller_info($i); return "$err at $i{file} line $i{line}$tid_msg\.\n"; } sub short_error_loc { # You have to create your (hash)ref out here, rather than defaulting it # inside trusts *on a lexical*, as you want it to persist across calls. # (You can default it on $_[2], but that gets messy) my $cache = {}; my $i = 1; my $lvl = $CarpLevel; { my $cgc = _cgc(); my $called = $cgc ? $cgc->($i) : caller($i); $i++; my $caller = $cgc ? $cgc->($i) : caller($i); if (!defined($caller)) { my @caller = $cgc ? $cgc->($i) : caller($i); if (@caller) { # if there's no package but there is other caller info, then # the package has been deleted - treat this as a valid package # in this case redo if defined($called) && $CarpInternal{$called}; redo unless 0 > --$lvl; last; } else { return 0; } } redo if $Internal{$caller}; redo if $CarpInternal{$caller}; redo if $CarpInternal{$called}; redo if trusts( $called, $caller, $cache ); redo if trusts( $caller, $called, $cache ); redo unless 0 > --$lvl; } return $i - 1; } sub shortmess_heavy { return longmess_heavy(@_) if $Verbose; return @_ if ref( $_[0] ); # don't break references as exceptions my $i = short_error_loc(); if ($i) { ret_summary( $i, @_ ); } else { longmess_heavy(@_); } } # If a string is too long, trims it with ... sub str_len_trim { my $str = shift; my $max = shift || 0; if ( 2 < $max and $max < length($str) ) { substr( $str, $max - 3 ) = '...'; } return $str; } # Takes two packages and an optional cache. Says whether the # first inherits from the second. # # Recursive versions of this have to work to avoid certain # possible endless loops, and when following long chains of # inheritance are less efficient. sub trusts { my $child = shift; my $parent = shift; my $cache = shift; my ( $known, $partial ) = get_status( $cache, $child ); # Figure out consequences until we have an answer while ( @$partial and not exists $known->{$parent} ) { my $anc = shift @$partial; next if exists $known->{$anc}; $known->{$anc}++; my ( $anc_knows, $anc_partial ) = get_status( $cache, $anc ); my @found = keys %$anc_knows; @$known{@found} = (); push @$partial, @$anc_partial; } return exists $known->{$parent}; } # Takes a package and gives a list of those trusted directly sub trusts_directly { my $class = shift; no strict 'refs'; my $stash = \%{"$class\::"}; for my $var (qw/ CARP_NOT ISA /) { # Don't try using the variable until we know it exists, # to avoid polluting the caller's namespace. if ( $stash->{$var} && *{$stash->{$var}}{ARRAY} && @{$stash->{$var}} ) { return @{$stash->{$var}} } } return; } if(!defined($warnings::VERSION) || do { no warnings "numeric"; $warnings::VERSION < 1.03 }) { # Very old versions of warnings.pm import from Carp. This can go # wrong due to the circular dependency. If Carp is invoked before # warnings, then Carp starts by loading warnings, then warnings # tries to import from Carp, and gets nothing because Carp is in # the process of loading and hasn't defined its import method yet. # So we work around that by manually exporting to warnings here. no strict "refs"; *{"warnings::$_"} = \&$_ foreach @EXPORT; } 1; __END__ #line 893FILE3aa9477e/Carp/Heavy.pm#line 1 "/usr/local/lib/perl5/5.20.0/Carp/Heavy.pm" package Carp::Heavy; use Carp (); our $VERSION = '1.3301'; my $cv = defined($Carp::VERSION) ? $Carp::VERSION : "undef"; if($cv ne $VERSION) { die "Version mismatch between Carp $cv ($INC{q(Carp.pm)}) and Carp::Heavy $VERSION ($INC{q(Carp/Heavy.pm)}). Did you alter \@INC after Carp was loaded?\n"; } 1; # Most of the machinery of Carp used to be here. # It has been moved in Carp.pm now, but this placeholder remains for # the benefit of modules that like to preload Carp::Heavy directly. # This must load Carp, because some modules rely on the historical # behaviour of Carp::Heavy loading Carp. FILEb2ec5a0d/Exporter.pm ~#line 1 "/usr/local/lib/perl5/5.20.0/Exporter.pm" package Exporter; require 5.006; # Be lean. #use strict; #no strict 'refs'; our $Debug = 0; our $ExportLevel = 0; our $Verbose ||= 0; our $VERSION = '5.70'; our (%Cache); sub as_heavy { require Exporter::Heavy; # Unfortunately, this does not work if the caller is aliased as *name = \&foo # Thus the need to create a lot of identical subroutines my $c = (caller(1))[3]; $c =~ s/.*:://; \&{"Exporter::Heavy::heavy_$c"}; } sub export { goto &{as_heavy()}; } sub import { my $pkg = shift; my $callpkg = caller($ExportLevel); if ($pkg eq "Exporter" and @_ and $_[0] eq "import") { *{$callpkg."::import"} = \&import; return; } # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-( my $exports = \@{"$pkg\::EXPORT"}; # But, avoid creating things if they don't exist, which saves a couple of # hundred bytes per package processed. my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"}; return export $pkg, $callpkg, @_ if $Verbose or $Debug or $fail && @$fail > 1; my $export_cache = ($Cache{$pkg} ||= {}); my $args = @_ or @_ = @$exports; if ($args and not %$export_cache) { s/^&//, $export_cache->{$_} = 1 foreach (@$exports, @{"$pkg\::EXPORT_OK"}); } my $heavy; # Try very hard not to use {} and hence have to enter scope on the foreach # We bomb out of the loop with last as soon as heavy is set. if ($args or $fail) { ($heavy = (/\W/ or $args and not exists $export_cache->{$_} or $fail and @$fail and $_ eq $fail->[0])) and last foreach (@_); } else { ($heavy = /\W/) and last foreach (@_); } return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy; local $SIG{__WARN__} = sub {require Carp; &Carp::carp} if not $SIG{__WARN__}; # shortcut for the common case of no type character *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_; } # Default methods sub export_fail { my $self = shift; @_; } # Unfortunately, caller(1)[3] "does not work" if the caller is aliased as # *name = \&foo. Thus the need to create a lot of identical subroutines # Otherwise we could have aliased them to export(). sub export_to_level { goto &{as_heavy()}; } sub export_tags { goto &{as_heavy()}; } sub export_ok_tags { goto &{as_heavy()}; } sub require_version { goto &{as_heavy()}; } 1; __END__ #line 589 FILE442752da/Exporter/Heavy.pmH#line 1 "/usr/local/lib/perl5/5.20.0/Exporter/Heavy.pm" package Exporter::Heavy; use strict; no strict 'refs'; # On one line so MakeMaker will see it. require Exporter; our $VERSION = $Exporter::VERSION; #line 22 # # We go to a lot of trouble not to 'require Carp' at file scope, # because Carp requires Exporter, and something has to give. # sub _rebuild_cache { my ($pkg, $exports, $cache) = @_; s/^&// foreach @$exports; @{$cache}{@$exports} = (1) x @$exports; my $ok = \@{"${pkg}::EXPORT_OK"}; if (@$ok) { s/^&// foreach @$ok; @{$cache}{@$ok} = (1) x @$ok; } } sub heavy_export { # Save the old __WARN__ handler in case it was defined my $oldwarn = $SIG{__WARN__}; # First make import warnings look like they're coming from the "use". local $SIG{__WARN__} = sub { # restore it back so proper stacking occurs local $SIG{__WARN__} = $oldwarn; my $text = shift; if ($text =~ s/ at \S*Exporter\S*.pm line \d+.*\n//) { require Carp; local $Carp::CarpLevel = 1; # ignore package calling us too. Carp::carp($text); } else { warn $text; } }; local $SIG{__DIE__} = sub { require Carp; local $Carp::CarpLevel = 1; # ignore package calling us too. Carp::croak("$_[0]Illegal null symbol in \@${1}::EXPORT") if $_[0] =~ /^Unable to create sub named "(.*?)::"/; }; my($pkg, $callpkg, @imports) = @_; my($type, $sym, $cache_is_current, $oops); my($exports, $export_cache) = (\@{"${pkg}::EXPORT"}, $Exporter::Cache{$pkg} ||= {}); if (@imports) { if (!%$export_cache) { _rebuild_cache ($pkg, $exports, $export_cache); $cache_is_current = 1; } if (grep m{^[/!:]}, @imports) { my $tagsref = \%{"${pkg}::EXPORT_TAGS"}; my $tagdata; my %imports; my($remove, $spec, @names, @allexports); # negated first item implies starting with default set: unshift @imports, ':DEFAULT' if $imports[0] =~ m/^!/; foreach $spec (@imports){ $remove = $spec =~ s/^!//; if ($spec =~ s/^://){ if ($spec eq 'DEFAULT'){ @names = @$exports; } elsif ($tagdata = $tagsref->{$spec}) { @names = @$tagdata; } else { warn qq["$spec" is not defined in %${pkg}::EXPORT_TAGS]; ++$oops; next; } } elsif ($spec =~ m:^/(.*)/$:){ my $patn = $1; @allexports = keys %$export_cache unless @allexports; # only do keys once @names = grep(/$patn/, @allexports); # not anchored by default } else { @names = ($spec); # is a normal symbol name } warn "Import ".($remove ? "del":"add").": @names " if $Exporter::Verbose; if ($remove) { foreach $sym (@names) { delete $imports{$sym} } } else { @imports{@names} = (1) x @names; } } @imports = keys %imports; } my @carp; foreach $sym (@imports) { if (!$export_cache->{$sym}) { if ($sym =~ m/^\d/) { $pkg->VERSION($sym); # inherit from UNIVERSAL # If the version number was the only thing specified # then we should act as if nothing was specified: if (@imports == 1) { @imports = @$exports; last; } # We need a way to emulate 'use Foo ()' but still # allow an easy version check: "use Foo 1.23, ''"; if (@imports == 2 and !$imports[1]) { @imports = (); last; } } elsif ($sym !~ s/^&// || !$export_cache->{$sym}) { # Last chance - see if they've updated EXPORT_OK since we # cached it. unless ($cache_is_current) { %$export_cache = (); _rebuild_cache ($pkg, $exports, $export_cache); $cache_is_current = 1; } if (!$export_cache->{$sym}) { # accumulate the non-exports push @carp, qq["$sym" is not exported by the $pkg module\n]; $oops++; } } } } if ($oops) { require Carp; Carp::croak("@{carp}Can't continue after import errors"); } } else { @imports = @$exports; } my($fail, $fail_cache) = (\@{"${pkg}::EXPORT_FAIL"}, $Exporter::FailCache{$pkg} ||= {}); if (@$fail) { if (!%$fail_cache) { # Build cache of symbols. Optimise the lookup by adding # barewords twice... both with and without a leading &. # (Technique could be applied to $export_cache at cost of memory) my @expanded = map { /^\w/ ? ($_, '&'.$_) : $_ } @$fail; warn "${pkg}::EXPORT_FAIL cached: @expanded" if $Exporter::Verbose; @{$fail_cache}{@expanded} = (1) x @expanded; } my @failed; foreach $sym (@imports) { push(@failed, $sym) if $fail_cache->{$sym} } if (@failed) { @failed = $pkg->export_fail(@failed); foreach $sym (@failed) { require Carp; Carp::carp(qq["$sym" is not implemented by the $pkg module ], "on this architecture"); } if (@failed) { require Carp; Carp::croak("Can't continue after import errors"); } } } warn "Importing into $callpkg from $pkg: ", join(", ",sort @imports) if $Exporter::Verbose; foreach $sym (@imports) { # shortcut for the common case of no type character (*{"${callpkg}::$sym"} = \&{"${pkg}::$sym"}, next) unless $sym =~ s/^(\W)//; $type = $1; no warnings 'once'; *{"${callpkg}::$sym"} = $type eq '&' ? \&{"${pkg}::$sym"} : $type eq '$' ? \${"${pkg}::$sym"} : $type eq '@' ? \@{"${pkg}::$sym"} : $type eq '%' ? \%{"${pkg}::$sym"} : $type eq '*' ? *{"${pkg}::$sym"} : do { require Carp; Carp::croak("Can't export symbol: $type$sym") }; } } sub heavy_export_to_level { my $pkg = shift; my $level = shift; (undef) = shift; # XXX redundant arg my $callpkg = caller($level); $pkg->export($callpkg, @_); } # Utility functions sub _push_tags { my($pkg, $var, $syms) = @_; my @nontag = (); my $export_tags = \%{"${pkg}::EXPORT_TAGS"}; push(@{"${pkg}::$var"}, map { $export_tags->{$_} ? @{$export_tags->{$_}} : scalar(push(@nontag,$_),$_) } (@$syms) ? @$syms : keys %$export_tags); if (@nontag and $^W) { # This may change to a die one day require Carp; Carp::carp(join(", ", @nontag)." are not tags of $pkg"); } } sub heavy_require_version { my($self, $wanted) = @_; my $pkg = ref $self || $self; return ${pkg}->VERSION($wanted); } sub heavy_export_tags { _push_tags((caller)[0], "EXPORT", \@_); } sub heavy_export_ok_tags { _push_tags((caller)[0], "EXPORT_OK", \@_); } 1; FILEbd036cf7/File/Basename.pm#line 1 "/usr/local/lib/perl5/5.20.0/File/Basename.pm" #line 36 package File::Basename; # File::Basename is used during the Perl build, when the re extension may # not be available, but we only actually need it if running under tainting. BEGIN { if (${^TAINT}) { require re; re->import('taint'); } } use strict; use 5.006; use warnings; our(@ISA, @EXPORT, $VERSION, $Fileparse_fstype, $Fileparse_igncase); require Exporter; @ISA = qw(Exporter); @EXPORT = qw(fileparse fileparse_set_fstype basename dirname); $VERSION = "2.85"; fileparse_set_fstype($^O); #line 102 sub fileparse { my($fullname,@suffices) = @_; unless (defined $fullname) { require Carp; Carp::croak("fileparse(): need a valid pathname"); } my $orig_type = ''; my($type,$igncase) = ($Fileparse_fstype, $Fileparse_igncase); my($taint) = substr($fullname,0,0); # Is $fullname tainted? if ($type eq "VMS" and $fullname =~ m{/} ) { # We're doing Unix emulation $orig_type = $type; $type = 'Unix'; } my($dirpath, $basename); if (grep { $type eq $_ } qw(MSDOS DOS MSWin32 Epoc)) { ($dirpath,$basename) = ($fullname =~ /^((?:.*[:\\\/])?)(.*)/s); $dirpath .= '.\\' unless $dirpath =~ /[\\\/]\z/; } elsif ($type eq "OS2") { ($dirpath,$basename) = ($fullname =~ m#^((?:.*[:\\/])?)(.*)#s); $dirpath = './' unless $dirpath; # Can't be 0 $dirpath .= '/' unless $dirpath =~ m#[\\/]\z#; } elsif ($type eq "MacOS") { ($dirpath,$basename) = ($fullname =~ /^(.*:)?(.*)/s); $dirpath = ':' unless $dirpath; } elsif ($type eq "AmigaOS") { ($dirpath,$basename) = ($fullname =~ /(.*[:\/])?(.*)/s); $dirpath = './' unless $dirpath; } elsif ($type eq 'VMS' ) { ($dirpath,$basename) = ($fullname =~ /^(.*[:>\]])?(.*)/s); $dirpath ||= ''; # should always be defined } else { # Default to Unix semantics. ($dirpath,$basename) = ($fullname =~ m{^(.*/)?(.*)}s); if ($orig_type eq 'VMS' and $fullname =~ m{^(/[^/]+/000000(/|$))(.*)}) { # dev:[000000] is top of VMS tree, similar to Unix '/' # so strip it off and treat the rest as "normal" my $devspec = $1; my $remainder = $3; ($dirpath,$basename) = ($remainder =~ m{^(.*/)?(.*)}s); $dirpath ||= ''; # should always be defined $dirpath = $devspec.$dirpath; } $dirpath = './' unless $dirpath; } my $tail = ''; my $suffix = ''; if (@suffices) { foreach $suffix (@suffices) { my $pat = ($igncase ? '(?i)' : '') . "($suffix)\$"; if ($basename =~ s/$pat//s) { $taint .= substr($suffix,0,0); $tail = $1 . $tail; } } } # Ensure taint is propagated from the path to its pieces. $tail .= $taint; wantarray ? ($basename .= $taint, $dirpath .= $taint, $tail) : ($basename .= $taint); } #line 212 sub basename { my($path) = shift; # From BSD basename(1) # The basename utility deletes any prefix ending with the last slash '/' # character present in string (after first stripping trailing slashes) _strip_trailing_sep($path); my($basename, $dirname, $suffix) = fileparse( $path, map("\Q$_\E",@_) ); # From BSD basename(1) # The suffix is not stripped if it is identical to the remaining # characters in string. if( length $suffix and !length $basename ) { $basename = $suffix; } # Ensure that basename '/' == '/' if( !length $basename ) { $basename = $dirname; } return $basename; } #line 281 sub dirname { my $path = shift; my($type) = $Fileparse_fstype; if( $type eq 'VMS' and $path =~ m{/} ) { # Parse as Unix local($File::Basename::Fileparse_fstype) = ''; return dirname($path); } my($basename, $dirname) = fileparse($path); if ($type eq 'VMS') { $dirname ||= $ENV{DEFAULT}; } elsif ($type eq 'MacOS') { if( !length($basename) && $dirname !~ /^[^:]+:\z/) { _strip_trailing_sep($dirname); ($basename,$dirname) = fileparse $dirname; } $dirname .= ":" unless $dirname =~ /:\z/; } elsif (grep { $type eq $_ } qw(MSDOS DOS MSWin32 OS2)) { _strip_trailing_sep($dirname); unless( length($basename) ) { ($basename,$dirname) = fileparse $dirname; _strip_trailing_sep($dirname); } } elsif ($type eq 'AmigaOS') { if ( $dirname =~ /:\z/) { return $dirname } chop $dirname; $dirname =~ s{[^:/]+\z}{} unless length($basename); } else { _strip_trailing_sep($dirname); unless( length($basename) ) { ($basename,$dirname) = fileparse $dirname; _strip_trailing_sep($dirname); } } $dirname; } # Strip the trailing path separator. sub _strip_trailing_sep { my $type = $Fileparse_fstype; if ($type eq 'MacOS') { $_[0] =~ s/([^:]):\z/$1/s; } elsif (grep { $type eq $_ } qw(MSDOS DOS MSWin32 OS2)) { $_[0] =~ s/([^:])[\\\/]*\z/$1/; } else { $_[0] =~ s{(.)/*\z}{$1}s; } } #line 369 BEGIN { my @Ignore_Case = qw(MacOS VMS AmigaOS OS2 RISCOS MSWin32 MSDOS DOS Epoc); my @Types = (@Ignore_Case, qw(Unix)); sub fileparse_set_fstype { my $old = $Fileparse_fstype; if (@_) { my $new_type = shift; $Fileparse_fstype = 'Unix'; # default foreach my $type (@Types) { $Fileparse_fstype = $type if $new_type =~ /^$type/i; } $Fileparse_igncase = (grep $Fileparse_fstype eq $_, @Ignore_Case) ? 1 : 0; } return $old; } } 1; #line 403FILE6901c7ea/File/Copy.pm#h#line 1 "/usr/local/lib/perl5/5.20.0/File/Copy.pm" # File/Copy.pm. Written in 1994 by Aaron Sherman . This # source code has been placed in the public domain by the author. # Please be kind and preserve the documentation. # # Additions copyright 1996 by Charles Bailey. Permission is granted # to distribute the revised code under the same terms as Perl itself. package File::Copy; use 5.006; use strict; use warnings; no warnings 'newline'; use File::Spec; use Config; # During perl build, we need File::Copy but Scalar::Util might not be built yet # And then we need these games to avoid loading overload, as that will # confuse miniperl during the bootstrap of perl. my $Scalar_Util_loaded = eval q{ require Scalar::Util; require overload; 1 }; our(@ISA, @EXPORT, @EXPORT_OK, $VERSION, $Too_Big, $Syscopy_is_copy); sub copy; sub syscopy; sub cp; sub mv; $VERSION = '2.29'; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(copy move); @EXPORT_OK = qw(cp mv); $Too_Big = 1024 * 1024 * 2; sub croak { require Carp; goto &Carp::croak; } sub carp { require Carp; goto &Carp::carp; } sub _catname { my($from, $to) = @_; if (not defined &basename) { require File::Basename; import File::Basename 'basename'; } return File::Spec->catfile($to, basename($from)); } # _eq($from, $to) tells whether $from and $to are identical sub _eq { my ($from, $to) = map { $Scalar_Util_loaded && Scalar::Util::blessed($_) && overload::Method($_, q{""}) ? "$_" : $_ } (@_); return '' if ( (ref $from) xor (ref $to) ); return $from == $to if ref $from; return $from eq $to; } sub copy { croak("Usage: copy(FROM, TO [, BUFFERSIZE]) ") unless(@_ == 2 || @_ == 3); my $from = shift; my $to = shift; my $size; if (@_) { $size = shift(@_) + 0; croak("Bad buffer size for copy: $size\n") unless ($size > 0); } my $from_a_handle = (ref($from) ? (ref($from) eq 'GLOB' || UNIVERSAL::isa($from, 'GLOB') || UNIVERSAL::isa($from, 'IO::Handle')) : (ref(\$from) eq 'GLOB')); my $to_a_handle = (ref($to) ? (ref($to) eq 'GLOB' || UNIVERSAL::isa($to, 'GLOB') || UNIVERSAL::isa($to, 'IO::Handle')) : (ref(\$to) eq 'GLOB')); if (_eq($from, $to)) { # works for references, too carp("'$from' and '$to' are identical (not copied)"); return 0; } if (!$from_a_handle && !$to_a_handle && -d $to && ! -d $from) { $to = _catname($from, $to); } if ((($Config{d_symlink} && $Config{d_readlink}) || $Config{d_link}) && !($^O eq 'MSWin32' || $^O eq 'os2')) { my @fs = stat($from); if (@fs) { my @ts = stat($to); if (@ts && $fs[0] == $ts[0] && $fs[1] == $ts[1] && !-p $from) { carp("'$from' and '$to' are identical (not copied)"); return 0; } } } elsif (_eq($from, $to)) { carp("'$from' and '$to' are identical (not copied)"); return 0; } if (defined &syscopy && !$Syscopy_is_copy && !$to_a_handle && !($from_a_handle && $^O eq 'os2' ) # OS/2 cannot handle handles && !($from_a_handle && $^O eq 'MSWin32') && !($from_a_handle && $^O eq 'NetWare') ) { if ($^O eq 'VMS' && -e $from && ! -d $to && ! -d $from) { # VMS natively inherits path components from the source of a # copy, but we want the Unixy behavior of inheriting from # the current working directory. Also, default in a trailing # dot for null file types. $to = VMS::Filespec::rmsexpand(VMS::Filespec::vmsify($to), '.'); # Get rid of the old versions to be like UNIX 1 while unlink $to; } return syscopy($from, $to) || 0; } my $closefrom = 0; my $closeto = 0; my ($status, $r, $buf); local($\) = ''; my $from_h; if ($from_a_handle) { $from_h = $from; } else { open $from_h, "<", $from or goto fail_open1; binmode $from_h or die "($!,$^E)"; $closefrom = 1; } # Seems most logical to do this here, in case future changes would want to # make this croak for some reason. unless (defined $size) { $size = tied(*$from_h) ? 0 : -s $from_h || 0; $size = 1024 if ($size < 512); $size = $Too_Big if ($size > $Too_Big); } my $to_h; if ($to_a_handle) { $to_h = $to; } else { $to_h = \do { local *FH }; # XXX is this line obsolete? open $to_h, ">", $to or goto fail_open2; binmode $to_h or die "($!,$^E)"; $closeto = 1; } $! = 0; for (;;) { my ($r, $w, $t); defined($r = sysread($from_h, $buf, $size)) or goto fail_inner; last unless $r; for ($w = 0; $w < $r; $w += $t) { $t = syswrite($to_h, $buf, $r - $w, $w) or goto fail_inner; } } close($to_h) || goto fail_open2 if $closeto; close($from_h) || goto fail_open1 if $closefrom; # Use this idiom to avoid uninitialized value warning. return 1; # All of these contortions try to preserve error messages... fail_inner: if ($closeto) { $status = $!; $! = 0; close $to_h; $! = $status unless $!; } fail_open2: if ($closefrom) { $status = $!; $! = 0; close $from_h; $! = $status unless $!; } fail_open1: return 0; } sub cp { my($from,$to) = @_; my(@fromstat) = stat $from; my(@tostat) = stat $to; my $perm; return 0 unless copy(@_) and @fromstat; if (@tostat) { $perm = $tostat[2]; } else { $perm = $fromstat[2] & ~(umask || 0); @tostat = stat $to; } # Might be more robust to look for S_I* in Fcntl, but we're # trying to avoid dependence on any XS-containing modules, # since File::Copy is used during the Perl build. $perm &= 07777; if ($perm & 06000) { croak("Unable to check setuid/setgid permissions for $to: $!") unless @tostat; if ($perm & 04000 and # setuid $fromstat[4] != $tostat[4]) { # owner must match $perm &= ~06000; } if ($perm & 02000 && $> != 0) { # if not root, setgid my $ok = $fromstat[5] == $tostat[5]; # group must match if ($ok) { # and we must be in group $ok = grep { $_ == $fromstat[5] } split /\s+/, $) } $perm &= ~06000 unless $ok; } } return 0 unless @tostat; return 1 if $perm == ($tostat[2] & 07777); return eval { chmod $perm, $to; } ? 1 : 0; } sub _move { croak("Usage: move(FROM, TO) ") unless @_ == 3; my($from,$to,$fallback) = @_; my($fromsz,$tosz1,$tomt1,$tosz2,$tomt2,$sts,$ossts); if (-d $to && ! -d $from) { $to = _catname($from, $to); } ($tosz1,$tomt1) = (stat($to))[7,9]; $fromsz = -s $from; if ($^O eq 'os2' and defined $tosz1 and defined $fromsz) { # will not rename with overwrite unlink $to; } if ($^O eq 'VMS' && -e $from && ! -d $to && ! -d $from) { # VMS natively inherits path components from the source of a # copy, but we want the Unixy behavior of inheriting from # the current working directory. Also, default in a trailing # dot for null file types. $to = VMS::Filespec::rmsexpand(VMS::Filespec::vmsify($to), '.'); # Get rid of the old versions to be like UNIX 1 while unlink $to; } return 1 if rename $from, $to; # Did rename return an error even though it succeeded, because $to # is on a remote NFS file system, and NFS lost the server's ack? return 1 if defined($fromsz) && !-e $from && # $from disappeared (($tosz2,$tomt2) = (stat($to))[7,9]) && # $to's there ((!defined $tosz1) || # not before or ($tosz1 != $tosz2 or $tomt1 != $tomt2)) && # was changed $tosz2 == $fromsz; # it's all there ($tosz1,$tomt1) = (stat($to))[7,9]; # just in case rename did something { local $@; eval { local $SIG{__DIE__}; $fallback->($from,$to) or die; my($atime, $mtime) = (stat($from))[8,9]; utime($atime, $mtime, $to); unlink($from) or die; }; return 1 unless $@; } ($sts,$ossts) = ($! + 0, $^E + 0); ($tosz2,$tomt2) = ((stat($to))[7,9],0,0) if defined $tomt1; unlink($to) if !defined($tomt1) or $tomt1 != $tomt2 or $tosz1 != $tosz2; ($!,$^E) = ($sts,$ossts); return 0; } sub move { _move(@_,\©); } sub mv { _move(@_,\&cp); } # &syscopy is an XSUB under OS/2 unless (defined &syscopy) { if ($^O eq 'VMS') { *syscopy = \&rmscopy; } elsif ($^O eq 'MSWin32' && defined &DynaLoader::boot_DynaLoader) { # Win32::CopyFile() fill only work if we can load Win32.xs *syscopy = sub { return 0 unless @_ == 2; return Win32::CopyFile(@_, 1); }; } else { $Syscopy_is_copy = 1; *syscopy = \© } } 1; __END__ #line 497 FILEc445970b/File/Find.pmU*#line 1 "/usr/local/lib/perl5/5.20.0/File/Find.pm" package File::Find; use 5.006; use strict; use warnings; use warnings::register; our $VERSION = '1.27'; require Exporter; require Cwd; # # Modified to ensure sub-directory traversal order is not inverted by stack # push and pops. That is remains in the same order as in the directory file, # or user pre-processing (EG:sorted). # #line 352 our @ISA = qw(Exporter); our @EXPORT = qw(find finddepth); use strict; my $Is_VMS; my $Is_Win32; require File::Basename; require File::Spec; # Should ideally be my() not our() but local() currently # refuses to operate on lexicals our %SLnkSeen; our ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow, $follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat, $pre_process, $post_process, $dangling_symlinks); sub contract_name { my ($cdir,$fn) = @_; return substr($cdir,0,rindex($cdir,'/')) if $fn eq $File::Find::current_dir; $cdir = substr($cdir,0,rindex($cdir,'/')+1); $fn =~ s|^\./||; my $abs_name= $cdir . $fn; if (substr($fn,0,3) eq '../') { 1 while $abs_name =~ s!/[^/]*/\.\./+!/!; } return $abs_name; } sub PathCombine($$) { my ($Base,$Name) = @_; my $AbsName; if (substr($Name,0,1) eq '/') { $AbsName= $Name; } else { $AbsName= contract_name($Base,$Name); } # (simple) check for recursion my $newlen= length($AbsName); if ($newlen <= length($Base)) { if (($newlen == length($Base) || substr($Base,$newlen,1) eq '/') && $AbsName eq substr($Base,0,$newlen)) { return undef; } } return $AbsName; } sub Follow_SymLink($) { my ($AbsName) = @_; my ($NewName,$DEV, $INO); ($DEV, $INO)= lstat $AbsName; while (-l _) { if ($SLnkSeen{$DEV, $INO}++) { if ($follow_skip < 2) { die "$AbsName is encountered a second time"; } else { return undef; } } $NewName= PathCombine($AbsName, readlink($AbsName)); unless(defined $NewName) { if ($follow_skip < 2) { die "$AbsName is a recursive symbolic link"; } else { return undef; } } else { $AbsName= $NewName; } ($DEV, $INO) = lstat($AbsName); return undef unless defined $DEV; # dangling symbolic link } if ($full_check && defined $DEV && $SLnkSeen{$DEV, $INO}++) { if ( ($follow_skip < 1) || ((-d _) && ($follow_skip < 2)) ) { die "$AbsName encountered a second time"; } else { return undef; } } return $AbsName; } our($dir, $name, $fullname, $prune); sub _find_dir_symlnk($$$); sub _find_dir($$$); # check whether or not a scalar variable is tainted # (code straight from the Camel, 3rd ed., page 561) sub is_tainted_pp { my $arg = shift; my $nada = substr($arg, 0, 0); # zero-length local $@; eval { eval "# $nada" }; return length($@) != 0; } sub _find_opt { my $wanted = shift; die "invalid top directory" unless defined $_[0]; # This function must local()ize everything because callbacks may # call find() or finddepth() local %SLnkSeen; local ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow, $follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat, $pre_process, $post_process, $dangling_symlinks); local($dir, $name, $fullname, $prune); local *_ = \my $a; my $cwd = $wanted->{bydepth} ? Cwd::fastcwd() : Cwd::getcwd(); if ($Is_VMS) { # VMS returns this by default in VMS format which just doesn't # work for the rest of this module. $cwd = VMS::Filespec::unixpath($cwd); # Apparently this is not expected to have a trailing space. # To attempt to make VMS/UNIX conversions mostly reversible, # a trailing slash is needed. The run-time functions ignore the # resulting double slash, but it causes the perl tests to fail. $cwd =~ s#/\z##; # This comes up in upper case now, but should be lower. # In the future this could be exact case, no need to change. } my $cwd_untainted = $cwd; my $check_t_cwd = 1; $wanted_callback = $wanted->{wanted}; $bydepth = $wanted->{bydepth}; $pre_process = $wanted->{preprocess}; $post_process = $wanted->{postprocess}; $no_chdir = $wanted->{no_chdir}; $full_check = $Is_Win32 ? 0 : $wanted->{follow}; $follow = $Is_Win32 ? 0 : $full_check || $wanted->{follow_fast}; $follow_skip = $wanted->{follow_skip}; $untaint = $wanted->{untaint}; $untaint_pat = $wanted->{untaint_pattern}; $untaint_skip = $wanted->{untaint_skip}; $dangling_symlinks = $wanted->{dangling_symlinks}; # for compatibility reasons (find.pl, find2perl) local our ($topdir, $topdev, $topino, $topmode, $topnlink); # a symbolic link to a directory doesn't increase the link count $avoid_nlink = $follow || $File::Find::dont_use_nlink; my ($abs_dir, $Is_Dir); Proc_Top_Item: foreach my $TOP (@_) { my $top_item = $TOP; $top_item = VMS::Filespec::unixify($top_item) if $Is_VMS; ($topdev,$topino,$topmode,$topnlink) = $follow ? stat $top_item : lstat $top_item; if ($Is_Win32) { $top_item =~ s|[/\\]\z|| unless $top_item =~ m{^(?:\w:)?[/\\]$}; } else { $top_item =~ s|/\z|| unless $top_item eq '/'; } $Is_Dir= 0; if ($follow) { if (substr($top_item,0,1) eq '/') { $abs_dir = $top_item; } elsif ($top_item eq $File::Find::current_dir) { $abs_dir = $cwd; } else { # care about any ../ $top_item =~ s/\.dir\z//i if $Is_VMS; $abs_dir = contract_name("$cwd/",$top_item); } $abs_dir= Follow_SymLink($abs_dir); unless (defined $abs_dir) { if ($dangling_symlinks) { if (ref $dangling_symlinks eq 'CODE') { $dangling_symlinks->($top_item, $cwd); } else { warnings::warnif "$top_item is a dangling symbolic link\n"; } } next Proc_Top_Item; } if (-d _) { $top_item =~ s/\.dir\z//i if $Is_VMS; _find_dir_symlnk($wanted, $abs_dir, $top_item); $Is_Dir= 1; } } else { # no follow $topdir = $top_item; unless (defined $topnlink) { warnings::warnif "Can't stat $top_item: $!\n"; next Proc_Top_Item; } if (-d _) { $top_item =~ s/\.dir\z//i if $Is_VMS; _find_dir($wanted, $top_item, $topnlink); $Is_Dir= 1; } else { $abs_dir= $top_item; } } unless ($Is_Dir) { unless (($_,$dir) = File::Basename::fileparse($abs_dir)) { ($dir,$_) = ('./', $top_item); } $abs_dir = $dir; if (( $untaint ) && (is_tainted($dir) )) { ( $abs_dir ) = $dir =~ m|$untaint_pat|; unless (defined $abs_dir) { if ($untaint_skip == 0) { die "directory $dir is still tainted"; } else { next Proc_Top_Item; } } } unless ($no_chdir || chdir $abs_dir) { warnings::warnif "Couldn't chdir $abs_dir: $!\n"; next Proc_Top_Item; } $name = $abs_dir . $_; # $File::Find::name $_ = $name if $no_chdir; { $wanted_callback->() }; # protect against wild "next" } unless ( $no_chdir ) { if ( ($check_t_cwd) && (($untaint) && (is_tainted($cwd) )) ) { ( $cwd_untainted ) = $cwd =~ m|$untaint_pat|; unless (defined $cwd_untainted) { die "insecure cwd in find(depth)"; } $check_t_cwd = 0; } unless (chdir $cwd_untainted) { die "Can't cd to $cwd: $!\n"; } } } } # API: # $wanted # $p_dir : "parent directory" # $nlink : what came back from the stat # preconditions: # chdir (if not no_chdir) to dir sub _find_dir($$$) { my ($wanted, $p_dir, $nlink) = @_; my ($CdLvl,$Level) = (0,0); my @Stack; my @filenames; my ($subcount,$sub_nlink); my $SE= []; my $dir_name= $p_dir; my $dir_pref; my $dir_rel = $File::Find::current_dir; my $tainted = 0; my $no_nlink; if ($Is_Win32) { $dir_pref = ($p_dir =~ m{^(?:\w:[/\\]?|[/\\])$} ? $p_dir : "$p_dir/" ); } elsif ($Is_VMS) { # VMS is returning trailing .dir on directories # and trailing . on files and symbolic links # in UNIX syntax. # $p_dir =~ s/\.(dir)?$//i unless $p_dir eq '.'; $dir_pref = ($p_dir =~ m/[\]>]+$/ ? $p_dir : "$p_dir/" ); } else { $dir_pref= ( $p_dir eq '/' ? '/' : "$p_dir/" ); } local ($dir, $name, $prune, *DIR); unless ( $no_chdir || ($p_dir eq $File::Find::current_dir)) { my $udir = $p_dir; if (( $untaint ) && (is_tainted($p_dir) )) { ( $udir ) = $p_dir =~ m|$untaint_pat|; unless (defined $udir) { if ($untaint_skip == 0) { die "directory $p_dir is still tainted"; } else { return; } } } unless (chdir ($Is_VMS && $udir !~ /[\/\[<]+/ ? "./$udir" : $udir)) { warnings::warnif "Can't cd to $udir: $!\n"; return; } } # push the starting directory push @Stack,[$CdLvl,$p_dir,$dir_rel,-1] if $bydepth; while (defined $SE) { unless ($bydepth) { $dir= $p_dir; # $File::Find::dir $name= $dir_name; # $File::Find::name $_= ($no_chdir ? $dir_name : $dir_rel ); # $_ # prune may happen here $prune= 0; { $wanted_callback->() }; # protect against wild "next" next if $prune; } # change to that directory unless ($no_chdir || ($dir_rel eq $File::Find::current_dir)) { my $udir= $dir_rel; if ( ($untaint) && (($tainted) || ($tainted = is_tainted($dir_rel) )) ) { ( $udir ) = $dir_rel =~ m|$untaint_pat|; unless (defined $udir) { if ($untaint_skip == 0) { die "directory (" . ($p_dir ne '/' ? $p_dir : '') . "/) $dir_rel is still tainted"; } else { # $untaint_skip == 1 next; } } } unless (chdir ($Is_VMS && $udir !~ /[\/\[<]+/ ? "./$udir" : $udir)) { warnings::warnif "Can't cd to (" . ($p_dir ne '/' ? $p_dir : '') . "/) $udir: $!\n"; next; } $CdLvl++; } $dir= $dir_name; # $File::Find::dir # Get the list of files in the current directory. unless (opendir DIR, ($no_chdir ? $dir_name : $File::Find::current_dir)) { warnings::warnif "Can't opendir($dir_name): $!\n"; next; } @filenames = readdir DIR; closedir(DIR); @filenames = $pre_process->(@filenames) if $pre_process; push @Stack,[$CdLvl,$dir_name,"",-2] if $post_process; # default: use whatever was specified # (if $nlink >= 2, and $avoid_nlink == 0, this will switch back) $no_nlink = $avoid_nlink; # if dir has wrong nlink count, force switch to slower stat method $no_nlink = 1 if ($nlink < 2); if ($nlink == 2 && !$no_nlink) { # This dir has no subdirectories. for my $FN (@filenames) { if ($Is_VMS) { # Big hammer here - Compensate for VMS trailing . and .dir # No win situation until this is changed, but this # will handle the majority of the cases with breaking the fewest $FN =~ s/\.dir\z//i; $FN =~ s#\.$## if ($FN ne '.'); } next if $FN =~ $File::Find::skip_pattern; $name = $dir_pref . $FN; # $File::Find::name $_ = ($no_chdir ? $name : $FN); # $_ { $wanted_callback->() }; # protect against wild "next" } } else { # This dir has subdirectories. $subcount = $nlink - 2; # HACK: insert directories at this position. so as to preserve # the user pre-processed ordering of files. # EG: directory traversal is in user sorted order, not at random. my $stack_top = @Stack; for my $FN (@filenames) { next if $FN =~ $File::Find::skip_pattern; if ($subcount > 0 || $no_nlink) { # Seen all the subdirs? # check for directoriness. # stat is faster for a file in the current directory $sub_nlink = (lstat ($no_chdir ? $dir_pref . $FN : $FN))[3]; if (-d _) { --$subcount; $FN =~ s/\.dir\z//i if $Is_VMS; # HACK: replace push to preserve dir traversal order #push @Stack,[$CdLvl,$dir_name,$FN,$sub_nlink]; splice @Stack, $stack_top, 0, [$CdLvl,$dir_name,$FN,$sub_nlink]; } else { $name = $dir_pref . $FN; # $File::Find::name $_= ($no_chdir ? $name : $FN); # $_ { $wanted_callback->() }; # protect against wild "next" } } else { $name = $dir_pref . $FN; # $File::Find::name $_= ($no_chdir ? $name : $FN); # $_ { $wanted_callback->() }; # protect against wild "next" } } } } continue { while ( defined ($SE = pop @Stack) ) { ($Level, $p_dir, $dir_rel, $nlink) = @$SE; if ($CdLvl > $Level && !$no_chdir) { my $tmp; if ($Is_VMS) { $tmp = '[' . ('-' x ($CdLvl-$Level)) . ']'; } else { $tmp = join('/',('..') x ($CdLvl-$Level)); } die "Can't cd to $tmp from $dir_name: $!" unless chdir ($tmp); $CdLvl = $Level; } if ($Is_Win32) { $dir_name = ($p_dir =~ m{^(?:\w:[/\\]?|[/\\])$} ? "$p_dir$dir_rel" : "$p_dir/$dir_rel"); $dir_pref = "$dir_name/"; } elsif ($^O eq 'VMS') { if ($p_dir =~ m/[\]>]+$/) { $dir_name = $p_dir; $dir_name =~ s/([\]>]+)$/.$dir_rel$1/; $dir_pref = $dir_name; } else { $dir_name = "$p_dir/$dir_rel"; $dir_pref = "$dir_name/"; } } else { $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel"); $dir_pref = "$dir_name/"; } if ( $nlink == -2 ) { $name = $dir = $p_dir; # $File::Find::name / dir $_ = $File::Find::current_dir; $post_process->(); # End-of-directory processing } elsif ( $nlink < 0 ) { # must be finddepth, report dirname now $name = $dir_name; if ( substr($name,-2) eq '/.' ) { substr($name, length($name) == 2 ? -1 : -2) = ''; } $dir = $p_dir; $_ = ($no_chdir ? $dir_name : $dir_rel ); if ( substr($_,-2) eq '/.' ) { substr($_, length($_) == 2 ? -1 : -2) = ''; } { $wanted_callback->() }; # protect against wild "next" } else { push @Stack,[$CdLvl,$p_dir,$dir_rel,-1] if $bydepth; last; } } } } # API: # $wanted # $dir_loc : absolute location of a dir # $p_dir : "parent directory" # preconditions: # chdir (if not no_chdir) to dir sub _find_dir_symlnk($$$) { my ($wanted, $dir_loc, $p_dir) = @_; # $dir_loc is the absolute directory my @Stack; my @filenames; my $new_loc; my $updir_loc = $dir_loc; # untainted parent directory my $SE = []; my $dir_name = $p_dir; my $dir_pref; my $loc_pref; my $dir_rel = $File::Find::current_dir; my $byd_flag; # flag for pending stack entry if $bydepth my $tainted = 0; my $ok = 1; $dir_pref = ( $p_dir eq '/' ? '/' : "$p_dir/" ); $loc_pref = ( $dir_loc eq '/' ? '/' : "$dir_loc/" ); local ($dir, $name, $fullname, $prune, *DIR); unless ($no_chdir) { # untaint the topdir if (( $untaint ) && (is_tainted($dir_loc) )) { ( $updir_loc ) = $dir_loc =~ m|$untaint_pat|; # parent dir, now untainted # once untainted, $updir_loc is pushed on the stack (as parent directory); # hence, we don't need to untaint the parent directory every time we chdir # to it later unless (defined $updir_loc) { if ($untaint_skip == 0) { die "directory $dir_loc is still tainted"; } else { return; } } } $ok = chdir($updir_loc) unless ($p_dir eq $File::Find::current_dir); unless ($ok) { warnings::warnif "Can't cd to $updir_loc: $!\n"; return; } } push @Stack,[$dir_loc,$updir_loc,$p_dir,$dir_rel,-1] if $bydepth; while (defined $SE) { unless ($bydepth) { # change (back) to parent directory (always untainted) unless ($no_chdir) { unless (chdir $updir_loc) { warnings::warnif "Can't cd to $updir_loc: $!\n"; next; } } $dir= $p_dir; # $File::Find::dir $name= $dir_name; # $File::Find::name $_= ($no_chdir ? $dir_name : $dir_rel ); # $_ $fullname= $dir_loc; # $File::Find::fullname # prune may happen here $prune= 0; lstat($_); # make sure file tests with '_' work { $wanted_callback->() }; # protect against wild "next" next if $prune; } # change to that directory unless ($no_chdir || ($dir_rel eq $File::Find::current_dir)) { $updir_loc = $dir_loc; if ( ($untaint) && (($tainted) || ($tainted = is_tainted($dir_loc) )) ) { # untaint $dir_loc, what will be pushed on the stack as (untainted) parent dir ( $updir_loc ) = $dir_loc =~ m|$untaint_pat|; unless (defined $updir_loc) { if ($untaint_skip == 0) { die "directory $dir_loc is still tainted"; } else { next; } } } unless (chdir $updir_loc) { warnings::warnif "Can't cd to $updir_loc: $!\n"; next; } } $dir = $dir_name; # $File::Find::dir # Get the list of files in the current directory. unless (opendir DIR, ($no_chdir ? $dir_loc : $File::Find::current_dir)) { warnings::warnif "Can't opendir($dir_loc): $!\n"; next; } @filenames = readdir DIR; closedir(DIR); for my $FN (@filenames) { if ($Is_VMS) { # Big hammer here - Compensate for VMS trailing . and .dir # No win situation until this is changed, but this # will handle the majority of the cases with breaking the fewest. $FN =~ s/\.dir\z//i; $FN =~ s#\.$## if ($FN ne '.'); } next if $FN =~ $File::Find::skip_pattern; # follow symbolic links / do an lstat $new_loc = Follow_SymLink($loc_pref.$FN); # ignore if invalid symlink unless (defined $new_loc) { if (!defined -l _ && $dangling_symlinks) { $fullname = undef; if (ref $dangling_symlinks eq 'CODE') { $dangling_symlinks->($FN, $dir_pref); } else { warnings::warnif "$dir_pref$FN is a dangling symbolic link\n"; } } else { $fullname = $loc_pref . $FN; } $name = $dir_pref . $FN; $_ = ($no_chdir ? $name : $FN); { $wanted_callback->() }; next; } if (-d _) { if ($Is_VMS) { $FN =~ s/\.dir\z//i; $FN =~ s#\.$## if ($FN ne '.'); $new_loc =~ s/\.dir\z//i; $new_loc =~ s#\.$## if ($new_loc ne '.'); } push @Stack,[$new_loc,$updir_loc,$dir_name,$FN,1]; } else { $fullname = $new_loc; # $File::Find::fullname $name = $dir_pref . $FN; # $File::Find::name $_ = ($no_chdir ? $name : $FN); # $_ { $wanted_callback->() }; # protect against wild "next" } } } continue { while (defined($SE = pop @Stack)) { ($dir_loc, $updir_loc, $p_dir, $dir_rel, $byd_flag) = @$SE; $dir_name = ($p_dir eq '/' ? "/$dir_rel" : "$p_dir/$dir_rel"); $dir_pref = "$dir_name/"; $loc_pref = "$dir_loc/"; if ( $byd_flag < 0 ) { # must be finddepth, report dirname now unless ($no_chdir || ($dir_rel eq $File::Find::current_dir)) { unless (chdir $updir_loc) { # $updir_loc (parent dir) is always untainted warnings::warnif "Can't cd to $updir_loc: $!\n"; next; } } $fullname = $dir_loc; # $File::Find::fullname $name = $dir_name; # $File::Find::name if ( substr($name,-2) eq '/.' ) { substr($name, length($name) == 2 ? -1 : -2) = ''; # $File::Find::name } $dir = $p_dir; # $File::Find::dir $_ = ($no_chdir ? $dir_name : $dir_rel); # $_ if ( substr($_,-2) eq '/.' ) { substr($_, length($_) == 2 ? -1 : -2) = ''; } lstat($_); # make sure file tests with '_' work { $wanted_callback->() }; # protect against wild "next" } else { push @Stack,[$dir_loc, $updir_loc, $p_dir, $dir_rel,-1] if $bydepth; last; } } } } sub wrap_wanted { my $wanted = shift; if ( ref($wanted) eq 'HASH' ) { unless( exists $wanted->{wanted} and ref( $wanted->{wanted} ) eq 'CODE' ) { die 'no &wanted subroutine given'; } if ( $wanted->{follow} || $wanted->{follow_fast}) { $wanted->{follow_skip} = 1 unless defined $wanted->{follow_skip}; } if ( $wanted->{untaint} ) { $wanted->{untaint_pattern} = $File::Find::untaint_pattern unless defined $wanted->{untaint_pattern}; $wanted->{untaint_skip} = 0 unless defined $wanted->{untaint_skip}; } return $wanted; } elsif( ref( $wanted ) eq 'CODE' ) { return { wanted => $wanted }; } else { die 'no &wanted subroutine given'; } } sub find { my $wanted = shift; _find_opt(wrap_wanted($wanted), @_); } sub finddepth { my $wanted = wrap_wanted(shift); $wanted->{bydepth} = 1; _find_opt($wanted, @_); } # default $File::Find::skip_pattern = qr/^\.{1,2}\z/; $File::Find::untaint_pattern = qr|^([-+@\w./]+)$|; # These are hard-coded for now, but may move to hint files. if ($^O eq 'VMS') { $Is_VMS = 1; $File::Find::dont_use_nlink = 1; } elsif ($^O eq 'MSWin32') { $Is_Win32 = 1; } # this _should_ work properly on all platforms # where File::Find can be expected to work $File::Find::current_dir = File::Spec->curdir || '.'; $File::Find::dont_use_nlink = 1 if $^O eq 'os2' || $^O eq 'dos' || $^O eq 'amigaos' || $Is_Win32 || $^O eq 'interix' || $^O eq 'cygwin' || $^O eq 'qnx' || $^O eq 'nto'; # Set dont_use_nlink in your hint file if your system's stat doesn't # report the number of links in a directory as an indication # of the number of files. # See, e.g. hints/machten.sh for MachTen 2.2. unless ($File::Find::dont_use_nlink) { require Config; $File::Find::dont_use_nlink = 1 if ($Config::Config{'dont_use_nlink'}); } # We need a function that checks if a scalar is tainted. Either use the # Scalar::Util module's tainted() function or our (slower) pure Perl # fallback is_tainted_pp() { local $@; eval { require Scalar::Util }; *is_tainted = $@ ? \&is_tainted_pp : \&Scalar::Util::tainted; } 1; FILE3cc5849a/File/Path.pm; #line 1 "/usr/local/lib/perl5/5.20.0/File/Path.pm" package File::Path; use 5.005_04; use strict; use Cwd 'getcwd'; use File::Basename (); use File::Spec (); BEGIN { if ($] < 5.006) { # can't say 'opendir my $dh, $dirname' # need to initialise $dh eval "use Symbol"; } } use Exporter (); use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); $VERSION = '2.09'; @ISA = qw(Exporter); @EXPORT = qw(mkpath rmtree); @EXPORT_OK = qw(make_path remove_tree); my $Is_VMS = $^O eq 'VMS'; my $Is_MacOS = $^O eq 'MacOS'; # These OSes complain if you want to remove a file that you have no # write permission to: my $Force_Writeable = grep {$^O eq $_} qw(amigaos dos epoc MSWin32 MacOS os2); # Unix-like systems need to stat each directory in order to detect # race condition. MS-Windows is immune to this particular attack. my $Need_Stat_Check = !($^O eq 'MSWin32'); sub _carp { require Carp; goto &Carp::carp; } sub _croak { require Carp; goto &Carp::croak; } sub _error { my $arg = shift; my $message = shift; my $object = shift; if ($arg->{error}) { $object = '' unless defined $object; $message .= ": $!" if $!; push @{${$arg->{error}}}, {$object => $message}; } else { _carp(defined($object) ? "$message for $object: $!" : "$message: $!"); } } sub make_path { push @_, {} unless @_ and UNIVERSAL::isa($_[-1],'HASH'); goto &mkpath; } sub mkpath { my $old_style = !(@_ and UNIVERSAL::isa($_[-1],'HASH')); my $arg; my $paths; if ($old_style) { my ($verbose, $mode); ($paths, $verbose, $mode) = @_; $paths = [$paths] unless UNIVERSAL::isa($paths,'ARRAY'); $arg->{verbose} = $verbose; $arg->{mode} = defined $mode ? $mode : 0777; } else { $arg = pop @_; $arg->{mode} = delete $arg->{mask} if exists $arg->{mask}; $arg->{mode} = 0777 unless exists $arg->{mode}; ${$arg->{error}} = [] if exists $arg->{error}; $arg->{owner} = delete $arg->{user} if exists $arg->{user}; $arg->{owner} = delete $arg->{uid} if exists $arg->{uid}; if (exists $arg->{owner} and $arg->{owner} =~ /\D/) { my $uid = (getpwnam $arg->{owner})[2]; if (defined $uid) { $arg->{owner} = $uid; } else { _error($arg, "unable to map $arg->{owner} to a uid, ownership not changed"); delete $arg->{owner}; } } if (exists $arg->{group} and $arg->{group} =~ /\D/) { my $gid = (getgrnam $arg->{group})[2]; if (defined $gid) { $arg->{group} = $gid; } else { _error($arg, "unable to map $arg->{group} to a gid, group ownership not changed"); delete $arg->{group}; } } if (exists $arg->{owner} and not exists $arg->{group}) { $arg->{group} = -1; # chown will leave group unchanged } if (exists $arg->{group} and not exists $arg->{owner}) { $arg->{owner} = -1; # chown will leave owner unchanged } $paths = [@_]; } return _mkpath($arg, $paths); } sub _mkpath { my $arg = shift; my $paths = shift; my(@created,$path); foreach $path (@$paths) { next unless defined($path) and length($path); $path .= '/' if $^O eq 'os2' and $path =~ /^\w:\z/s; # feature of CRT # Logic wants Unix paths, so go with the flow. if ($Is_VMS) { next if $path eq '/'; $path = VMS::Filespec::unixify($path); } next if -d $path; my $parent = File::Basename::dirname($path); unless (-d $parent or $path eq $parent) { push(@created,_mkpath($arg, [$parent])); } print "mkdir $path\n" if $arg->{verbose}; if (mkdir($path,$arg->{mode})) { push(@created, $path); if (exists $arg->{owner}) { # NB: $arg->{group} guaranteed to be set during initialisation if (!chown $arg->{owner}, $arg->{group}, $path) { _error($arg, "Cannot change ownership of $path to $arg->{owner}:$arg->{group}"); } } } else { my $save_bang = $!; my ($e, $e1) = ($save_bang, $^E); $e .= "; $e1" if $e ne $e1; # allow for another process to have created it meanwhile if (!-d $path) { $! = $save_bang; if ($arg->{error}) { push @{${$arg->{error}}}, {$path => $e}; } else { _croak("mkdir $path: $e"); } } } } return @created; } sub remove_tree { push @_, {} unless @_ and UNIVERSAL::isa($_[-1],'HASH'); goto &rmtree; } sub _is_subdir { my($dir, $test) = @_; my($dv, $dd) = File::Spec->splitpath($dir, 1); my($tv, $td) = File::Spec->splitpath($test, 1); # not on same volume return 0 if $dv ne $tv; my @d = File::Spec->splitdir($dd); my @t = File::Spec->splitdir($td); # @t can't be a subdir if it's shorter than @d return 0 if @t < @d; return join('/', @d) eq join('/', splice @t, 0, +@d); } sub rmtree { my $old_style = !(@_ and UNIVERSAL::isa($_[-1],'HASH')); my $arg; my $paths; if ($old_style) { my ($verbose, $safe); ($paths, $verbose, $safe) = @_; $arg->{verbose} = $verbose; $arg->{safe} = defined $safe ? $safe : 0; if (defined($paths) and length($paths)) { $paths = [$paths] unless UNIVERSAL::isa($paths,'ARRAY'); } else { _carp ("No root path(s) specified\n"); return 0; } } else { $arg = pop @_; ${$arg->{error}} = [] if exists $arg->{error}; ${$arg->{result}} = [] if exists $arg->{result}; $paths = [@_]; } $arg->{prefix} = ''; $arg->{depth} = 0; my @clean_path; $arg->{cwd} = getcwd() or do { _error($arg, "cannot fetch initial working directory"); return 0; }; for ($arg->{cwd}) { /\A(.*)\Z/; $_ = $1 } # untaint for my $p (@$paths) { # need to fixup case and map \ to / on Windows my $ortho_root = $^O eq 'MSWin32' ? _slash_lc($p) : $p; my $ortho_cwd = $^O eq 'MSWin32' ? _slash_lc($arg->{cwd}) : $arg->{cwd}; my $ortho_root_length = length($ortho_root); $ortho_root_length-- if $^O eq 'VMS'; # don't compare '.' with ']' if ($ortho_root_length && _is_subdir($ortho_root, $ortho_cwd)) { local $! = 0; _error($arg, "cannot remove path when cwd is $arg->{cwd}", $p); next; } if ($Is_MacOS) { $p = ":$p" unless $p =~ /:/; $p .= ":" unless $p =~ /:\z/; } elsif ($^O eq 'MSWin32') { $p =~ s{[/\\]\z}{}; } else { $p =~ s{/\z}{}; } push @clean_path, $p; } @{$arg}{qw(device inode perm)} = (lstat $arg->{cwd})[0,1] or do { _error($arg, "cannot stat initial working directory", $arg->{cwd}); return 0; }; return _rmtree($arg, \@clean_path); } sub _rmtree { my $arg = shift; my $paths = shift; my $count = 0; my $curdir = File::Spec->curdir(); my $updir = File::Spec->updir(); my (@files, $root); ROOT_DIR: foreach $root (@$paths) { # since we chdir into each directory, it may not be obvious # to figure out where we are if we generate a message about # a file name. We therefore construct a semi-canonical # filename, anchored from the directory being unlinked (as # opposed to being truly canonical, anchored from the root (/). my $canon = $arg->{prefix} ? File::Spec->catfile($arg->{prefix}, $root) : $root ; my ($ldev, $lino, $perm) = (lstat $root)[0,1,2] or next ROOT_DIR; if ( -d _ ) { $root = VMS::Filespec::vmspath(VMS::Filespec::pathify($root)) if $Is_VMS; if (!chdir($root)) { # see if we can escalate privileges to get in # (e.g. funny protection mask such as -w- instead of rwx) $perm &= 07777; my $nperm = $perm | 0700; if (!($arg->{safe} or $nperm == $perm or chmod($nperm, $root))) { _error($arg, "cannot make child directory read-write-exec", $canon); next ROOT_DIR; } elsif (!chdir($root)) { _error($arg, "cannot chdir to child", $canon); next ROOT_DIR; } } my ($cur_dev, $cur_inode, $perm) = (stat $curdir)[0,1,2] or do { _error($arg, "cannot stat current working directory", $canon); next ROOT_DIR; }; if ($Need_Stat_Check) { ($ldev eq $cur_dev and $lino eq $cur_inode) or _croak("directory $canon changed before chdir, expected dev=$ldev ino=$lino, actual dev=$cur_dev ino=$cur_inode, aborting."); } $perm &= 07777; # don't forget setuid, setgid, sticky bits my $nperm = $perm | 0700; # notabene: 0700 is for making readable in the first place, # it's also intended to change it to writable in case we have # to recurse in which case we are better than rm -rf for # subtrees with strange permissions if (!($arg->{safe} or $nperm == $perm or chmod($nperm, $curdir))) { _error($arg, "cannot make directory read+writeable", $canon); $nperm = $perm; } my $d; $d = gensym() if $] < 5.006; if (!opendir $d, $curdir) { _error($arg, "cannot opendir", $canon); @files = (); } else { no strict 'refs'; if (!defined ${"\cTAINT"} or ${"\cTAINT"}) { # Blindly untaint dir names if taint mode is # active, or any perl < 5.006 @files = map { /\A(.*)\z/s; $1 } readdir $d; } else { @files = readdir $d; } closedir $d; } if ($Is_VMS) { # Deleting large numbers of files from VMS Files-11 # filesystems is faster if done in reverse ASCIIbetical order. # include '.' to '.;' from blead patch #31775 @files = map {$_ eq '.' ? '.;' : $_} reverse @files; } @files = grep {$_ ne $updir and $_ ne $curdir} @files; if (@files) { # remove the contained files before the directory itself my $narg = {%$arg}; @{$narg}{qw(device inode cwd prefix depth)} = ($cur_dev, $cur_inode, $updir, $canon, $arg->{depth}+1); $count += _rmtree($narg, \@files); } # restore directory permissions of required now (in case the rmdir # below fails), while we are still in the directory and may do so # without a race via '.' if ($nperm != $perm and not chmod($perm, $curdir)) { _error($arg, "cannot reset chmod", $canon); } # don't leave the client code in an unexpected directory chdir($arg->{cwd}) or _croak("cannot chdir to $arg->{cwd} from $canon: $!, aborting."); # ensure that a chdir upwards didn't take us somewhere other # than we expected (see CVE-2002-0435) ($cur_dev, $cur_inode) = (stat $curdir)[0,1] or _croak("cannot stat prior working directory $arg->{cwd}: $!, aborting."); if ($Need_Stat_Check) { ($arg->{device} eq $cur_dev and $arg->{inode} eq $cur_inode) or _croak("previous directory $arg->{cwd} changed before entering $canon, expected dev=$ldev ino=$lino, actual dev=$cur_dev ino=$cur_inode, aborting."); } if ($arg->{depth} or !$arg->{keep_root}) { if ($arg->{safe} && ($Is_VMS ? !&VMS::Filespec::candelete($root) : !-w $root)) { print "skipped $root\n" if $arg->{verbose}; next ROOT_DIR; } if ($Force_Writeable and !chmod $perm | 0700, $root) { _error($arg, "cannot make directory writeable", $canon); } print "rmdir $root\n" if $arg->{verbose}; if (rmdir $root) { push @{${$arg->{result}}}, $root if $arg->{result}; ++$count; } else { _error($arg, "cannot remove directory", $canon); if ($Force_Writeable && !chmod($perm, ($Is_VMS ? VMS::Filespec::fileify($root) : $root)) ) { _error($arg, sprintf("cannot restore permissions to 0%o",$perm), $canon); } } } } else { # not a directory $root = VMS::Filespec::vmsify("./$root") if $Is_VMS && !File::Spec->file_name_is_absolute($root) && ($root !~ m/(?]+/); # not already in VMS syntax if ($arg->{safe} && ($Is_VMS ? !&VMS::Filespec::candelete($root) : !(-l $root || -w $root))) { print "skipped $root\n" if $arg->{verbose}; next ROOT_DIR; } my $nperm = $perm & 07777 | 0600; if ($Force_Writeable and $nperm != $perm and not chmod $nperm, $root) { _error($arg, "cannot make file writeable", $canon); } print "unlink $canon\n" if $arg->{verbose}; # delete all versions under VMS for (;;) { if (unlink $root) { push @{${$arg->{result}}}, $root if $arg->{result}; } else { _error($arg, "cannot unlink file", $canon); $Force_Writeable and chmod($perm, $root) or _error($arg, sprintf("cannot restore permissions to 0%o",$perm), $canon); last; } ++$count; last unless $Is_VMS && lstat $root; } } } return $count; } sub _slash_lc { # fix up slashes and case on MSWin32 so that we can determine that # c:\path\to\dir is underneath C:/Path/To my $path = shift; $path =~ tr{\\}{/}; return lc($path); } 1; __END__ #line 986 FILEb6cb299b/File/Temp.pm#line 1 "/usr/local/lib/perl5/5.20.0/File/Temp.pm" package File::Temp; # ABSTRACT: return name and handle of a temporary file safely our $VERSION = '0.2304'; # VERSION # Toolchain targets v5.8.1, but we'll try to support back to v5.6 anyway. # It might be possible to make this v5.5, but many v5.6isms are creeping # into the code and tests. use 5.006; use strict; use Carp; use File::Spec 0.8; use Cwd (); use File::Path 2.06 qw/ rmtree /; use Fcntl 1.03; use IO::Seekable; # For SEEK_* use Errno; use Scalar::Util 'refaddr'; require VMS::Stdio if $^O eq 'VMS'; # pre-emptively load Carp::Heavy. If we don't when we run out of file # handles and attempt to call croak() we get an error message telling # us that Carp::Heavy won't load rather than an error telling us we # have run out of file handles. We either preload croak() or we # switch the calls to croak from _gettemp() to use die. eval { require Carp::Heavy; }; # Need the Symbol package if we are running older perl require Symbol if $] < 5.006; ### For the OO interface use parent 0.221 qw/ IO::Handle IO::Seekable /; use overload '""' => "STRINGIFY", '0+' => "NUMIFY", fallback => 1; # use 'our' on v5.6.0 use vars qw(@EXPORT_OK %EXPORT_TAGS $DEBUG $KEEP_ALL); $DEBUG = 0; $KEEP_ALL = 0; # We are exporting functions use Exporter 5.57 'import'; # 5.57 lets us import 'import' # Export list - to allow fine tuning of export table @EXPORT_OK = qw{ tempfile tempdir tmpnam tmpfile mktemp mkstemp mkstemps mkdtemp unlink0 cleanup SEEK_SET SEEK_CUR SEEK_END }; # Groups of functions for export %EXPORT_TAGS = ( 'POSIX' => [qw/ tmpnam tmpfile /], 'mktemp' => [qw/ mktemp mkstemp mkstemps mkdtemp/], 'seekable' => [qw/ SEEK_SET SEEK_CUR SEEK_END /], ); # add contents of these tags to @EXPORT Exporter::export_tags('POSIX','mktemp','seekable'); # This is a list of characters that can be used in random filenames my @CHARS = (qw/ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 _ /); # Maximum number of tries to make a temp file before failing use constant MAX_TRIES => 1000; # Minimum number of X characters that should be in a template use constant MINX => 4; # Default template when no template supplied use constant TEMPXXX => 'X' x 10; # Constants for the security level use constant STANDARD => 0; use constant MEDIUM => 1; use constant HIGH => 2; # OPENFLAGS. If we defined the flag to use with Sysopen here this gives # us an optimisation when many temporary files are requested my $OPENFLAGS = O_CREAT | O_EXCL | O_RDWR; my $LOCKFLAG; unless ($^O eq 'MacOS') { for my $oflag (qw/ NOFOLLOW BINARY LARGEFILE NOINHERIT /) { my ($bit, $func) = (0, "Fcntl::O_" . $oflag); no strict 'refs'; $OPENFLAGS |= $bit if eval { # Make sure that redefined die handlers do not cause problems # e.g. CGI::Carp local $SIG{__DIE__} = sub {}; local $SIG{__WARN__} = sub {}; $bit = &$func(); 1; }; } # Special case O_EXLOCK $LOCKFLAG = eval { local $SIG{__DIE__} = sub {}; local $SIG{__WARN__} = sub {}; &Fcntl::O_EXLOCK(); }; } # On some systems the O_TEMPORARY flag can be used to tell the OS # to automatically remove the file when it is closed. This is fine # in most cases but not if tempfile is called with UNLINK=>0 and # the filename is requested -- in the case where the filename is to # be passed to another routine. This happens on windows. We overcome # this by using a second open flags variable my $OPENTEMPFLAGS = $OPENFLAGS; unless ($^O eq 'MacOS') { for my $oflag (qw/ TEMPORARY /) { my ($bit, $func) = (0, "Fcntl::O_" . $oflag); local($@); no strict 'refs'; $OPENTEMPFLAGS |= $bit if eval { # Make sure that redefined die handlers do not cause problems # e.g. CGI::Carp local $SIG{__DIE__} = sub {}; local $SIG{__WARN__} = sub {}; $bit = &$func(); 1; }; } } # Private hash tracking which files have been created by each process id via the OO interface my %FILES_CREATED_BY_OBJECT; # INTERNAL ROUTINES - not to be used outside of package # Generic routine for getting a temporary filename # modelled on OpenBSD _gettemp() in mktemp.c # The template must contain X's that are to be replaced # with the random values # Arguments: # TEMPLATE - string containing the XXXXX's that is converted # to a random filename and opened if required # Optionally, a hash can also be supplied containing specific options # "open" => if true open the temp file, else just return the name # default is 0 # "mkdir"=> if true, we are creating a temp directory rather than tempfile # default is 0 # "suffixlen" => number of characters at end of PATH to be ignored. # default is 0. # "unlink_on_close" => indicates that, if possible, the OS should remove # the file as soon as it is closed. Usually indicates # use of the O_TEMPORARY flag to sysopen. # Usually irrelevant on unix # "use_exlock" => Indicates that O_EXLOCK should be used. Default is true. # Optionally a reference to a scalar can be passed into the function # On error this will be used to store the reason for the error # "ErrStr" => \$errstr # "open" and "mkdir" can not both be true # "unlink_on_close" is not used when "mkdir" is true. # The default options are equivalent to mktemp(). # Returns: # filehandle - open file handle (if called with doopen=1, else undef) # temp name - name of the temp file or directory # For example: # ($fh, $name) = _gettemp($template, "open" => 1); # for the current version, failures are associated with # stored in an error string and returned to give the reason whilst debugging # This routine is not called by any external function sub _gettemp { croak 'Usage: ($fh, $name) = _gettemp($template, OPTIONS);' unless scalar(@_) >= 1; # the internal error string - expect it to be overridden # Need this in case the caller decides not to supply us a value # need an anonymous scalar my $tempErrStr; # Default options my %options = ( "open" => 0, "mkdir" => 0, "suffixlen" => 0, "unlink_on_close" => 0, "use_exlock" => 1, "ErrStr" => \$tempErrStr, ); # Read the template my $template = shift; if (ref($template)) { # Use a warning here since we have not yet merged ErrStr carp "File::Temp::_gettemp: template must not be a reference"; return (); } # Check that the number of entries on stack are even if (scalar(@_) % 2 != 0) { # Use a warning here since we have not yet merged ErrStr carp "File::Temp::_gettemp: Must have even number of options"; return (); } # Read the options and merge with defaults %options = (%options, @_) if @_; # Make sure the error string is set to undef ${$options{ErrStr}} = undef; # Can not open the file and make a directory in a single call if ($options{"open"} && $options{"mkdir"}) { ${$options{ErrStr}} = "doopen and domkdir can not both be true\n"; return (); } # Find the start of the end of the Xs (position of last X) # Substr starts from 0 my $start = length($template) - 1 - $options{"suffixlen"}; # Check that we have at least MINX x X (e.g. 'XXXX") at the end of the string # (taking suffixlen into account). Any fewer is insecure. # Do it using substr - no reason to use a pattern match since # we know where we are looking and what we are looking for if (substr($template, $start - MINX + 1, MINX) ne 'X' x MINX) { ${$options{ErrStr}} = "The template must end with at least ". MINX . " 'X' characters\n"; return (); } # Replace all the X at the end of the substring with a # random character or just all the XX at the end of a full string. # Do it as an if, since the suffix adjusts which section to replace # and suffixlen=0 returns nothing if used in the substr directly # and generate a full path from the template my $path = _replace_XX($template, $options{"suffixlen"}); # Split the path into constituent parts - eventually we need to check # whether the directory exists # We need to know whether we are making a temp directory # or a tempfile my ($volume, $directories, $file); my $parent; # parent directory if ($options{"mkdir"}) { # There is no filename at the end ($volume, $directories, $file) = File::Spec->splitpath( $path, 1); # The parent is then $directories without the last directory # Split the directory and put it back together again my @dirs = File::Spec->splitdir($directories); # If @dirs only has one entry (i.e. the directory template) that means # we are in the current directory if ($#dirs == 0) { $parent = File::Spec->curdir; } else { if ($^O eq 'VMS') { # need volume to avoid relative dir spec $parent = File::Spec->catdir($volume, @dirs[0..$#dirs-1]); $parent = 'sys$disk:[]' if $parent eq ''; } else { # Put it back together without the last one $parent = File::Spec->catdir(@dirs[0..$#dirs-1]); # ...and attach the volume (no filename) $parent = File::Spec->catpath($volume, $parent, ''); } } } else { # Get rid of the last filename (use File::Basename for this?) ($volume, $directories, $file) = File::Spec->splitpath( $path ); # Join up without the file part $parent = File::Spec->catpath($volume,$directories,''); # If $parent is empty replace with curdir $parent = File::Spec->curdir unless $directories ne ''; } # Check that the parent directories exist # Do this even for the case where we are simply returning a name # not a file -- no point returning a name that includes a directory # that does not exist or is not writable unless (-e $parent) { ${$options{ErrStr}} = "Parent directory ($parent) does not exist"; return (); } unless (-d $parent) { ${$options{ErrStr}} = "Parent directory ($parent) is not a directory"; return (); } # Check the stickiness of the directory and chown giveaway if required # If the directory is world writable the sticky bit # must be set if (File::Temp->safe_level == MEDIUM) { my $safeerr; unless (_is_safe($parent,\$safeerr)) { ${$options{ErrStr}} = "Parent directory ($parent) is not safe ($safeerr)"; return (); } } elsif (File::Temp->safe_level == HIGH) { my $safeerr; unless (_is_verysafe($parent, \$safeerr)) { ${$options{ErrStr}} = "Parent directory ($parent) is not safe ($safeerr)"; return (); } } # Now try MAX_TRIES time to open the file for (my $i = 0; $i < MAX_TRIES; $i++) { # Try to open the file if requested if ($options{"open"}) { my $fh; # If we are running before perl5.6.0 we can not auto-vivify if ($] < 5.006) { $fh = &Symbol::gensym; } # Try to make sure this will be marked close-on-exec # XXX: Win32 doesn't respect this, nor the proper fcntl, # but may have O_NOINHERIT. This may or may not be in Fcntl. local $^F = 2; # Attempt to open the file my $open_success = undef; if ( $^O eq 'VMS' and $options{"unlink_on_close"} && !$KEEP_ALL) { # make it auto delete on close by setting FAB$V_DLT bit $fh = VMS::Stdio::vmssysopen($path, $OPENFLAGS, 0600, 'fop=dlt'); $open_success = $fh; } else { my $flags = ( ($options{"unlink_on_close"} && !$KEEP_ALL) ? $OPENTEMPFLAGS : $OPENFLAGS ); $flags |= $LOCKFLAG if (defined $LOCKFLAG && $options{use_exlock}); $open_success = sysopen($fh, $path, $flags, 0600); } if ( $open_success ) { # in case of odd umask force rw chmod(0600, $path); # Opened successfully - return file handle and name return ($fh, $path); } else { # Error opening file - abort with error # if the reason was anything but EEXIST unless ($!{EEXIST}) { ${$options{ErrStr}} = "Could not create temp file $path: $!"; return (); } # Loop round for another try } } elsif ($options{"mkdir"}) { # Open the temp directory if (mkdir( $path, 0700)) { # in case of odd umask chmod(0700, $path); return undef, $path; } else { # Abort with error if the reason for failure was anything # except EEXIST unless ($!{EEXIST}) { ${$options{ErrStr}} = "Could not create directory $path: $!"; return (); } # Loop round for another try } } else { # Return true if the file can not be found # Directory has been checked previously return (undef, $path) unless -e $path; # Try again until MAX_TRIES } # Did not successfully open the tempfile/dir # so try again with a different set of random letters # No point in trying to increment unless we have only # 1 X say and the randomness could come up with the same # file MAX_TRIES in a row. # Store current attempt - in principal this implies that the # 3rd time around the open attempt that the first temp file # name could be generated again. Probably should store each # attempt and make sure that none are repeated my $original = $path; my $counter = 0; # Stop infinite loop my $MAX_GUESS = 50; do { # Generate new name from original template $path = _replace_XX($template, $options{"suffixlen"}); $counter++; } until ($path ne $original || $counter > $MAX_GUESS); # Check for out of control looping if ($counter > $MAX_GUESS) { ${$options{ErrStr}} = "Tried to get a new temp name different to the previous value $MAX_GUESS times.\nSomething wrong with template?? ($template)"; return (); } } # If we get here, we have run out of tries ${ $options{ErrStr} } = "Have exceeded the maximum number of attempts (" . MAX_TRIES . ") to open temp file/dir"; return (); } # Internal routine to replace the XXXX... with random characters # This has to be done by _gettemp() every time it fails to # open a temp file/dir # Arguments: $template (the template with XXX), # $ignore (number of characters at end to ignore) # Returns: modified template sub _replace_XX { croak 'Usage: _replace_XX($template, $ignore)' unless scalar(@_) == 2; my ($path, $ignore) = @_; # Do it as an if, since the suffix adjusts which section to replace # and suffixlen=0 returns nothing if used in the substr directly # Alternatively, could simply set $ignore to length($path)-1 # Don't want to always use substr when not required though. my $end = ( $] >= 5.006 ? "\\z" : "\\Z" ); if ($ignore) { substr($path, 0, - $ignore) =~ s/X(?=X*$end)/$CHARS[ int( rand( @CHARS ) ) ]/ge; } else { $path =~ s/X(?=X*$end)/$CHARS[ int( rand( @CHARS ) ) ]/ge; } return $path; } # Internal routine to force a temp file to be writable after # it is created so that we can unlink it. Windows seems to occasionally # force a file to be readonly when written to certain temp locations sub _force_writable { my $file = shift; chmod 0600, $file; } # internal routine to check to see if the directory is safe # First checks to see if the directory is not owned by the # current user or root. Then checks to see if anyone else # can write to the directory and if so, checks to see if # it has the sticky bit set # Will not work on systems that do not support sticky bit #Args: directory path to check # Optionally: reference to scalar to contain error message # Returns true if the path is safe and false otherwise. # Returns undef if can not even run stat() on the path # This routine based on version written by Tom Christiansen # Presumably, by the time we actually attempt to create the # file or directory in this directory, it may not be safe # anymore... Have to run _is_safe directly after the open. sub _is_safe { my $path = shift; my $err_ref = shift; # Stat path my @info = stat($path); unless (scalar(@info)) { $$err_ref = "stat(path) returned no values"; return 0; } ; return 1 if $^O eq 'VMS'; # owner delete control at file level # Check to see whether owner is neither superuser (or a system uid) nor me # Use the effective uid from the $> variable # UID is in [4] if ($info[4] > File::Temp->top_system_uid() && $info[4] != $>) { Carp::cluck(sprintf "uid=$info[4] topuid=%s euid=$> path='$path'", File::Temp->top_system_uid()); $$err_ref = "Directory owned neither by root nor the current user" if ref($err_ref); return 0; } # check whether group or other can write file # use 066 to detect either reading or writing # use 022 to check writability # Do it with S_IWOTH and S_IWGRP for portability (maybe) # mode is in info[2] if (($info[2] & &Fcntl::S_IWGRP) || # Is group writable? ($info[2] & &Fcntl::S_IWOTH) ) { # Is world writable? # Must be a directory unless (-d $path) { $$err_ref = "Path ($path) is not a directory" if ref($err_ref); return 0; } # Must have sticky bit set unless (-k $path) { $$err_ref = "Sticky bit not set on $path when dir is group|world writable" if ref($err_ref); return 0; } } return 1; } # Internal routine to check whether a directory is safe # for temp files. Safer than _is_safe since it checks for # the possibility of chown giveaway and if that is a possibility # checks each directory in the path to see if it is safe (with _is_safe) # If _PC_CHOWN_RESTRICTED is not set, does the full test of each # directory anyway. # Takes optional second arg as scalar ref to error reason sub _is_verysafe { # Need POSIX - but only want to bother if really necessary due to overhead require POSIX; my $path = shift; print "_is_verysafe testing $path\n" if $DEBUG; return 1 if $^O eq 'VMS'; # owner delete control at file level my $err_ref = shift; # Should Get the value of _PC_CHOWN_RESTRICTED if it is defined # and If it is not there do the extensive test local($@); my $chown_restricted; $chown_restricted = &POSIX::_PC_CHOWN_RESTRICTED() if eval { &POSIX::_PC_CHOWN_RESTRICTED(); 1}; # If chown_resticted is set to some value we should test it if (defined $chown_restricted) { # Return if the current directory is safe return _is_safe($path,$err_ref) if POSIX::sysconf( $chown_restricted ); } # To reach this point either, the _PC_CHOWN_RESTRICTED symbol # was not available or the symbol was there but chown giveaway # is allowed. Either way, we now have to test the entire tree for # safety. # Convert path to an absolute directory if required unless (File::Spec->file_name_is_absolute($path)) { $path = File::Spec->rel2abs($path); } # Split directory into components - assume no file my ($volume, $directories, undef) = File::Spec->splitpath( $path, 1); # Slightly less efficient than having a function in File::Spec # to chop off the end of a directory or even a function that # can handle ../ in a directory tree # Sometimes splitdir() returns a blank at the end # so we will probably check the bottom directory twice in some cases my @dirs = File::Spec->splitdir($directories); # Concatenate one less directory each time around foreach my $pos (0.. $#dirs) { # Get a directory name my $dir = File::Spec->catpath($volume, File::Spec->catdir(@dirs[0.. $#dirs - $pos]), '' ); print "TESTING DIR $dir\n" if $DEBUG; # Check the directory return 0 unless _is_safe($dir,$err_ref); } return 1; } # internal routine to determine whether unlink works on this # platform for files that are currently open. # Returns true if we can, false otherwise. # Currently WinNT, OS/2 and VMS can not unlink an opened file # On VMS this is because the O_EXCL flag is used to open the # temporary file. Currently I do not know enough about the issues # on VMS to decide whether O_EXCL is a requirement. sub _can_unlink_opened_file { if (grep { $^O eq $_ } qw/MSWin32 os2 VMS dos MacOS haiku/) { return 0; } else { return 1; } } # internal routine to decide which security levels are allowed # see safe_level() for more information on this # Controls whether the supplied security level is allowed # $cando = _can_do_level( $level ) sub _can_do_level { # Get security level my $level = shift; # Always have to be able to do STANDARD return 1 if $level == STANDARD; # Currently, the systems that can do HIGH or MEDIUM are identical if ( $^O eq 'MSWin32' || $^O eq 'os2' || $^O eq 'cygwin' || $^O eq 'dos' || $^O eq 'MacOS' || $^O eq 'mpeix') { return 0; } else { return 1; } } # This routine sets up a deferred unlinking of a specified # filename and filehandle. It is used in the following cases: # - Called by unlink0 if an opened file can not be unlinked # - Called by tempfile() if files are to be removed on shutdown # - Called by tempdir() if directories are to be removed on shutdown # Arguments: # _deferred_unlink( $fh, $fname, $isdir ); # # - filehandle (so that it can be explicitly closed if open # - filename (the thing we want to remove) # - isdir (flag to indicate that we are being given a directory) # [and hence no filehandle] # Status is not referred to since all the magic is done with an END block { # Will set up two lexical variables to contain all the files to be # removed. One array for files, another for directories They will # only exist in this block. # This means we only have to set up a single END block to remove # all files. # in order to prevent child processes inadvertently deleting the parent # temp files we use a hash to store the temp files and directories # created by a particular process id. # %files_to_unlink contains values that are references to an array of # array references containing the filehandle and filename associated with # the temp file. my (%files_to_unlink, %dirs_to_unlink); # Set up an end block to use these arrays END { local($., $@, $!, $^E, $?); cleanup(at_exit => 1); } # Cleanup function. Always triggered on END (with at_exit => 1) but # can be invoked manually. sub cleanup { my %h = @_; my $at_exit = delete $h{at_exit}; $at_exit = 0 if not defined $at_exit; { my @k = sort keys %h; die "unrecognized parameters: @k" if @k } if (!$KEEP_ALL) { # Files my @files = (exists $files_to_unlink{$$} ? @{ $files_to_unlink{$$} } : () ); foreach my $file (@files) { # close the filehandle without checking its state # in order to make real sure that this is closed # if its already closed then I don't care about the answer # probably a better way to do this close($file->[0]); # file handle is [0] if (-f $file->[1]) { # file name is [1] _force_writable( $file->[1] ); # for windows unlink $file->[1] or warn "Error removing ".$file->[1]; } } # Dirs my @dirs = (exists $dirs_to_unlink{$$} ? @{ $dirs_to_unlink{$$} } : () ); my ($cwd, $cwd_to_remove); foreach my $dir (@dirs) { if (-d $dir) { # Some versions of rmtree will abort if you attempt to remove # the directory you are sitting in. For automatic cleanup # at program exit, we avoid this by chdir()ing out of the way # first. If not at program exit, it's best not to mess with the # current directory, so just let it fail with a warning. if ($at_exit) { $cwd = Cwd::abs_path(File::Spec->curdir) if not defined $cwd; my $abs = Cwd::abs_path($dir); if ($abs eq $cwd) { $cwd_to_remove = $dir; next; } } eval { rmtree($dir, $DEBUG, 0); }; warn $@ if ($@ && $^W); } } if (defined $cwd_to_remove) { # We do need to clean up the current directory, and everything # else is done, so get out of there and remove it. chdir $cwd_to_remove or die "cannot chdir to $cwd_to_remove: $!"; my $updir = File::Spec->updir; chdir $updir or die "cannot chdir to $updir: $!"; eval { rmtree($cwd_to_remove, $DEBUG, 0); }; warn $@ if ($@ && $^W); } # clear the arrays @{ $files_to_unlink{$$} } = () if exists $files_to_unlink{$$}; @{ $dirs_to_unlink{$$} } = () if exists $dirs_to_unlink{$$}; } } # This is the sub called to register a file for deferred unlinking # This could simply store the input parameters and defer everything # until the END block. For now we do a bit of checking at this # point in order to make sure that (1) we have a file/dir to delete # and (2) we have been called with the correct arguments. sub _deferred_unlink { croak 'Usage: _deferred_unlink($fh, $fname, $isdir)' unless scalar(@_) == 3; my ($fh, $fname, $isdir) = @_; warn "Setting up deferred removal of $fname\n" if $DEBUG; # make sure we save the absolute path for later cleanup # OK to untaint because we only ever use this internally # as a file path, never interpolating into the shell $fname = Cwd::abs_path($fname); ($fname) = $fname =~ /^(.*)$/; # If we have a directory, check that it is a directory if ($isdir) { if (-d $fname) { # Directory exists so store it # first on VMS turn []foo into [.foo] for rmtree $fname = VMS::Filespec::vmspath($fname) if $^O eq 'VMS'; $dirs_to_unlink{$$} = [] unless exists $dirs_to_unlink{$$}; push (@{ $dirs_to_unlink{$$} }, $fname); } else { carp "Request to remove directory $fname could not be completed since it does not exist!\n" if $^W; } } else { if (-f $fname) { # file exists so store handle and name for later removal $files_to_unlink{$$} = [] unless exists $files_to_unlink{$$}; push(@{ $files_to_unlink{$$} }, [$fh, $fname]); } else { carp "Request to remove file $fname could not be completed since it is not there!\n" if $^W; } } } } # normalize argument keys to upper case and do consistent handling # of leading template vs TEMPLATE sub _parse_args { my $leading_template = (scalar(@_) % 2 == 1 ? shift(@_) : '' ); my %args = @_; %args = map { uc($_), $args{$_} } keys %args; # template (store it in an array so that it will # disappear from the arg list of tempfile) my @template = ( exists $args{TEMPLATE} ? $args{TEMPLATE} : $leading_template ? $leading_template : () ); delete $args{TEMPLATE}; return( \@template, \%args ); } sub new { my $proto = shift; my $class = ref($proto) || $proto; my ($maybe_template, $args) = _parse_args(@_); # see if they are unlinking (defaulting to yes) my $unlink = (exists $args->{UNLINK} ? $args->{UNLINK} : 1 ); delete $args->{UNLINK}; # Protect OPEN delete $args->{OPEN}; # Open the file and retain file handle and file name my ($fh, $path) = tempfile( @$maybe_template, %$args ); print "Tmp: $fh - $path\n" if $DEBUG; # Store the filename in the scalar slot ${*$fh} = $path; # Cache the filename by pid so that the destructor can decide whether to remove it $FILES_CREATED_BY_OBJECT{$$}{$path} = 1; # Store unlink information in hash slot (plus other constructor info) %{*$fh} = %$args; # create the object bless $fh, $class; # final method-based configuration $fh->unlink_on_destroy( $unlink ); return $fh; } sub newdir { my $self = shift; my ($maybe_template, $args) = _parse_args(@_); # handle CLEANUP without passing CLEANUP to tempdir my $cleanup = (exists $args->{CLEANUP} ? $args->{CLEANUP} : 1 ); delete $args->{CLEANUP}; my $tempdir = tempdir( @$maybe_template, %$args); # get a safe absolute path for cleanup, just like # happens in _deferred_unlink my $real_dir = Cwd::abs_path( $tempdir ); ($real_dir) = $real_dir =~ /^(.*)$/; return bless { DIRNAME => $tempdir, REALNAME => $real_dir, CLEANUP => $cleanup, LAUNCHPID => $$, }, "File::Temp::Dir"; } sub filename { my $self = shift; return ${*$self}; } sub STRINGIFY { my $self = shift; return $self->filename; } # For reference, can't use '0+'=>\&Scalar::Util::refaddr directly because # refaddr() demands one parameter only, whereas overload.pm calls with three # even for unary operations like '0+'. sub NUMIFY { return refaddr($_[0]); } sub unlink_on_destroy { my $self = shift; if (@_) { ${*$self}{UNLINK} = shift; } return ${*$self}{UNLINK}; } sub DESTROY { local($., $@, $!, $^E, $?); my $self = shift; # Make sure we always remove the file from the global hash # on destruction. This prevents the hash from growing uncontrollably # and post-destruction there is no reason to know about the file. my $file = $self->filename; my $was_created_by_proc; if (exists $FILES_CREATED_BY_OBJECT{$$}{$file}) { $was_created_by_proc = 1; delete $FILES_CREATED_BY_OBJECT{$$}{$file}; } if (${*$self}{UNLINK} && !$KEEP_ALL) { print "# ---------> Unlinking $self\n" if $DEBUG; # only delete if this process created it return unless $was_created_by_proc; # The unlink1 may fail if the file has been closed # by the caller. This leaves us with the decision # of whether to refuse to remove the file or simply # do an unlink without test. Seems to be silly # to do this when we are trying to be careful # about security _force_writable( $file ); # for windows unlink1( $self, $file ) or unlink($file); } } sub tempfile { if ( @_ && $_[0] eq 'File::Temp' ) { croak "'tempfile' can't be called as a method"; } # Can not check for argument count since we can have any # number of args # Default options my %options = ( "DIR" => undef, # Directory prefix "SUFFIX" => '', # Template suffix "UNLINK" => 0, # Do not unlink file on exit "OPEN" => 1, # Open file "TMPDIR" => 0, # Place tempfile in tempdir if template specified "EXLOCK" => 1, # Open file with O_EXLOCK ); # Check to see whether we have an odd or even number of arguments my ($maybe_template, $args) = _parse_args(@_); my $template = @$maybe_template ? $maybe_template->[0] : undef; # Read the options and merge with defaults %options = (%options, %$args); # First decision is whether or not to open the file if (! $options{"OPEN"}) { warn "tempfile(): temporary filename requested but not opened.\nPossibly unsafe, consider using tempfile() with OPEN set to true\n" if $^W; } if ($options{"DIR"} and $^O eq 'VMS') { # on VMS turn []foo into [.foo] for concatenation $options{"DIR"} = VMS::Filespec::vmspath($options{"DIR"}); } # Construct the template # Have a choice of trying to work around the mkstemp/mktemp/tmpnam etc # functions or simply constructing a template and using _gettemp() # explicitly. Go for the latter # First generate a template if not defined and prefix the directory # If no template must prefix the temp directory if (defined $template) { # End up with current directory if neither DIR not TMPDIR are set if ($options{"DIR"}) { $template = File::Spec->catfile($options{"DIR"}, $template); } elsif ($options{TMPDIR}) { $template = File::Spec->catfile(File::Spec->tmpdir, $template ); } } else { if ($options{"DIR"}) { $template = File::Spec->catfile($options{"DIR"}, TEMPXXX); } else { $template = File::Spec->catfile(File::Spec->tmpdir, TEMPXXX); } } # Now add a suffix $template .= $options{"SUFFIX"}; # Determine whether we should tell _gettemp to unlink the file # On unix this is irrelevant and can be worked out after the file is # opened (simply by unlinking the open filehandle). On Windows or VMS # we have to indicate temporary-ness when we open the file. In general # we only want a true temporary file if we are returning just the # filehandle - if the user wants the filename they probably do not # want the file to disappear as soon as they close it (which may be # important if they want a child process to use the file) # For this reason, tie unlink_on_close to the return context regardless # of OS. my $unlink_on_close = ( wantarray ? 0 : 1); # Create the file my ($fh, $path, $errstr); croak "Error in tempfile() using template $template: $errstr" unless (($fh, $path) = _gettemp($template, "open" => $options{'OPEN'}, "mkdir"=> 0 , "unlink_on_close" => $unlink_on_close, "suffixlen" => length($options{'SUFFIX'}), "ErrStr" => \$errstr, "use_exlock" => $options{EXLOCK}, ) ); # Set up an exit handler that can do whatever is right for the # system. This removes files at exit when requested explicitly or when # system is asked to unlink_on_close but is unable to do so because # of OS limitations. # The latter should be achieved by using a tied filehandle. # Do not check return status since this is all done with END blocks. _deferred_unlink($fh, $path, 0) if $options{"UNLINK"}; # Return if (wantarray()) { if ($options{'OPEN'}) { return ($fh, $path); } else { return (undef, $path); } } else { # Unlink the file. It is up to unlink0 to decide what to do with # this (whether to unlink now or to defer until later) unlink0($fh, $path) or croak "Error unlinking file $path using unlink0"; # Return just the filehandle. return $fh; } } # ' sub tempdir { if ( @_ && $_[0] eq 'File::Temp' ) { croak "'tempdir' can't be called as a method"; } # Can not check for argument count since we can have any # number of args # Default options my %options = ( "CLEANUP" => 0, # Remove directory on exit "DIR" => '', # Root directory "TMPDIR" => 0, # Use tempdir with template ); # Check to see whether we have an odd or even number of arguments my ($maybe_template, $args) = _parse_args(@_); my $template = @$maybe_template ? $maybe_template->[0] : undef; # Read the options and merge with defaults %options = (%options, %$args); # Modify or generate the template # Deal with the DIR and TMPDIR options if (defined $template) { # Need to strip directory path if using DIR or TMPDIR if ($options{'TMPDIR'} || $options{'DIR'}) { # Strip parent directory from the filename # # There is no filename at the end $template = VMS::Filespec::vmspath($template) if $^O eq 'VMS'; my ($volume, $directories, undef) = File::Spec->splitpath( $template, 1); # Last directory is then our template $template = (File::Spec->splitdir($directories))[-1]; # Prepend the supplied directory or temp dir if ($options{"DIR"}) { $template = File::Spec->catdir($options{"DIR"}, $template); } elsif ($options{TMPDIR}) { # Prepend tmpdir $template = File::Spec->catdir(File::Spec->tmpdir, $template); } } } else { if ($options{"DIR"}) { $template = File::Spec->catdir($options{"DIR"}, TEMPXXX); } else { $template = File::Spec->catdir(File::Spec->tmpdir, TEMPXXX); } } # Create the directory my $tempdir; my $suffixlen = 0; if ($^O eq 'VMS') { # dir names can end in delimiters $template =~ m/([\.\]:>]+)$/; $suffixlen = length($1); } if ( ($^O eq 'MacOS') && (substr($template, -1) eq ':') ) { # dir name has a trailing ':' ++$suffixlen; } my $errstr; croak "Error in tempdir() using $template: $errstr" unless ((undef, $tempdir) = _gettemp($template, "open" => 0, "mkdir"=> 1 , "suffixlen" => $suffixlen, "ErrStr" => \$errstr, ) ); # Install exit handler; must be dynamic to get lexical if ( $options{'CLEANUP'} && -d $tempdir) { _deferred_unlink(undef, $tempdir, 1); } # Return the dir name return $tempdir; } sub mkstemp { croak "Usage: mkstemp(template)" if scalar(@_) != 1; my $template = shift; my ($fh, $path, $errstr); croak "Error in mkstemp using $template: $errstr" unless (($fh, $path) = _gettemp($template, "open" => 1, "mkdir"=> 0 , "suffixlen" => 0, "ErrStr" => \$errstr, ) ); if (wantarray()) { return ($fh, $path); } else { return $fh; } } sub mkstemps { croak "Usage: mkstemps(template, suffix)" if scalar(@_) != 2; my $template = shift; my $suffix = shift; $template .= $suffix; my ($fh, $path, $errstr); croak "Error in mkstemps using $template: $errstr" unless (($fh, $path) = _gettemp($template, "open" => 1, "mkdir"=> 0 , "suffixlen" => length($suffix), "ErrStr" => \$errstr, ) ); if (wantarray()) { return ($fh, $path); } else { return $fh; } } #' # for emacs sub mkdtemp { croak "Usage: mkdtemp(template)" if scalar(@_) != 1; my $template = shift; my $suffixlen = 0; if ($^O eq 'VMS') { # dir names can end in delimiters $template =~ m/([\.\]:>]+)$/; $suffixlen = length($1); } if ( ($^O eq 'MacOS') && (substr($template, -1) eq ':') ) { # dir name has a trailing ':' ++$suffixlen; } my ($junk, $tmpdir, $errstr); croak "Error creating temp directory from template $template\: $errstr" unless (($junk, $tmpdir) = _gettemp($template, "open" => 0, "mkdir"=> 1 , "suffixlen" => $suffixlen, "ErrStr" => \$errstr, ) ); return $tmpdir; } sub mktemp { croak "Usage: mktemp(template)" if scalar(@_) != 1; my $template = shift; my ($tmpname, $junk, $errstr); croak "Error getting name to temp file from template $template: $errstr" unless (($junk, $tmpname) = _gettemp($template, "open" => 0, "mkdir"=> 0 , "suffixlen" => 0, "ErrStr" => \$errstr, ) ); return $tmpname; } sub tmpnam { # Retrieve the temporary directory name my $tmpdir = File::Spec->tmpdir; croak "Error temporary directory is not writable" if $tmpdir eq ''; # Use a ten character template and append to tmpdir my $template = File::Spec->catfile($tmpdir, TEMPXXX); if (wantarray() ) { return mkstemp($template); } else { return mktemp($template); } } sub tmpfile { # Simply call tmpnam() in a list context my ($fh, $file) = tmpnam(); # Make sure file is removed when filehandle is closed # This will fail on NFS unlink0($fh, $file) or return undef; return $fh; } sub tempnam { croak 'Usage tempnam($dir, $prefix)' unless scalar(@_) == 2; my ($dir, $prefix) = @_; # Add a string to the prefix $prefix .= 'XXXXXXXX'; # Concatenate the directory to the file my $template = File::Spec->catfile($dir, $prefix); return mktemp($template); } sub unlink0 { croak 'Usage: unlink0(filehandle, filename)' unless scalar(@_) == 2; # Read args my ($fh, $path) = @_; cmpstat($fh, $path) or return 0; # attempt remove the file (does not work on some platforms) if (_can_unlink_opened_file()) { # return early (Without unlink) if we have been instructed to retain files. return 1 if $KEEP_ALL; # XXX: do *not* call this on a directory; possible race # resulting in recursive removal croak "unlink0: $path has become a directory!" if -d $path; unlink($path) or return 0; # Stat the filehandle my @fh = stat $fh; print "Link count = $fh[3] \n" if $DEBUG; # Make sure that the link count is zero # - Cygwin provides deferred unlinking, however, # on Win9x the link count remains 1 # On NFS the link count may still be 1 but we can't know that # we are on NFS. Since we can't be sure, we'll defer it return 1 if $fh[3] == 0 || $^O eq 'cygwin'; } # fall-through if we can't unlink now _deferred_unlink($fh, $path, 0); return 1; } sub cmpstat { croak 'Usage: cmpstat(filehandle, filename)' unless scalar(@_) == 2; # Read args my ($fh, $path) = @_; warn "Comparing stat\n" if $DEBUG; # Stat the filehandle - which may be closed if someone has manually # closed the file. Can not turn off warnings without using $^W # unless we upgrade to 5.006 minimum requirement my @fh; { local ($^W) = 0; @fh = stat $fh; } return unless @fh; if ($fh[3] > 1 && $^W) { carp "unlink0: fstat found too many links; SB=@fh" if $^W; } # Stat the path my @path = stat $path; unless (@path) { carp "unlink0: $path is gone already" if $^W; return; } # this is no longer a file, but may be a directory, or worse unless (-f $path) { confess "panic: $path is no longer a file: SB=@fh"; } # Do comparison of each member of the array # On WinNT dev and rdev seem to be different # depending on whether it is a file or a handle. # Cannot simply compare all members of the stat return # Select the ones we can use my @okstat = (0..$#fh); # Use all by default if ($^O eq 'MSWin32') { @okstat = (1,2,3,4,5,7,8,9,10); } elsif ($^O eq 'os2') { @okstat = (0, 2..$#fh); } elsif ($^O eq 'VMS') { # device and file ID are sufficient @okstat = (0, 1); } elsif ($^O eq 'dos') { @okstat = (0,2..7,11..$#fh); } elsif ($^O eq 'mpeix') { @okstat = (0..4,8..10); } # Now compare each entry explicitly by number for (@okstat) { print "Comparing: $_ : $fh[$_] and $path[$_]\n" if $DEBUG; # Use eq rather than == since rdev, blksize, and blocks (6, 11, # and 12) will be '' on platforms that do not support them. This # is fine since we are only comparing integers. unless ($fh[$_] eq $path[$_]) { warn "Did not match $_ element of stat\n" if $DEBUG; return 0; } } return 1; } sub unlink1 { croak 'Usage: unlink1(filehandle, filename)' unless scalar(@_) == 2; # Read args my ($fh, $path) = @_; cmpstat($fh, $path) or return 0; # Close the file close( $fh ) or return 0; # Make sure the file is writable (for windows) _force_writable( $path ); # return early (without unlink) if we have been instructed to retain files. return 1 if $KEEP_ALL; # remove the file return unlink($path); } { # protect from using the variable itself my $LEVEL = STANDARD; sub safe_level { my $self = shift; if (@_) { my $level = shift; if (($level != STANDARD) && ($level != MEDIUM) && ($level != HIGH)) { carp "safe_level: Specified level ($level) not STANDARD, MEDIUM or HIGH - ignoring\n" if $^W; } else { # Don't allow this on perl 5.005 or earlier if ($] < 5.006 && $level != STANDARD) { # Cant do MEDIUM or HIGH checks croak "Currently requires perl 5.006 or newer to do the safe checks"; } # Check that we are allowed to change level # Silently ignore if we can not. $LEVEL = $level if _can_do_level($level); } } return $LEVEL; } } { my $TopSystemUID = 10; $TopSystemUID = 197108 if $^O eq 'interix'; # "Administrator" sub top_system_uid { my $self = shift; if (@_) { my $newuid = shift; croak "top_system_uid: UIDs should be numeric" unless $newuid =~ /^\d+$/s; $TopSystemUID = $newuid; } return $TopSystemUID; } } package File::Temp::Dir; use File::Path qw/ rmtree /; use strict; use overload '""' => "STRINGIFY", '0+' => \&File::Temp::NUMIFY, fallback => 1; # private class specifically to support tempdir objects # created by File::Temp->newdir # ostensibly the same method interface as File::Temp but without # inheriting all the IO::Seekable methods and other cruft # Read-only - returns the name of the temp directory sub dirname { my $self = shift; return $self->{DIRNAME}; } sub STRINGIFY { my $self = shift; return $self->dirname; } sub unlink_on_destroy { my $self = shift; if (@_) { $self->{CLEANUP} = shift; } return $self->{CLEANUP}; } sub DESTROY { my $self = shift; local($., $@, $!, $^E, $?); if ($self->unlink_on_destroy && $$ == $self->{LAUNCHPID} && !$File::Temp::KEEP_ALL) { if (-d $self->{REALNAME}) { # Some versions of rmtree will abort if you attempt to remove # the directory you are sitting in. We protect that and turn it # into a warning. We do this because this occurs during object # destruction and so can not be caught by the user. eval { rmtree($self->{REALNAME}, $File::Temp::DEBUG, 0); }; warn $@ if ($@ && $^W); } } } 1; __END__ #line 2595 FILE7e2f1c4f/FileHandle.pmw#line 1 "/usr/local/lib/perl5/5.20.0/FileHandle.pm" package FileHandle; use 5.006; use strict; our($VERSION, @ISA, @EXPORT, @EXPORT_OK); $VERSION = "2.02"; require IO::File; @ISA = qw(IO::File); @EXPORT = qw(_IOFBF _IOLBF _IONBF); @EXPORT_OK = qw( pipe autoflush output_field_separator output_record_separator input_record_separator input_line_number format_page_number format_lines_per_page format_lines_left format_name format_top_name format_line_break_characters format_formfeed print printf getline getlines ); # # Everything we're willing to export, we must first import. # import IO::Handle grep { !defined(&$_) } @EXPORT, @EXPORT_OK; # # Some people call "FileHandle::function", so all the functions # that were in the old FileHandle class must be imported, too. # { no strict 'refs'; my %import = ( 'IO::Handle' => [qw(DESTROY new_from_fd fdopen close fileno getc ungetc gets eof flush error clearerr setbuf setvbuf _open_mode_string)], 'IO::Seekable' => [qw(seek tell getpos setpos)], 'IO::File' => [qw(new new_tmpfile open)] ); for my $pkg (keys %import) { for my $func (@{$import{$pkg}}) { my $c = *{"${pkg}::$func"}{CODE} or die "${pkg}::$func missing"; *$func = $c; } } } # # Specialized importer for Fcntl magic. # sub import { my $pkg = shift; my $callpkg = caller; require Exporter; Exporter::export($pkg, $callpkg, @_); # # If the Fcntl extension is available, # export its constants. # eval { require Fcntl; Exporter::export('Fcntl', $callpkg); }; } ################################################ # This is the only exported function we define; # the rest come from other classes. # sub pipe { my $r = new IO::Handle; my $w = new IO::Handle; CORE::pipe($r, $w) or return undef; ($r, $w); } # Rebless standard file handles bless *STDIN{IO}, "FileHandle" if ref *STDIN{IO} eq "IO::Handle"; bless *STDOUT{IO}, "FileHandle" if ref *STDOUT{IO} eq "IO::Handle"; bless *STDERR{IO}, "FileHandle" if ref *STDERR{IO} eq "IO::Handle"; 1; __END__ #line 263 FILE8cca5473/PerlIO.pm#line 1 "/usr/local/lib/perl5/5.20.0/PerlIO.pm" package PerlIO; our $VERSION = '1.09'; # Map layer name to package that defines it our %alias; sub import { my $class = shift; while (@_) { my $layer = shift; if (exists $alias{$layer}) { $layer = $alias{$layer} } else { $layer = "${class}::$layer"; } eval { require $layer =~ s{::}{/}gr . '.pm' }; warn $@ if $@; } } sub F_UTF8 () { 0x8000 } 1; __END__ #line 332 FILE79d1de14/SelectSaver.pm#line 1 "/usr/local/lib/perl5/5.20.0/SelectSaver.pm" package SelectSaver; our $VERSION = '1.02'; #line 36 require 5.000; use Carp; use Symbol; sub new { @_ >= 1 && @_ <= 2 or croak 'usage: SelectSaver->new( [FILEHANDLE] )'; my $fh = select; my $self = bless \$fh, $_[0]; select qualify($_[1], caller) if @_ > 1; $self; } sub DESTROY { my $self = $_[0]; select $$self; } 1; FILEc1652e23/Symbol.pmn#line 1 "/usr/local/lib/perl5/5.20.0/Symbol.pm" package Symbol; #line 80 BEGIN { require 5.005; } require Exporter; @ISA = qw(Exporter); @EXPORT = qw(gensym ungensym qualify qualify_to_ref); @EXPORT_OK = qw(delete_package geniosym); $VERSION = '1.07'; my $genpkg = "Symbol::"; my $genseq = 0; my %global = map {$_ => 1} qw(ARGV ARGVOUT ENV INC SIG STDERR STDIN STDOUT); # # Note that we never _copy_ the glob; we just make a ref to it. # If we did copy it, then SVf_FAKE would be set on the copy, and # glob-specific behaviors (e.g. C<*$ref = \&func>) wouldn't work. # sub gensym () { my $name = "GEN" . $genseq++; my $ref = \*{$genpkg . $name}; delete $$genpkg{$name}; $ref; } sub geniosym () { my $sym = gensym(); # force the IO slot to be filled select(select $sym); *$sym{IO}; } sub ungensym ($) {} sub qualify ($;$) { my ($name) = @_; if (!ref($name) && index($name, '::') == -1 && index($name, "'") == -1) { my $pkg; # Global names: special character, "^xyz", or other. if ($name =~ /^(([^a-z])|(\^[a-z_]+))\z/i || $global{$name}) { # RGS 2001-11-05 : translate leading ^X to control-char $name =~ s/^\^([a-z_])/'qq(\c'.$1.')'/eei; $pkg = "main"; } else { $pkg = (@_ > 1) ? $_[1] : caller; } $name = $pkg . "::" . $name; } $name; } sub qualify_to_ref ($;$) { return \*{ qualify $_[0], @_ > 1 ? $_[1] : caller }; } # # of Safe.pm lineage # sub delete_package ($) { my $pkg = shift; # expand to full symbol table name if needed unless ($pkg =~ /^main::.*::$/) { $pkg = "main$pkg" if $pkg =~ /^::/; $pkg = "main::$pkg" unless $pkg =~ /^main::/; $pkg .= '::' unless $pkg =~ /::$/; } my($stem, $leaf) = $pkg =~ m/(.*::)(\w+::)$/; my $stem_symtab = *{$stem}{HASH}; return unless defined $stem_symtab and exists $stem_symtab->{$leaf}; # free all the symbols in the package my $leaf_symtab = *{$stem_symtab->{$leaf}}{HASH}; foreach my $name (keys %$leaf_symtab) { undef *{$pkg . $name}; } # delete the symbol table %$leaf_symtab = (); delete $stem_symtab->{$leaf}; } 1; FILE6a4d2d04/Time/Local.pm#line 1 "/usr/local/lib/perl5/5.20.0/Time/Local.pm" package Time::Local; require Exporter; use Carp; use Config; use strict; use vars qw( $VERSION @ISA @EXPORT @EXPORT_OK ); $VERSION = '1.2300'; @ISA = qw( Exporter ); @EXPORT = qw( timegm timelocal ); @EXPORT_OK = qw( timegm_nocheck timelocal_nocheck ); my @MonthDays = ( 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); # Determine breakpoint for rolling century my $ThisYear = ( localtime() )[5]; my $Breakpoint = ( $ThisYear + 50 ) % 100; my $NextCentury = $ThisYear - $ThisYear % 100; $NextCentury += 100 if $Breakpoint < 50; my $Century = $NextCentury - 100; my $SecOff = 0; my ( %Options, %Cheat ); use constant SECS_PER_MINUTE => 60; use constant SECS_PER_HOUR => 3600; use constant SECS_PER_DAY => 86400; my $MaxDay; if ($] < 5.012000) { my $MaxInt; if ( $^O eq 'MacOS' ) { # time_t is unsigned... $MaxInt = ( 1 << ( 8 * $Config{ivsize} ) ) - 1; } else { $MaxInt = ( ( 1 << ( 8 * $Config{ivsize} - 2 ) ) - 1 ) * 2 + 1; } $MaxDay = int( ( $MaxInt - ( SECS_PER_DAY / 2 ) ) / SECS_PER_DAY ) - 1; } else { # recent localtime()'s limit is the year 2**31 $MaxDay = 365 * (2**31); } # Determine the EPOC day for this machine my $Epoc = 0; if ( $^O eq 'vos' ) { # work around posix-977 -- VOS doesn't handle dates in the range # 1970-1980. $Epoc = _daygm( 0, 0, 0, 1, 0, 70, 4, 0 ); } elsif ( $^O eq 'MacOS' ) { $MaxDay *=2 if $^O eq 'MacOS'; # time_t unsigned ... quick hack? # MacOS time() is seconds since 1 Jan 1904, localtime # so we need to calculate an offset to apply later $Epoc = 693901; $SecOff = timelocal( localtime(0)) - timelocal( gmtime(0) ) ; $Epoc += _daygm( gmtime(0) ); } else { $Epoc = _daygm( gmtime(0) ); } %Cheat = (); # clear the cache as epoc has changed sub _daygm { # This is written in such a byzantine way in order to avoid # lexical variables and sub calls, for speed return $_[3] + ( $Cheat{ pack( 'ss', @_[ 4, 5 ] ) } ||= do { my $month = ( $_[4] + 10 ) % 12; my $year = $_[5] + 1900 - int($month / 10); ( ( 365 * $year ) + int( $year / 4 ) - int( $year / 100 ) + int( $year / 400 ) + int( ( ( $month * 306 ) + 5 ) / 10 ) ) - $Epoc; } ); } sub _timegm { my $sec = $SecOff + $_[0] + ( SECS_PER_MINUTE * $_[1] ) + ( SECS_PER_HOUR * $_[2] ); return $sec + ( SECS_PER_DAY * &_daygm ); } sub timegm { my ( $sec, $min, $hour, $mday, $month, $year ) = @_; if ( $year >= 1000 ) { $year -= 1900; } elsif ( $year < 100 and $year >= 0 ) { $year += ( $year > $Breakpoint ) ? $Century : $NextCentury; } unless ( $Options{no_range_check} ) { croak "Month '$month' out of range 0..11" if $month > 11 or $month < 0; my $md = $MonthDays[$month]; ++$md if $month == 1 && _is_leap_year( $year + 1900 ); croak "Day '$mday' out of range 1..$md" if $mday > $md or $mday < 1; croak "Hour '$hour' out of range 0..23" if $hour > 23 or $hour < 0; croak "Minute '$min' out of range 0..59" if $min > 59 or $min < 0; croak "Second '$sec' out of range 0..59" if $sec >= 60 or $sec < 0; } my $days = _daygm( undef, undef, undef, $mday, $month, $year ); unless ($Options{no_range_check} or abs($days) < $MaxDay) { my $msg = ''; $msg .= "Day too big - $days > $MaxDay\n" if $days > $MaxDay; $year += 1900; $msg .= "Cannot handle date ($sec, $min, $hour, $mday, $month, $year)"; croak $msg; } return $sec + $SecOff + ( SECS_PER_MINUTE * $min ) + ( SECS_PER_HOUR * $hour ) + ( SECS_PER_DAY * $days ); } sub _is_leap_year { return 0 if $_[0] % 4; return 1 if $_[0] % 100; return 0 if $_[0] % 400; return 1; } sub timegm_nocheck { local $Options{no_range_check} = 1; return &timegm; } sub timelocal { my $ref_t = &timegm; my $loc_for_ref_t = _timegm( localtime($ref_t) ); my $zone_off = $loc_for_ref_t - $ref_t or return $loc_for_ref_t; # Adjust for timezone my $loc_t = $ref_t - $zone_off; # Are we close to a DST change or are we done my $dst_off = $ref_t - _timegm( localtime($loc_t) ); # If this evaluates to true, it means that the value in $loc_t is # the _second_ hour after a DST change where the local time moves # backward. if ( ! $dst_off && ( ( $ref_t - SECS_PER_HOUR ) - _timegm( localtime( $loc_t - SECS_PER_HOUR ) ) < 0 ) ) { return $loc_t - SECS_PER_HOUR; } # Adjust for DST change $loc_t += $dst_off; return $loc_t if $dst_off > 0; # If the original date was a non-extent gap in a forward DST jump, # we should now have the wrong answer - undo the DST adjustment my ( $s, $m, $h ) = localtime($loc_t); $loc_t -= $dst_off if $s != $_[0] || $m != $_[1] || $h != $_[2]; return $loc_t; } sub timelocal_nocheck { local $Options{no_range_check} = 1; return &timelocal; } 1; __END__ #line 385 FILEf8da1972/XSLoader.pm Z#line 1 "/usr/local/lib/perl5/5.20.0/XSLoader.pm" # Generated from XSLoader.pm.PL (resolved %Config::Config value) package XSLoader; $VERSION = "0.17"; #use strict; package DynaLoader; # No prizes for guessing why we don't say 'bootstrap DynaLoader;' here. # NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) && !defined(&dl_error); package XSLoader; sub load { package DynaLoader; my ($module, $modlibname) = caller(); if (@_) { $module = $_[0]; } else { $_[0] = $module; } # work with static linking too my $boots = "$module\::bootstrap"; goto &$boots if defined &$boots; goto \&XSLoader::bootstrap_inherit; my @modparts = split(/::/,$module); my $modfname = $modparts[-1]; my $modpname = join('/',@modparts); my $c = @modparts; $modlibname =~ s,[\\/][^\\/]+$,, while $c--; # Q&D basename my $file = "$modlibname/auto/$modpname/$modfname.so"; # print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug; my $bs = $file; $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library if (-s $bs) { # only read file if it's not empty # print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug; eval { do $bs; }; warn "$bs: $@\n" if $@; } goto \&XSLoader::bootstrap_inherit if not -f $file or -s $bs; my $bootname = "boot_$module"; $bootname =~ s/\W/_/g; @DynaLoader::dl_require_symbols = ($bootname); my $boot_symbol_ref; # Many dynamic extension loading problems will appear to come from # this section of code: XYZ failed at line 123 of DynaLoader.pm. # Often these errors are actually occurring in the initialisation # C code of the extension XS file. Perl reports the error as being # in this perl code simply because this was the last perl code # it executed. my $libref = dl_load_file($file, 0) or do { require Carp; Carp::croak("Can't load '$file' for module $module: " . dl_error()); }; push(@DynaLoader::dl_librefs,$libref); # record loaded object my @unresolved = dl_undef_symbols(); if (@unresolved) { require Carp; Carp::carp("Undefined symbols present after loading $file: @unresolved\n"); } $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do { require Carp; Carp::croak("Can't find '$bootname' symbol in $file\n"); }; push(@DynaLoader::dl_modules, $module); # record loaded module boot: my $xs = dl_install_xsub($boots, $boot_symbol_ref, $file); # See comment block above push(@DynaLoader::dl_shared_objects, $file); # record files loaded return &$xs(@_); } sub bootstrap_inherit { require DynaLoader; goto \&DynaLoader::bootstrap_inherit; } 1; __END__ #line 356 FILE519bf2d5/base.pm#line 1 "/usr/local/lib/perl5/5.20.0/base.pm" package base; use strict 'vars'; use vars qw($VERSION); $VERSION = '2.22'; $VERSION = eval $VERSION; # constant.pm is slow sub SUCCESS () { 1 } sub PUBLIC () { 2**0 } sub PRIVATE () { 2**1 } sub INHERITED () { 2**2 } sub PROTECTED () { 2**3 } my $Fattr = \%fields::attr; sub has_fields { my($base) = shift; my $fglob = ${"$base\::"}{FIELDS}; return( ($fglob && 'GLOB' eq ref($fglob) && *$fglob{HASH}) ? 1 : 0 ); } sub has_attr { my($proto) = shift; my($class) = ref $proto || $proto; return exists $Fattr->{$class}; } sub get_attr { $Fattr->{$_[0]} = [1] unless $Fattr->{$_[0]}; return $Fattr->{$_[0]}; } if ($] < 5.009) { *get_fields = sub { # Shut up a possible typo warning. () = \%{$_[0].'::FIELDS'}; my $f = \%{$_[0].'::FIELDS'}; # should be centralized in fields? perhaps # fields::mk_FIELDS_be_OK. Peh. As long as %{ $package . '::FIELDS' } # is used here anyway, it doesn't matter. bless $f, 'pseudohash' if (ref($f) ne 'pseudohash'); return $f; } } else { *get_fields = sub { # Shut up a possible typo warning. () = \%{$_[0].'::FIELDS'}; return \%{$_[0].'::FIELDS'}; } } if ($] < 5.008) { *_module_to_filename = sub { (my $fn = $_[0]) =~ s!::!/!g; $fn .= '.pm'; return $fn; } } else { *_module_to_filename = sub { (my $fn = $_[0]) =~ s!::!/!g; $fn .= '.pm'; utf8::encode($fn); return $fn; } } sub import { my $class = shift; return SUCCESS unless @_; # List of base classes from which we will inherit %FIELDS. my $fields_base; my $inheritor = caller(0); my @bases; foreach my $base (@_) { if ( $inheritor eq $base ) { warn "Class '$inheritor' tried to inherit from itself\n"; } next if grep $_->isa($base), ($inheritor, @bases); # Following blocks help isolate $SIG{__DIE__} changes { my $sigdie; { local $SIG{__DIE__}; my $fn = _module_to_filename($base); eval { require $fn }; # Only ignore "Can't locate" errors from our eval require. # Other fatal errors (syntax etc) must be reported. # # changing the check here is fragile - if the check # here isn't catching every error you want, you should # probably be using parent.pm, which doesn't try to # guess whether require is needed or failed, # see [perl #118561] die if $@ && $@ !~ /^Can't locate \Q$fn\E .*? at .* line [0-9]+(?:, <[^>]*> (?:line|chunk) [0-9]+)?\.\n\z/s || $@ =~ /Compilation failed in require at .* line [0-9]+(?:, <[^>]*> (?:line|chunk) [0-9]+)?\.\n\z/; unless (%{"$base\::"}) { require Carp; local $" = " "; Carp::croak(<[0] = @$battr; if( keys %$dfields ) { warn <<"END"; $derived is inheriting from $base but already has its own fields! This will cause problems. Be sure you use base BEFORE declaring fields. END } # Iterate through the base's fields adding all the non-private # ones to the derived class. Hang on to the original attribute # (Public, Private, etc...) and add Inherited. # This is all too complicated to do efficiently with add_fields(). while (my($k,$v) = each %$bfields) { my $fno; if ($fno = $dfields->{$k} and $fno != $v) { require Carp; Carp::croak ("Inherited fields can't override existing fields"); } if( $battr->[$v] & PRIVATE ) { $dattr->[$v] = PRIVATE | INHERITED; } else { $dattr->[$v] = INHERITED | $battr->[$v]; $dfields->{$k} = $v; } } foreach my $idx (1..$#{$battr}) { next if defined $dattr->[$idx]; $dattr->[$idx] = $battr->[$idx] & INHERITED; } } 1; __END__ #line 277 FILE3419c0fa/bytes.pm#line 1 "/usr/local/lib/perl5/5.20.0/bytes.pm" package bytes; our $VERSION = '1.04'; $bytes::hint_bits = 0x00000008; sub import { $^H |= $bytes::hint_bits; } sub unimport { $^H &= ~$bytes::hint_bits; } sub AUTOLOAD { require "bytes_heavy.pl"; goto &$AUTOLOAD if defined &$AUTOLOAD; require Carp; Carp::croak("Undefined subroutine $AUTOLOAD called"); } sub length (_); sub chr (_); sub ord (_); sub substr ($$;$$); sub index ($$;$); sub rindex ($$;$); 1; __END__ #line 101 FILEf91e83e6/constant.pm#line 1 "/usr/local/lib/perl5/5.20.0/constant.pm" package constant; use 5.008; use strict; use warnings::register; use vars qw($VERSION %declared); $VERSION = '1.31'; #======================================================================= # Some names are evil choices. my %keywords = map +($_, 1), qw{ BEGIN INIT CHECK END DESTROY AUTOLOAD }; $keywords{UNITCHECK}++ if $] > 5.009; my %forced_into_main = map +($_, 1), qw{ STDIN STDOUT STDERR ARGV ARGVOUT ENV INC SIG }; my %forbidden = (%keywords, %forced_into_main); my $normal_constant_name = qr/^_?[^\W_0-9]\w*\z/; my $tolerable = qr/^[A-Za-z_]\w*\z/; my $boolean = qr/^[01]?\z/; BEGIN { # We'd like to do use constant _CAN_PCS => $] > 5.009002 # but that's a bit tricky before we load the constant module :-) # By doing this, we save 1 run time check for *every* call to import. my $const = $] > 5.009002; my $downgrade = $] < 5.015004; # && $] >= 5.008 my $constarray = exists &_make_const; if ($const) { Internals::SvREADONLY($const, 1); Internals::SvREADONLY($downgrade, 1); $constant::{_CAN_PCS} = \$const; $constant::{_DOWNGRADE} = \$downgrade; $constant::{_CAN_PCS_FOR_ARRAY} = \$constarray; } else { no strict 'refs'; *{"_CAN_PCS"} = sub () {$const}; *{"_DOWNGRADE"} = sub () { $downgrade }; *{"_CAN_PCS_FOR_ARRAY"} = sub () { $constarray }; } } #======================================================================= # import() - import symbols into user's namespace # # What we actually do is define a function in the caller's namespace # which returns the value. The function we create will normally # be inlined as a constant, thereby avoiding further sub calling # overhead. #======================================================================= sub import { my $class = shift; return unless @_; # Ignore 'use constant;' my $constants; my $multiple = ref $_[0]; my $pkg = caller; my $flush_mro; my $symtab; if (_CAN_PCS) { no strict 'refs'; $symtab = \%{$pkg . '::'}; }; if ( $multiple ) { if (ref $_[0] ne 'HASH') { require Carp; Carp::croak("Invalid reference type '".ref(shift)."' not 'HASH'"); } $constants = shift; } else { unless (defined $_[0]) { require Carp; Carp::croak("Can't use undef as constant name"); } $constants->{+shift} = undef; } foreach my $name ( keys %$constants ) { # Normal constant name if ($name =~ $normal_constant_name and !$forbidden{$name}) { # Everything is okay # Name forced into main, but we're not in main. Fatal. } elsif ($forced_into_main{$name} and $pkg ne 'main') { require Carp; Carp::croak("Constant name '$name' is forced into main::"); # Starts with double underscore. Fatal. } elsif ($name =~ /^__/) { require Carp; Carp::croak("Constant name '$name' begins with '__'"); # Maybe the name is tolerable } elsif ($name =~ $tolerable) { # Then we'll warn only if you've asked for warnings if (warnings::enabled()) { if ($keywords{$name}) { warnings::warn("Constant name '$name' is a Perl keyword"); } elsif ($forced_into_main{$name}) { warnings::warn("Constant name '$name' is " . "forced into package main::"); } } # Looks like a boolean # use constant FRED == fred; } elsif ($name =~ $boolean) { require Carp; if (@_) { Carp::croak("Constant name '$name' is invalid"); } else { Carp::croak("Constant name looks like boolean value"); } } else { # Must have bad characters require Carp; Carp::croak("Constant name '$name' has invalid characters"); } { no strict 'refs'; my $full_name = "${pkg}::$name"; $declared{$full_name}++; if ($multiple || @_ == 1) { my $scalar = $multiple ? $constants->{$name} : $_[0]; if (_DOWNGRADE) { # for 5.8 to 5.14 # Work around perl bug #31991: Sub names (actually glob # names in general) ignore the UTF8 flag. So we have to # turn it off to get the "right" symbol table entry. utf8::is_utf8 $name and utf8::encode $name; } # The constant serves to optimise this entire block out on # 5.8 and earlier. if (_CAN_PCS) { # Use a reference as a proxy for a constant subroutine. # If this is not a glob yet, it saves space. If it is # a glob, we must still create it this way to get the # right internal flags set, as constants are distinct # from subroutines created with sub(){...}. # The check in Perl_ck_rvconst knows that inlinable # constants from cv_const_sv are read only. So we have to: Internals::SvREADONLY($scalar, 1); if ($symtab && !exists $symtab->{$name}) { $symtab->{$name} = \$scalar; ++$flush_mro; } else { local $constant::{_dummy} = \$scalar; *$full_name = \&{"_dummy"}; } } else { *$full_name = sub () { $scalar }; } } elsif (@_) { my @list = @_; if (_CAN_PCS_FOR_ARRAY) { _make_const($list[$_]) for 0..$#list; _make_const(@list); if ($symtab && !exists $symtab->{$name}) { $symtab->{$name} = \@list; $flush_mro++; } else { local $constant::{_dummy} = \@list; *$full_name = \&{"_dummy"}; } } else { *$full_name = sub () { @list }; } } else { *$full_name = sub () { }; } } } # Flush the cache exactly once if we make any direct symbol table changes. mro::method_changed_in($pkg) if _CAN_PCS && $flush_mro; } 1; __END__ #line 431 FILEb583492c/Config.pm #line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/Config.pm" # This file was created by configpm when Perl was built. Any changes # made to this file will be lost the next time perl is built. # for a description of the variables, please have a look at the # Glossary file, as written in the Porting folder, or use the url: # http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/Glossary package Config; use strict; use warnings; use vars '%Config', '$VERSION'; $VERSION = "5.020000"; # Skip @Config::EXPORT because it only contains %Config, which we special # case below as it's not a function. @Config::EXPORT won't change in the # lifetime of Perl 5. my %Export_Cache = (myconfig => 1, config_sh => 1, config_vars => 1, config_re => 1, compile_date => 1, local_patches => 1, bincompat_options => 1, non_bincompat_options => 1, header_files => 1); @Config::EXPORT = qw(%Config); @Config::EXPORT_OK = keys %Export_Cache; # Need to stub all the functions to make code such as print Config::config_sh # keep working sub bincompat_options; sub compile_date; sub config_re; sub config_sh; sub config_vars; sub header_files; sub local_patches; sub myconfig; sub non_bincompat_options; # Define our own import method to avoid pulling in the full Exporter: sub import { shift; @_ = @Config::EXPORT unless @_; my @funcs = grep $_ ne '%Config', @_; my $export_Config = @funcs < @_ ? 1 : 0; no strict 'refs'; my $callpkg = caller(0); foreach my $func (@funcs) { die qq{"$func" is not exported by the Config module\n} unless $Export_Cache{$func}; *{$callpkg.'::'.$func} = \&{$func}; } *{"$callpkg\::Config"} = \%Config if $export_Config; return; } die "$0: Perl lib version (5.20.0) doesn't match executable '$^X' version ($])" unless $^V; $^V eq 5.20.0 or die sprintf "%s: Perl lib version (5.20.0) doesn't match executable '$^X' version (%vd)", $0, $^V; sub FETCH { my($self, $key) = @_; # check for cached value (which may be undef so we use exists not defined) return exists $self->{$key} ? $self->{$key} : $self->fetch_string($key); } sub TIEHASH { bless $_[1], $_[0]; } sub DESTROY { } sub AUTOLOAD { require 'Config_heavy.pl'; goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/; die "&Config::AUTOLOAD failed on $Config::AUTOLOAD"; } # tie returns the object, so the value returned to require will be true. tie %Config, 'Config', { archlibexp => '/usr/local/lib/perl5/5.20.0/i86pc-solaris', archname => 'i86pc-solaris', cc => 'gcc', d_readlink => 'define', d_symlink => 'define', dlext => 'so', dlsrc => 'dl_dlopen.xs', dont_use_nlink => undef, exe_ext => '', inc_version_list => ' ', intsize => '4', ldlibpthname => 'LD_LIBRARY_PATH', libpth => '/usr/local/lib /usr/gcc/4.5/lib /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/include-fixed /usr/lib /usr/gnu/lib /usr/ccs/lib', osname => 'solaris', osvers => '2.11', path_sep => ':', privlibexp => '/usr/local/lib/perl5/5.20.0', scriptdir => '/usr/local/bin', sitearchexp => '/usr/local/lib/perl5/site_perl/5.20.0/i86pc-solaris', sitelibexp => '/usr/local/lib/perl5/site_perl/5.20.0', so => 'so', useithreads => undef, usevendorprefix => undef, version => '5.20.0', }; FILEc33fbebe/Config_git.pl###################################################################### # WARNING: 'lib/Config_git.pl' is generated by make_patchnum.pl # DO NOT EDIT DIRECTLY - edit make_patchnum.pl instead ###################################################################### $Config::Git_Data=<<'ENDOFGIT'; git_commit_id='' git_describe='' git_branch='' git_uncommitted_changes='' git_commit_id_title='' ENDOFGIT FILE21b94530/Config_heavy.plF# This file was created by configpm when Perl was built. Any changes # made to this file will be lost the next time perl is built. package Config; use strict; use warnings; use vars '%Config'; sub bincompat_options { return split ' ', (Internals::V())[0]; } sub non_bincompat_options { return split ' ', (Internals::V())[1]; } sub compile_date { return (Internals::V())[2] } sub local_patches { my (undef, undef, undef, @patches) = Internals::V(); return @patches; } sub _V { die "Perl lib was built for 'solaris' but is being run on '$^O'" unless "solaris" eq $^O; my ($bincompat, $non_bincompat, $date, @patches) = Internals::V(); my $opts = join ' ', sort split ' ', "$bincompat $non_bincompat"; # wrap at 76 columns. $opts =~ s/(?=.{53})(.{1,53}) /$1\n /mg; print Config::myconfig(); print "\nCharacteristics of this binary (from libperl): \n"; print " Compile-time options: $opts\n"; if (@patches) { print " Locally applied patches:\n"; print "\t$_\n" foreach @patches; } print " Built under solaris\n"; print " $date\n" if defined $date; my @env = map { "$_=\"$ENV{$_}\"" } sort grep {/^PERL/} keys %ENV; if (@env) { print " \%ENV:\n"; print " $_\n" foreach @env; } print " \@INC:\n"; print " $_\n" foreach @INC; } sub header_files { return qw(EXTERN.h INTERN.h XSUB.h av.h config.h cop.h cv.h dosish.h embed.h embedvar.h form.h gv.h handy.h hv.h hv_func.h intrpvar.h iperlsys.h keywords.h mg.h nostdio.h op.h opcode.h pad.h parser.h patchlevel.h perl.h perlio.h perliol.h perlsdio.h perlvars.h perly.h pp.h pp_proto.h proto.h regcomp.h regexp.h regnodes.h scope.h sv.h thread.h time64.h unixish.h utf8.h util.h); } ## ## This file was produced by running the Configure script. It holds all the ## definitions figured out by Configure. Should you modify one of these values, ## do not forget to propagate your changes by running "Configure -der". You may ## instead choose to run each of the .SH files by yourself, or "Configure -S". ## # ## Package name : perl5 ## Source directory : . ## Configuration time: Sat Jun 13 09:13:07 HKT 2015 ## Configured by : chris ## Target system : sunos zeus 5.11 11.2 i86pc i386 i86pc # #: Configure command line arguments. # #: Variables propagated from previous config.sh file. our $summary = <<'!END!'; Summary of my $package (revision $revision $version_patchlevel_string) configuration: $git_commit_id_title $git_commit_id$git_ancestor_line Platform: osname=$osname, osvers=$osvers, archname=$archname uname='$myuname' config_args='$config_args' hint=$hint, useposix=$useposix, d_sigaction=$d_sigaction useithreads=$useithreads, usemultiplicity=$usemultiplicity use64bitint=$use64bitint, use64bitall=$use64bitall, uselongdouble=$uselongdouble usemymalloc=$usemymalloc, bincompat5005=undef Compiler: cc='$cc', ccflags ='$ccflags', optimize='$optimize', cppflags='$cppflags' ccversion='$ccversion', gccversion='$gccversion', gccosandvers='$gccosandvers' intsize=$intsize, longsize=$longsize, ptrsize=$ptrsize, doublesize=$doublesize, byteorder=$byteorder d_longlong=$d_longlong, longlongsize=$longlongsize, d_longdbl=$d_longdbl, longdblsize=$longdblsize ivtype='$ivtype', ivsize=$ivsize, nvtype='$nvtype', nvsize=$nvsize, Off_t='$lseektype', lseeksize=$lseeksize alignbytes=$alignbytes, prototype=$prototype Linker and Libraries: ld='$ld', ldflags ='$ldflags' libpth=$libpth libs=$libs perllibs=$perllibs libc=$libc, so=$so, useshrplib=$useshrplib, libperl=$libperl gnulibc_version='$gnulibc_version' Dynamic Linking: dlsrc=$dlsrc, dlext=$dlext, d_dlsymun=$d_dlsymun, ccdlflags='$ccdlflags' cccdlflags='$cccdlflags', lddlflags='$lddlflags' !END! my $summary_expanded; sub myconfig { return $summary_expanded if $summary_expanded; ($summary_expanded = $summary) =~ s{\$(\w+)} { my $c; if ($1 eq 'git_ancestor_line') { if ($Config::Config{git_ancestor}) { $c= "\n Ancestor: $Config::Config{git_ancestor}"; } else { $c= ""; } } else { $c = $Config::Config{$1}; } defined($c) ? $c : 'undef' }ge; $summary_expanded; } local *_ = \my $a; $_ = <<'!END!'; Author='' CONFIG='true' Date='$Date' Header='' Id='$Id' Locker='' Log='$Log' PATCHLEVEL='20' PERL_API_REVISION='5' PERL_API_SUBVERSION='0' PERL_API_VERSION='20' PERL_CONFIG_SH='true' PERL_PATCHLEVEL='' PERL_REVISION='5' PERL_SUBVERSION='0' PERL_VERSION='20' RCSfile='$RCSfile' Revision='$Revision' SUBVERSION='0' Source='' State='' _a='.a' _exe='' _o='.o' afs='false' afsroot='/afs' alignbytes='4' ansi2knr='' aphostname='/usr/bin/hostname' api_revision='5' api_subversion='0' api_version='20' api_versionstring='5.20.0' ar='ar' archlib='/usr/local/lib/perl5/5.20.0/i86pc-solaris' archlibexp='/usr/local/lib/perl5/5.20.0/i86pc-solaris' archname64='' archname='i86pc-solaris' archobjs='' asctime_r_proto='0' awk='awk' baserev='5.0' bash='' bin='/usr/local/bin' bin_ELF='define' binexp='/usr/local/bin' bison='bison' bootstrap_charset='undef' byacc='byacc' byteorder='1234' c='\c' castflags='0' cat='cat' cc='gcc' cccdlflags='-fPIC' ccdlflags=' -R /usr/local/lib/perl5/5.20.0/i86pc-solaris/CORE' ccflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV' ccflags_uselargefiles='-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' ccname='gcc' ccsymbols='' ccversion='' cf_by='chris' cf_email='chris@zeus.communilink.net' cf_time='Sat Jun 13 09:13:07 HKT 2015' charbits='8' charsize='1' chgrp='' chmod='chmod' chown='' clocktype='clock_t' comm='comm' compress='' config_arg0='./Configure' config_arg1='-Ui_db' config_arg2='de' config_argc='2' config_args='-Ui_db de' contains='grep' cp='cp' cpio='' cpp='cpp' cpp_stuff='42' cppccsymbols='' cppflags='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include' cpplast='-' cppminus='-' cpprun='gcc -E' cppstdin='gcc -E' cppsymbols='__ELF__=1 __GNUC__=4 __GNUC_MINOR__=5 __i386__=1 __i386=1 __STDC__=1 __sun__=1 __sun=1 __svr4__=1 __SVR4=1 __unix__=1 __unix=1 _FILE_OFFSET_BITS=64 _ILP32= _LARGEFILE_SOURCE=1 _LARGEFILE64_SOURCE=1 _LITTLE_ENDIAN= i386=1 sun=1 unix=1' crypt_r_proto='0' cryptlib='' csh='csh' ctermid_r_proto='0' ctime_r_proto='0' d_Gconvert='gconvert((x),(n),(t),(b))' d_PRIEUldbl='define' d_PRIFUldbl='define' d_PRIGUldbl='define' d_PRIXU64='define' d_PRId64='define' d_PRIeldbl='define' d_PRIfldbl='define' d_PRIgldbl='define' d_PRIi64='define' d_PRIo64='define' d_PRIu64='define' d_PRIx64='define' d_SCNfldbl='define' d__fwalk='undef' d_access='define' d_accessx='undef' d_aintl='undef' d_alarm='define' d_archlib='define' d_asctime64='undef' d_asctime_r='undef' d_atolf='undef' d_atoll='define' d_attribute_deprecated='define' d_attribute_format='define' d_attribute_malloc='define' d_attribute_nonnull='define' d_attribute_noreturn='define' d_attribute_pure='define' d_attribute_unused='define' d_attribute_warn_unused_result='define' d_bcmp='define' d_bcopy='define' d_bsd='undef' d_bsdgetpgrp='undef' d_bsdsetpgrp='undef' d_builtin_choose_expr='define' d_builtin_expect='define' d_bzero='define' d_c99_variadic_macros='define' d_casti32='undef' d_castneg='define' d_charvspr='undef' d_chown='define' d_chroot='define' d_chsize='undef' d_class='undef' d_clearenv='define' d_closedir='define' d_cmsghdr_s='define' d_const='define' d_copysignl='define' d_cplusplus='undef' d_crypt='define' d_crypt_r='undef' d_csh='define' d_ctermid='define' d_ctermid_r='undef' d_ctime64='undef' d_ctime_r='undef' d_cuserid='define' d_dbl_dig='define' d_dbminitproto='undef' d_difftime64='undef' d_difftime='define' d_dir_dd_fd='undef' d_dirfd='define' d_dirnamlen='undef' d_dlerror='define' d_dlopen='define' d_dlsymun='undef' d_dosuid='undef' d_drand48_r='undef' d_drand48proto='define' d_dup2='define' d_eaccess='undef' d_endgrent='define' d_endgrent_r='undef' d_endhent='define' d_endhostent_r='undef' d_endnent='define' d_endnetent_r='undef' d_endpent='define' d_endprotoent_r='undef' d_endpwent='define' d_endpwent_r='undef' d_endsent='define' d_endservent_r='undef' d_eofnblk='define' d_eunice='undef' d_faststdio='define' d_fchdir='define' d_fchmod='define' d_fchown='define' d_fcntl='define' d_fcntl_can_lock='define' d_fd_macros='define' d_fd_set='define' d_fds_bits='define' d_fgetpos='define' d_finite='define' d_finitel='undef' d_flexfnam='define' d_flock='undef' d_flockproto='undef' d_fork='define' d_fp_class='undef' d_fpathconf='define' d_fpclass='define' d_fpclassify='undef' d_fpclassl='undef' d_fpos64_t='define' d_frexpl='define' d_fs_data_s='undef' d_fseeko='define' d_fsetpos='define' d_fstatfs='define' d_fstatvfs='define' d_fsync='define' d_ftello='define' d_ftime='undef' d_futimes='undef' d_gdbm_ndbm_h_uses_prototypes='undef' d_gdbmndbm_h_uses_prototypes='undef' d_getaddrinfo='define' d_getcwd='define' d_getespwnam='undef' d_getfsstat='undef' d_getgrent='define' d_getgrent_r='undef' d_getgrgid_r='undef' d_getgrnam_r='undef' d_getgrps='define' d_gethbyaddr='define' d_gethbyname='define' d_gethent='define' d_gethname='define' d_gethostbyaddr_r='undef' d_gethostbyname_r='undef' d_gethostent_r='undef' d_gethostprotos='define' d_getitimer='define' d_getlogin='define' d_getlogin_r='undef' d_getmnt='undef' d_getmntent='define' d_getnameinfo='define' d_getnbyaddr='define' d_getnbyname='define' d_getnent='define' d_getnetbyaddr_r='undef' d_getnetbyname_r='undef' d_getnetent_r='undef' d_getnetprotos='define' d_getpagsz='define' d_getpbyname='define' d_getpbynumber='define' d_getpent='define' d_getpgid='define' d_getpgrp2='undef' d_getpgrp='define' d_getppid='define' d_getprior='define' d_getprotobyname_r='undef' d_getprotobynumber_r='undef' d_getprotoent_r='undef' d_getprotoprotos='define' d_getprpwnam='undef' d_getpwent='define' d_getpwent_r='undef' d_getpwnam_r='undef' d_getpwuid_r='undef' d_getsbyname='define' d_getsbyport='define' d_getsent='define' d_getservbyname_r='undef' d_getservbyport_r='undef' d_getservent_r='undef' d_getservprotos='define' d_getspnam='define' d_getspnam_r='undef' d_gettimeod='define' d_gmtime64='undef' d_gmtime_r='undef' d_gnulibc='undef' d_grpasswd='define' d_hasmntopt='define' d_htonl='define' d_ilogbl='define' d_inc_version_list='undef' d_index='undef' d_inetaton='define' d_inetntop='define' d_inetpton='define' d_int64_t='define' d_ip_mreq='define' d_ip_mreq_source='define' d_ipv6_mreq='define' d_ipv6_mreq_source='undef' d_isascii='define' d_isblank='define' d_isfinite='undef' d_isinf='undef' d_isnan='define' d_isnanl='define' d_killpg='define' d_lchown='define' d_ldbl_dig='define' d_libm_lib_version='undef' d_libname_unique='undef' d_link='define' d_localtime64='undef' d_localtime_r='undef' d_localtime_r_needs_tzset='undef' d_locconv='define' d_lockf='define' d_longdbl='define' d_longlong='define' d_lseekproto='define' d_lstat='define' d_madvise='define' d_malloc_good_size='undef' d_malloc_size='undef' d_mblen='define' d_mbstowcs='define' d_mbtowc='define' d_memchr='define' d_memcmp='define' d_memcpy='define' d_memmove='define' d_memset='define' d_mkdir='define' d_mkdtemp='define' d_mkfifo='define' d_mkstemp='define' d_mkstemps='define' d_mktime64='undef' d_mktime='define' d_mmap='define' d_modfl='define' d_modfl_pow32_bug='undef' d_modflproto='define' d_mprotect='define' d_msg='define' d_msg_ctrunc='define' d_msg_dontroute='define' d_msg_oob='define' d_msg_peek='define' d_msg_proxy='undef' d_msgctl='define' d_msgget='define' d_msghdr_s='define' d_msgrcv='define' d_msgsnd='define' d_msync='define' d_munmap='define' d_mymalloc='undef' d_ndbm='define' d_ndbm_h_uses_prototypes='define' d_nice='define' d_nl_langinfo='define' d_nv_preserves_uv='define' d_nv_zero_is_allbits_zero='define' d_off64_t='define' d_old_pthread_create_joinable='undef' d_oldpthreads='undef' d_oldsock='undef' d_open3='define' d_pathconf='define' d_pause='define' d_perl_otherlibdirs='undef' d_phostname='undef' d_pipe='define' d_poll='define' d_portable='define' d_prctl='undef' d_prctl_set_name='undef' d_printf_format_null='define' d_procselfexe='define' d_pseudofork='undef' d_pthread_atfork='define' d_pthread_attr_setscope='define' d_pthread_yield='undef' d_pwage='define' d_pwchange='undef' d_pwclass='undef' d_pwcomment='define' d_pwexpire='undef' d_pwgecos='define' d_pwpasswd='define' d_pwquota='undef' d_qgcvt='define' d_quad='define' d_random_r='undef' d_readdir64_r='undef' d_readdir='define' d_readdir_r='undef' d_readlink='define' d_readv='define' d_recvmsg='define' d_rename='define' d_rewinddir='define' d_rmdir='define' d_safebcpy='undef' d_safemcpy='undef' d_sanemcmp='define' d_sbrkproto='define' d_scalbnl='define' d_sched_yield='define' d_scm_rights='define' d_seekdir='define' d_select='define' d_sem='define' d_semctl='define' d_semctl_semid_ds='define' d_semctl_semun='define' d_semget='define' d_semop='define' d_sendmsg='define' d_setegid='define' d_seteuid='define' d_setgrent='define' d_setgrent_r='undef' d_setgrps='define' d_sethent='define' d_sethostent_r='undef' d_setitimer='define' d_setlinebuf='define' d_setlocale='define' d_setlocale_r='undef' d_setnent='define' d_setnetent_r='undef' d_setpent='define' d_setpgid='define' d_setpgrp2='undef' d_setpgrp='define' d_setprior='define' d_setproctitle='undef' d_setprotoent_r='undef' d_setpwent='define' d_setpwent_r='undef' d_setregid='define' d_setresgid='undef' d_setresuid='undef' d_setreuid='define' d_setrgid='undef' d_setruid='undef' d_setsent='define' d_setservent_r='undef' d_setsid='define' d_setvbuf='define' d_shm='define' d_shmat='define' d_shmatprototype='define' d_shmctl='define' d_shmdt='define' d_shmget='define' d_sigaction='define' d_signbit='define' d_sigprocmask='define' d_sigsetjmp='define' d_sin6_scope_id='define' d_sitearch='define' d_snprintf='define' d_sockaddr_in6='define' d_sockaddr_sa_len='undef' d_sockatmark='define' d_sockatmarkproto='define' d_socket='define' d_socklen_t='define' d_sockpair='define' d_socks5_init='undef' d_sprintf_returns_strlen='define' d_sqrtl='define' d_srand48_r='undef' d_srandom_r='undef' d_sresgproto='undef' d_sresuproto='undef' d_statblks='define' d_statfs_f_flags='undef' d_statfs_s='define' d_static_inline='define' d_statvfs='define' d_stdio_cnt_lval='define' d_stdio_ptr_lval='define' d_stdio_ptr_lval_nochange_cnt='define' d_stdio_ptr_lval_sets_cnt='undef' d_stdio_stream_array='define' d_stdiobase='define' d_stdstdio='define' d_strchr='define' d_strcoll='define' d_strctcpy='define' d_strerrm='strerror(e)' d_strerror='define' d_strerror_r='undef' d_strftime='define' d_strlcat='define' d_strlcpy='define' d_strtod='define' d_strtol='define' d_strtold='define' d_strtoll='define' d_strtoq='undef' d_strtoul='define' d_strtoull='define' d_strtouq='undef' d_strxfrm='define' d_suidsafe='define' d_symlink='define' d_syscall='define' d_syscallproto='undef' d_sysconf='define' d_sysernlst='' d_syserrlst='define' d_system='define' d_tcgetpgrp='define' d_tcsetpgrp='define' d_telldir='define' d_telldirproto='define' d_time='define' d_timegm='undef' d_times='define' d_tm_tm_gmtoff='undef' d_tm_tm_zone='undef' d_tmpnam_r='undef' d_truncate='define' d_ttyname_r='undef' d_tzname='define' d_u32align='undef' d_ualarm='define' d_umask='define' d_uname='define' d_union_semun='undef' d_unordered='define' d_unsetenv='define' d_usleep='define' d_usleepproto='define' d_ustat='define' d_vendorarch='undef' d_vendorbin='undef' d_vendorlib='undef' d_vendorscript='undef' d_vfork='undef' d_void_closedir='undef' d_voidsig='define' d_voidtty='' d_volatile='define' d_vprintf='define' d_vsnprintf='define' d_wait4='define' d_waitpid='define' d_wcstombs='define' d_wctomb='define' d_writev='define' d_xenix='undef' date='date' db_hashtype='u_int32_t' db_prefixtype='size_t' db_version_major='' db_version_minor='' db_version_patch='' direntrytype='struct dirent' dlext='so' dlsrc='dl_dlopen.xs' doublesize='8' drand01='Perl_drand48()' drand48_r_proto='0' dtrace='' dynamic_ext='arybase attributes B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/Peek Devel/PPPort Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util Math/BigInt/FastCalc MIME/Base64 mro NDBM_File ODBM_File Opcode PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog threads threads/shared Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate Unicode/Normalize XS/APItest XS/Typemap' eagain='EAGAIN' ebcdic='undef' echo='echo' egrep='egrep' emacs='' endgrent_r_proto='0' endhostent_r_proto='0' endnetent_r_proto='0' endprotoent_r_proto='0' endpwent_r_proto='0' endservent_r_proto='0' eunicefix=':' exe_ext='' expr='expr' extensions='arybase attributes B Compress/Raw/Bzip2 Compress/Raw/Zlib Cwd Data/Dumper Devel/Peek Devel/PPPort Digest/MD5 Digest/SHA Encode Fcntl File/DosGlob File/Glob Filter/Util/Call GDBM_File Hash/Util Hash/Util/FieldHash I18N/Langinfo IO IPC/SysV List/Util Math/BigInt/FastCalc MIME/Base64 mro NDBM_File ODBM_File Opcode PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via POSIX re SDBM_File Socket Storable Sys/Hostname Sys/Syslog threads threads/shared Tie/Hash/NamedCapture Time/HiRes Time/Piece Unicode/Collate Unicode/Normalize XS/APItest XS/Typemap Archive/Tar Attribute/Handlers autodie AutoLoader autouse B/Debug base bignum Carp CGI Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Devel/SelfStubber Digest Dumpvalue encoding/warnings Env Errno experimental Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags if IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP lib libnet Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/Build Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata Net/Ping NEXT Package/Constants Params/Check parent Parse/CPAN/Meta Perl/OSType perlfaq PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage podlators Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local version XSLoader' extern_C='extern' extras='' fflushNULL='define' fflushall='undef' find='' firstmakefile='makefile' flex='' found_libucb='2' fpossize='8' fpostype='fpos_t' freetype='void' from=':' full_ar='/usr/bin/ar' full_csh='/usr/bin/csh' full_sed='/usr/bin/sed' gccansipedantic='' gccosandvers='' gccversion='4.5.2' getgrent_r_proto='0' getgrgid_r_proto='0' getgrnam_r_proto='0' gethostbyaddr_r_proto='0' gethostbyname_r_proto='0' gethostent_r_proto='0' getlogin_r_proto='0' getnetbyaddr_r_proto='0' getnetbyname_r_proto='0' getnetent_r_proto='0' getprotobyname_r_proto='0' getprotobynumber_r_proto='0' getprotoent_r_proto='0' getpwent_r_proto='0' getpwnam_r_proto='0' getpwuid_r_proto='0' getservbyname_r_proto='0' getservbyport_r_proto='0' getservent_r_proto='0' getspnam_r_proto='0' gidformat='"lu"' gidsign='1' gidsize='4' gidtype='gid_t' glibpth='/usr/shlib /usr/lib /usr/lib/386 /lib/386 /usr/ccs/lib /usr/local/lib' gmake='gmake' gmtime_r_proto='0' gnulibc_version='' grep='grep' groupcat='cat /etc/group' groupstype='gid_t' gzip='gzip' h_fcntl='true' h_sysfile='false' hint='recommended' hostcat='cat /etc/hosts' hostgenerate='' hostosname='' hostperl='' html1dir=' ' html1direxp='' html3dir=' ' html3direxp='' i16size='2' i16type='short' i32size='4' i32type='long' i64size='8' i64type='long long' i8size='1' i8type='signed char' i_arpainet='define' i_assert='define' i_bsdioctl='' i_crypt='define' i_db='undef' i_dbm='undef' i_dirent='define' i_dlfcn='define' i_fcntl='define' i_float='define' i_fp='undef' i_fp_class='undef' i_gdbm='define' i_gdbm_ndbm='undef' i_gdbmndbm='undef' i_grp='define' i_ieeefp='define' i_inttypes='define' i_langinfo='define' i_libutil='undef' i_limits='define' i_locale='define' i_machcthr='undef' i_malloc='define' i_mallocmalloc='undef' i_math='define' i_memory='undef' i_mntent='undef' i_ndbm='define' i_netdb='define' i_neterrno='undef' i_netinettcp='define' i_niin='define' i_poll='define' i_prot='undef' i_pthread='define' i_pwd='define' i_rpcsvcdbm='define' i_sgtty='undef' i_shadow='define' i_socks='undef' i_stdarg='define' i_stdbool='define' i_stddef='define' i_stdlib='define' i_string='define' i_sunmath='define' i_sysaccess='undef' i_sysdir='undef' i_sysfile='undef' i_sysfilio='define' i_sysin='undef' i_sysioctl='define' i_syslog='define' i_sysmman='define' i_sysmode='define' i_sysmount='define' i_sysndir='undef' i_sysparam='define' i_syspoll='define' i_sysresrc='define' i_syssecrt='undef' i_sysselct='define' i_syssockio='define' i_sysstat='define' i_sysstatfs='define' i_sysstatvfs='define' i_systime='define' i_systimek='undef' i_systimes='define' i_systypes='define' i_sysuio='define' i_sysun='define' i_sysutsname='define' i_sysvfs='define' i_syswait='define' i_termio='undef' i_termios='define' i_time='undef' i_unistd='define' i_ustat='define' i_utime='define' i_values='define' i_varargs='undef' i_varhdr='stdarg.h' i_vfork='undef' ignore_versioned_solibs='y' inc_version_list=' ' inc_version_list_init='0' incpath='' incpth='/usr/local/include /usr/gcc/4.5/include /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/include /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/include-fixed /usr/include' inews='' initialinstalllocation='/usr/local/bin' installarchlib='/usr/local/lib/perl5/5.20.0/i86pc-solaris' installbin='/usr/local/bin' installhtml1dir='' installhtml3dir='' installman1dir='/usr/local/share/man/man1' installman3dir='/usr/local/share/man/man3' installprefix='/usr/local' installprefixexp='/usr/local' installprivlib='/usr/local/lib/perl5/5.20.0' installscript='/usr/local/bin' installsitearch='/usr/local/lib/perl5/site_perl/5.20.0/i86pc-solaris' installsitebin='/usr/local/bin' installsitehtml1dir='' installsitehtml3dir='' installsitelib='/usr/local/lib/perl5/site_perl/5.20.0' installsiteman1dir='/usr/local/share/man/man1' installsiteman3dir='/usr/local/share/man/man3' installsitescript='/usr/local/bin' installstyle='lib/perl5' installusrbinperl='define' installvendorarch='' installvendorbin='' installvendorhtml1dir='' installvendorhtml3dir='' installvendorlib='' installvendorman1dir='' installvendorman3dir='' installvendorscript='' intsize='4' issymlink='test -h' ivdformat='"ld"' ivsize='4' ivtype='long' known_extensions='Archive/Tar arybase Attribute/Handlers attributes autodie AutoLoader autouse B B/Debug base bignum Carp CGI Compress/Raw/Bzip2 Compress/Raw/Zlib Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Cwd Data/Dumper DB_File Devel/Peek Devel/PPPort Devel/SelfStubber Digest Digest/MD5 Digest/SHA Dumpvalue Encode encoding/warnings Env Errno experimental Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS Fcntl File/DosGlob File/Fetch File/Find File/Glob File/Path File/Temp FileCache Filter/Simple Filter/Util/Call GDBM_File Getopt/Long Hash/Util Hash/Util/FieldHash HTTP/Tiny I18N/Collate I18N/Langinfo I18N/LangTags if IO IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 IPC/SysV JSON/PP lib libnet List/Util Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigInt/FastCalc Math/BigRat Math/Complex Memoize MIME/Base64 Module/Build Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata mro NDBM_File Net/Ping NEXT ODBM_File Opcode Package/Constants Params/Check parent Parse/CPAN/Meta Perl/OSType perlfaq PerlIO/encoding PerlIO/mmap PerlIO/scalar PerlIO/via PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage podlators POSIX re Safe SDBM_File Search/Dict SelfLoader Socket Storable Sys/Hostname Sys/Syslog Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore threads threads/shared Tie/File Tie/Hash/NamedCapture Tie/Memoize Tie/RefHash Time/HiRes Time/Local Time/Piece Unicode/Collate Unicode/Normalize version VMS/DCLsym VMS/Filespec VMS/Stdio Win32 Win32API/File Win32CORE XS/APItest XS/Typemap XSLoader ' ksh='' ld='gcc' ld_can_script='undef' lddlflags='-shared -L/usr/local/lib -L/usr/gnu/lib -fstack-protector' ldflags=' -fstack-protector -L/usr/local/lib -L/usr/gnu/lib ' ldflags_uselargefiles='' ldlibpthname='LD_LIBRARY_PATH' less='less' lib_ext='.a' libc='/lib/libc.so' libperl='libperl.so' libpth='/usr/local/lib /usr/gcc/4.5/lib /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/include-fixed /usr/lib /usr/gnu/lib /usr/ccs/lib' libs='-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc' libsdirs=' /usr/lib /usr/local/lib' libsfiles=' libsocket.so libnsl.so libgdbm.so libdb.so libdl.so libm.so libc.so' libsfound=' /usr/lib/libsocket.so /usr/lib/libnsl.so /usr/lib/libgdbm.so /usr/local/lib/libdb.so /usr/lib/libdl.so /usr/lib/libm.so /usr/lib/libc.so' libspath=' /usr/local/lib /usr/gcc/4.5/lib /usr/gcc/4.5/lib/gcc/i386-pc-solaris2.11/4.5.2/include-fixed /usr/lib /usr/gnu/lib /usr/ccs/lib' libswanted='socket bind inet nsl nm ndbm gdbm dbm db dl sun m util c cposix posix bsd BSD ' libswanted_uselargefiles='' line='' lint='' lkflags='' ln='ln' lns='/usr/bin/ln -s' localtime_r_proto='0' locincpth='/usr/local/include /opt/local/include /usr/gnu/include /opt/gnu/include /usr/GNU/include /opt/GNU/include' loclibpth='/usr/local/lib /opt/local/lib /usr/gnu/lib /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib' longdblsize='12' longlongsize='8' longsize='4' lp='' lpr='' ls='ls' lseeksize='8' lseektype='off_t' mad='undef' madlyh='' madlyobj='' madlysrc='' mail='' mailx='' make='make' make_set_make='#' mallocobj='' mallocsrc='' malloctype='void *' man1dir='/usr/local/share/man/man1' man1direxp='/usr/local/share/man/man1' man1ext='1' man3dir='/usr/local/share/man/man3' man3direxp='/usr/local/share/man/man3' man3ext='3' mips_type='' mistrustnm='run' mkdir='mkdir' mmaptype='void *' modetype='mode_t' more='more' multiarch='undef' mv='' myarchname='i86pc-solaris' mydomain='.communilink.net' myhostname='zeus' myuname='sunos zeus 5.11 11.2 i86pc i386 i86pc ' n='' need_va_copy='undef' netdb_hlen_type='size_t' netdb_host_type='const void *' netdb_name_type='const char *' netdb_net_type='in_addr_t' nm='nm' nm_opt='-p' nm_so_opt='' nonxs_ext='Archive/Tar Attribute/Handlers autodie AutoLoader autouse B/Debug base bignum Carp CGI Config/Perl/V constant CPAN CPAN/Meta CPAN/Meta/Requirements CPAN/Meta/YAML Devel/SelfStubber Digest Dumpvalue encoding/warnings Env Errno experimental Exporter ExtUtils/CBuilder ExtUtils/Command ExtUtils/Constant ExtUtils/Install ExtUtils/MakeMaker ExtUtils/Manifest ExtUtils/Miniperl ExtUtils/ParseXS File/Fetch File/Find File/Path File/Temp FileCache Filter/Simple Getopt/Long HTTP/Tiny I18N/Collate I18N/LangTags if IO/Compress IO/Socket/IP IO/Zlib IPC/Cmd IPC/Open3 JSON/PP lib libnet Locale/Codes Locale/Maketext Locale/Maketext/Simple Math/BigInt Math/BigRat Math/Complex Memoize Module/Build Module/CoreList Module/Load Module/Load/Conditional Module/Loaded Module/Metadata Net/Ping NEXT Package/Constants Params/Check parent Parse/CPAN/Meta Perl/OSType perlfaq PerlIO/via/QuotedPrint Pod/Checker Pod/Escapes Pod/Functions Pod/Html Pod/Parser Pod/Perldoc Pod/Simple Pod/Usage podlators Safe Search/Dict SelfLoader Term/ANSIColor Term/Cap Term/Complete Term/ReadLine Test Test/Harness Test/Simple Text/Abbrev Text/Balanced Text/ParseWords Text/Tabs Thread/Queue Thread/Semaphore Tie/File Tie/Memoize Tie/RefHash Time/Local version XSLoader' nroff='nroff' nvEUformat='"E"' nvFUformat='"F"' nvGUformat='"G"' nv_overflows_integers_at='256.0*256.0*256.0*256.0*256.0*256.0*2.0*2.0*2.0*2.0*2.0' nv_preserves_uv_bits='32' nveformat='"e"' nvfformat='"f"' nvgformat='"g"' nvsize='8' nvtype='double' o_nonblock='O_NONBLOCK' obj_ext='.o' old_pthread_create_joinable='' optimize='-O' orderlib='false' osname='solaris' osvers='2.11' otherlibdirs=' ' package='perl5' pager='/usr/bin/less -R' passcat='cat /etc/passwd' patchlevel='20' path_sep=':' perl5='/usr/local/bin/perl' perl='perl' perl_patchlevel='' perl_static_inline='static __inline__' perladmin='chris@zeus.communilink.net' perllibs='-lsocket -lnsl -ldl -lm -lc' perlpath='/usr/local/bin/perl' pg='pg' phostname='hostname' pidtype='pid_t' plibpth='' pmake='' pr='' prefix='/usr/local' prefixexp='/usr/local' privlib='/usr/local/lib/perl5/5.20.0' privlibexp='/usr/local/lib/perl5/5.20.0' procselfexe='"/proc/self/path/a.out"' prototype='define' ptrsize='4' quadkind='3' quadtype='long long' randbits='48' randfunc='Perl_drand48' random_r_proto='0' randseedtype='U32' ranlib=':' rd_nodata='-1' readdir64_r_proto='0' readdir_r_proto='0' revision='5' rm='rm' rm_try='/usr/bin/rm -f try try a.out .out try.[cho] try..o core core.try* try.core*' rmail='' run='' runnm='true' sGMTIME_max='2147483647' sGMTIME_min='-2147483648' sLOCALTIME_max='2147483647' sLOCALTIME_min='-2147483648' sPRIEUldbl='"LE"' sPRIFUldbl='"LF"' sPRIGUldbl='"LG"' sPRIXU64='"llX"' sPRId64='"lld"' sPRIeldbl='"Le"' sPRIfldbl='"Lf"' sPRIgldbl='"Lg"' sPRIi64='"lli"' sPRIo64='"llo"' sPRIu64='"llu"' sPRIx64='"llx"' sSCNfldbl='"Lf"' sched_yield='sched_yield()' scriptdir='/usr/local/bin' scriptdirexp='/usr/local/bin' sed='sed' seedfunc='Perl_drand48_init' selectminbits='32' selecttype='fd_set *' sendmail='' setgrent_r_proto='0' sethostent_r_proto='0' setlocale_r_proto='0' setnetent_r_proto='0' setprotoent_r_proto='0' setpwent_r_proto='0' setservent_r_proto='0' sh='/bin/sh' shar='' sharpbang='#!' shmattype='void *' shortsize='2' shrpenv='' shsharp='true' sig_count='73' sig_name='ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM USR1 USR2 CHLD PWR WINCH URG IO STOP TSTP CONT TTIN TTOU VTALRM PROF XCPU XFSZ WAITING LWP FREEZE THAW CANCEL LOST XRES JVM1 JVM2 RTMIN NUM42 NUM43 NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58 NUM59 NUM60 NUM61 NUM62 NUM63 NUM64 NUM65 NUM66 NUM67 NUM68 NUM69 NUM70 NUM71 RTMAX IOT CLD POLL ' sig_name_init='"ZERO", "HUP", "INT", "QUIT", "ILL", "TRAP", "ABRT", "EMT", "FPE", "KILL", "BUS", "SEGV", "SYS", "PIPE", "ALRM", "TERM", "USR1", "USR2", "CHLD", "PWR", "WINCH", "URG", "IO", "STOP", "TSTP", "CONT", "TTIN", "TTOU", "VTALRM", "PROF", "XCPU", "XFSZ", "WAITING", "LWP", "FREEZE", "THAW", "CANCEL", "LOST", "XRES", "JVM1", "JVM2", "RTMIN", "NUM42", "NUM43", "NUM44", "NUM45", "NUM46", "NUM47", "NUM48", "NUM49", "NUM50", "NUM51", "NUM52", "NUM53", "NUM54", "NUM55", "NUM56", "NUM57", "NUM58", "NUM59", "NUM60", "NUM61", "NUM62", "NUM63", "NUM64", "NUM65", "NUM66", "NUM67", "NUM68", "NUM69", "NUM70", "NUM71", "RTMAX", "IOT", "CLD", "POLL", 0' sig_num='0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 6 18 22 ' sig_num_init='0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 6, 18, 22, 0' sig_size='76' signal_t='void' sitearch='/usr/local/lib/perl5/site_perl/5.20.0/i86pc-solaris' sitearchexp='/usr/local/lib/perl5/site_perl/5.20.0/i86pc-solaris' sitebin='/usr/local/bin' sitebinexp='/usr/local/bin' sitehtml1dir='' sitehtml1direxp='' sitehtml3dir='' sitehtml3direxp='' sitelib='/usr/local/lib/perl5/site_perl/5.20.0' sitelib_stem='/usr/local/lib/perl5/site_perl' sitelibexp='/usr/local/lib/perl5/site_perl/5.20.0' siteman1dir='/usr/local/share/man/man1' siteman1direxp='/usr/local/share/man/man1' siteman3dir='/usr/local/share/man/man3' siteman3direxp='/usr/local/share/man/man3' siteprefix='/usr/local' siteprefixexp='/usr/local' sitescript='/usr/local/bin' sitescriptexp='/usr/local/bin' sizesize='4' sizetype='size_t' sleep='' smail='' so='so' sockethdr='' socketlib='' socksizetype='socklen_t' sort='sort' spackage='Perl5' spitshell='cat' srand48_r_proto='0' srandom_r_proto='0' src='.' ssizetype='ssize_t' st_ino_sign='1' st_ino_size='8' startperl='#!/usr/local/bin/perl' startsh='#!/bin/sh' static_ext=' ' stdchar='unsigned char' stdio_base='((fp)->_base)' stdio_bufsiz='((fp)->_cnt + (fp)->_ptr - (fp)->_base)' stdio_cnt='((fp)->_cnt)' stdio_filbuf='' stdio_ptr='((fp)->_ptr)' stdio_stream_array='__iob' strerror_r_proto='0' strings='/usr/include/string.h' submit='' subversion='0' sysman='/usr/share/man/man1' sysroot='' tail='' tar='' targetarch='' targetdir='' targetenv='' targethost='' targetmkdir='' targetport='' targetsh='/bin/sh' tbl='' tee='' test='test' timeincl='/usr/include/sys/time.h ' timetype='time_t' tmpnam_r_proto='0' to=':' touch='touch' tr='tr' trnl='\n' troff='' ttyname_r_proto='0' u16size='2' u16type='unsigned short' u32size='4' u32type='unsigned long' u64size='8' u64type='unsigned long long' u8size='1' u8type='unsigned char' uidformat='"lu"' uidsign='1' uidsize='4' uidtype='uid_t' uname='uname' uniq='uniq' uquadtype='unsigned long long' use5005threads='undef' use64bitall='undef' use64bitint='undef' usecrosscompile='undef' usedevel='undef' usedl='define' usedtrace='undef' usefaststdio='undef' useithreads='undef' usekernprocpathname='undef' uselargefiles='define' uselongdouble='undef' usemallocwrap='define' usemorebits='undef' usemultiplicity='undef' usemymalloc='n' usenm='true' usensgetexecutablepath='undef' useopcode='true' useperlio='define' useposix='true' usereentrant='undef' userelocatableinc='undef' useshrplib='true' usesitecustomize='undef' usesocks='undef' usethreads='undef' usevendorprefix='undef' useversionedarchname='undef' usevfork='false' usrinc='/usr/include' uuname='' uvXUformat='"lX"' uvoformat='"lo"' uvsize='4' uvtype='unsigned long' uvuformat='"lu"' uvxformat='"lx"' vaproto='define' vendorarch='' vendorarchexp='' vendorbin='' vendorbinexp='' vendorhtml1dir=' ' vendorhtml1direxp='' vendorhtml3dir=' ' vendorhtml3direxp='' vendorlib='' vendorlib_stem='' vendorlibexp='' vendorman1dir=' ' vendorman1direxp='' vendorman3dir=' ' vendorman3direxp='' vendorprefix='' vendorprefixexp='' vendorscript='' vendorscriptexp='' version='5.20.0' version_patchlevel_string='version 20 subversion 0' versiononly='undef' vi='' xlibpth='/usr/lib/386 /lib/386' yacc='yacc' yaccflags='' zcat='' zip='zip' !END! my $i = ord(4); foreach my $c (3,2,1) { $i <<= 8; $i |= ord($c); } our $byteorder = join('', unpack('aaaa', pack('L!', $i))); s/(byteorder=)(['"]).*?\2/$1$2$Config::byteorder$2/m; my $config_sh_len = length $_; our $Config_SH_expanded = "\n$_" . << 'EOVIRTUAL'; ccflags_nolargefiles='-fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -I/usr/gnu/include -DPERL_USE_SAFE_PUTENV' ldflags_nolargefiles=' -fstack-protector -L/usr/local/lib -L/usr/gnu/lib ' libs_nolargefiles='-lsocket -lnsl -lgdbm -ldb -ldl -lm -lc' libswanted_nolargefiles='socket bind inet nsl nm ndbm gdbm dbm db dl sun m util c cposix posix bsd BSD ' EOVIRTUAL eval { # do not have hairy conniptions if this isnt available require 'Config_git.pl'; $Config_SH_expanded .= $Config::Git_Data; 1; } or warn "Warning: failed to load Config_git.pl, something strange about this perl...\n"; # Search for it in the big string sub fetch_string { my($self, $key) = @_; return undef unless $Config_SH_expanded =~ /\n$key=\'(.*?)\'\n/s; # So we can say "if $Config{'foo'}". $self->{$key} = $1 eq 'undef' ? undef : $1; } my $prevpos = 0; sub FIRSTKEY { $prevpos = 0; substr($Config_SH_expanded, 1, index($Config_SH_expanded, '=') - 1 ); } sub NEXTKEY { my $pos = index($Config_SH_expanded, qq('\n), $prevpos) + 2; my $len = index($Config_SH_expanded, "=", $pos) - $pos; $prevpos = $pos; $len > 0 ? substr($Config_SH_expanded, $pos, $len) : undef; } sub EXISTS { return 1 if exists($_[0]->{$_[1]}); return(index($Config_SH_expanded, "\n$_[1]='") != -1 ); } sub STORE { die "\%Config::Config is read-only\n" } *DELETE = *CLEAR = \*STORE; # Typeglob aliasing uses less space sub config_sh { substr $Config_SH_expanded, 1, $config_sh_len; } sub config_re { my $re = shift; return map { chomp; $_ } grep eval{ /^(?:$re)=/ }, split /^/, $Config_SH_expanded; } sub config_vars { # implements -V:cfgvar option (see perlrun -V:) foreach (@_) { # find optional leading, trailing colons; and query-spec my ($notag,$qry,$lncont) = m/^(:)?(.*?)(:)?$/; # flags fore and aft, # map colon-flags to print decorations my $prfx = $notag ? '': "$qry="; # tag-prefix for print my $lnend = $lncont ? ' ' : ";\n"; # line ending for print # all config-vars are by definition \w only, any \W means regex if ($qry =~ /\W/) { my @matches = config_re($qry); print map "$_$lnend", @matches ? @matches : "$qry: not found" if !$notag; print map { s/\w+=//; "$_$lnend" } @matches ? @matches : "$qry: not found" if $notag; } else { my $v = (exists $Config::Config{$qry}) ? $Config::Config{$qry} : 'UNKNOWN'; $v = 'undef' unless defined $v; print "${prfx}'${v}'$lnend"; } } } # Called by the real AUTOLOAD sub launcher { undef &AUTOLOAD; goto \&$Config::AUTOLOAD; } 1; FILEcd689485/Cwd.pmG#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/Cwd.pm" package Cwd; #line 169 use strict; use Exporter; use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); $VERSION = '3.47'; my $xs_version = $VERSION; $VERSION =~ tr/_//; @ISA = qw/ Exporter /; @EXPORT = qw(cwd getcwd fastcwd fastgetcwd); push @EXPORT, qw(getdcwd) if $^O eq 'MSWin32'; @EXPORT_OK = qw(chdir abs_path fast_abs_path realpath fast_realpath); # sys_cwd may keep the builtin command # All the functionality of this module may provided by builtins, # there is no sense to process the rest of the file. # The best choice may be to have this in BEGIN, but how to return from BEGIN? if ($^O eq 'os2') { local $^W = 0; *cwd = defined &sys_cwd ? \&sys_cwd : \&_os2_cwd; *getcwd = \&cwd; *fastgetcwd = \&cwd; *fastcwd = \&cwd; *fast_abs_path = \&sys_abspath if defined &sys_abspath; *abs_path = \&fast_abs_path; *realpath = \&fast_abs_path; *fast_realpath = \&fast_abs_path; return 1; } # Need to look up the feature settings on VMS. The preferred way is to use the # VMS::Feature module, but that may not be available to dual life modules. my $use_vms_feature; BEGIN { if ($^O eq 'VMS') { if (eval { local $SIG{__DIE__}; require VMS::Feature; }) { $use_vms_feature = 1; } } } # Need to look up the UNIX report mode. This may become a dynamic mode # in the future. sub _vms_unix_rpt { my $unix_rpt; if ($use_vms_feature) { $unix_rpt = VMS::Feature::current("filename_unix_report"); } else { my $env_unix_rpt = $ENV{'DECC$FILENAME_UNIX_REPORT'} || ''; $unix_rpt = $env_unix_rpt =~ /^[ET1]/i; } return $unix_rpt; } # Need to look up the EFS character set mode. This may become a dynamic # mode in the future. sub _vms_efs { my $efs; if ($use_vms_feature) { $efs = VMS::Feature::current("efs_charset"); } else { my $env_efs = $ENV{'DECC$EFS_CHARSET'} || ''; $efs = $env_efs =~ /^[ET1]/i; } return $efs; } # If loading the XS stuff doesn't work, we can fall back to pure perl unless (defined &getcwd) { eval { if ( $] >= 5.006 ) { require XSLoader; XSLoader::load( __PACKAGE__, $xs_version); } else { require DynaLoader; push @ISA, 'DynaLoader'; __PACKAGE__->bootstrap( $xs_version ); } }; } # Big nasty table of function aliases my %METHOD_MAP = ( VMS => { cwd => '_vms_cwd', getcwd => '_vms_cwd', fastcwd => '_vms_cwd', fastgetcwd => '_vms_cwd', abs_path => '_vms_abs_path', fast_abs_path => '_vms_abs_path', }, MSWin32 => { # We assume that &_NT_cwd is defined as an XSUB or in the core. cwd => '_NT_cwd', getcwd => '_NT_cwd', fastcwd => '_NT_cwd', fastgetcwd => '_NT_cwd', abs_path => 'fast_abs_path', realpath => 'fast_abs_path', }, dos => { cwd => '_dos_cwd', getcwd => '_dos_cwd', fastgetcwd => '_dos_cwd', fastcwd => '_dos_cwd', abs_path => 'fast_abs_path', }, # QNX4. QNX6 has a $os of 'nto'. qnx => { cwd => '_qnx_cwd', getcwd => '_qnx_cwd', fastgetcwd => '_qnx_cwd', fastcwd => '_qnx_cwd', abs_path => '_qnx_abs_path', fast_abs_path => '_qnx_abs_path', }, cygwin => { getcwd => 'cwd', fastgetcwd => 'cwd', fastcwd => 'cwd', abs_path => 'fast_abs_path', realpath => 'fast_abs_path', }, epoc => { cwd => '_epoc_cwd', getcwd => '_epoc_cwd', fastgetcwd => '_epoc_cwd', fastcwd => '_epoc_cwd', abs_path => 'fast_abs_path', }, MacOS => { getcwd => 'cwd', fastgetcwd => 'cwd', fastcwd => 'cwd', abs_path => 'fast_abs_path', }, ); $METHOD_MAP{NT} = $METHOD_MAP{MSWin32}; # Find the pwd command in the expected locations. We assume these # are safe. This prevents _backtick_pwd() consulting $ENV{PATH} # so everything works under taint mode. my $pwd_cmd; foreach my $try ('/bin/pwd', '/usr/bin/pwd', '/QOpenSys/bin/pwd', # OS/400 PASE. ) { if( -x $try ) { $pwd_cmd = $try; last; } } # Android has a built-in pwd. Using $pwd_cmd will DTRT if # this perl was compiled with -Dd_useshellcmds, which is the # default for Android, but the block below is needed for the # miniperl running on the host when cross-compiling, and # potentially for native builds with -Ud_useshellcmds. if ($^O =~ /android/) { # If targetsh is executable, then we're either a full # perl, or a miniperl for a native build. if (-x $Config::Config{targetsh}) { $pwd_cmd = "$Config::Config{targetsh} -c pwd" } else { $pwd_cmd = "$Config::Config{sh} -c pwd" } } my $found_pwd_cmd = defined($pwd_cmd); unless ($pwd_cmd) { # Isn't this wrong? _backtick_pwd() will fail if someone has # pwd in their path but it is not /bin/pwd or /usr/bin/pwd? # See [perl #16774]. --jhi $pwd_cmd = 'pwd'; } # Lazy-load Carp sub _carp { require Carp; Carp::carp(@_) } sub _croak { require Carp; Carp::croak(@_) } # The 'natural and safe form' for UNIX (pwd may be setuid root) sub _backtick_pwd { # Localize %ENV entries in a way that won't create new hash keys my @localize = grep exists $ENV{$_}, qw(PATH IFS CDPATH ENV BASH_ENV); local @ENV{@localize}; my $cwd = `$pwd_cmd`; # Belt-and-suspenders in case someone said "undef $/". local $/ = "\n"; # `pwd` may fail e.g. if the disk is full chomp($cwd) if defined $cwd; $cwd; } # Since some ports may predefine cwd internally (e.g., NT) # we take care not to override an existing definition for cwd(). unless ($METHOD_MAP{$^O}{cwd} or defined &cwd) { # The pwd command is not available in some chroot(2)'ed environments my $sep = $Config::Config{path_sep} || ':'; my $os = $^O; # Protect $^O from tainting # Try again to find a pwd, this time searching the whole PATH. if (defined $ENV{PATH} and $os ne 'MSWin32') { # no pwd on Windows my @candidates = split($sep, $ENV{PATH}); while (!$found_pwd_cmd and @candidates) { my $candidate = shift @candidates; $found_pwd_cmd = 1 if -x "$candidate/pwd"; } } # MacOS has some special magic to make `pwd` work. if( $os eq 'MacOS' || $found_pwd_cmd ) { *cwd = \&_backtick_pwd; } else { *cwd = \&getcwd; } } if ($^O eq 'cygwin') { # We need to make sure cwd() is called with no args, because it's # got an arg-less prototype and will die if args are present. local $^W = 0; my $orig_cwd = \&cwd; *cwd = sub { &$orig_cwd() } } # set a reasonable (and very safe) default for fastgetcwd, in case it # isn't redefined later (20001212 rspier) *fastgetcwd = \&cwd; # A non-XS version of getcwd() - also used to bootstrap the perl build # process, when miniperl is running and no XS loading happens. sub _perl_getcwd { abs_path('.'); } # By John Bazik # # Usage: $cwd = &fastcwd; # # This is a faster version of getcwd. It's also more dangerous because # you might chdir out of a directory that you can't chdir back into. sub fastcwd_ { my($odev, $oino, $cdev, $cino, $tdev, $tino); my(@path, $path); local(*DIR); my($orig_cdev, $orig_cino) = stat('.'); ($cdev, $cino) = ($orig_cdev, $orig_cino); for (;;) { my $direntry; ($odev, $oino) = ($cdev, $cino); CORE::chdir('..') || return undef; ($cdev, $cino) = stat('.'); last if $odev == $cdev && $oino == $cino; opendir(DIR, '.') || return undef; for (;;) { $direntry = readdir(DIR); last unless defined $direntry; next if $direntry eq '.'; next if $direntry eq '..'; ($tdev, $tino) = lstat($direntry); last unless $tdev != $odev || $tino != $oino; } closedir(DIR); return undef unless defined $direntry; # should never happen unshift(@path, $direntry); } $path = '/' . join('/', @path); if ($^O eq 'apollo') { $path = "/".$path; } # At this point $path may be tainted (if tainting) and chdir would fail. # Untaint it then check that we landed where we started. $path =~ /^(.*)\z/s # untaint && CORE::chdir($1) or return undef; ($cdev, $cino) = stat('.'); die "Unstable directory path, current directory changed unexpectedly" if $cdev != $orig_cdev || $cino != $orig_cino; $path; } if (not defined &fastcwd) { *fastcwd = \&fastcwd_ } # Keeps track of current working directory in PWD environment var # Usage: # use Cwd 'chdir'; # chdir $newdir; my $chdir_init = 0; sub chdir_init { if ($ENV{'PWD'} and $^O ne 'os2' and $^O ne 'dos' and $^O ne 'MSWin32') { my($dd,$di) = stat('.'); my($pd,$pi) = stat($ENV{'PWD'}); if (!defined $dd or !defined $pd or $di != $pi or $dd != $pd) { $ENV{'PWD'} = cwd(); } } else { my $wd = cwd(); $wd = Win32::GetFullPathName($wd) if $^O eq 'MSWin32'; $ENV{'PWD'} = $wd; } # Strip an automounter prefix (where /tmp_mnt/foo/bar == /foo/bar) if ($^O ne 'MSWin32' and $ENV{'PWD'} =~ m|(/[^/]+(/[^/]+/[^/]+))(.*)|s) { my($pd,$pi) = stat($2); my($dd,$di) = stat($1); if (defined $pd and defined $dd and $di == $pi and $dd == $pd) { $ENV{'PWD'}="$2$3"; } } $chdir_init = 1; } sub chdir { my $newdir = @_ ? shift : ''; # allow for no arg (chdir to HOME dir) $newdir =~ s|///*|/|g unless $^O eq 'MSWin32'; chdir_init() unless $chdir_init; my $newpwd; if ($^O eq 'MSWin32') { # get the full path name *before* the chdir() $newpwd = Win32::GetFullPathName($newdir); } return 0 unless CORE::chdir $newdir; if ($^O eq 'VMS') { return $ENV{'PWD'} = $ENV{'DEFAULT'} } elsif ($^O eq 'MacOS') { return $ENV{'PWD'} = cwd(); } elsif ($^O eq 'MSWin32') { $ENV{'PWD'} = $newpwd; return 1; } if (ref $newdir eq 'GLOB') { # in case a file/dir handle is passed in $ENV{'PWD'} = cwd(); } elsif ($newdir =~ m#^/#s) { $ENV{'PWD'} = $newdir; } else { my @curdir = split(m#/#,$ENV{'PWD'}); @curdir = ('') unless @curdir; my $component; foreach $component (split(m#/#, $newdir)) { next if $component eq '.'; pop(@curdir),next if $component eq '..'; push(@curdir,$component); } $ENV{'PWD'} = join('/',@curdir) || '/'; } 1; } sub _perl_abs_path { my $start = @_ ? shift : '.'; my($dotdots, $cwd, @pst, @cst, $dir, @tst); unless (@cst = stat( $start )) { _carp("stat($start): $!"); return ''; } unless (-d _) { # Make sure we can be invoked on plain files, not just directories. # NOTE that this routine assumes that '/' is the only directory separator. my ($dir, $file) = $start =~ m{^(.*)/(.+)$} or return cwd() . '/' . $start; # Can't use "-l _" here, because the previous stat was a stat(), not an lstat(). if (-l $start) { my $link_target = readlink($start); die "Can't resolve link $start: $!" unless defined $link_target; require File::Spec; $link_target = $dir . '/' . $link_target unless File::Spec->file_name_is_absolute($link_target); return abs_path($link_target); } return $dir ? abs_path($dir) . "/$file" : "/$file"; } $cwd = ''; $dotdots = $start; do { $dotdots .= '/..'; @pst = @cst; local *PARENT; unless (opendir(PARENT, $dotdots)) { # probably a permissions issue. Try the native command. require File::Spec; return File::Spec->rel2abs( $start, _backtick_pwd() ); } unless (@cst = stat($dotdots)) { _carp("stat($dotdots): $!"); closedir(PARENT); return ''; } if ($pst[0] == $cst[0] && $pst[1] == $cst[1]) { $dir = undef; } else { do { unless (defined ($dir = readdir(PARENT))) { _carp("readdir($dotdots): $!"); closedir(PARENT); return ''; } $tst[0] = $pst[0]+1 unless (@tst = lstat("$dotdots/$dir")) } while ($dir eq '.' || $dir eq '..' || $tst[0] != $pst[0] || $tst[1] != $pst[1]); } $cwd = (defined $dir ? "$dir" : "" ) . "/$cwd" ; closedir(PARENT); } while (defined $dir); chop($cwd) unless $cwd eq '/'; # drop the trailing / $cwd; } my $Curdir; sub fast_abs_path { local $ENV{PWD} = $ENV{PWD} || ''; # Guard against clobberage my $cwd = getcwd(); require File::Spec; my $path = @_ ? shift : ($Curdir ||= File::Spec->curdir); # Detaint else we'll explode in taint mode. This is safe because # we're not doing anything dangerous with it. ($path) = $path =~ /(.*)/s; ($cwd) = $cwd =~ /(.*)/s; unless (-e $path) { _croak("$path: No such file or directory"); } unless (-d _) { # Make sure we can be invoked on plain files, not just directories. my ($vol, $dir, $file) = File::Spec->splitpath($path); return File::Spec->catfile($cwd, $path) unless length $dir; if (-l $path) { my $link_target = readlink($path); die "Can't resolve link $path: $!" unless defined $link_target; $link_target = File::Spec->catpath($vol, $dir, $link_target) unless File::Spec->file_name_is_absolute($link_target); return fast_abs_path($link_target); } return $dir eq File::Spec->rootdir ? File::Spec->catpath($vol, $dir, $file) : fast_abs_path(File::Spec->catpath($vol, $dir, '')) . '/' . $file; } if (!CORE::chdir($path)) { _croak("Cannot chdir to $path: $!"); } my $realpath = getcwd(); if (! ((-d $cwd) && (CORE::chdir($cwd)))) { _croak("Cannot chdir back to $cwd: $!"); } $realpath; } # added function alias to follow principle of least surprise # based on previous aliasing. --tchrist 27-Jan-00 *fast_realpath = \&fast_abs_path; # --- PORTING SECTION --- # VMS: $ENV{'DEFAULT'} points to default directory at all times # 06-Mar-1996 Charles Bailey bailey@newman.upenn.edu # Note: Use of Cwd::chdir() causes the logical name PWD to be defined # in the process logical name table as the default device and directory # seen by Perl. This may not be the same as the default device # and directory seen by DCL after Perl exits, since the effects # the CRTL chdir() function persist only until Perl exits. sub _vms_cwd { return $ENV{'DEFAULT'}; } sub _vms_abs_path { return $ENV{'DEFAULT'} unless @_; my $path = shift; my $efs = _vms_efs; my $unix_rpt = _vms_unix_rpt; if (defined &VMS::Filespec::vmsrealpath) { my $path_unix = 0; my $path_vms = 0; $path_unix = 1 if ($path =~ m#(?<=\^)/#); $path_unix = 1 if ($path =~ /^\.\.?$/); $path_vms = 1 if ($path =~ m#[\[<\]]#); $path_vms = 1 if ($path =~ /^--?$/); my $unix_mode = $path_unix; if ($efs) { # In case of a tie, the Unix report mode decides. if ($path_vms == $path_unix) { $unix_mode = $unix_rpt; } else { $unix_mode = 0 if $path_vms; } } if ($unix_mode) { # Unix format return VMS::Filespec::unixrealpath($path); } # VMS format my $new_path = VMS::Filespec::vmsrealpath($path); # Perl expects directories to be in directory format $new_path = VMS::Filespec::pathify($new_path) if -d $path; return $new_path; } # Fallback to older algorithm if correct ones are not # available. if (-l $path) { my $link_target = readlink($path); die "Can't resolve link $path: $!" unless defined $link_target; return _vms_abs_path($link_target); } # may need to turn foo.dir into [.foo] my $pathified = VMS::Filespec::pathify($path); $path = $pathified if defined $pathified; return VMS::Filespec::rmsexpand($path); } sub _os2_cwd { $ENV{'PWD'} = `cmd /c cd`; chomp $ENV{'PWD'}; $ENV{'PWD'} =~ s:\\:/:g ; return $ENV{'PWD'}; } sub _win32_cwd_simple { $ENV{'PWD'} = `cd`; chomp $ENV{'PWD'}; $ENV{'PWD'} =~ s:\\:/:g ; return $ENV{'PWD'}; } sub _win32_cwd { # Need to avoid taking any sort of reference to the typeglob or the code in # the optree, so that this tests the runtime state of things, as the # ExtUtils::MakeMaker tests for "miniperl" need to be able to fake things at # runtime by deleting the subroutine. *foo{THING} syntax on a symbol table # lookup avoids needing a string eval, which has been reported to cause # problems (for reasons that we haven't been able to get to the bottom of - # rt.cpan.org #56225) if (*{$DynaLoader::{boot_DynaLoader}}{CODE}) { $ENV{'PWD'} = Win32::GetCwd(); } else { # miniperl chomp($ENV{'PWD'} = `cd`); } $ENV{'PWD'} =~ s:\\:/:g ; return $ENV{'PWD'}; } *_NT_cwd = defined &Win32::GetCwd ? \&_win32_cwd : \&_win32_cwd_simple; sub _dos_cwd { if (!defined &Dos::GetCwd) { $ENV{'PWD'} = `command /c cd`; chomp $ENV{'PWD'}; $ENV{'PWD'} =~ s:\\:/:g ; } else { $ENV{'PWD'} = Dos::GetCwd(); } return $ENV{'PWD'}; } sub _qnx_cwd { local $ENV{PATH} = ''; local $ENV{CDPATH} = ''; local $ENV{ENV} = ''; $ENV{'PWD'} = `/usr/bin/fullpath -t`; chomp $ENV{'PWD'}; return $ENV{'PWD'}; } sub _qnx_abs_path { local $ENV{PATH} = ''; local $ENV{CDPATH} = ''; local $ENV{ENV} = ''; my $path = @_ ? shift : '.'; local *REALPATH; defined( open(REALPATH, '-|') || exec '/usr/bin/fullpath', '-t', $path ) or die "Can't open /usr/bin/fullpath: $!"; my $realpath = ; close REALPATH; chomp $realpath; return $realpath; } sub _epoc_cwd { $ENV{'PWD'} = EPOC::getcwd(); return $ENV{'PWD'}; } # Now that all the base-level functions are set up, alias the # user-level functions to the right places if (exists $METHOD_MAP{$^O}) { my $map = $METHOD_MAP{$^O}; foreach my $name (keys %$map) { local $^W = 0; # assignments trigger 'subroutine redefined' warning no strict 'refs'; *{$name} = \&{$map->{$name}}; } } # In case the XS version doesn't load. *abs_path = \&_perl_abs_path unless defined &abs_path; *getcwd = \&_perl_getcwd unless defined &getcwd; # added function alias for those of us more # used to the libc function. --tchrist 27-Jan-00 *realpath = \&abs_path; 1; FILEf180d56c/DynaLoader.pm*P#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/DynaLoader.pm" # Generated from DynaLoader_pm.PL package DynaLoader; # And Gandalf said: 'Many folk like to know beforehand what is to # be set on the table; but those who have laboured to prepare the # feast like to keep their secret; for wonder makes the words of # praise louder.' # (Quote from Tolkien suggested by Anno Siegel.) # # See pod text at end of file for documentation. # See also ext/DynaLoader/README in source tree for other information. # # Tim.Bunce@ig.co.uk, August 1994 BEGIN { $VERSION = '1.25'; } use Config; # enable debug/trace messages from DynaLoader perl code $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug; # # Flags to alter dl_load_file behaviour. Assigned bits: # 0x01 make symbols available for linking later dl_load_file's. # (only known to work on Solaris 2 using dlopen(RTLD_GLOBAL)) # (ignored under VMS; effect is built-in to image linking) # (ignored under Android; the linker always uses RTLD_LOCAL) # # This is called as a class method $module->dl_load_flags. The # definition here will be inherited and result on "default" loading # behaviour unless a sub-class of DynaLoader defines its own version. # sub dl_load_flags { 0x00 } ($dl_dlext, $dl_so, $dlsrc) = @Config::Config{qw(dlext so dlsrc)}; $do_expand = 0; @dl_require_symbols = (); # names of symbols we need @dl_resolve_using = (); # names of files to link with @dl_library_path = (); # path to look for files #XSLoader.pm may have added elements before we were required #@dl_shared_objects = (); # shared objects for symbols we have #@dl_librefs = (); # things we have loaded #@dl_modules = (); # Modules we have loaded # This is a fix to support DLD's unfortunate desire to relink -lc @dl_resolve_using = dl_findfile('-lc') if $dlsrc eq "dl_dld.xs"; # Initialise @dl_library_path with the 'standard' library path # for this platform as determined by Configure. push(@dl_library_path, split(' ', $Config::Config{libpth})); my $ldlibpthname = $Config::Config{ldlibpthname}; my $ldlibpthname_defined = defined $Config::Config{ldlibpthname}; my $pthsep = $Config::Config{path_sep}; # Add to @dl_library_path any extra directories we can gather from environment # during runtime. if ($ldlibpthname_defined && exists $ENV{$ldlibpthname}) { push(@dl_library_path, split(/$pthsep/, $ENV{$ldlibpthname})); } # E.g. HP-UX supports both its native SHLIB_PATH *and* LD_LIBRARY_PATH. if ($ldlibpthname_defined && $ldlibpthname ne 'LD_LIBRARY_PATH' && exists $ENV{LD_LIBRARY_PATH}) { push(@dl_library_path, split(/$pthsep/, $ENV{LD_LIBRARY_PATH})); } # No prizes for guessing why we don't say 'bootstrap DynaLoader;' here. # NOTE: All dl_*.xs (including dl_none.xs) define a dl_error() XSUB boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) && !defined(&dl_error); if ($dl_debug) { print STDERR "DynaLoader.pm loaded (@INC, @dl_library_path)\n"; print STDERR "DynaLoader not linked into this perl\n" unless defined(&boot_DynaLoader); } 1; # End of main code sub croak { require Carp; Carp::croak(@_) } sub bootstrap_inherit { my $module = $_[0]; local *isa = *{"$module\::ISA"}; local @isa = (@isa, 'DynaLoader'); # Cannot goto due to delocalization. Will report errors on a wrong line? bootstrap(@_); } sub bootstrap { # use local vars to enable $module.bs script to edit values local(@args) = @_; local($module) = $args[0]; local(@dirs, $file); unless ($module) { require Carp; Carp::confess("Usage: DynaLoader::bootstrap(module)"); } # A common error on platforms which don't support dynamic loading. # Since it's fatal and potentially confusing we give a detailed message. croak("Can't load module $module, dynamic loading not available in this perl.\n". " (You may need to build a new perl executable which either supports\n". " dynamic loading or has the $module module statically linked into it.)\n") unless defined(&dl_load_file); my @modparts = split(/::/,$module); my $modfname = $modparts[-1]; # Some systems have restrictions on files names for DLL's etc. # mod2fname returns appropriate file base name (typically truncated) # It may also edit @modparts if required. $modfname = &mod2fname(\@modparts) if defined &mod2fname; my $modpname = join('/',@modparts); print STDERR "DynaLoader::bootstrap for $module ", "(auto/$modpname/$modfname.$dl_dlext)\n" if $dl_debug; foreach (@INC) { my $dir = "$_/auto/$modpname"; next unless -d $dir; # skip over uninteresting directories # check for common cases to avoid autoload of dl_findfile my $try = "$dir/$modfname.$dl_dlext"; last if $file = ($do_expand) ? dl_expandspec($try) : ((-f $try) && $try); # no luck here, save dir for possible later dl_findfile search push @dirs, $dir; } # last resort, let dl_findfile have a go in all known locations $file = dl_findfile(map("-L$_",@dirs,@INC), $modfname) unless $file; croak("Can't locate loadable object for module $module in \@INC (\@INC contains: @INC)") unless $file; # wording similar to error from 'require' my $bootname = "boot_$module"; $bootname =~ s/\W/_/g; @dl_require_symbols = ($bootname); # Execute optional '.bootstrap' perl script for this module. # The .bs file can be used to configure @dl_resolve_using etc to # match the needs of the individual module on this architecture. my $bs = $file; $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library if (-s $bs) { # only read file if it's not empty print STDERR "BS: $bs ($^O, $dlsrc)\n" if $dl_debug; eval { do $bs; }; warn "$bs: $@\n" if $@; } my $boot_symbol_ref; # Many dynamic extension loading problems will appear to come from # this section of code: XYZ failed at line 123 of DynaLoader.pm. # Often these errors are actually occurring in the initialisation # C code of the extension XS file. Perl reports the error as being # in this perl code simply because this was the last perl code # it executed. my $flags = $module->dl_load_flags; my $libref = dl_load_file($file, $flags) or croak("Can't load '$file' for module $module: ".dl_error()); push(@dl_librefs,$libref); # record loaded object my @unresolved = dl_undef_symbols(); if (@unresolved) { require Carp; Carp::carp("Undefined symbols present after loading $file: @unresolved\n"); } $boot_symbol_ref = dl_find_symbol($libref, $bootname) or croak("Can't find '$bootname' symbol in $file\n"); push(@dl_modules, $module); # record loaded module boot: my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file); # See comment block above push(@dl_shared_objects, $file); # record files loaded &$xs(@args); } sub dl_findfile { # Read ext/DynaLoader/DynaLoader.doc for detailed information. # This function does not automatically consider the architecture # or the perl library auto directories. my (@args) = @_; my (@dirs, $dir); # which directories to search my (@found); # full paths to real files we have found #my $dl_ext= 'so'; # $Config::Config{'dlext'} suffix for perl extensions #my $dl_so = 'so'; # $Config::Config{'so'} suffix for shared libraries print STDERR "dl_findfile(@args)\n" if $dl_debug; # accumulate directories but process files as they appear arg: foreach(@args) { # Special fast case: full filepath requires no search if (m:/: && -f $_) { push(@found,$_); last arg unless wantarray; next; } # Deal with directories first: # Using a -L prefix is the preferred option (faster and more robust) if (m:^-L:) { s/^-L//; push(@dirs, $_); next; } # Otherwise we try to try to spot directories by a heuristic # (this is a more complicated issue than it first appears) if (m:/: && -d $_) { push(@dirs, $_); next; } # Only files should get this far... my(@names, $name); # what filenames to look for if (m:-l: ) { # convert -lname to appropriate library name s/-l//; push(@names,"lib$_.$dl_so"); push(@names,"lib$_.a"); } else { # Umm, a bare name. Try various alternatives: # these should be ordered with the most likely first push(@names,"$_.$dl_dlext") unless m/\.$dl_dlext$/o; push(@names,"$_.$dl_so") unless m/\.$dl_so$/o; push(@names,"lib$_.$dl_so") unless m:/:; push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs"; push(@names, $_); } my $dirsep = '/'; foreach $dir (@dirs, @dl_library_path) { next unless -d $dir; foreach $name (@names) { my($file) = "$dir$dirsep$name"; print STDERR " checking in $dir for $name\n" if $dl_debug; $file = ($do_expand) ? dl_expandspec($file) : (-f $file && $file); #$file = _check_file($file); if ($file) { push(@found, $file); next arg; # no need to look any further } } } } if ($dl_debug) { foreach(@dirs) { print STDERR " dl_findfile ignored non-existent directory: $_\n" unless -d $_; } print STDERR "dl_findfile found: @found\n"; } return $found[0] unless wantarray; @found; } sub dl_expandspec { my($spec) = @_; # Optional function invoked if DynaLoader.pm sets $do_expand. # Most systems do not require or use this function. # Some systems may implement it in the dl_*.xs file in which case # this Perl version should be excluded at build time. # This function is designed to deal with systems which treat some # 'filenames' in a special way. For example VMS 'Logical Names' # (something like unix environment variables - but different). # This function should recognise such names and expand them into # full file paths. # Must return undef if $spec is invalid or file does not exist. my $file = $spec; # default output to input return undef unless -f $file; print STDERR "dl_expandspec($spec) => $file\n" if $dl_debug; $file; } sub dl_find_symbol_anywhere { my $sym = shift; my $libref; foreach $libref (@dl_librefs) { my $symref = dl_find_symbol($libref,$sym); return $symref if $symref; } return undef; } __END__ #line 772 FILEf685019e/Errno.pmd#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/Errno.pm" # -*- buffer-read-only: t -*- # # This file is auto-generated. ***ANY*** changes here will be lost # package Errno; require Exporter; use Config; use strict; "$Config{'archname'}-$Config{'osvers'}" eq "i86pc-solaris-2.11" or die "Errno architecture (i86pc-solaris-2.11) does not match executable architecture ($Config{'archname'}-$Config{'osvers'})"; our $VERSION = "1.20_03"; $VERSION = eval $VERSION; our @ISA = 'Exporter'; my %err; BEGIN { %err = ( EPERM => 1, ENOENT => 2, ESRCH => 3, EINTR => 4, EIO => 5, ENXIO => 6, E2BIG => 7, ENOEXEC => 8, EBADF => 9, ECHILD => 10, EAGAIN => 11, EWOULDBLOCK => 11, ENOMEM => 12, EACCES => 13, EFAULT => 14, ENOTBLK => 15, EBUSY => 16, EEXIST => 17, EXDEV => 18, ENODEV => 19, ENOTDIR => 20, EISDIR => 21, EINVAL => 22, ENFILE => 23, EMFILE => 24, ENOTTY => 25, ETXTBSY => 26, EFBIG => 27, ENOSPC => 28, ESPIPE => 29, EROFS => 30, EMLINK => 31, EPIPE => 32, EDOM => 33, ERANGE => 34, ENOMSG => 35, EIDRM => 36, ECHRNG => 37, EL2NSYNC => 38, EL3HLT => 39, EL3RST => 40, ELNRNG => 41, EUNATCH => 42, ENOCSI => 43, EL2HLT => 44, EDEADLK => 45, ENOLCK => 46, ECANCELED => 47, ENOTSUP => 48, EDQUOT => 49, EBADE => 50, EBADR => 51, EXFULL => 52, ENOANO => 53, EBADRQC => 54, EBADSLT => 55, EDEADLOCK => 56, EBFONT => 57, EOWNERDEAD => 58, ENOTRECOVERABLE => 59, ENOSTR => 60, ENODATA => 61, ETIME => 62, ENOSR => 63, ENONET => 64, ENOPKG => 65, EREMOTE => 66, ENOLINK => 67, EADV => 68, ESRMNT => 69, ECOMM => 70, EPROTO => 71, ELOCKUNMAPPED => 72, ENOTACTIVE => 73, EMULTIHOP => 74, EADI => 75, EBADMSG => 77, ENAMETOOLONG => 78, EOVERFLOW => 79, ENOTUNIQ => 80, EBADFD => 81, EREMCHG => 82, ELIBACC => 83, ELIBBAD => 84, ELIBSCN => 85, ELIBMAX => 86, ELIBEXEC => 87, EILSEQ => 88, ENOSYS => 89, ELOOP => 90, ERESTART => 91, ESTRPIPE => 92, ENOTEMPTY => 93, EUSERS => 94, ENOTSOCK => 95, EDESTADDRREQ => 96, EMSGSIZE => 97, EPROTOTYPE => 98, ENOPROTOOPT => 99, EPROTONOSUPPORT => 120, ESOCKTNOSUPPORT => 121, EOPNOTSUPP => 122, EPFNOSUPPORT => 123, EAFNOSUPPORT => 124, EADDRINUSE => 125, EADDRNOTAVAIL => 126, ENETDOWN => 127, ENETUNREACH => 128, ENETRESET => 129, ECONNABORTED => 130, ECONNRESET => 131, ENOBUFS => 132, EISCONN => 133, ENOTCONN => 134, ESHUTDOWN => 143, ETOOMANYREFS => 144, ETIMEDOUT => 145, ECONNREFUSED => 146, EHOSTDOWN => 147, EHOSTUNREACH => 148, EALREADY => 149, EINPROGRESS => 150, ESTALE => 151, ); # Generate proxy constant subroutines for all the values. # Well, almost all the values. Unfortunately we can't assume that at this # point that our symbol table is empty, as code such as if the parser has # seen code such as C, it will have created the # typeglob. # Doing this before defining @EXPORT_OK etc means that even if a platform is # crazy enough to define EXPORT_OK as an error constant, everything will # still work, because the parser will upgrade the PCS to a real typeglob. # We rely on the subroutine definitions below to update the internal caches. # Don't use %each, as we don't want a copy of the value. foreach my $name (keys %err) { if ($Errno::{$name}) { # We expect this to be reached fairly rarely, so take an approach # which uses the least compile time effort in the common case: eval "sub $name() { $err{$name} }; 1" or die $@; } else { $Errno::{$name} = \$err{$name}; } } } our @EXPORT_OK = keys %err; our %EXPORT_TAGS = ( POSIX => [qw( E2BIG EACCES EADDRINUSE EADDRNOTAVAIL EAFNOSUPPORT EAGAIN EALREADY EBADF EBUSY ECHILD ECONNABORTED ECONNREFUSED ECONNRESET EDEADLK EDESTADDRREQ EDOM EDQUOT EEXIST EFAULT EFBIG EHOSTDOWN EHOSTUNREACH EINPROGRESS EINTR EINVAL EIO EISCONN EISDIR ELOOP EMFILE EMLINK EMSGSIZE ENAMETOOLONG ENETDOWN ENETRESET ENETUNREACH ENFILE ENOBUFS ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOPROTOOPT ENOSPC ENOSYS ENOTBLK ENOTCONN ENOTDIR ENOTEMPTY ENOTSOCK ENOTTY ENXIO EOPNOTSUPP EPERM EPFNOSUPPORT EPIPE EPROTONOSUPPORT EPROTOTYPE ERANGE EREMOTE ERESTART EROFS ESHUTDOWN ESOCKTNOSUPPORT ESPIPE ESRCH ESTALE ETIMEDOUT ETOOMANYREFS ETXTBSY EUSERS EWOULDBLOCK EXDEV )] ); sub TIEHASH { bless \%err } sub FETCH { my (undef, $errname) = @_; return "" unless exists $err{$errname}; my $errno = $err{$errname}; return $errno == $! ? $errno : 0; } sub STORE { require Carp; Carp::confess("ERRNO hash is read only!"); } *CLEAR = *DELETE = \*STORE; # Typeglob aliasing uses less space sub NEXTKEY { each %err; } sub FIRSTKEY { my $s = scalar keys %err; # initialize iterator each %err; } sub EXISTS { my (undef, $errname) = @_; exists $err{$errname}; } tie %!, __PACKAGE__; # Returns an object, objects are true. __END__ #line 271 # ex: set ro: FILEceb6fa9d/Fcntl.pm;#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/Fcntl.pm" package Fcntl; #line 57 use strict; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); require Exporter; require XSLoader; @ISA = qw(Exporter); $VERSION = '1.11'; XSLoader::load(); # Named groups of exports %EXPORT_TAGS = ( 'flock' => [qw(LOCK_SH LOCK_EX LOCK_NB LOCK_UN)], 'Fcompat' => [qw(FAPPEND FASYNC FCREAT FDEFER FDSYNC FEXCL FLARGEFILE FNDELAY FNONBLOCK FRSYNC FSYNC FTRUNC)], 'seek' => [qw(SEEK_SET SEEK_CUR SEEK_END)], 'mode' => [qw(S_ISUID S_ISGID S_ISVTX S_ISTXT _S_IFMT S_IFREG S_IFDIR S_IFLNK S_IFSOCK S_IFBLK S_IFCHR S_IFIFO S_IFWHT S_ENFMT S_IRUSR S_IWUSR S_IXUSR S_IRWXU S_IRGRP S_IWGRP S_IXGRP S_IRWXG S_IROTH S_IWOTH S_IXOTH S_IRWXO S_IREAD S_IWRITE S_IEXEC S_ISREG S_ISDIR S_ISLNK S_ISSOCK S_ISBLK S_ISCHR S_ISFIFO S_ISWHT S_ISENFMT S_IFMT S_IMODE )], ); # Items to export into callers namespace by default # (move infrequently used names to @EXPORT_OK below) @EXPORT = qw( FD_CLOEXEC F_ALLOCSP F_ALLOCSP64 F_COMPAT F_DUP2FD F_DUPFD F_EXLCK F_FREESP F_FREESP64 F_FSYNC F_FSYNC64 F_GETFD F_GETFL F_GETLK F_GETLK64 F_GETOWN F_NODNY F_POSIX F_RDACC F_RDDNY F_RDLCK F_RWACC F_RWDNY F_SETFD F_SETFL F_SETLK F_SETLK64 F_SETLKW F_SETLKW64 F_SETOWN F_SHARE F_SHLCK F_UNLCK F_UNSHARE F_WRACC F_WRDNY F_WRLCK O_ACCMODE O_ALIAS O_APPEND O_ASYNC O_BINARY O_CREAT O_DEFER O_DIRECT O_DIRECTORY O_DSYNC O_EXCL O_EXLOCK O_LARGEFILE O_NDELAY O_NOCTTY O_NOFOLLOW O_NOINHERIT O_NONBLOCK O_RANDOM O_RAW O_RDONLY O_RDWR O_RSRC O_RSYNC O_SEQUENTIAL O_SHLOCK O_SYNC O_TEMPORARY O_TEXT O_TRUNC O_WRONLY ); # Other items we are prepared to export if requested @EXPORT_OK = (qw( DN_ACCESS DN_ATTRIB DN_CREATE DN_DELETE DN_MODIFY DN_MULTISHOT DN_RENAME F_GETLEASE F_GETSIG F_NOTIFY F_SETLEASE F_SETSIG LOCK_MAND LOCK_READ LOCK_RW LOCK_WRITE O_IGNORE_CTTY O_NOATIME O_NOLINK O_NOTRANS ), map {@{$_}} values %EXPORT_TAGS); 1; FILEaaa10779/File/Glob.pmx#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/File/Glob.pm" package File::Glob; use strict; our($VERSION, @ISA, @EXPORT_OK, @EXPORT_FAIL, %EXPORT_TAGS, $DEFAULT_FLAGS); require XSLoader; @ISA = qw(Exporter); # NOTE: The glob() export is only here for compatibility with 5.6.0. # csh_glob() should not be used directly, unless you know what you're doing. %EXPORT_TAGS = ( 'glob' => [ qw( GLOB_ABEND GLOB_ALPHASORT GLOB_ALTDIRFUNC GLOB_BRACE GLOB_CSH GLOB_ERR GLOB_ERROR GLOB_LIMIT GLOB_MARK GLOB_NOCASE GLOB_NOCHECK GLOB_NOMAGIC GLOB_NOSORT GLOB_NOSPACE GLOB_QUOTE GLOB_TILDE bsd_glob glob ) ], ); $EXPORT_TAGS{bsd_glob} = [@{$EXPORT_TAGS{glob}}]; pop @{$EXPORT_TAGS{bsd_glob}}; # no "glob" @EXPORT_OK = (@{$EXPORT_TAGS{'glob'}}, 'csh_glob'); $VERSION = '1.23'; sub import { require Exporter; local $Exporter::ExportLevel = $Exporter::ExportLevel + 1; Exporter::import(grep { my $passthrough; if ($_ eq ':case') { $DEFAULT_FLAGS &= ~GLOB_NOCASE() } elsif ($_ eq ':nocase') { $DEFAULT_FLAGS |= GLOB_NOCASE(); } elsif ($_ eq ':globally') { no warnings 'redefine'; *CORE::GLOBAL::glob = \&File::Glob::csh_glob; } elsif ($_ eq ':bsd_glob') { no strict; *{caller."::glob"} = \&bsd_glob_override; $passthrough = 1; } else { $passthrough = 1; } $passthrough; } @_); } XSLoader::load(); $DEFAULT_FLAGS = GLOB_CSH(); if ($^O =~ /^(?:MSWin32|VMS|os2|dos|riscos)$/) { $DEFAULT_FLAGS |= GLOB_NOCASE(); } # File::Glob::glob() is deprecated because its prototype is different from # CORE::glob() (use bsd_glob() instead) sub glob { splice @_, 1; # no flags goto &bsd_glob; } 1; __END__ #line 398 FILEf5137db2/File/Spec.pm#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/File/Spec.pm" package File::Spec; use strict; use vars qw(@ISA $VERSION); $VERSION = '3.47'; $VERSION =~ tr/_//; my %module = (MacOS => 'Mac', MSWin32 => 'Win32', os2 => 'OS2', VMS => 'VMS', epoc => 'Epoc', NetWare => 'Win32', # Yes, File::Spec::Win32 works on NetWare. symbian => 'Win32', # Yes, File::Spec::Win32 works on symbian. dos => 'OS2', # Yes, File::Spec::OS2 works on DJGPP. cygwin => 'Cygwin'); my $module = $module{$^O} || 'Unix'; require "File/Spec/$module.pm"; @ISA = ("File::Spec::$module"); 1; __END__ #line 340 FILE26177d6e/File/Spec/Unix.pm&#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/File/Spec/Unix.pm" package File::Spec::Unix; use strict; use vars qw($VERSION); $VERSION = '3.47'; my $xs_version = $VERSION; $VERSION =~ tr/_//; unless (defined &canonpath) { eval { if ( $] >= 5.006 ) { require XSLoader; XSLoader::load("Cwd", $xs_version); } else { require Cwd; } }; } #line 54 sub _pp_canonpath { my ($self,$path) = @_; return unless defined $path; # Handle POSIX-style node names beginning with double slash (qnx, nto) # (POSIX says: "a pathname that begins with two successive slashes # may be interpreted in an implementation-defined manner, although # more than two leading slashes shall be treated as a single slash.") my $node = ''; my $double_slashes_special = $^O eq 'qnx' || $^O eq 'nto'; if ( $double_slashes_special && ( $path =~ s{^(//[^/]+)/?\z}{}s || $path =~ s{^(//[^/]+)/}{/}s ) ) { $node = $1; } # This used to be # $path =~ s|/+|/|g unless ($^O eq 'cygwin'); # but that made tests 29, 30, 35, 46, and 213 (as of #13272) to fail # (Mainly because trailing "" directories didn't get stripped). # Why would cygwin avoid collapsing multiple slashes into one? --jhi $path =~ s|/{2,}|/|g; # xx////xx -> xx/xx $path =~ s{(?:/\.)+(?:/|\z)}{/}g; # xx/././xx -> xx/xx $path =~ s|^(?:\./)+||s unless $path eq "./"; # ./xx -> xx $path =~ s|^/(?:\.\./)+|/|; # /../../xx -> xx $path =~ s|^/\.\.$|/|; # /.. -> / $path =~ s|/\z|| unless $path eq "/"; # xx/ -> xx return "$node$path"; } *canonpath = \&_pp_canonpath unless defined &canonpath; #line 95 sub _pp_catdir { my $self = shift; $self->canonpath(join('/', @_, '')); # '' because need a trailing '/' } *catdir = \&_pp_catdir unless defined &catdir; #line 109 sub _pp_catfile { my $self = shift; my $file = $self->canonpath(pop @_); return $file unless @_; my $dir = $self->catdir(@_); $dir .= "/" unless substr($dir,-1) eq "/"; return $dir.$file; } *catfile = \&_pp_catfile unless defined &catfile; #line 125 sub curdir { '.' } use constant _fn_curdir => "."; #line 134 sub devnull { '/dev/null' } use constant _fn_devnull => "/dev/null"; #line 143 sub rootdir { '/' } use constant _fn_rootdir => "/"; #line 160 my ($tmpdir, %tmpenv); # Cache and return the calculated tmpdir, recording which env vars # determined it. sub _cache_tmpdir { @tmpenv{@_[2..$#_]} = @ENV{@_[2..$#_]}; return $tmpdir = $_[1]; } # Retrieve the cached tmpdir, checking first whether relevant env vars have # changed and invalidated the cache. sub _cached_tmpdir { shift; local $^W; return if grep $ENV{$_} ne $tmpenv{$_}, @_; return $tmpdir; } sub _tmpdir { my $self = shift; my @dirlist = @_; my $taint = do { no strict 'refs'; ${"\cTAINT"} }; if ($taint) { # Check for taint mode on perl >= 5.8.0 require Scalar::Util; @dirlist = grep { ! Scalar::Util::tainted($_) } @dirlist; } elsif ($] < 5.007) { # No ${^TAINT} before 5.8 @dirlist = grep { eval { eval('1'.substr $_,0,0) } } @dirlist; } foreach (@dirlist) { next unless defined && -d && -w _; $tmpdir = $_; last; } $tmpdir = $self->curdir unless defined $tmpdir; $tmpdir = defined $tmpdir && $self->canonpath($tmpdir); if ( !$self->file_name_is_absolute($tmpdir) ) { # See [perl #120593] for the full details # If possible, return a full path, rather than '.' or 'lib', but # jump through some hoops to avoid returning a tainted value. ($tmpdir) = grep { $taint ? ! Scalar::Util::tainted($_) : $] < 5.007 ? eval { eval('1'.substr $_,0,0) } : 1 } $self->rel2abs($tmpdir), $tmpdir; } return $tmpdir; } sub tmpdir { my $cached = $_[0]->_cached_tmpdir('TMPDIR'); return $cached if defined $cached; $_[0]->_cache_tmpdir($_[0]->_tmpdir( $ENV{TMPDIR}, "/tmp" ), 'TMPDIR'); } #line 218 sub updir { '..' } use constant _fn_updir => ".."; #line 228 sub no_upwards { my $self = shift; return grep(!/^\.{1,2}\z/s, @_); } #line 240 sub case_tolerant { 0 } use constant _fn_case_tolerant => 0; #line 253 sub file_name_is_absolute { my ($self,$file) = @_; return scalar($file =~ m:^/:s); } #line 264 sub path { return () unless exists $ENV{PATH}; my @path = split(':', $ENV{PATH}); foreach (@path) { $_ = '.' if $_ eq '' } return @path; } #line 277 sub join { my $self = shift; return $self->catfile(@_); } #line 303 sub splitpath { my ($self,$path, $nofile) = @_; my ($volume,$directory,$file) = ('','',''); if ( $nofile ) { $directory = $path; } else { $path =~ m|^ ( (?: .* / (?: \.\.?\z )? )? ) ([^/]*) |xs; $directory = $1; $file = $2; } return ($volume,$directory,$file); } #line 345 sub splitdir { return split m|/|, $_[1], -1; # Preserve trailing fields } #line 359 sub catpath { my ($self,$volume,$directory,$file) = @_; if ( $directory ne '' && $file ne '' && substr( $directory, -1 ) ne '/' && substr( $file, 0, 1 ) ne '/' ) { $directory .= "/$file" ; } else { $directory .= $file ; } return $directory ; } #line 406 sub abs2rel { my($self,$path,$base) = @_; $base = $self->_cwd() unless defined $base and length $base; ($path, $base) = map $self->canonpath($_), $path, $base; my $path_directories; my $base_directories; if (grep $self->file_name_is_absolute($_), $path, $base) { ($path, $base) = map $self->rel2abs($_), $path, $base; my ($path_volume) = $self->splitpath($path, 1); my ($base_volume) = $self->splitpath($base, 1); # Can't relativize across volumes return $path unless $path_volume eq $base_volume; $path_directories = ($self->splitpath($path, 1))[1]; $base_directories = ($self->splitpath($base, 1))[1]; # For UNC paths, the user might give a volume like //foo/bar that # strictly speaking has no directory portion. Treat it as if it # had the root directory for that volume. if (!length($base_directories) and $self->file_name_is_absolute($base)) { $base_directories = $self->rootdir; } } else { my $wd= ($self->splitpath($self->_cwd(), 1))[1]; $path_directories = $self->catdir($wd, $path); $base_directories = $self->catdir($wd, $base); } # Now, remove all leading components that are the same my @pathchunks = $self->splitdir( $path_directories ); my @basechunks = $self->splitdir( $base_directories ); if ($base_directories eq $self->rootdir) { return $self->curdir if $path_directories eq $self->rootdir; shift @pathchunks; return $self->canonpath( $self->catpath('', $self->catdir( @pathchunks ), '') ); } my @common; while (@pathchunks && @basechunks && $self->_same($pathchunks[0], $basechunks[0])) { push @common, shift @pathchunks ; shift @basechunks ; } return $self->curdir unless @pathchunks || @basechunks; # @basechunks now contains the directories the resulting relative path # must ascend out of before it can descend to $path_directory. If there # are updir components, we must descend into the corresponding directories # (this only works if they are no symlinks). my @reverse_base; while( defined(my $dir= shift @basechunks) ) { if( $dir ne $self->updir ) { unshift @reverse_base, $self->updir; push @common, $dir; } elsif( @common ) { if( @reverse_base && $reverse_base[0] eq $self->updir ) { shift @reverse_base; pop @common; } else { unshift @reverse_base, pop @common; } } } my $result_dirs = $self->catdir( @reverse_base, @pathchunks ); return $self->canonpath( $self->catpath('', $result_dirs, '') ); } sub _same { $_[1] eq $_[2]; } #line 511 sub rel2abs { my ($self,$path,$base ) = @_; # Clean up $path if ( ! $self->file_name_is_absolute( $path ) ) { # Figure out the effective $base and clean it up. if ( !defined( $base ) || $base eq '' ) { $base = $self->_cwd(); } elsif ( ! $self->file_name_is_absolute( $base ) ) { $base = $self->rel2abs( $base ) ; } else { $base = $self->canonpath( $base ) ; } # Glom them together $path = $self->catdir( $base, $path ) ; } return $self->canonpath( $path ) ; } #line 551 # Internal routine to File::Spec, no point in making this public since # it is the standard Cwd interface. Most of the platform-specific # File::Spec subclasses use this. sub _cwd { require Cwd; Cwd::getcwd(); } # Internal method to reduce xx\..\yy -> yy sub _collapse { my($fs, $path) = @_; my $updir = $fs->updir; my $curdir = $fs->curdir; my($vol, $dirs, $file) = $fs->splitpath($path); my @dirs = $fs->splitdir($dirs); pop @dirs if @dirs && $dirs[-1] eq ''; my @collapsed; foreach my $dir (@dirs) { if( $dir eq $updir and # if we have an updir @collapsed and # and something to collapse length $collapsed[-1] and # and its not the rootdir $collapsed[-1] ne $updir and # nor another updir $collapsed[-1] ne $curdir # nor the curdir ) { # then pop @collapsed; # collapse } else { # else push @collapsed, $dir; # just hang onto it } } return $fs->catpath($vol, $fs->catdir(@collapsed), $file ); } 1; FILE3da154fd/IO.pm#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/IO.pm" # package IO; use XSLoader (); use Carp; use strict; use warnings; our $VERSION = "1.31"; XSLoader::load 'IO', $VERSION; sub import { shift; warnings::warnif('deprecated', qq{Parameterless "use IO" deprecated}) if @_ == 0 ; my @l = @_ ? @_ : qw(Handle Seekable File Pipe Socket Dir); eval join("", map { "require IO::" . (/(\w+)/)[0] . ";\n" } @l) or croak $@; } 1; __END__ #line 68 FILE854e47f9/IO/File.pm#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/IO/File.pm" # package IO::File; #line 126 use 5.006_001; use strict; our($VERSION, @EXPORT, @EXPORT_OK, @ISA); use Carp; use Symbol; use SelectSaver; use IO::Seekable; require Exporter; @ISA = qw(IO::Handle IO::Seekable Exporter); $VERSION = "1.16"; @EXPORT = @IO::Seekable::EXPORT; eval { # Make all Fcntl O_XXX constants available for importing require Fcntl; my @O = grep /^O_/, @Fcntl::EXPORT; Fcntl->import(@O); # first we import what we want to export push(@EXPORT, @O); }; ################################################ ## Constructor ## sub new { my $type = shift; my $class = ref($type) || $type || "IO::File"; @_ >= 0 && @_ <= 3 or croak "usage: $class->new([FILENAME [,MODE [,PERMS]]])"; my $fh = $class->SUPER::new(); if (@_) { $fh->open(@_) or return undef; } $fh; } ################################################ ## Open ## sub open { @_ >= 2 && @_ <= 4 or croak 'usage: $fh->open(FILENAME [,MODE [,PERMS]])'; my ($fh, $file) = @_; if (@_ > 2) { my ($mode, $perms) = @_[2, 3]; if ($mode =~ /^\d+$/) { defined $perms or $perms = 0666; return sysopen($fh, $file, $mode, $perms); } elsif ($mode =~ /:/) { return open($fh, $mode, $file) if @_ == 3; croak 'usage: $fh->open(FILENAME, IOLAYERS)'; } else { return open($fh, IO::Handle::_open_mode_string($mode), $file); } } open($fh, $file); } ################################################ ## Binmode ## sub binmode { ( @_ == 1 or @_ == 2 ) or croak 'usage $fh->binmode([LAYER])'; my($fh, $layer) = @_; return binmode $$fh unless $layer; return binmode $$fh, $layer; } 1; FILE9131d42d/IO/Handle.pm y#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/IO/Handle.pm" package IO::Handle; #line 262 use 5.006_001; use strict; our($VERSION, @EXPORT_OK, @ISA); use Carp; use Symbol; use SelectSaver; use IO (); # Load the XS module require Exporter; @ISA = qw(Exporter); $VERSION = "1.35"; $VERSION = eval $VERSION; @EXPORT_OK = qw( autoflush output_field_separator output_record_separator input_record_separator input_line_number format_page_number format_lines_per_page format_lines_left format_name format_top_name format_line_break_characters format_formfeed format_write print printf say getline getlines printflush flush SEEK_SET SEEK_CUR SEEK_END _IOFBF _IOLBF _IONBF ); ################################################ ## Constructors, destructors. ## sub new { my $class = ref($_[0]) || $_[0] || "IO::Handle"; if (@_ != 1) { # Since perl will automatically require IO::File if needed, but # also initialises IO::File's @ISA as part of the core we must # ensure IO::File is loaded if IO::Handle is. This avoids effect- # ively "half-loading" IO::File. if ($] > 5.013 && $class eq 'IO::File' && !$INC{"IO/File.pm"}) { require IO::File; shift; return IO::File::->new(@_); } croak "usage: $class->new()"; } my $io = gensym; bless $io, $class; } sub new_from_fd { my $class = ref($_[0]) || $_[0] || "IO::Handle"; @_ == 3 or croak "usage: $class->new_from_fd(FD, MODE)"; my $io = gensym; shift; IO::Handle::fdopen($io, @_) or return undef; bless $io, $class; } # # There is no need for DESTROY to do anything, because when the # last reference to an IO object is gone, Perl automatically # closes its associated files (if any). However, to avoid any # attempts to autoload DESTROY, we here define it to do nothing. # sub DESTROY {} ################################################ ## Open and close. ## sub _open_mode_string { my ($mode) = @_; $mode =~ /^\+?(<|>>?)$/ or $mode =~ s/^r(\+?)$/$1/ or $mode =~ s/^a(\+?)$/$1>>/ or croak "IO::Handle: bad open mode: $mode"; $mode; } sub fdopen { @_ == 3 or croak 'usage: $io->fdopen(FD, MODE)'; my ($io, $fd, $mode) = @_; local(*GLOB); if (ref($fd) && "".$fd =~ /GLOB\(/o) { # It's a glob reference; Alias it as we cannot get name of anon GLOBs my $n = qualify(*GLOB); *GLOB = *{*$fd}; $fd = $n; } elsif ($fd =~ m#^\d+$#) { # It's an FD number; prefix with "=". $fd = "=$fd"; } open($io, _open_mode_string($mode) . '&' . $fd) ? $io : undef; } sub close { @_ == 1 or croak 'usage: $io->close()'; my($io) = @_; close($io); } ################################################ ## Normal I/O functions. ## # flock # select sub opened { @_ == 1 or croak 'usage: $io->opened()'; defined fileno($_[0]); } sub fileno { @_ == 1 or croak 'usage: $io->fileno()'; fileno($_[0]); } sub getc { @_ == 1 or croak 'usage: $io->getc()'; getc($_[0]); } sub eof { @_ == 1 or croak 'usage: $io->eof()'; eof($_[0]); } sub print { @_ or croak 'usage: $io->print(ARGS)'; my $this = shift; print $this @_; } sub printf { @_ >= 2 or croak 'usage: $io->printf(FMT,[ARGS])'; my $this = shift; printf $this @_; } sub say { @_ or croak 'usage: $io->say(ARGS)'; my $this = shift; local $\ = "\n"; print $this @_; } # Special XS wrapper to make them inherit lexical hints from the caller. _create_getline_subs( <<'END' ) or die $@; sub getline { @_ == 1 or croak 'usage: $io->getline()'; my $this = shift; return scalar <$this>; } sub getlines { @_ == 1 or croak 'usage: $io->getlines()'; wantarray or croak 'Can\'t call $io->getlines in a scalar context, use $io->getline'; my $this = shift; return <$this>; } 1; # return true for error checking END *gets = \&getline; # deprecated sub truncate { @_ == 2 or croak 'usage: $io->truncate(LEN)'; truncate($_[0], $_[1]); } sub read { @_ == 3 || @_ == 4 or croak 'usage: $io->read(BUF, LEN [, OFFSET])'; read($_[0], $_[1], $_[2], $_[3] || 0); } sub sysread { @_ == 3 || @_ == 4 or croak 'usage: $io->sysread(BUF, LEN [, OFFSET])'; sysread($_[0], $_[1], $_[2], $_[3] || 0); } sub write { @_ >= 2 && @_ <= 4 or croak 'usage: $io->write(BUF [, LEN [, OFFSET]])'; local($\) = ""; $_[2] = length($_[1]) unless defined $_[2]; print { $_[0] } substr($_[1], $_[3] || 0, $_[2]); } sub syswrite { @_ >= 2 && @_ <= 4 or croak 'usage: $io->syswrite(BUF [, LEN [, OFFSET]])'; if (defined($_[2])) { syswrite($_[0], $_[1], $_[2], $_[3] || 0); } else { syswrite($_[0], $_[1]); } } sub stat { @_ == 1 or croak 'usage: $io->stat()'; stat($_[0]); } ################################################ ## State modification functions. ## sub autoflush { my $old = new SelectSaver qualify($_[0], caller); my $prev = $|; $| = @_ > 1 ? $_[1] : 1; $prev; } sub output_field_separator { carp "output_field_separator is not supported on a per-handle basis" if ref($_[0]); my $prev = $,; $, = $_[1] if @_ > 1; $prev; } sub output_record_separator { carp "output_record_separator is not supported on a per-handle basis" if ref($_[0]); my $prev = $\; $\ = $_[1] if @_ > 1; $prev; } sub input_record_separator { carp "input_record_separator is not supported on a per-handle basis" if ref($_[0]); my $prev = $/; $/ = $_[1] if @_ > 1; $prev; } sub input_line_number { local $.; () = tell qualify($_[0], caller) if ref($_[0]); my $prev = $.; $. = $_[1] if @_ > 1; $prev; } sub format_page_number { my $old; $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $%; $% = $_[1] if @_ > 1; $prev; } sub format_lines_per_page { my $old; $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $=; $= = $_[1] if @_ > 1; $prev; } sub format_lines_left { my $old; $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $-; $- = $_[1] if @_ > 1; $prev; } sub format_name { my $old; $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $~; $~ = qualify($_[1], caller) if @_ > 1; $prev; } sub format_top_name { my $old; $old = new SelectSaver qualify($_[0], caller) if ref($_[0]); my $prev = $^; $^ = qualify($_[1], caller) if @_ > 1; $prev; } sub format_line_break_characters { carp "format_line_break_characters is not supported on a per-handle basis" if ref($_[0]); my $prev = $:; $: = $_[1] if @_ > 1; $prev; } sub format_formfeed { carp "format_formfeed is not supported on a per-handle basis" if ref($_[0]); my $prev = $^L; $^L = $_[1] if @_ > 1; $prev; } sub formline { my $io = shift; my $picture = shift; local($^A) = $^A; local($\) = ""; formline($picture, @_); print $io $^A; } sub format_write { @_ < 3 || croak 'usage: $io->write( [FORMAT_NAME] )'; if (@_ == 2) { my ($io, $fmt) = @_; my $oldfmt = $io->format_name(qualify($fmt,caller)); CORE::write($io); $io->format_name($oldfmt); } else { CORE::write($_[0]); } } sub fcntl { @_ == 3 || croak 'usage: $io->fcntl( OP, VALUE );'; my ($io, $op) = @_; return fcntl($io, $op, $_[2]); } sub ioctl { @_ == 3 || croak 'usage: $io->ioctl( OP, VALUE );'; my ($io, $op) = @_; return ioctl($io, $op, $_[2]); } # this sub is for compatibility with older releases of IO that used # a sub called constant to determine if a constant existed -- GMB # # The SEEK_* and _IO?BF constants were the only constants at that time # any new code should just check defined(&CONSTANT_NAME) sub constant { no strict 'refs'; my $name = shift; (($name =~ /^(SEEK_(SET|CUR|END)|_IO[FLN]BF)$/) && defined &{$name}) ? &{$name}() : undef; } # so that flush.pl can be deprecated sub printflush { my $io = shift; my $old; $old = new SelectSaver qualify($io, caller) if ref($io); local $| = 1; if(ref($io)) { print $io @_; } else { print @_; } } 1; FILEd43737b1/IO/Seekable.pm#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/IO/Seekable.pm" # package IO::Seekable; #line 96 use 5.006_001; use Carp; use strict; our($VERSION, @EXPORT, @ISA); use IO::Handle (); # XXX we can't get these from IO::Handle or we'll get prototype # mismatch warnings on C :-( use Fcntl qw(SEEK_SET SEEK_CUR SEEK_END); require Exporter; @EXPORT = qw(SEEK_SET SEEK_CUR SEEK_END); @ISA = qw(Exporter); $VERSION = "1.10"; $VERSION = eval $VERSION; sub seek { @_ == 3 or croak 'usage: $io->seek(POS, WHENCE)'; seek($_[0], $_[1], $_[2]); } sub sysseek { @_ == 3 or croak 'usage: $io->sysseek(POS, WHENCE)'; sysseek($_[0], $_[1], $_[2]); } sub tell { @_ == 1 or croak 'usage: $io->tell()'; tell($_[0]); } 1; FILE5a4b8b5f/List/Util.pmF#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/List/Util.pm" # Copyright (c) 1997-2009 Graham Barr . All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # # Maintained since 2013 by Paul Evans package List::Util; use strict; require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw( all any first min max minstr maxstr none notall product reduce sum sum0 shuffle pairmap pairgrep pairfirst pairs pairkeys pairvalues ); our $VERSION = "1.38"; our $XS_VERSION = $VERSION; $VERSION = eval $VERSION; require XSLoader; XSLoader::load('List::Util', $XS_VERSION); sub import { my $pkg = caller; # (RT88848) Touch the caller's $a and $b, to avoid the warning of # Name "main::a" used only once: possible typo" warning no strict 'refs'; ${"${pkg}::a"} = ${"${pkg}::a"}; ${"${pkg}::b"} = ${"${pkg}::b"}; goto &Exporter::import; } 1; __END__ #line 59 #line 65 #line 210 #line 220 #line 312 #line 316 #line 324 #line 357 FILE989a8c59/PerlIO/scalar.pm#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/PerlIO/scalar.pm" package PerlIO::scalar; our $VERSION = '0.18'; require XSLoader; XSLoader::load(); 1; __END__ #line 42 FILE48624e33/Scalar/Util.pm#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/Scalar/Util.pm" # Copyright (c) 1997-2007 Graham Barr . All rights reserved. # This program is free software; you can redistribute it and/or # modify it under the same terms as Perl itself. # # Maintained since 2013 by Paul Evans package Scalar::Util; use strict; require Exporter; require List::Util; # List::Util loads the XS our @ISA = qw(Exporter); our @EXPORT_OK = qw( blessed refaddr reftype weaken unweaken isweak dualvar isdual isvstring looks_like_number openhandle readonly set_prototype tainted ); our $VERSION = "1.38"; $VERSION = eval $VERSION; our @EXPORT_FAIL; unless (defined &weaken) { push @EXPORT_FAIL, qw(weaken); } unless (defined &isweak) { push @EXPORT_FAIL, qw(isweak isvstring); } unless (defined &isvstring) { push @EXPORT_FAIL, qw(isvstring); } sub export_fail { if (grep { /^(?:weaken|isweak)$/ } @_ ) { require Carp; Carp::croak("Weak references are not implemented in the version of perl"); } if (grep { /^isvstring$/ } @_ ) { require Carp; Carp::croak("Vstrings are not implemented in the version of perl"); } @_; } 1; __END__ #line 73 #line 322 FILE!bd5162d5/Tie/Hash/NamedCapture.pm#line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/Tie/Hash/NamedCapture.pm" use strict; package Tie::Hash::NamedCapture; our $VERSION = "0.09"; require XSLoader; XSLoader::load(); # This returns true, which makes require happy. __END__ #line 50 FILEcc03e381/attributes.pm #line 1 "/usr/local/lib/perl5/5.20.0/i86pc-solaris/attributes.pm" package attributes; our $VERSION = 0.22; @EXPORT_OK = qw(get reftype); @EXPORT = (); %EXPORT_TAGS = (ALL => [@EXPORT, @EXPORT_OK]); use strict; sub croak { require Carp; goto &Carp::croak; } sub carp { require Carp; goto &Carp::carp; } my %deprecated; $deprecated{CODE} = qr/\A-?(locked)\z/; $deprecated{ARRAY} = $deprecated{HASH} = $deprecated{SCALAR} = qr/\A-?(unique)\z/; sub _modify_attrs_and_deprecate { my $svtype = shift; # Now that we've removed handling of locked from the XS code, we need to # remove it here, else it ends up in @badattrs. (If we do the deprecation in # XS, we can't control the warning based on *our* caller's lexical settings, # and the warned line is in this package) grep { $deprecated{$svtype} && /$deprecated{$svtype}/ ? do { require warnings; warnings::warnif('deprecated', "Attribute \"$1\" is deprecated"); 0; } : $svtype eq 'CODE' && /^-?lvalue\z/ ? do { require warnings; warnings::warnif( 'misc', "lvalue attribute " . (/^-/ ? "removed from" : "applied to") . " already-defined subroutine" ); 0; } : 1 } _modify_attrs(@_); } sub import { @_ > 2 && ref $_[2] or do { require Exporter; goto &Exporter::import; }; my (undef,$home_stash,$svref,@attrs) = @_; my $svtype = uc reftype($svref); my $pkgmeth; $pkgmeth = UNIVERSAL::can($home_stash, "MODIFY_${svtype}_ATTRIBUTES") if defined $home_stash && $home_stash ne ''; my @badattrs; if ($pkgmeth) { my @pkgattrs = _modify_attrs_and_deprecate($svtype, $svref, @attrs); @badattrs = $pkgmeth->($home_stash, $svref, @pkgattrs); if (!@badattrs && @pkgattrs) { require warnings; return unless warnings::enabled('reserved'); @pkgattrs = grep { m/\A[[:lower:]]+(?:\z|\()/ } @pkgattrs; if (@pkgattrs) { for my $attr (@pkgattrs) { $attr =~ s/\(.+\z//s; } my $s = ((@pkgattrs == 1) ? '' : 's'); carp "$svtype package attribute$s " . "may clash with future reserved word$s: " . join(' : ' , @pkgattrs); } } } else { @badattrs = _modify_attrs_and_deprecate($svtype, $svref, @attrs); } if (@badattrs) { croak "Invalid $svtype attribute" . (( @badattrs == 1 ) ? '' : 's') . ": " . join(' : ', @badattrs); } } sub get ($) { @_ == 1 && ref $_[0] or croak 'Usage: '.__PACKAGE__.'::get $ref'; my $svref = shift; my $svtype = uc reftype($svref); my $stash = _guess_stash($svref); $stash = caller unless defined $stash; my $pkgmeth; $pkgmeth = UNIVERSAL::can($stash, "FETCH_${svtype}_ATTRIBUTES") if defined $stash && $stash ne ''; return $pkgmeth ? (_fetch_attrs($svref), $pkgmeth->($stash, $svref)) : (_fetch_attrs($svref)) ; } sub require_version { goto &UNIVERSAL::VERSION } require XSLoader; XSLoader::load(); 1; __END__ #The POD goes here #line 544 FILEfed5de85/auto/Cwd/Cwd.soJ(ELF48D4 (&%....(8Pdd  `- -x  ``p``(`Po&Koo(xo``>.;-C?  !"#%'()*+,-/123468:<=> $&.0579;, & < HNt [' nd    [     9" I) Wc - y /#/7IXcs*A .`-0*7K( eny"P.")8"T`f-s-yCwd.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummyCwd.cXS_Cwd_CLONETHX_unix_canonpathXS_File__Spec__Unix__fn_catfileXS_File__Spec__Unix__fn_canonpathXS_File__Spec__Unix_canonpathXS_File__Spec__Unix__fn_catdirTHX_invocant_is_unixXS_File__Spec__Unix_catfileXS_File__Spec__Unix_catdirXS_Cwd_abs_pathXS_Cwd_getcwdssp-local.c__do_global_ctors_auxcrtn.s__stack_chk_fail_localPL_markstack_ptrstrlcat_Jv_RegisterClassesPL_curpadPerl_sv_magicmemmovestrchrPerl_push_scopePerl_do_joinstrrchrPerl_mg_get_edataPL_stack_splstat64Perl_sv_newmortalPL_unitcheckavPerl_newXSPerl_stack_growPerl_sv_2pv_flags__stack_chk_guardstrlcpyPL_opboot_Cwdreadlink_GLOBAL_OFFSET_TABLE_PL_markstack_maxPerl_newSVpvn_initPL_stack_max_endPerl_xs_version_bootcheckPL_taintingPerl_newSVsvPerl_sv_setsv_flags_PROCEDURE_LINKAGE_TABLE__DYNAMICPerl_newSV__deregister_frame_info_basesPerl_sv_2mortalPerl_call_methodPL_scopestack_ixPerl_call_listPerl_croak_xs_usagePerl_markstack_growPerl_sv_catsv_flagsmemchr_etextmemcpyPerl_pop_scope__register_frame_info_basesPL_sv_undeferrno_lib_version_finiPerl_sv_setpv_mgPL_sv_yesPL_stack_basePerl_xs_apiversion_bootcheck__stack_chk_failPerl_mg_setPerl_getcwd_svlibgcc_s.so.1GCC_3.0libssp.so.0P&y <; /4ON16..\// /T/X/@/4// /)/4`/5/9/:.&.3.&.3./ //%///1 /$/'(/ ,/.0/+8//=/;///*/<hh$h0h4h 8h(<h0@h8pHh@`LhHPPhP@ThX0Xh` `hhdhplhxphthxhhhhhhph`hPh@h0h hhhhhhhh UVS>u])9s 9r拃 t$6ƃ[^]US\ÿt$D$\$ D$$tt $Ѓ[]Ë$ÐUVSWK 2D$$ D$$$(0,0[^]UWVSLE@ t$OUԋBu<t % =uMԋ@Eq D$ED$Eԉ$ƋEuD$$EY<$EЋUB tH MЋI MUU؋MuE܉E%E}܉<$'( U<U؍T$ DD$$D$E$EE‹@t R |/tD$$D$}<$D$E܉D$U$ DM<}䋻(U$cU,]u}]U8]u}QE,8  (p)ǃ~DU䋻($U,]u}]U8]u}ó, 2()D$E$~DDnU䋻($ U,]u}]UWVS,, 11z()V\ )9}T$D$$>U( oEUT$ DD$$D$E$cEwU$/U,,[^_]à $t$|$#¸B t& yur 8$t$|$ UWVS\,Eԋ 2(8EԉEȍU)‰EЅD$E$ MċE(}UЍTUUȋM̋AljEԃ}EЉ<$( Ủ (UȍT$ EĉD$$D$MЉ $EEԉ‹@t R |/tD$$D$Eԉ$D$|$Uԉ$ h;u (M+\+EȃD$EԉD$$9EԋM̋UԉJу}EЍT(UԉB,D$$?}ԋ?} G}EԃE h;u MЋ, D$.$,EMЋA% =u @EQ D$ED$EЉ$‹EDE̋UЉ$HEԀ}/tD$$D$Mԉ $D$|$Eԉ$DU}ԋ(Mԉ $PU,\[^_]ËDUԉB,D$$8mMЉ $EAUWVS, ,8 2()щUD$E$UE܋E\)9}D$|$<$NjE M؋( $E䋋(U؍T$ ED$$D$E$EtEE2 h;u& (+ \)D$|$<$NjE܉GGUW,D$$E}tMA(U$'U,,[^_]UWVS  u|U1ҋ, 99( <)v5D$4$$~4@tP , _,Dt8F% =u v DD$D$4$DD:/uLƅT/ƅUЃzD$D$T$q<Dž8D$T$Vu%D$D$T$"Tу8D$DD$T$<<w8w<uNDž T@T40(D$/@$sD@<E+@vNt$@D$4$?Ƅ5T@)N^n~.>N^n~.>N^n~x ( x  (  `----..////// !"#$%0//, -*5/C/Q/d/q // /t /' d  + I h[ }    " ) ------. .--. #.(...9."F.(R..-4.:-@`.F}.L.R*^/k/y/ -  &.5ERZf/my*A .(6`-<I0Nht( ""6J^e.ls"-- &Cwd.socrti.svalues-Xa.cDrodata.rodatacrtstuff.c__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN____JCR_LIST____do_global_dtors_auxcompleted.5017dtor_idx.5019frame_dummyobject.5029Cwd.cXS_Cwd_CLONEmy_cxtTHX_unix_canonpathXS_File__Spec__Unix__fn_catfileXS_File__Spec__Unix__fn_canonpathXS_File__Spec__Unix_canonpathXS_File__Spec__Unix__fn_catdirTHX_invocant_is_unixXS_File__Spec__Unix_catfileXS_File__Spec__Unix_catdirXS_Cwd_abs_pathXS_Cwd_getcwd.LC0.LC1.LC2.LC3.LC4.LC5.LC6.LC8.LC7.LC9.LC10.LC11.LC12.LC13.LC14.LC15.LC16.LC17.LC18.LC19.LC20.LC21.LC22ssp-local.c__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxcrtn.s_END___DTOR_END____dso_handle_START___stack_chk_fail_localPL_markstack_ptrstrlcat_Jv_RegisterClassesPL_curpadPerl_sv_magicmemmovestrchrPerl_push_scopePerl_do_joinstrrchrPerl_mg_get_edataPL_stack_splstat64Perl_sv_newmortalPL_unitcheckavPerl_newXSPerl_stack_growPerl_sv_2pv_flags__stack_chk_guardstrlcpyPL_opboot_Cwdreadlink_GLOBAL_OFFSET_TABLE_PL_markstack_maxPerl_newSVpvn_initPL_stack_max_endPerl_xs_version_bootcheckPL_taintingPerl_newSVsvPerl_sv_setsv_flags_PROCEDURE_LINKAGE_TABLE__DYNAMICPerl_newSV__deregister_frame_info_basesPerl_sv_2mortalPerl_call_methodPL_scopestack_ixPerl_call_listPerl_croak_xs_usagePerl_markstack_growPerl_sv_catsv_flagsmemchr_etextmemcpyPerl_pop_scope__register_frame_info_basesPL_sv_undeferrno_lib_version_finiPerl_sv_setpv_mgPL_sv_yesPL_stack_basePerl_xs_apiversion_bootcheck__stack_chk_failPerl_mg_setPerl_getcwd_svGCC: (GNU) 4.5.2ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2432% .? : ; ' @3 ,-n., -w /builds/hudson/workspace/nightly-update/build/i386/components/gcc45/gcc-4.5.2/libsspssp-local.c,.!Y |  ,AB AWA  -ttut)7!__stack_chk_fail_local,!GNU C 4.5.2/builds/hudson/workspace/nightly-update/build/i386/components/gcc45/gcc-4.5.2/libssp/ssp-local.c__stack_chk_fail_local.dynamic.eh_frame_hdr.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_version.SUNW_versym.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.rodata.str1.1.rodata.str1.4.got.eh_frame.data.ctors.dtors.jcr.bss.symtab.strtab.comment.debug_abbrev.debug_info.debug_line.debug_frame.debug_loc.debug_pubnames.debug_aranges.debug_str.shstrtab8  o, 4"x x <o Jo~Wo((Ph xxt B(x((`}`-`-----2--2.. ..////////////(/ d 950-@X@' @7@!xAH.A89A-I%B X0EBc BmFILE8c3c2585/auto/Fcntl/Fcntl.soAELF4<4 (R'R'T'T'@Pdd    ``0``<`4oo oo(po``>T';&53  #$%'*+- !"&(),./012 ( >@ JR cs th h >   "-  &2L[aj w R'2@ Zk} T'*"HZj ~.Fcntl.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummyFcntl.cget_missing_hashXS_Fcntl_S_ISREGXS_Fcntl_S_IFMTXS_Fcntl_S_IMODEXS_Fcntl_AUTOLOAD__do_global_ctors_auxcrtn.s__register_frame_info_basesPerl_sv_setpvn_edataPL_stack_spPerl_newSVpvfPerl_newSV_type_initPerl_mg_setPerl_xs_version_bootcheckPL_unitcheckavPL_opPL_sv_no_lib_versionPL_scopestack_ixPL_sv_undefPL_stack_maxPerl_sv_2mortalPerl_sv_free2_DYNAMIC_finiPerl_newSViv_etextPerl_croak_xs_usagePL_curpadPerl_mro_method_changed_inPerl_hv_common_key_lenPerl_croak_sv_PROCEDURE_LINKAGE_TABLE_Perl_newCONSTSUBPerl_sv_newmortalPerl_stack_growPerl_call_listPL_markstack_ptrPerl_xs_apiversion_bootcheckboot_FcntlPerl_sv_setuv_GLOBAL_OFFSET_TABLE_Perl_hv_commonPL_curcopPL_sv_yesPL_stack_base__deregister_frame_info_basesPerl_sv_2uv_flagsPerl_sv_upgrade_Jv_RegisterClasses_endPerl_newSVpvn_flagsPerl_newXSPerl_get_hvPerl_croaklibgcc_s.so.1GCC_3.0libssp.so.0P&y #, 3$5>@(H(P(X(`(h(p(x((((((((((((((((()))) )()0)8)@)H)P)X)`)h)p)x)))))))))))))))***(*4*@*L*X*d*p*|***********+ ++$+0+<+H+T+`+l+x++++++++++++,, ,,,8,D,P,\,h,t,,,,,,,,,,,,---(-4-@-L-X-d-p-|--------'' ' ' (''''!'''(')p'-h'`'*d'*l't'1x'|'',''+''$'''/'&''''"' '0''2''''( hh h$h(h ,h(@h0Hh8p\h@``hHPdhP@hhX0lh` thhxhp|hxhhhhhhhhph`hPh@UVSÊu])9s 9r拃 t$ƃ[^]US\ t$D$\$ D$$tt $Ѓ[]Ë$ÐUH]u} ÐD$$PD$D$D$ 0D$2T$$.ƿtG@ tx :$ ENjxuD$$ UP H]u}]U8]u}004  8 )׉}?}<)~D3<)D$t$4$wƋDDP u @%D$$G%;EuLP00]u}]U8]u}04 1u 8))ЉE䋃T@tP X4ƸtA8UDP u @%D$$X%D$4$gF @t4$iUMq0]u}]UWVS, 084 M8)‰E)NjT@tP X4ƃ}~8MD3<)D$|$<$[NjDDP u @%D$$.%D$4$=F @t4$?Ww0,[^_]UWVS,ÿ E024 9 8 )tT$$P T$RT$@ $Njp0D$D$D$D$D$ D$|$$t0NVtB L$ D$|$$k.NVtB L$ D$|$$;$C$KUWVSLÁ 0E܋4:80GEED$8D$U؋$D$ @D$M؉L$u)Ɖ$Et$3D$M$t$D$]$t$D$l$D$z$kE܍F$wEED$D$D$ FD$UT$M܉ $.uut$D$5xGuЃt%= t uED$UT$M܉ $(uD$<$EG OH >0 EUD$D$D$ FD$D$M܉ $[EuD$D$`EPBu6ȃt.ǁ t tD$MЉL$$>ht xtZLD$D$U܉$Nj@tPvP T$$`0@@MAPL$LL$D$L L$T$ D$D$E$uD$h$T>U܉$}Et$|$$@t$|$$@@t$|$$@t$|$$@t$|$$@`t$|$$`@ t$|$$A@t$|$$"@tD$$i8Lu؉ U0L[^_]Ë$ÐUVS.t&Ћu[^]Ë$US[Ëk[US[k[ExtUtils::Constant::ProxySubs::MissingYour vendor has not defined Fcntl macro %-p, used at %-p line %d %-p is not a valid Fcntl macro at %-p line %d Couldn't add key '%s' to %%Fcntl::Couldn't add key '%s' to missing_hashDN_ACCESSDN_MODIFYDN_CREATEDN_DELETEDN_RENAMEDN_ATTRIBDN_MULTISHOTFAPPENDFASYNCFCREATFDEFERFDSYNCFEXCLFLARGEFILEFNDELAYFNONBLOCKFRSYNCF_FSYNCFTRUNCF_EXLCKF_FSYNC64F_GETLEASEF_GETSIGF_NOTIFYF_POSIXF_SETLEASEF_SETSIGF_SHLCKLOCK_MANDLOCK_READLOCK_WRITELOCK_RWO_ALIASO_ASYNCO_DEFERO_DIRECTO_EXLOCKO_IGNORE_CTTYO_NOATIMEO_NOINHERITO_NOLINKO_NOTRANSO_RANDOMO_RAWO_RSRCO_SEQUENTIALO_SHLOCKO_TEMPORARYS_IFWHTS_ISTXTFD_CLOEXECF_ALLOCSPF_ALLOCSP64F_COMPATF_DUP2FDF_DUPFDF_FREESPF_FREESP64F_GETFDF_GETFLF_GETLKF_GETLK64F_GETOWNF_NODNYF_RDACCF_RDDNYF_RDLCKF_RWACCF_RWDNYF_SETFDF_SETFLF_SETLKF_SETLK64F_SETLKWF_SETLKW64F_SETOWNF_SHAREF_UNLCKF_UNSHAREF_WRACCF_WRDNYF_WRLCKO_ACCMODEO_APPENDO_BINARYO_CREATO_DIRECTORYO_DSYNCO_EXCLO_LARGEFILEO_NDELAYO_NOCTTYO_NOFOLLOWO_NONBLOCKO_RDONLYO_RDWRO_RSYNCO_SYNCO_TEXTO_TRUNCO_WRONLYS_ENFMTS_IEXECS_IFBLKS_IFCHRS_IFDIRS_IFIFOS_IFLNKS_IFREGS_IFSOCKS_IREADS_IRGRPS_IROTHS_IRUSRS_IRWXGS_IRWXOS_IRWXUS_ISGIDS_ISUIDS_ISVTXS_IWGRPS_IWOTHS_IWRITES_IWUSRS_IXGRPS_IXOTHS_IXUSRSEEK_SETSEEK_CURSEEK_END_S_IFMTLOCK_SHLOCK_EXLOCK_NBLOCK_UNFcntlv5.20.01.11Fcntl.cFcntl::AUTOLOADFcntl::S_IMODEFcntl::S_IFMTFcntl::Fcntl::S_ISREGFcntl::S_ISDIRFcntl::S_ISLNKFcntl::S_ISSOCKFcntl::S_ISBLKFcntl::S_ISCHRFcntl::S_ISFIFOFcntl::S_ISENFMT&6FVfv&6FVfv! ! ! " " " " ,"4";"B"I"P"V" a"i" s"|"""z"" " """" """ " " "# ###$#-# ;# E# Q#Z# d#m#s#z# ## ### # # ## ### #$ $!$ !$&$.$6$>$F$N$V$^$f$"n$ "x$#$ #$$($$ )$$$$ `$$$$ $@$% %%$% /% :%C%J%R%Y%`%h%q%y%@%`% %@%%%%%% %%%8%%%%& &&&#&+&3&;&@C&L&U&^&f&n&v&~&  < p (      !T'( ((( (@(-.( (!  ,7(E(S(f (s --@ - s h h > )/@(C H&M!R$!Wh!\&a&f&k&p&u&{&!!&&&''"'1'A',(( (  )"ET-[gu  $- 3@R'G[e / :HT'^mw" .Fcntl.socrti.svalues-Xa.cDrodata.rodatacrtstuff.c__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN____JCR_LIST____do_global_dtors_auxcompleted.5017dtor_idx.5019frame_dummyobject.5029Fcntl.cget_missing_hashXS_Fcntl_S_ISREGXS_Fcntl_S_IFMTXS_Fcntl_S_IMODEXS_Fcntl_AUTOLOADvalues_for_iv.11754values_for_notfound.LC0.LC1.LC2.LC3.LC4.LC5.LC6.LC7.LC8.LC9.LC10.LC11.LC12.LC13.LC14.LC15.LC16.LC17.LC18.LC19.LC20.LC21__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxcrtn.s_END___DTOR_END____dso_handle_START___register_frame_info_basesPerl_sv_setpvn_edataPL_stack_spPerl_newSVpvfPerl_newSV_type_initPerl_mg_setPerl_xs_version_bootcheckPL_unitcheckavPL_opPL_sv_no_lib_versionPL_scopestack_ixPL_sv_undefPL_stack_maxPerl_sv_2mortalPerl_sv_free2_DYNAMIC_finiPerl_newSViv_etextPerl_croak_xs_usagePL_curpadPerl_mro_method_changed_inPerl_hv_common_key_lenPerl_croak_sv_PROCEDURE_LINKAGE_TABLE_Perl_newCONSTSUBPerl_sv_newmortalPerl_stack_growPerl_call_listPL_markstack_ptrPerl_xs_apiversion_bootcheckboot_FcntlPerl_sv_setuv_GLOBAL_OFFSET_TABLE_Perl_hv_commonPL_curcopPL_sv_yesPL_stack_base__deregister_frame_info_basesPerl_sv_2uv_flagsPerl_sv_upgrade_Jv_RegisterClasses_endPerl_newSVpvn_flagsPerl_newXSPerl_get_hvPerl_croakGCC: (GNU) 4.5.2ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2432.dynamic.eh_frame_hdr.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_version.SUNW_versym.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.rodata.str1.4.rodata.str1.1.got.eh_frame.data.ctors.dtors.jcr.data.rel.ro.local.bss.symtab.strtab.comment.shstrtab@  o, 04"<o Jo fWo<<4h ppt B((x}    2 2!!pT'T'(( ( ((((( ( (@(@( -- -pU X60v;X ;FILEa4a646d2/auto/File/Glob/Glob.sonELF4g4 ()(KKKK@l@Pdd  I I0 ` ``0```oCoooho``>K;DKa] !"#$%&)+-/24678;>?ABCEGIKMNOPQSUVWX\  '(*,.01359:<=@DFHJLRTYZ[I '0 = IT  ]<- di  jr!* ~! L#4 &Y ) g0. 0 -r A.& `3 ~3 4 "8# ? E8 8 :z 4y93 ;&< R< k= @I y1< "2i .5BJVenz NIKLN,=DK _IewK/5 O]mxIpF !*:DJW"u .:NYgxGlob.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummybsd_glob.cg_strchrg_CtocmatchS_croak_memory_wrapglobextendglob2glob3glob0ci_compareglobexp1globexp2Glob.cerrfuncglob_ophookiteratecsh_glob_iterXS_File__Glob_csh_globXS_File__Glob_bsd_glob_overridedoglob_iter_wrapperdoglobXS_File__Glob_AUTOLOADXS_File__Glob_GLOB_ERRORXS_File__Glob_bsd_globssp-local.c__do_global_ctors_auxcrtn.s__stack_chk_fail_localPL_curcopPerl_gv_add_by_type__register_frame_info_basesPerl_get_svbsd_globfreeqsortPerl_safesysmallocgetenvPL_charclassstrlcpyPerl_mg_getPerl_ck_warnergetpwnamPL_tainting_edataPerl_av_push_DYNAMICPerl_hv_common_key_len_finiPerl_newCONSTSUBPerl_sv_setpvn_etext_end__stack_chk_guardPerl_call_listPerl_sv_2iv_flagsPerl_croakPerl_croak_svPL_scopestack_ixgetuidstrcmp_Jv_RegisterClasses_initPerl_sv_2pv_flagsPL_memory_wrapPL_opfreehookPerl_newSVivclosedirPerl_sv_newmortalPerl_sv_setiv_GLOBAL_OFFSET_TABLE_PL_unitcheckavPL_markstack_ptrlstat64PL_sv_yesPerl_xs_apiversion_bootcheckerrno_PROCEDURE_LINKAGE_TABLE_PL_stack_basePerl_newSV_typePL_tainted_lib_version__stack_chk_failmemchrPerl_sv_upgradePL_curpadPerl_safesysfreePerl_sv_2mortalPerl_av_shiftboot_File__GlobPL_phasetolowerPL_globhookPerl_sv_free2PL_defgvPerl_stack_growreaddir64PL_opPL_stack_max__deregister_frame_info_basesPL_sv_undefPerl_croak_xs_usagePerl_sv_catpvn_flagsPerl_block_gimmePerl_newSVpvfgetpwuidPerl_newSVpvn_flagsPerl_mg_setPerl_xs_version_bootcheckPerl_newSVpvnPerl_markstack_growPL_stack_spPerl_safesysreallocPerl_newXSPerl_sv_magicPL_markstack_maxPerl_mro_method_changed_inPerl_get_hvopendirmemcpylibgcc_s.so.1GCC_3.0libssp.so.0P&y 8W (, !cH:[P>`MlMxMMMMMMMMMMMMNLPL LL,MK!L$M%(M+L,4M.L0L2L4L9TL>MApLC0LE`LFLGLI\LTLXKKHKHKL?L LULL: L-$L@(L ,L[4L'8L f?tQf[t]f*;Ǹ;uE D$U$af?^fыEfx)KURfUf>f>!Eԍ4F҉Uf>-u[} t:$^EЋE؉$PE9E/F$<9ENf9ErEf;FF8} t!$EE؉$9Ef;EEf=]V;}tuE;UB} t!$E<$9Ef9u?EE9uXf8(! <[^_]USb*$D$$$UWVS<6*E؉֋BEЋBtCfnEfEm؃`݃hvMЍT$$ljF:fnEfEm؃`݃hv>UЍ$Džu)V$F~u)N~"<ȃxuٍ<~Efu+EEԋM$E܅t9Eԉ$U܋EZtU܉$LVM܉ FF @t"EЋU=v8}<[^_]UWVSÃ(4,EtN]\uf[F!Df[G!u fG!fff>-uVf]tf-ffP]uƋJ f]xHI f?1H ;tf*tf* f%fffftRML$L$ut$ L$T$$YtJ ;u?B uR u(P E$DjQ uH0DщT$ D$+D$BB$A \[^_]UWV0ljUf8{u4fx}u-fxu&AED$E$2u E"EE{ƅuɋU0^_]UWV 9t f9ufP@fֹf[u+VFf]tftf]tfufEf{uf}u fu 9vFUM 7Džf[t$f[w f,^f{t:f}:VFf]tftf]tfufEt|us9s7Ѝ<0AfF9uyLf fuUU N9M  ^_]ËfUSmEU T$$[]UWVS<=E0} t|Mʋp }u z }p<u 9}uEt}uMMp4uB p4ʁu )uE D$M $<[^_]UWVMUBBE B EBBE uu91usu99Eƒ\uu@fFf~9sA9t?ȃ}f09s*1t#ꍅfE t  ^_]UWVS[UBtCыR9t 4t$tUB$MA[^_]Ë$ÐD$ tt øUS$yVt8tbdtFE@f%ftf=u/D$D$D$ DD$ED$$htU$Ѓ$[]UWVSlE|8@t ƃuE7GEȃdu$ odD$D$D$ 0D$T$d$EĀx F t4$$Fut<tp%= tdB 8uD$$@ 0F t4$Fu)<t%%= tEEu+F% =u@EF ED$ED$4$E̋F EtU;V u E<tUD$ED$ủ4$cP uRU@ ED$UT$$E̋E}trvmD$D$Ẻ$tO8D$ỦT$D$ D$xD$$;}u6}9|EȉED$ ED$ỦT$Eĉ$U6u|8q}Uċ@+U9}D$uȉt$4$PEȋUċPUfnEfEm؃d݃pv$D$$EȃuċN T$L$$@UȍTUD$D$D$ @D$t$d$mUċxtE$$uȉGD$D$D$ DD$D$d$EUȉ|uȉ0l[^_]USò[]UVSÎ| 1 )щ )ȅtP/)ƒD$D$$PH|M[^]UVS| 1 )щ )ȅtP/)ƒD$D$$PH|[^]UWVSl|Y$֋|EU T$ D$t$`E+U9}D$ED$$ME}EE̋M׹уD$L$$Ƌ9t(D$D$ D$tD$$EE0EU9Uy|ME$l[^_]UWVS,I&|ED$$@% =u D$$@E)D$$D$$E;u{E䋋+|EUE 6u䋓U0@t t|MHD$ E$Ut9ur$}@D$<$9us,[^_]U(]u} æE|2 9  )tT$$zP T$RT$@ $crJtQ t$ T$D$$-$$-U8]u} |:)tD$E$@tP 4ƍGE8`D$4$F @t4$wE|]u}]UWVSL" |Eԋ })D$E$MЋP u RUp D$UT$$ƋEv{D$D$4$t`8D$t$D$ D$xD$$;WEЍ|~AUЋDP u@D$$jD$$\@% =uD$$7P(D$$D$$E)|L[^_]UWVS\. EE|ED$$@% =u D$$@E)D$$hD$$hE̋@t ƒUFEu uD$ M $J} EEEERU't\"o}u#D$M $kE؀}tH }t#D$ +ED$ED$U؉$BWl<\u59v^M:uVD$ ЍD$T$E؉$08Eu+D$ )ЉD$T$U؉$Er9wM؉ME p%=u)pE  tE pVF%=tU U9sW}t%+E D$U T$M $IEUT$+E D$E $EEU U}MAvAE~D$U$M ME[}EDljE98<"t<')}u1G+ED$U$]E؉}}H D$ G+ED$ML$E؉$-}E䋓p%=}tQ}u&+ED$M $E؀}t.H %D$ +ED$ED$U؉$}tL}u$ $EȋM؉L$Eȉ$EE }UD׉U9}Mȋ@Q UԃE܉}uЋ};uh+|0Uԋ@ U| M䋓 4)‰EЃ9ur@D$<$9usMЍ40}t Em5}uЃ}}‰քut.t!D$ +}|$ED$U؉$ M؋I M;uGM+|UЉŰEt"U؋BvBD$M؉ $|8E䋃 }u }tTE M΃9w@D$U$9sU+UUЋ|MЉ\[^_]UWVSLb|E䋃:0GEED$D$U؋$D$ D$E؉D$U)‰$t$D$$t$D$$t$eD$$ft$D$$Jt$FD$;$.B0ǃd4hD$P$E܍F$EED$D$D$ FD$UT$E܉$uUT$$xGuЃt%= t uED$UT$E܉$w(uD$<$QUW OJ >0u܉4$FHtD$L$6Tu؉ U|L[^_]Ë$ÐUS[]Ë$ÐUVS.Ödtd&Ћu[^]Ë$US[WS[7{[GLOB_ABENDGLOB_ALPHASORTGLOB_ALTDIRFUNCGLOB_BRACEGLOB_ERRGLOB_LIMITGLOB_MARKGLOB_NOCASEGLOB_NOCHECKGLOB_NOMAGICGLOB_NOSORTGLOB_NOSPACEGLOB_QUOTEGLOB_TILDEGLOB_CSH%spattern_sv, ...HOMEFile::Glob::bsd_globpatternFile::Glob::DEFAULT_FLAGSv5.20.01.23Glob.cFile::Glob::GLOB_ERRORFile::Glob::csh_globFile::Glob::bsd_glob_overrideFile::Glob::AUTOLOADFile::Glob::AAInvalid \0 character in %s for %s: %s\0%s%-p is not a valid File::Glob macro at %-p line %d Couldn't add key '%s' to %%File::Glob::&6FVfv&6FVfv&6FVfv&I I I@I II @J J J )J 6J BJ OJ ZJ eJ.`0   h   0 IIII@KHKXKKqJCJIJOJUJ[JaJgJmJsKy0KK+HM7;6IJ  !#$&(*+-.02345679;<=>?@BCEFH "%'),/18:ADGI3 % ; GLlL \? j  : -$ Q b C `  c!  .m" Br# W& n', ( )P K,- 3  ,=IxWt8y}7"X4)@8GVgp{7&5D 4JXfo@4 (4? S^h"x.) h IO.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummyIO.cio_pp_nextstateio_ck_lineseqXS_IO__Socket_sockatmarkXS_IO__Handle__create_getline_subsXS_IO__Handle_syncnot_hereXS_IO__Handle_setbufXS_IO__Handle_setvbufXS_IO__Handle_flushXS_IO__Handle_untaintXS_IO__Handle_clearerrXS_IO__Handle_errorXS_IO__Handle_ungetcXS_IO__Handle_blockingXS_IO__Seekable_setposXS_IO__Seekable_getposXS_IO__Poll__pollXS_IO__File_new_tmpfilepoll.cssp-local.c__do_global_ctors_auxcrtn.s__stack_chk_fail_localerrnoPL_stack_spPerl_eval_pvPerl_newXS_flagsPL_sv_undefPerl_sv_free2Perl_xs_apiversion_bootcheck_endPerl_newCONSTSUBPerl_newRVPerl_do_openn_etextPerl_mg_set__register_frame_info_basesPerl_croak_xs_usagePerlIO_getposPerl_PerlIO_filenoPerl_PerlIO_clearerr_lib_versionPerl_hv_common_key_len_edataPerlIO_tmpfilePL_markstack_ptrPL_checkPerl_newSVfsyncPerl_PerlIO_flushPerl_sv_newmortalPerlIO_isutf8_GLOBAL_OFFSET_TABLE_Perl_sv_setivPL_sv_yesfcntlPerl_sv_2pv_flagsPerl_newSVuvPerl_gv_stashpvnPerl_sv_setpvnPL_unitcheckavPerl_call_list_initPerlIO_ungetcPerl_sv_bless_DYNAMICPerl_uvoffuni_to_utf8_flags_finiPerl_gv_stashpvPL_stack_basePerl_newSViv__stack_chk_guard__stack_chk_failPerl_sv_2iv_flagsPL_opPerl_PerlIO_unreadPerl_sv_2mortalPerlIO_setposPerl_sv_2ioPerl_croak_Jv_RegisterClassesPerl_newXSPL_curcop__deregister_frame_info_basesPerl_xs_version_bootcheckPL_scopestack_ixPerl_PerlIO_errorPerl_newGVgen_flagsPerl_sv_2nv_flagsPL_curpadboot_IO_PROCEDURE_LINKAGE_TABLE_PL_ppaddrPerl_sv_2uv_flagslibgcc_s.so.1GCC_3.0libssp.so.01P&y ?Lg fIN4?)7708778!|8'7082757<7>8A7E7H77?7?777:7777&7 7#77777;7778B84 8D8I88*8- 86$8$(8",8148988<8@88D8H8L8CP8T8 X8 \8/`8+d8h8@l8=p8t8%x8 8(83hh8h<h@h Dh(Hh0Lh8pPh@`ThHP\hP@`hX0dh` lhhphpxhx|hhhhhhhhph`hPh@h0h hhhhhhhh h(h0h8ph@`hHPhP@hX0h` hhhp hxUVS,u]0$ )9s 0 09r拃 t$ƃ,[^]US\wt$4D$\$ D$$H(tt ($Ѓ[]Ë$ÐU]u}! 7$P(7]u}]VSD$ Pt$JfffwrRu[^UWVS,{,024)щtD$E$JU$B@ $G$ONj4UUJUtBu'D$ D$4$'|$4$4U,,[^_]UWVS,},024)щtD$E$LUP u@ D$D$$~X8D$$ft@X4$JU,,[^_]UWVS,,024)щtD$E$N<E$F@uE$2@ t2$3$E䋃4E6U}u!fh40G}u'D$ D$4$ED$4$48,8,[^_]UShGD$4$UVSC",024)уD$E$$xt j4,[^]U]uÎ,024)t\$UWVS,P/,024)щt)D$E$<$@t*$E䋃4EU}u!fh40G}u'D$ D$4$ED$4$48,8,[^_]UWVS,3,024)щt)D$E$UE$@tP t<NjE$t HAh442D$<$G @t<$#~4U,,[^_]UWVS,0,024)щt)D$E$U$@ E䋃$@tP t<ǃ}tE$jh442D$<$G @t<$~4U,,[^_]UWVS,&,024)щt)D$E$U$@ E䋃$@tP t<ǃ}t E$ph442D$<$G @t<$~4U,,[^_]UWVS\!MU1ҋ,08784<)t0D$ $~U$@ E4t$@tP tEEă}oFu*% =u xyOD$4$.x;FtA% =u@v(D$4$v$F% =upD$4$ƃvw#E$ut$U$E$u$D$t$U։U$+EED$ED$U$¸;UuC}484$$U4,Yh442D$Uĉ$)E@ @t$UĉV4U,U3t \[^_]UWVS, _,8024)Wv:D$E$-U܋$%@ E~64DP u@D$$ tEE}uh U$D$D$$Dž}u E }~0${E;}t&U$gUT$D$$x>u܋40DŽ$$U܋4,4 U,,[^_]UWVS, â,0:4)щtID$E$qwU$i@ 4Tt-T$$Nj4UUeUu"bh4u0=Bu'D$ D$4$ |$4$4U,,[^_]U8]u} p,024)щt)D$E$?U$7x tFU䋃4UMU4D$<$t04h44U,]u}]UWVS< w ,00 MЃ4)UD$E$FUЃ M̋P u @ED$$Eȃ40u؉u܍$Eԋp }EЍE4MP u@D$$}4MDP u@D$$MUfDfDE9}mMȉL$E؉D$4$Exg}~aUЍ<EuMD$48$5MDD$4D8$9u}t"MԋAvAD$Eԉ$b4u7U$$U,<[^_]UWVSLH' ,0:4)vbD$E$xM~7P u@ ED$D$$"EED$E$ƅ@PD$D$D$ DJL$T$@$XD$ D$UT$D$D$D$ D$D$4$44E4$$MUD$M $D$4$tOFvF?D$4$N14tFvF D$4$48,8L[^_]UWVS<,E0 M40σED$D$$D$ D$|$UM)$t$|D$$t$PD$$t$D$$t${D$$D$D$ t$D$$yt$D$$Mt$D$$1t$D$%$t$D$:$t$D$N$t$D$$t$aD$$t$sD$`$t$uD$$mD$D$ t$wD$q$OD$D$$A$#D$D$4$-$D$D$4$ $D$D$4$$@D$D$4$$D$D$4$$yD$D$4$$WD$D$4$a$@5D$D$4$?$D$D$4$$D$D$4$$ D$D$4$D$D$ $$D$D$4$$@kD$D$4$u$ID$D$4$S$'D$D$4$1$D$D$4$$D$(D$4$tD$$4 U,<[^_]Ë$ÐUS[]Ë$ÐUVS.Öt&Ћu[^]Ë$US[W[US[7+[sock0 but truecodearghandle, ...IO::Handle::setbufIO::Handle::setvbufhandlehandle, chandle, blk=-1handle, postimeout, ...packname = "IO::File"IO::File+>&v5.20.01.31IO.cIO::Seekable::getposIO::Seekable::setposIO::File::new_tmpfileIO::Poll::_poll$;$IO::Handle::blockingIO::Handle::ungetcIO::Handle::errorIO::Handle::clearerrIO::Handle::untaintIO::Handle::flushIO::Handle::syncIO::Socket::sockatmarkIO::PollPOLLINPOLLPRIPOLLOUTPOLLRDNORMPOLLWRNORMPOLLRDBANDPOLLWRBANDPOLLNORMPOLLERRPOLLHUPPOLLNVALIO::Handle_IOFBF_IOLBF_IONBFSEEK_SETSEEK_CURSEEK_END%s not implemented on this architectureUsage: IO::Handle::setvbuf(handle, buf, type, size)Negative character number in ungetc()Wide character number in ungetc()IO::Handle::_create_getline_subs~.>N^n~.>N^n~.>N^nLL @` `  h  4@4X4\467888888 !"#$%8883 X4)48B8P8c8p 88 8lL ?   : --$ 6Q Kb aC u`  c!  m" r# & ', ( )P "K,- :]4?b4Dm4Ir4N6Sv4X4]6b4g4l4r7x87~4444455 555,5A5W5g5k5555555\7i55666  6&(6,362>68I6>T6D]6Je6Pm6Vv6\6b6h6n6t6z6)8883 (5FR`}8}7"%X42I8P_py7 />M 4Saox@4#1=H \gq"x.) h (IO.socrti.svalues-Xa.cDrodata.rodatacrtstuff.c__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN____JCR_LIST____do_global_dtors_auxcompleted.5017dtor_idx.5019frame_dummyobject.5029IO.cio_pp_nextstateio_ck_lineseqXS_IO__Socket_sockatmarkXS_IO__Handle__create_getline_subsXS_IO__Handle_syncnot_hereXS_IO__Handle_setbufXS_IO__Handle_setvbufXS_IO__Handle_flushXS_IO__Handle_untaintXS_IO__Handle_clearerrXS_IO__Handle_errorXS_IO__Handle_ungetcXS_IO__Handle_blockingXS_IO__Seekable_setposXS_IO__Seekable_getposXS_IO__Poll__pollXS_IO__File_new_tmpfile.LC0.LC1.LC2.LC3.LC4.LC5.LC6.LC7.LC8.LC9.LC10.LC12.LC13.LC14.LC15.LC16.LC18.LC17.LC19.LC20.LC21.LC22.LC23.LC24.LC25.LC26.LC27.LC28.LC29.LC30.LC31.LC32.LC33.LC34.LC35.LC36.LC37.LC38.LC39.LC40.LC41.LC42.LC43.LC44.LC45.LC46.LC47.LC48.LC49.LC50.LC51.LC52.LC53.LC54.LC55.LC56poll.cssp-local.c__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxcrtn.s_END___DTOR_END____dso_handle_START___stack_chk_fail_localerrnoPL_stack_spPerl_eval_pvPerl_newXS_flagsPL_sv_undefPerl_sv_free2Perl_xs_apiversion_bootcheck_endPerl_newCONSTSUBPerl_newRVPerl_do_openn_etextPerl_mg_set__register_frame_info_basesPerl_croak_xs_usagePerlIO_getposPerl_PerlIO_filenoPerl_PerlIO_clearerr_lib_versionPerl_hv_common_key_len_edataPerlIO_tmpfilePL_markstack_ptrPL_checkPerl_newSVfsyncPerl_PerlIO_flushPerl_sv_newmortalPerlIO_isutf8_GLOBAL_OFFSET_TABLE_Perl_sv_setivPL_sv_yesfcntlPerl_sv_2pv_flagsPerl_newSVuvPerl_gv_stashpvnPerl_sv_setpvnPL_unitcheckavPerl_call_list_initPerlIO_ungetcPerl_sv_bless_DYNAMICPerl_uvoffuni_to_utf8_flags_finiPerl_gv_stashpvPL_stack_basePerl_newSViv__stack_chk_guard__stack_chk_failPerl_sv_2iv_flagsPL_opPerl_PerlIO_unreadPerl_sv_2mortalPerlIO_setposPerl_sv_2ioPerl_croak_Jv_RegisterClassesPerl_newXSPL_curcop__deregister_frame_info_basesPerl_xs_version_bootcheckPL_scopestack_ixPerl_PerlIO_errorPerl_newGVgen_flagsPerl_sv_2nv_flagsPL_curpadboot_IO_PROCEDURE_LINKAGE_TABLE_PL_ppaddrPerl_sv_2uv_flagsGCC: (GNU) 4.5.2ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2432% .? : ; ' @3 33n.33w /builds/hudson/workspace/nightly-update/build/i386/components/gcc45/gcc-4.5.2/libsspssp-local.c3.!Y |  3AB AWA  3ttut)7!__stack_chk_fail_local3!GNU C 4.5.2/builds/hudson/workspace/nightly-update/build/i386/components/gcc45/gcc-4.5.2/libssp/ssp-local.c__stack_chk_fail_local.dynamic.eh_frame_hdr.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_version.SUNW_versym.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.rodata.str1.1.rodata.str1.4.got.eh_frame.data.ctors.dtors.jcr.bss.symtab.strtab.comment.debug_abbrev.debug_info.debug_line.debug_frame.debug_loc.debug_pubnames.debug_aranges.debug_str.shstrtab8  ToLL , LL4" S<o@@ Jo``Wolh ``t Bxhh} 4 4@4@4X4X42\4\4U26677888888888888 8P  E:06NXN' N7N!OH.O89P-I-P X0MPc PmFILEbd772ab0/auto/List/Util/Util.soELF44 ( 8Pdd [ E | @|d g  `T` ```o6oo@Po``>;kj !"#$&'()+./023578;<=>?@ABCDEGJKLNOPSTVXY\]_`acdefhi  %*,-1469:FHIMQRUWZ[^bg '" = # IT# k)$ $ % &* & '6  ) $) <+  U,| l," -' .- 0 2 3 4 4Y &H6u 8: M; _}A'  uJ vS  ] pc ;l { "*9G [kt!2>N\i""1ARer@|+:Pbr~X  |&3X|@Pdnŷ+?Zty OZiw  ! ; Util.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummyListUtil.cXS_Scalar__Util_isweakXS_Scalar__Util_isdualXS_Scalar__Util_openhandleXS_Scalar__Util_isvstringS_croak_memory_wrapXS_Scalar__Util_set_prototypeXS_Scalar__Util_looks_like_numberXS_Scalar__Util_readonlyXS_Scalar__Util_taintedXS_Scalar__Util_unweakenXS_Scalar__Util_weakenXS_Scalar__Util_refaddrXS_Scalar__Util_reftypeXS_Scalar__Util_blessedXS_Scalar__Util_dualvarXS_List__Util_shuffleXS_List__Util_pairvaluesXS_List__Util_pairkeysXS_List__Util_pairsXS_List__Util_minXS_List__Util_minstrXS_List__Util_sumXS_List__Util_pairmapXS_List__Util_pairgrepXS_List__Util_pairfirstXS_List__Util_reduceXS_List__Util_anyXS_List__Util_first__do_global_ctors_auxcrtn.s__deregister_frame_info_basesPerl_push_scopePL_memory_wrapPerl_sv_setuv_Jv_RegisterClassesPerl_sv_2mortal_DYNAMICPerl_sv_setnvPL_top_envPerl_gv_stashpvnPerl_sv_2uv_flagsPL_curstackPerl_was_lvalue_subPerl_newSV_typePL_opPerl_sv_magicPerl_sv_2iv_flagsPerl_sv_del_backref_edataPerl_newRV_noincPL_sv_undefPL_srand_calledPL_stack_basePerl_call_svPerl_sv_mortalcopy_flagsPerl_newXS_flags__register_frame_info_basesPerl_newSVsvPL_curpmPerl_save_vptrPerl_call_listPerl_hv_common_key_lenPerl_pad_pushPL_markstackPerl_newSVivPerl_pop_scopePerl_gv_fetchpvPL_markstack_maxPerl_safesysmallocPerl_av_pushPerl_sv_2bool_flagsPL_scopestack_ixPerl_ckwarnPL_sv_noPerl_sv_setsv_flagsPL_stack_maxPerl_mg_setPerl_looks_like_number_finiPL_curstackinfoPerl_block_gimmePerl_gv_add_by_typePL_unitcheckav_GLOBAL_OFFSET_TABLE_Perl_save_pushptrPerl_sv_reftypePerl_sv_2cvPerl_save_strlenPerl_save_sptrPerl_markstack_grow_PROCEDURE_LINKAGE_TABLE_Perl_sv_cmp_flagsPerl_sv_taintedPerl_sv_rvweaken_initPerl_sv_upgradePerl_amagic_callPerl_mg_find_lib_versionPL_random_statePerl_croak_popstackPerl_warnPL_tmps_ixPerl_sv_free2_endPerl_xs_apiversion_bootcheckPerl_sv_2nv_flagsPerl_mg_getPerl_new_stackinfoPL_markstack_ptrPerl_seedPL_comppadPerl_gv_init_pvnPL_taintingPL_tmps_floorPerl_croak_xs_usageboot_List__UtilPerl_cxincPerl_drand48_rPerl_sv_setpvPL_runopsPL_stack_spPerl_sv_setivPerl_croak_no_modifyPL_defgvPerl_drand48_init_rPerl_sv_copypv_flagsPerl_croakmemcpyPL_sv_yesPerl_sv_newmortal_etextPL_curpadPerl_xs_version_bootcheckPL_curcoplibgcc_s.so.1GCC_3.0libssp.so.0E P&y S .d  !"#~hXl]rD  P@(,$"X&(*4,. 25FI$P<RTU@[ \h_0dTg i ,V8N<DHbLaXe\C`0d]h/l?p+tHx^|@8ZBM Q`Yāȁ(́Ё)ԁ>؁#܁-93%;:OX0 478!D'HcLJPGT$\<`dlLphtx | S4hh,h8h<h Hh(Lh0Xh8p\h@``hHPdhP@hhX0lh` phhthpxhx|hhhhhhhhph`hPh@h0h hhhhhhhh h(h0h8ph@`hHPhP@hX0h` hhhphx0h4h8hDhHhLhPhThp\h``hPdh@lh0ph thxh|hhhhUVSV^u])9s 9r拃 t$Vƃ[^]US\]t$D$\$ D$$tt $Ѓ[]Ë$ÐUVS6Xc] 0$ ()։t]D$E$ЋIu04( [^]U(]u}W\ 0$ ()։t]D$E$<4Ft4$(FDt 3u440(8 8]u}]U8]u}V[ $:()щt]D$E$;U4F t4$-F tv F utJF tCpu9t5~ uF t)D$q4$t(U (@ U ]u}]U8]u}UZ 0$ ()։t]D$E$5<4F t4$*(EFtD$V4$t044U(8 8]u}]UST$ZDD$`$U(]u}TY 0$( )ΉtcD$E$1J4 |A t=A P t$1G tD$|$$'滉P$(0 0]u}]UWVS,SY $:()щt]D$E$[U4P@tP TEuEF t4$$F t:F @ t1@ t'D$ D$ @D$4$9E4$<4(2D$E$.UB @t$-EF(U ,[^_]UWVS,RW $:()щt]D$E$%UE䋃P@tP T4?ƋE@ t$<(8UB%D$4$6F @t4$8w(U ,[^_]UWVS,QV $2()щt]D$E$3UE䋃P@tP T<MNjE@ t$UBt$q4(2D$<$.G @t<$0~(U ,[^_]UVSPU $2()щt]D$E$,Bu<t uq$#t $ tU$Et t&J %BAT$ $u( [^]UVSOT $2()щt]D$E$!D$(0 0[^]U8]u}2O_T $:()щt]D$E$U4P@tP TEEF t4$gF u (@ U K<(8F D$E$UB @t$EG(U ]u}]UWVS,NCS $:()щt]D$E$U4P@tP TEEF t4$KF u (@ U [D$F $D$E$4(0UB @t$cEF(U ,[^_]UWVS,LR $2()щt]D$E$[U$$UEUM 9ENjM؋ET( ,[^_]UWVSF P4Rp (+F F$$+F (F,FFPEԁ@u@EtEԋMN@4F(Fx4uAD$ $Uԃ`P"PfFU@4@4~D$Mȉ $mD$<$EUP4MȋAP TU@EEZM̋ MԋUB MA UЃ@9~Ű|8EȋP@ B tD$$u<t t'@wUB 80uEt'ft yu,tk@zuXD$$tD}u1Eԉ$UċM̉Uԉ<$UԋM̉E }Eă9u PRPB(MB4u#tAvAD$E$ HIPHr 1r $1$1r(1J, @uW1(+VR  I 41  I U6u}P}'}̋$E;u|4E Mȋ(0E̋MA ỦMA UЃ@M9~(T2UԋUԉ$X;uX$(M+ D$E$; 3B tD$$ u<vt t*@w`B 80uPvt/vt yu3@zuD$$tu}ubEE(ED$M̉ $NUȉUċMD (ED$Eԉ$ỦE }Eă9}}uEċMT( 8}u'(u7Uĉ$VU  Ml[^_]UWVS\O(|- E̋$ Mԃ(u)։UЉUąD$E$}ԃ}}D$ UT$UT$Uȋ$ƋP@EuEEu$ t$D$D$$D$D$$hEG $jMA $\@0t}{n(M M@$E<E $,P$ƀ @ Eԅu(D$)$ Eԋ UԉBP MAA@MЍM)ȋ(+BUԋP Mԋ@ Mԋ@  A;A}A UMԉA PRPU (+EԉP UԉB$$+MԉQ (A,AAPÉ@u@EtE̋Eԉp@4UԉB(Bx4uFD$ 4$Ũ`P"PҋMfQ@4@4~D$E$vD$<$NP4MA<P T@Ẽ}EuM MԋG UB Uă@M9~ UTUЋMЉŰP@ B tD$$_u<t Bt'3@w_#B 80uOt-t yu7@zuD$$u PRPB(B4u tFvF D$4$ HIPHr 1r $1$1r(1J, :@u(+>zR 06v <>06v4 2 MI}uX(u7D$Eԉ$UUȍ4MD$EЉ$/Uԉ7 0(0uȉ u0 0d PR@Ћ@(B4u tFvF D$4$c HIPHr 1r $1$1r(1J, 2@u(+7rR 06v <> 06v UMȍ(>EԍEE U(UԋEG MUB Uă@M;U~(MԋT ŰỦ$X;u*$(M+ D$4$ gB tD$$t@u<t #t'@w^B 80uNt,t yu7@zuD$$}uU(u7D$E$1Uȍ4MD$Ẻ$ UЉ7 0i(0uȉ u0 0F}ȍ( *9uuEEE9E뺃\[^_]UWVS\Fs# E$( u)ΉMЉMąD$E$UUU4Eԋ(8D$ ED$ED$4$E̅u$}&(@u U }}D$D$$rD$D$$RNjF $UG $JF UԉMȋA9tD$D$$ű@0t}G@$E E$P$ƀ p u$D$)$ Ƌ Fp FF@(E+BP @ @  0F;F}FJF B4@r (+V F$$+V (F,FFPE@u@EtEM̉N@4F(Fx4uAD$ $U`P"PfFű@4@4~D$E$}D$<$UŰP4MAP Tű@E}~QG MȋUP@ 9EtD$D$Mԉ $9u PRPB(űB4u#tFvFD$Ẻ$Ͽ HIPHr 1r $1$1r(1J, @uz1(+VR  I 41 I  U$ MЋG Mȋ$X;u$(M+ D$Ẻ$ 9EtD$D$Uԉ$z9uo(uԋM4U \[^_]UWVS\UÂM 8$00(4uԉ+uuԉuċ1v}D$ $豺UЉED$ ED$ED$Ű$ϼEЅu$蚺ɉMuȋh@ $¼uЋ@0t}@$E証E$蘼P$芼ƀ p u$D$)$ nƋ Fp FF@Mԍ)lj(+BP @ @  0F;F}FݻF P4Rp (+V F$$+V (F,FFP@u@t]NjEЉF‹@4F(Fx4uBD$ $8`P"PfFMЋ@4@4~D$u4$D$<$}ЋP4MAP T@E}mh@ M̋EP@ B tD$$pu<tǁ t)tx@wnthB 80Zt/t :uCt9@z%u#&D$$ϸ ;MJ PRPB(MЋB4u#tAvAD$uЉ4$蚹 HIPHr 1r $1$1r(1J, 2@uE(+7rR 06v <>06v4 2 UE(}t40(U 9u PRPB(uЋB4u#tFvFD$}Љ<$D HIPHr 1r $1$1r(1J, :@u(+>zR 06v <>06v4 2 U虷$ Mԋh@ M̋X;uj$(M+ D$EЉ$M B t D$$豵҉Uu<tE t@E@EEtvB 80Eet3tE yuLEt@@z*u(-D$$EEEU9Ut6(E}t40(U @9uK(E}t04(U \[^_]UWVSL÷ Eԋ$  (:u)u̅D$E$EED$ ED$ED$$EЅu$ݱ&(@uȉ U Lh@ $UЋ@0@$EE $гP$³ƀ p u$D$)$ 観Ƌ Fp FF@(U+P@ R  R  0F;F}F F P4Rp (+V F$$+V (F,FFPEԁ@u@Et袲EԋMЉN@4F(Fx4uAD$ $~Uԃ`P"PfVuЋ@4@4~D$E$SD$<$+UЋP4MAP TuЋ@EԾh@ EԋP@ ~B tD$$辰Wu<t 4t'%@w`B 80uPt.ft yu7@zuD$$ PRPB(}ЋB4u#tGvGD$EЉ$ HIPHz 9z $9$9z(9J, @u謰 (+QR UЉ I   IUЍ  UJuȋMȉE  PRPB(}ЋB4u#tGvGD$EЉ$į HIPHr 1r $1$1r(1J, @uo1(+VR  I 41 I  UG Mԋh@ $X;u$(M+ D$EЉ$Ю B tD$$4u<t t'@wSB 80uCt%t yu,t~@zukD$$褬tW(uȋ uȉ U G(@}ȉ U $9uAo9uyt&빃L[^_]UWVSD$|$ t$HED$$@D$|$ t$UT$$@D$|$ t$ED$$赬@D$|$ t$UT$'$臬@D$|$ t$ED$7$Y@D$|$ t$UT$H$%@D$|$ t$ED$[$@D$UT$ t$D$n$轫D$ED$ t$;D$$蒫D$UT$ t$pE܉D$$d@D$UT$ t$E܉D$$3@D$UT$ t$E܉D$$@D$UT$ t$E܉D$$Ѫ@D$UT$ t$vD$$蝪D$ED$ t$D$$rD$UT$ t$}D$$GD$|$ t$D$$D$|$ t$D$($D$|$ t$D$=$ϩD$|$ t$D$T$觩D$hD$ t$D$k$yD$i|$ t$)D$$KD$|$ t$֭D$$#D$|$ t$D$$D$|$ t$D$$ӨD$|$ t$D$$諨D$|$ t$D$$胨D$|$ t$D$$[D$|$ t$ D$$3D$|$ t$D$0$ D$|$ t$D$F$D$|$ t$֦D$$軧D$^D$ t$D$a$荧D$|$ t$D$}$eD$D$ $WD$D$D$ 0D$D$<$30~ t&D$D$ D$|$4$F 8uD$4$ @ D$0T$$.tD$($ަ(0u U <[^_]Ë$ÐUVS.t&Ћu[^]Ë$US[[US[÷K[sv%ssubref, protoCan't unweaken a nonreferenceReference is not weaknum, strblock, ...abNot a subroutine referencev5.20.01.38&@ListUtil.cList::Util::maxList::Util::minList::Util::productList::Util::sumList::Util::sum0List::Util::maxstrList::Util::minstrList::Util::reduceList::Util::firstList::Util::allList::Util::anyList::Util::noneList::Util::notallList::Util::pairfirstList::Util::pairgrepList::Util::pairmapList::Util::pairsList::Util::pairkeysList::Util::pairvaluesList::Util::shuffle$$Scalar::Util::dualvarScalar::Util::isdualScalar::Util::blessedScalar::Util::reftypeScalar::Util::refaddrScalar::Util::weakenScalar::Util::unweakenScalar::Util::isweakScalar::Util::readonlyScalar::Util::taintedScalar::Util::isvstring&$Scalar::Util::set_prototypeScalar::Util::openhandleList::UtilREAL_MULTICALLset_prototype: not a subroutine referenceset_prototype: not a referenceOdd number of elements in pairvaluesOdd number of elements in pairkeysOdd number of elements in pairsOdd number of elements in pairmapOdd number of elements in pairgrepOdd number of elements in pairfirstScalar::Util::looks_like_numberAn~.>N^n~  . > N ^ n ~ !!.!>!N!^!n!~!!!!!!!!!"".">"N"^"n"~""Td P @ X " |@|X|\| ̂ - X|+6DRer"  # # )$ $ % +&* ?& ]'6  ) ) +  ,| ," -' .- (0 @2 V3 o4 4Y H6u : ; }A'  J vS  ] -pc ?;l S]|X`|]c|bglq|q|v|{$H|h||||||||}}'}7}H}[}| n}}}}!}'}-}3}9~?~E(~K=~QT~Wh~]k~ci~i~o~u~{~~~0FԀ^a}+{ 5"Scr  -?SZkw" 3AN[jz)@|/?PdsX   ' 8 |> N _ l X|y      ̂     $ . 9 J V d x Zty           & - 7 I P Z t Util.socrti.svalues-Xa.cDrodata.rodatacrtstuff.c__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN____JCR_LIST____do_global_dtors_auxcompleted.5017dtor_idx.5019frame_dummyobject.5029ListUtil.cXS_Scalar__Util_isweakXS_Scalar__Util_isdualXS_Scalar__Util_openhandleXS_Scalar__Util_isvstringS_croak_memory_wrapXS_Scalar__Util_set_prototypeXS_Scalar__Util_looks_like_numberXS_Scalar__Util_readonlyXS_Scalar__Util_taintedXS_Scalar__Util_unweakenXS_Scalar__Util_weakenXS_Scalar__Util_refaddrXS_Scalar__Util_reftypeXS_Scalar__Util_blessedXS_Scalar__Util_dualvarXS_List__Util_shuffleXS_List__Util_pairvaluesXS_List__Util_pairkeysXS_List__Util_pairsXS_List__Util_minXS_List__Util_minstrXS_List__Util_sumXS_List__Util_pairmapXS_List__Util_pairgrepXS_List__Util_pairfirstXS_List__Util_reduceXS_List__Util_anyXS_List__Util_first.LC0.LC1.LC2.LC3.LC4.LC5.LC6.LC7.LC8.LC9.LC10.LC12.LC13.LC14.LC15.LC11.LC16.LC17.LC18.LC19.LC20.LC21.LC22.LC23.LC24.LC25.LC26.LC27.LC28.LC29.LC30.LC31.LC32.LC33.LC34.LC35.LC36.LC37.LC38.LC39.LC40.LC41.LC42.LC43.LC44.LC45.LC46.LC47.LC48.LC49.LC50.LC51.LC52.LC53.LC54.LC55.LC56.LC57.LC58.LC59.LC60.LC61.LC62.LC63__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxcrtn.s_END___DTOR_END____dso_handle_START___deregister_frame_info_basesPerl_push_scopePL_memory_wrapPerl_sv_setuv_Jv_RegisterClassesPerl_sv_2mortal_DYNAMICPerl_sv_setnvPL_top_envPerl_gv_stashpvnPerl_sv_2uv_flagsPL_curstackPerl_was_lvalue_subPerl_newSV_typePL_opPerl_sv_magicPerl_sv_2iv_flagsPerl_sv_del_backref_edataPerl_newRV_noincPL_sv_undefPL_srand_calledPL_stack_basePerl_call_svPerl_sv_mortalcopy_flagsPerl_newXS_flags__register_frame_info_basesPerl_newSVsvPL_curpmPerl_save_vptrPerl_call_listPerl_hv_common_key_lenPerl_pad_pushPL_markstackPerl_newSVivPerl_pop_scopePerl_gv_fetchpvPL_markstack_maxPerl_safesysmallocPerl_av_pushPerl_sv_2bool_flagsPL_scopestack_ixPerl_ckwarnPL_sv_noPerl_sv_setsv_flagsPL_stack_maxPerl_mg_setPerl_looks_like_number_finiPL_curstackinfoPerl_block_gimmePerl_gv_add_by_typePL_unitcheckav_GLOBAL_OFFSET_TABLE_Perl_save_pushptrPerl_sv_reftypePerl_sv_2cvPerl_save_strlenPerl_save_sptrPerl_markstack_grow_PROCEDURE_LINKAGE_TABLE_Perl_sv_cmp_flagsPerl_sv_taintedPerl_sv_rvweaken_initPerl_sv_upgradePerl_amagic_callPerl_mg_find_lib_versionPL_random_statePerl_croak_popstackPerl_warnPL_tmps_ixPerl_sv_free2_endPerl_xs_apiversion_bootcheckPerl_sv_2nv_flagsPerl_mg_getPerl_new_stackinfoPL_markstack_ptrPerl_seedPL_comppadPerl_gv_init_pvnPL_taintingPL_tmps_floorPerl_croak_xs_usageboot_List__UtilPerl_cxincPerl_drand48_rPerl_sv_setpvPL_runopsPL_stack_spPerl_sv_setivPerl_croak_no_modifyPL_defgvPerl_drand48_init_rPerl_sv_copypv_flagsPerl_croakmemcpyPL_sv_yesPerl_sv_newmortal_etextPL_curpadPerl_xs_version_bootcheckPL_curcopGCC: (GNU) 4.5.2ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2432.dynamic.eh_frame_hdr.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_version.SUNW_versym.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.rodata.str1.1.rodata.str1.4.rodata.cst4.rodata.cst8.got.eh_frame.data.ctors.dtors.jcr.bss.symtab.strtab.comment.shstrtab8  \oTTp', 4"ddg <o JoWoh PPt B@@xXX@}""|Y | |@|@|X|X|2\|\|T2D  ~  0 X bFILE%33085206/auto/PerlIO/scalar/scalar.so`&;,%OL !$'()*+,-./01235:;<=>@ABDEGI  "#%&46789?CFHJK ) ?P KT0% jq.z s k   '5 19M`&co~ @'p" 'ATp%Zf'kw~ %Y  %"3GVd x8$ 8 "U &2# CL`&S fw&e    J  +e< scalar.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummyscalar.c__do_global_ctors_auxcrtn.sPerlIOScalar_get_cntPerlIOScalar_get_basePL_scopestack_ixPerl_warnerPerlIOScalar_set_ptrcntPerlIOScalar_pushedPerl_get_svPerl_ckwarnPerlIO_push_edataPL_stack_basePerlIOScalar_closememmovePerlIO_define_layer_GLOBAL_OFFSET_TABLE_Perl_mg_setPerl_call_listPerlIOBase_pushedPerlIOScalar_flushPerl_sv_pvn_force_flagsPerlIO_scalar__register_frame_info_basesPerl_sv_upgradePerlIOBase_errorerrnoPerl_sv_force_normal_flagsPerl_xs_version_bootcheckPerlIOBase_binmode_initPerl_mg_get_endPL_stack_spmemcpy_PROCEDURE_LINKAGE_TABLE_PerlIOBase_dupPL_unitcheckav_lib_versionPerlIOScalar_argPerlIOScalar_fillPerl_sv_utf8_downgrade_finiPerl_sv_2pv_flags__deregister_frame_info_basesPerlIOBase_clearerrPerlIOBase_eofPerl_newSVpvn_Jv_RegisterClassesboot_PerlIO__scalarPerl_xs_apiversion_bootcheckPerlIO_sv_dupPerlIOScalar_openPerlIOScalar_poppedPL_sv_yesPerl_newRV_noincPerlIO_allocatePerl_sv_growPerlIO_arg_fetchPerl_sv_lenPerlIOScalar_dup_DYNAMIC_etextPerlIOScalar_writePerlIOBase_closePerl_sv_free2PerlIOScalar_readPL_no_modifyPerl_newSVsvPerlIOScalar_tellPerlIOScalar_seekPL_markstack_ptrmemsetPerlIOBase_setlinebufPerlIOScalar_bufsizPerlIOScalar_filenoPerlIOScalar_get_ptrlibgcc_s.so.1GCC_3.0libssp.so.0@P&y NG-UO21> T VPIL?F;(40 *D'''''P'' ' ' ''&\'& '$`'&''','-|&/X'3T'4 '5h';t'>l'A&B|'Dx'E&F'H'Id'J'Kt&l&+p&+x&&2&C&6&9&7& &*&&&&&&&(&8&G& &&!&?&&.&&&@&:&#&&'1'''hh h$h(h ,h(0h04h8p8h@`<hHP@hP@DhX0Hh` PhhThpXhx\h`hdhhhlhphxh|hph`hPh@h0h hhhhhUVSÆPu]T)9s TT9r拃 t$jƃP[^]US\t$XD$\$ D$$,tt $Ѓ[]Ë$ÐËD$P@øøUS4 uUE@tU T$$t $t@$[]U(]u} }$}(~E,0ED$E $ƸF t2uljt$ ED$ED$<$st J ]u}]U(]uK Ì E0FP u @ED$UT$$E+EFF]u]U(]u ! E0F tIFP u @ED$UT$$NU)9ѸBƋ]u]U]uf ç E0F tF@ t$\F@]u]U]u ] E0F tBF@ t$FP u@ D$D$$]u]U]u U2F t $F]u]U8]um î E UEUEU2tt ueEUFVWEUFVIFP u @ED$UT$$EEUFV~y9$ tD$$L]u]UWVS< E8G iwF t4$vF uD$4$Fu<t u$% =tD$D$4$pF tPD$4$ju<$,tD$$,LU@ tgF uPMT9P s@UDD$4$EN Mfn@fEfnEfE؋E؋UEUԉGWUJM؋WO9UsUF uMT M9Q sUDD$4$EN MW+U؋EF T$D$$mWfnEfEUMԃ|<;Ur5F uMTM9Q sUDD$4$EN MF EWOUЉMfnEfE؋E؋UEUԉGWUT$M L$EE$W;Pv PGMFDF@t4$E<[^_]UH]u}&U.:GuGL }ԋwF% =u @EV D$ED$4$}F D$4$t7F% =u @EV TD$ED$4$*9$,JtD$$,@L?M)θ~,;MGut$T$E $~MqQ]u}]U]uu4$Ob]u]UWVS,QÒ}U7DBu<t $B PuV} tPU :rtH$!t tD$D$$ LEDt@F@ t$VBu<t % =tyD$ D$$L_% =uB D$D$$!D$$t@FD$$FFxwD$$ED$ D$E D$<$EVBu<t %= u@ t+D$$F@F@ t@ F@ tyD$$ue$,jtD$$,`LFtPvP T$$FEp@ tIVBu<t%EE= u$EEE؋U܉FVFFF@ @t$!E,[^_]U]uHÉE0Ft#PvP T$$GF]u]UWVS,7E 0VUD$$FML$ ED$U T$E$Et(MAtPvP T$$FtPvP T$$EFtYUT$ML$E $P tBMQtPvP T$$-FVMAQ,[^_]UWVS,E M8΃ED$D$$D$ D$t$UM)$$tD$$ U,[^_]Ë$ÐUVS.&t&Ћu[^]Ë$US[[US[+[Strings with code points over 0xFF may not be mapped into in-memory file handles scalarOffset outside string%sv5.20.00.18"2BRbr"2BRbrp3&t$ Hh l    p%%%2&`&$'(','4'<'@''8'>8'K('X %-8,'F4'T$'g<'t ''P '%R:&P&2&S&[&-0'$'<'0% 1`.z us k  ' 5 (<`&R^m @'p"0Cp%IU'Zfm %Y  %""6ES g8$ {8 "U !# 2;`&B Uft&e    J  e< scalar.socrti.svalues-Xa.cDrodata.rodatacrtstuff.c__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN____JCR_LIST____do_global_dtors_auxcompleted.5017dtor_idx.5019frame_dummyobject.5029scalar.ccode_point_warning.LC0.LC1.LC2.LC3.LC4__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxcrtn.s_END___DTOR_END____dso_handle_START_PerlIOScalar_get_cntPerlIOScalar_get_basePL_scopestack_ixPerl_warnerPerlIOScalar_set_ptrcntPerlIOScalar_pushedPerl_get_svPerl_ckwarnPerlIO_push_edataPL_stack_basePerlIOScalar_closememmovePerlIO_define_layer_GLOBAL_OFFSET_TABLE_Perl_mg_setPerl_call_listPerlIOBase_pushedPerlIOScalar_flushPerl_sv_pvn_force_flagsPerlIO_scalar__register_frame_info_basesPerl_sv_upgradePerlIOBase_errorerrnoPerl_sv_force_normal_flagsPerl_xs_version_bootcheckPerlIOBase_binmode_initPerl_mg_get_endPL_stack_spmemcpy_PROCEDURE_LINKAGE_TABLE_PerlIOBase_dupPL_unitcheckav_lib_versionPerlIOScalar_argPerlIOScalar_fillPerl_sv_utf8_downgrade_finiPerl_sv_2pv_flags__deregister_frame_info_basesPerlIOBase_clearerrPerlIOBase_eofPerl_newSVpvn_Jv_RegisterClassesboot_PerlIO__scalarPerl_xs_apiversion_bootcheckPerlIO_sv_dupPerlIOScalar_openPerlIOScalar_poppedPL_sv_yesPerl_newRV_noincPerlIO_allocatePerl_sv_growPerlIO_arg_fetchPerl_sv_lenPerlIOScalar_dup_DYNAMIC_etextPerlIOScalar_writePerlIOBase_closePerl_sv_free2PerlIOScalar_readPL_no_modifyPerl_newSVsvPerlIOScalar_tellPerlIOScalar_seekPL_markstack_ptrmemsetPerlIOBase_setlinebufPerlIOScalar_bufsizPerlIOScalar_filenoPerlIOScalar_get_ptrGCC: (GNU) 4.5.2ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2432.dynamic.eh_frame_hdr.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_version.SUNW_versym.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.rodata.str1.1.got.eh_frame.data.ctors.dtors.jcr.data.rel.bss.symtab.strtab.comment.shstrtab@  tott , $$4" b<oHH JohhWolh ll t Bx0}p%p%%%%%r 22&2&.`&`&$'$'('(',','4'4'<'<'@'@'p '' '= 00/0_6X 6FILE35fa892ed/auto/Tie/Hash/NamedCapture/NamedCapture.so0ELF4+4 (33448Pdd  `  \ `\```x `4o^o o  o``>4;+, !"$%&*+  #'()$/P E Q`<  y G  $   '5A Ua3hu `4V 8BTbr" #09JO^"zNamedCapture.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummyNamedCapture.cXS_Tie__Hash__NamedCapture_flagsXS_Tie__Hash__NamedCapture_FIRSTKEYXS_Tie__Hash__NamedCapture_FETCHXS_Tie__Hash__NamedCapture_TIEHASHtie_it__do_global_ctors_auxcrtn.sPerl_xs_version_bootcheckPerl_sv_magicPL_stack_sp_Jv_RegisterClassesPL_sv_undef_etextPerl_newSVuvPerl_sv_unmagic_PROCEDURE_LINKAGE_TABLE__edata_init_GLOBAL_OFFSET_TABLE_Perl_sv_2uv_flagsPerl_newSV_typePL_unitcheckav_finiPerl_sv_blessPerl_croak_xs_usageboot_Tie__Hash__NamedCapturePL_sv_yesPerl_sv_2pv_flagsPerl_sv_setuvPerl_sv_2mortalPerl_gv_fetchpvn_flagsPerl_stack_growPerl_xs_apiversion_bootcheck_lib_versionPerl_sv_2bool_flags__deregister_frame_info_basesPerl_croak_no_modifyPerl_newXSPerl_sv_free2PL_stack_max_DYNAMICPL_markstack_ptr_endPerl_call_list__register_frame_info_basesPL_curpmPerl_sv_newmortalPL_scopestack_ixPL_stack_basePerl_newSVrvlibgcc_s.so.1GCC_3.0libssp.so.0P&y 2 # +4TPx`!X#p')\*@H&DL&dh(lt|  +%hh0h4h8h @h(Hh0Lh8pPh@`ThHPXhP@\hX0`h` dhhhhplhxphthxh|hhhhUVS u])9s 9r拃 t$ƃ[^]US\[ t$D$\$ D$$tt $Ѓ[]Ë$ÐU(]u}  0$ ()‰Ѓ)Ƌ,)D$t$4$JSFD$$P~8FD$$5 8]u}]UWVS, 2  E܋$( u)ΉM؋}I<>tw}M9Mt"h}iD‰D$u4$Ut B u(uD ( B P uHD$$8UU)‹ F @P$ ϸ}~(MD|$D$4$ҋ 2~t $DF 8,[^_]UWVS,í M E܋$:(u)։URU䋓<trU9Ut)rthwD‰D$ $t B u3Et$D ( B P uHD$$UU)‹ F @@ EE }~ (T}~ (DL$ T$D$4$U܋ 2Et"t7PvP'T$$Ht $D 0,[^_]UWVSL EЋ$(4M)D$E$UUUȋP u@ ED$D$$EuE9uEċUԋP u@EUԋ@ D$"UT$$1}2Ƌ}8EԋPB t$D$$<ҲUu<tE tKE@EEB 80E‰Eht3t EyuOEtC@z-u+0D$$%<EEEEU9Uu$NjED$<$ỦT$$Y(Uȉ<$nU L[^_]UWVS<;UED$ D$D$E$@ x$ZƋE$}F NED$4$tD$P<$tD$D$ D$Pt$<$`tFvF D$4$<[^_]UWVS,Hj E$:(0GEED$D$U$D$ D$ED$U)‰$t$D$$t$E|$$@ t$|$${@t$|$$\@t$|$8$=@t$|$X$@ t$|$x$@ t$|$$@t$|$$Nj@t$D$$B1uBp4$-44$+"tD$$K(u U ,[^_]Ë$ÐUVS. t&Ћu[^]Ë$US[[[US[ë[$lastkey$key$key, $valuepackage, ...allv5.20.00.09NamedCapture.cTie::Hash::NamedCapture::TIEHASHTie::Hash::NamedCapture::CLEARTie::Hash::NamedCapture::DELETETie::Hash::NamedCapture::EXISTSTie::Hash::NamedCapture::FETCHTie::Hash::NamedCapture::SCALARTie::Hash::NamedCapture::STORETie::Hash::NamedCapture::FIRSTKEYTie::Hash::NamedCapture::NEXTKEYTie::Hash::NamedCapture::flags *:JZjz *:\\  x     P `4$1$3>LZmzP  <  y :G ] dinsx} ,Ll3  9Sam 3 `4%3GV dn"!6AO\ev{"NamedCapture.socrti.svalues-Xa.cDrodata.rodatacrtstuff.c__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN____JCR_LIST____do_global_dtors_auxcompleted.5017dtor_idx.5019frame_dummyobject.5029NamedCapture.cXS_Tie__Hash__NamedCapture_flagsXS_Tie__Hash__NamedCapture_FIRSTKEYXS_Tie__Hash__NamedCapture_FETCHXS_Tie__Hash__NamedCapture_TIEHASHtie_it.LC1.LC0.LC2.LC3.LC4.LC5.LC7.LC8.LC9.LC10.LC11.LC12.LC13.LC14.LC15.LC16.LC17.LC18.LC19__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxcrtn.s_END___DTOR_END____dso_handle_START_Perl_xs_version_bootcheckPerl_sv_magicPL_stack_sp_Jv_RegisterClassesPL_sv_undef_etextPerl_newSVuvPerl_sv_unmagic_PROCEDURE_LINKAGE_TABLE__edata_init_GLOBAL_OFFSET_TABLE_Perl_sv_2uv_flagsPerl_newSV_typePL_unitcheckav_finiPerl_sv_blessPerl_croak_xs_usageboot_Tie__Hash__NamedCapturePL_sv_yesPerl_sv_2pv_flagsPerl_sv_setuvPerl_sv_2mortalPerl_gv_fetchpvn_flagsPerl_stack_growPerl_xs_apiversion_bootcheck_lib_versionPerl_sv_2bool_flags__deregister_frame_info_basesPerl_croak_no_modifyPerl_newXSPerl_sv_free2PL_stack_max_DYNAMICPL_markstack_ptr_endPerl_call_list__register_frame_info_basesPL_curpmPerl_sv_newmortalPL_scopestack_ixPL_stack_basePerl_newSVrvGCC: (GNU) 4.5.2ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2432.dynamic.eh_frame_hdr.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_version.SUNW_versym.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.rodata.str1.1.rodata.str1.4.got.eh_frame.data.ctors.dtors.jcr.bss.symtab.strtab.comment.shstrtab8  do\\, \\4"<o Jo XWox x 4h  `t B  x}PP ``2I2K44 O %0u*X *FILE&180069be/auto/attributes/attributes.so/ELF4+4 (8Pdd  ` X h `x``` `0o;o o8 0o``>;X//  "#$&)*+-. !%'(,"- C  O\ r C  "  "2FT` p~  (5`;J[krxd" 'DISgattributes.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummyattributes.cXS_attributes_reftypeXS_attributes__guess_stashXS_attributes__fetch_attrsXS_attributes__modify_attrs__do_global_ctors_auxcrtn.sPL_curpadPerl_newXS_flags__register_frame_info_basesPerl_cv_ckproto_len_flagsPerl_newSVpvn_flagsPerl_newSVhekPL_stack_spboot_attributesPL_stack_basePerl_sv_newmortalPerl_newXS_finiPerl_call_listPL_scopestack_ix_PROCEDURE_LINKAGE_TABLE_Perl_mg_getPerl_croak_xs_usagePerl_newSVpvnPerl_sv_setpvnPerl_sv_2mortalPL_stack_max_initPL_unitcheckavPL_markstack_ptrPerl_stack_grow_etextPL_opPerl_mg_setPerl_sv_reftype_edataPerl_sv_setpvPerl_ckwarn_lib_versionPerl_croakPerl_sv_2pv_flags__deregister_frame_info_bases_Jv_RegisterClasses_DYNAMICPL_sharehookPerl_xs_apiversion_bootcheck_endPL_sv_yesPerl_validate_protoPerl_xs_version_bootcheck_GLOBAL_OFFSET_TABLE_Perl_sv_setheklibgcc_s.so.1GCC_3.0libssp.so.0P&y 5 %0<8 <8%$'D*$$ .#"  + ((,,0 4@ hh4h8h<h @h(Dh0Hh8pLh@`ThHPXhP@\hX0`h` dhhhhplhxphthxh|hhhhhph`UVS u])9s 9r拃 t$ƃ[^]US\{ t$D$\$ D$$tt $Ѓ[]Ë$ÐUWVS,}   $2()E䋃,@tP 0<9ǃ}tD$E$,4u䋃(08F t4$Fu<t utD$F $D$<$G @t<$(U ,[^_]UWVS,j  $:()E䋃,@tP 04&ƃ}tD$E$<(0Bu<t utB PtFB t&@ B ‹t ȃztD$4$ʃ t. u^B1uRtz u ytAA@:umx tgP R ҉Dȋ ytRDЋ@t=@ t&R P Ћ t ʃxtT$4$-F @t4$(8 8,[^_]UWVS  0$ ()׉tD$E$^TBu<t utƃB x x0tHP)D$t$4$YƃD$D$$FtHP)D$t$4$ ƃD$D$ $ 0[^_]UWVS|A $22(4)D$E$ M Mċ1Nutρ utv u#}T MԅUȉEE}%E UMԋA% =u@Ey }D$"ED$Eԉ$EЋUЀ:-Eu UЃmMy E}G "+ - * / % ** << >> x .", assign => "+= -= *= /= %= **= <<= >>= x= .=", num_comparison => "< <= > >= == !=", '3way_comparison' => "<=> cmp", str_comparison => "lt le gt ge eq ne", binary => '& &= | |= ^ ^=', unary => "neg ! ~", mutators => '++ --', func => "atan2 cos sin exp abs log sqrt int", conversion => 'bool "" 0+ qr', iterators => '<>', filetest => "-X", dereferencing => '${} @{} %{} &{} *{}', matching => '~~', special => 'nomethod fallback =', ); my %ops_seen; for $category (keys %ops) { $ops_seen{$_}++ for (split /\s+/, $ops{$category}); } sub nil {} sub OVERLOAD { $package = shift; my %arg = @_; my ($sub, $fb); *{$package . "::(("} = \&nil; # Make it findable via fetchmethod. for (keys %arg) { if ($_ eq 'fallback') { for my $sym (*{$package . "::()"}) { *$sym = \&nil; # Make it findable via fetchmethod. $$sym = $arg{$_}; } } else { warnings::warnif("overload arg '$_' is invalid") unless $ops_seen{$_}; $sub = $arg{$_}; if (not ref $sub) { $ {$package . "::(" . $_} = $sub; $sub = \&nil; } #print STDERR "Setting '$ {'package'}::\cO$_' to \\&'$sub'.\n"; *{$package . "::(" . $_} = \&{ $sub }; } } } sub import { $package = (caller())[0]; # *{$package . "::OVERLOAD"} = \&OVERLOAD; shift; $package->overload::OVERLOAD(@_); } sub unimport { $package = (caller())[0]; shift; *{$package . "::(("} = \&nil; for (@_) { warnings::warnif("overload arg '$_' is invalid") unless $ops_seen{$_}; delete $ {$package . "::"}{$_ eq 'fallback' ? '()' : "(" .$_}; } } sub Overloaded { my $package = shift; $package = ref $package if ref $package; mycan ($package, '()') || mycan ($package, '(('); } sub ov_method { my $globref = shift; return undef unless $globref; my $sub = \&{*$globref}; no overloading; return $sub if !ref $sub or $sub != \&nil; return shift->can($ {*$globref}); } sub OverloadedStringify { my $package = shift; $package = ref $package if ref $package; #$package->can('(""') ov_method mycan($package, '(""'), $package or ov_method mycan($package, '(0+'), $package or ov_method mycan($package, '(bool'), $package or ov_method mycan($package, '(nomethod'), $package; } sub Method { my $package = shift; if(ref $package) { local $@; local $!; require Scalar::Util; $package = Scalar::Util::blessed($package); return undef if !defined $package; } #my $meth = $package->can('(' . shift); ov_method mycan($package, '(' . shift), $package; #return $meth if $meth ne \&nil; #return $ {*{$meth}}; } sub AddrRef { no overloading; "$_[0]"; } *StrVal = *AddrRef; sub mycan { # Real can would leave stubs. my ($package, $meth) = @_; local $@; local $!; require mro; my $mro = mro::get_linear_isa($package); foreach my $p (@$mro) { my $fqmeth = $p . q{::} . $meth; return \*{$fqmeth} if defined &{$fqmeth}; } return undef; } %constants = ( 'integer' => 0x1000, # HINT_NEW_INTEGER 'float' => 0x2000, # HINT_NEW_FLOAT 'binary' => 0x4000, # HINT_NEW_BINARY 'q' => 0x8000, # HINT_NEW_STRING 'qr' => 0x10000, # HINT_NEW_RE ); use warnings::register; sub constant { # Arguments: what, sub while (@_) { if (@_ == 1) { warnings::warnif ("Odd number of arguments for overload::constant"); last; } elsif (!exists $constants {$_ [0]}) { warnings::warnif ("'$_[0]' is not an overloadable type"); } elsif (!ref $_ [1] || "$_[1]" !~ /(^|=)CODE\(0x[0-9a-f]+\)$/) { # Can't use C above as code references can be # blessed, and C would return the package the ref is blessed into. if (warnings::enabled) { $_ [1] = "undef" unless defined $_ [1]; warnings::warn ("'$_[1]' is not a code reference"); } } else { $^H{$_[0]} = $_[1]; $^H |= $constants{$_[0]}; } shift, shift; } } sub remove_constant { # Arguments: what, sub while (@_) { delete $^H{$_[0]}; $^H &= ~ $constants{$_[0]}; shift, shift; } } 1; __END__ #line 1685 FILE19ab82ec/overloading.pm#line 1 "/usr/local/lib/perl5/5.20.0/overloading.pm" package overloading; use warnings; our $VERSION = '0.02'; my $HINT_NO_AMAGIC = 0x01000000; # see perl.h require 5.010001; sub _ops_to_nums { require overload::numbers; map { exists $overload::numbers::names{"($_"} ? $overload::numbers::names{"($_"} : do { require Carp; Carp::croak("'$_' is not a valid overload") } } @_; } sub import { my ( $class, @ops ) = @_; if ( @ops ) { if ( $^H{overloading} ) { vec($^H{overloading} , $_, 1) = 0 for _ops_to_nums(@ops); } if ( $^H{overloading} !~ /[^\0]/ ) { delete $^H{overloading}; $^H &= ~$HINT_NO_AMAGIC; } } else { delete $^H{overloading}; $^H &= ~$HINT_NO_AMAGIC; } } sub unimport { my ( $class, @ops ) = @_; if ( exists $^H{overloading} or not $^H & $HINT_NO_AMAGIC ) { if ( @ops ) { vec($^H{overloading} ||= '', $_, 1) = 1 for _ops_to_nums(@ops); } else { delete $^H{overloading}; } } $^H |= $HINT_NO_AMAGIC; } 1; __END__ #line 100 FILE101ab314/parent.pm#line 1 "/usr/local/lib/perl5/5.20.0/parent.pm" package parent; use strict; use vars qw($VERSION); $VERSION = '0.228'; sub import { my $class = shift; my $inheritor = caller(0); if ( @_ and $_[0] eq '-norequire' ) { shift @_; } else { for ( my @filename = @_ ) { if ( $_ eq $inheritor ) { warn "Class '$inheritor' tried to inherit from itself\n"; }; s{::|'}{/}g; require "$_.pm"; # dies if the file is not found } } { no strict 'refs'; push @{"$inheritor\::ISA"}, @_; }; }; "All your base are belong to us" __END__ #line 137 FILE3d0e1853/strict.pm(#line 1 "/usr/local/lib/perl5/5.20.0/strict.pm" package strict; $strict::VERSION = "1.08"; # Verify that we're called correctly so that strictures will work. unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { # Can't use Carp, since Carp uses us! my (undef, $f, $l) = caller; die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n"); } my %bitmask = ( refs => 0x00000002, subs => 0x00000200, vars => 0x00000400 ); my %explicit_bitmask = ( refs => 0x00000020, subs => 0x00000040, vars => 0x00000080 ); sub bits { my $bits = 0; my @wrong; foreach my $s (@_) { if (exists $bitmask{$s}) { $^H |= $explicit_bitmask{$s}; } else { push @wrong, $s }; $bits |= $bitmask{$s} || 0; } if (@wrong) { require Carp; Carp::croak("Unknown 'strict' tag(s) '@wrong'"); } $bits; } my @default_bits = qw(refs subs vars); sub import { shift; $^H |= bits(@_ ? @_ : @default_bits); } sub unimport { shift; $^H &= ~ bits(@_ ? @_ : @default_bits); } 1; __END__ #line 156 FILEfc6029fd/utf8.pm#line 1 "/usr/local/lib/perl5/5.20.0/utf8.pm" package utf8; $utf8::hint_bits = 0x00800000; our $VERSION = '1.13'; sub import { $^H |= $utf8::hint_bits; } sub unimport { $^H &= ~$utf8::hint_bits; } sub AUTOLOAD { require "utf8_heavy.pl"; goto &$AUTOLOAD if defined &$AUTOLOAD; require Carp; Carp::croak("Undefined subroutine $AUTOLOAD called"); } 1; __END__ #line 216 FILE4a1ff78d/vars.pm#line 1 "/usr/local/lib/perl5/5.20.0/vars.pm" package vars; use 5.006; our $VERSION = '1.03'; use warnings::register; use strict qw(vars subs); sub import { my $callpack = caller; my (undef, @imports) = @_; my ($sym, $ch); foreach (@imports) { if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { if ($sym =~ /\W/) { # time for a more-detailed check-up if ($sym =~ /^\w+[[{].*[]}]$/) { require Carp; Carp::croak("Can't declare individual elements of hash or array"); } elsif (warnings::enabled() and length($sym) == 1 and $sym !~ tr/a-zA-Z//) { warnings::warn("No need to declare built-in vars"); } elsif (($^H &= strict::bits('vars'))) { require Carp; Carp::croak("'$_' is not a valid variable name under strict vars"); } } $sym = "${callpack}::$sym" unless $sym =~ /::/; *$sym = ( $ch eq "\$" ? \$$sym : $ch eq "\@" ? \@$sym : $ch eq "\%" ? \%$sym : $ch eq "\*" ? \*$sym : $ch eq "\&" ? \&$sym : do { require Carp; Carp::croak("'$_' is not a valid variable name"); }); } else { require Carp; Carp::croak("'$_' is not a valid variable name"); } } }; 1; __END__ #line 84 FILE42231c95/warnings.pmH#line 1 "/usr/local/lib/perl5/5.20.0/warnings.pm" # -*- buffer-read-only: t -*- # !!!!!!! DO NOT EDIT THIS FILE !!!!!!! # This file is built by regen/warnings.pl. # Any changes made here will be lost! package warnings; our $VERSION = '1.23'; # Verify that we're called correctly so that warnings will work. # see also strict.pm. unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { my (undef, $f, $l) = caller; die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n"); } #line 738 our %Offsets = ( # Warnings Categories added in Perl 5.008 'all' => 0, 'closure' => 2, 'deprecated' => 4, 'exiting' => 6, 'glob' => 8, 'io' => 10, 'closed' => 12, 'exec' => 14, 'layer' => 16, 'newline' => 18, 'pipe' => 20, 'unopened' => 22, 'misc' => 24, 'numeric' => 26, 'once' => 28, 'overflow' => 30, 'pack' => 32, 'portable' => 34, 'recursion' => 36, 'redefine' => 38, 'regexp' => 40, 'severe' => 42, 'debugging' => 44, 'inplace' => 46, 'internal' => 48, 'malloc' => 50, 'signal' => 52, 'substr' => 54, 'syntax' => 56, 'ambiguous' => 58, 'bareword' => 60, 'digit' => 62, 'parenthesis' => 64, 'precedence' => 66, 'printf' => 68, 'prototype' => 70, 'qw' => 72, 'reserved' => 74, 'semicolon' => 76, 'taint' => 78, 'threads' => 80, 'uninitialized' => 82, 'unpack' => 84, 'untie' => 86, 'utf8' => 88, 'void' => 90, # Warnings Categories added in Perl 5.011 'imprecision' => 92, 'illegalproto' => 94, # Warnings Categories added in Perl 5.013 'non_unicode' => 96, 'nonchar' => 98, 'surrogate' => 100, # Warnings Categories added in Perl 5.017 'experimental' => 102, 'experimental::lexical_subs'=> 104, 'experimental::lexical_topic'=> 106, 'experimental::regex_sets'=> 108, 'experimental::smartmatch'=> 110, # Warnings Categories added in Perl 5.019 'experimental::autoderef'=> 112, 'experimental::postderef'=> 114, 'experimental::signatures'=> 116, 'syscalls' => 118, ); our %Bits = ( 'all' => "\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55\x55", # [0..59] 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00", # [29] 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00", # [30] 'closed' => "\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] 'closure' => "\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] 'debugging' => "\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] 'deprecated' => "\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2] 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x55\x15", # [51..58] 'experimental::autoderef'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01", # [56] 'experimental::lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00", # [52] 'experimental::lexical_topic'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00", # [53] 'experimental::postderef'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04", # [57] 'experimental::regex_sets'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00", # [54] 'experimental::signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10", # [58] 'experimental::smartmatch'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00", # [55] 'glob' => "\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00", # [46] 'inplace' => "\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23] 'internal' => "\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00", # [24] 'io' => "\x00\x54\x55\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [5..11,59] 'layer' => "\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] 'malloc' => "\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00", # [25] 'misc' => "\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] 'newline' => "\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00", # [48] 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00", # [49] 'numeric' => "\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13] 'once' => "\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14] 'overflow' => "\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15] 'pack' => "\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16] 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00", # [32] 'pipe' => "\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10] 'portable' => "\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17] 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00", # [33] 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00", # [34] 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00", # [35] 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00", # [36] 'recursion' => "\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] 'redefine' => "\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] 'regexp' => "\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00", # [37] 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00", # [38] 'severe' => "\x00\x00\x00\x00\x00\x54\x05\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] 'signal' => "\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00", # [26] 'substr' => "\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00", # [27] 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00", # [50] 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\x55\x55\x15\x00\x40\x00\x00\x00", # [28..38,47] 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40", # [59] 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00\x00", # [39] 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00", # [40] 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00", # [41] 'unopened' => "\x00\x00\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11] 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00", # [42] 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x40\x00\x00\x00\x00", # [43] 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x15\x00\x00", # [44,48..50] 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00", # [45] ); our %DeadBits = ( 'all' => "\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa\xaa", # [0..59] 'ambiguous' => "\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00", # [29] 'bareword' => "\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00", # [30] 'closed' => "\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [6] 'closure' => "\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [1] 'debugging' => "\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [22] 'deprecated' => "\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [2] 'digit' => "\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00", # [31] 'exec' => "\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [7] 'exiting' => "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [3] 'experimental' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\xaa\x2a", # [51..58] 'experimental::autoderef'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02", # [56] 'experimental::lexical_subs'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00", # [52] 'experimental::lexical_topic'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00", # [53] 'experimental::postderef'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08", # [57] 'experimental::regex_sets'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00", # [54] 'experimental::signatures'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20", # [58] 'experimental::smartmatch'=> "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00", # [55] 'glob' => "\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [4] 'illegalproto' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00", # [47] 'imprecision' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00", # [46] 'inplace' => "\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [23] 'internal' => "\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00", # [24] 'io' => "\x00\xa8\xaa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [5..11,59] 'layer' => "\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [8] 'malloc' => "\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00", # [25] 'misc' => "\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [12] 'newline' => "\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [9] 'non_unicode' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00", # [48] 'nonchar' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00", # [49] 'numeric' => "\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [13] 'once' => "\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [14] 'overflow' => "\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [15] 'pack' => "\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [16] 'parenthesis' => "\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00", # [32] 'pipe' => "\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [10] 'portable' => "\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [17] 'precedence' => "\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00", # [33] 'printf' => "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00", # [34] 'prototype' => "\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00", # [35] 'qw' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00", # [36] 'recursion' => "\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [18] 'redefine' => "\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [19] 'regexp' => "\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [20] 'reserved' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00", # [37] 'semicolon' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00", # [38] 'severe' => "\x00\x00\x00\x00\x00\xa8\x0a\x00\x00\x00\x00\x00\x00\x00\x00", # [21..25] 'signal' => "\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00\x00\x00\x00\x00", # [26] 'substr' => "\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00", # [27] 'surrogate' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00", # [50] 'syntax' => "\x00\x00\x00\x00\x00\x00\x00\xaa\xaa\x2a\x00\x80\x00\x00\x00", # [28..38,47] 'syscalls' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80", # [59] 'taint' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00", # [39] 'threads' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x00", # [40] 'uninitialized' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00", # [41] 'unopened' => "\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", # [11] 'unpack' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x00", # [42] 'untie' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00", # [43] 'utf8' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x2a\x00\x00", # [44,48..50] 'void' => "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x00\x00\x00", # [45] ); $NONE = "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"; $DEFAULT = "\x10\x01\x00\x00\x00\x50\x04\x00\x00\x00\x00\x00\x00\x55\x15", # [2,56,52,53,57,54,58,55,4,22,23,25] $LAST_BIT = 120 ; $BYTES = 15 ; $All = "" ; vec($All, $Offsets{'all'}, 2) = 3 ; sub Croaker { require Carp; # this initializes %CarpInternal local $Carp::CarpInternal{'warnings'}; delete $Carp::CarpInternal{'warnings'}; Carp::croak(@_); } sub _bits { my $mask = shift ; my $catmask ; my $fatal = 0 ; my $no_fatal = 0 ; foreach my $word ( @_ ) { if ($word eq 'FATAL') { $fatal = 1; $no_fatal = 0; } elsif ($word eq 'NONFATAL') { $fatal = 0; $no_fatal = 1; } elsif ($catmask = $Bits{$word}) { $mask |= $catmask ; $mask |= $DeadBits{$word} if $fatal ; $mask &= ~($DeadBits{$word}|$All) if $no_fatal ; } else { Croaker("Unknown warnings category '$word'")} } return $mask ; } sub bits { # called from B::Deparse.pm push @_, 'all' unless @_ ; return _bits(undef, @_) ; } sub import { shift; my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ; if (vec($mask, $Offsets{'all'}, 1)) { $mask |= $Bits{'all'} ; $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1); } # append 'all' when implied (after a lone "FATAL" or "NONFATAL") push @_, 'all' if @_==1 && ( $_[0] eq 'FATAL' || $_[0] eq 'NONFATAL' ); # Empty @_ is equivalent to @_ = 'all' ; ${^WARNING_BITS} = @_ ? _bits($mask, @_) : $mask | $Bits{all} ; } sub unimport { shift; my $catmask ; my $mask = ${^WARNING_BITS} // ($^W ? $Bits{all} : $DEFAULT) ; if (vec($mask, $Offsets{'all'}, 1)) { $mask |= $Bits{'all'} ; $mask |= $DeadBits{'all'} if vec($mask, $Offsets{'all'}+1, 1); } # append 'all' when implied (empty import list or after a lone "FATAL") push @_, 'all' if !@_ || @_==1 && $_[0] eq 'FATAL'; foreach my $word ( @_ ) { if ($word eq 'FATAL') { next; } elsif ($catmask = $Bits{$word}) { $mask &= ~($catmask | $DeadBits{$word} | $All); } else { Croaker("Unknown warnings category '$word'")} } ${^WARNING_BITS} = $mask ; } my %builtin_type; @builtin_type{qw(SCALAR ARRAY HASH CODE REF GLOB LVALUE Regexp)} = (); sub MESSAGE () { 4 }; sub FATAL () { 2 }; sub NORMAL () { 1 }; sub __chk { my $category ; my $offset ; my $isobj = 0 ; my $wanted = shift; my $has_message = $wanted & MESSAGE; unless (@_ == 1 || @_ == ($has_message ? 2 : 0)) { my $sub = (caller 1)[3]; my $syntax = $has_message ? "[category,] 'message'" : '[category]'; Croaker("Usage: $sub($syntax)"); } my $message = pop if $has_message; if (@_) { # check the category supplied. $category = shift ; if (my $type = ref $category) { Croaker("not an object") if exists $builtin_type{$type}; $category = $type; $isobj = 1 ; } $offset = $Offsets{$category}; Croaker("Unknown warnings category '$category'") unless defined $offset; } else { $category = (caller(1))[0] ; $offset = $Offsets{$category}; Croaker("package '$category' not registered for warnings") unless defined $offset ; } my $i; if ($isobj) { my $pkg; $i = 2; while (do { { package DB; $pkg = (caller($i++))[0] } } ) { last unless @DB::args && $DB::args[0] =~ /^$category=/ ; } $i -= 2 ; } else { $i = _error_loc(); # see where Carp will allocate the error } # Default to 0 if caller returns nothing. Default to $DEFAULT if it # explicitly returns undef. my(@callers_bitmask) = (caller($i))[9] ; my $callers_bitmask = @callers_bitmask ? $callers_bitmask[0] // $DEFAULT : 0 ; my @results; foreach my $type (FATAL, NORMAL) { next unless $wanted & $type; push @results, (vec($callers_bitmask, $offset + $type - 1, 1) || vec($callers_bitmask, $Offsets{'all'} + $type - 1, 1)); } # &enabled and &fatal_enabled return $results[0] unless $has_message; # &warnif, and the category is neither enabled as warning nor as fatal return if $wanted == (NORMAL | FATAL | MESSAGE) && !($results[0] || $results[1]); require Carp; Carp::croak($message) if $results[0]; # will always get here for &warn. will only get here for &warnif if the # category is enabled Carp::carp($message); } sub _mkMask { my ($bit) = @_; my $mask = ""; vec($mask, $bit, 1) = 1; return $mask; } sub register_categories { my @names = @_; for my $name (@names) { if (! defined $Bits{$name}) { $Bits{$name} = _mkMask($LAST_BIT); vec($Bits{'all'}, $LAST_BIT, 1) = 1; $Offsets{$name} = $LAST_BIT ++; foreach my $k (keys %Bits) { vec($Bits{$k}, $LAST_BIT, 1) = 0; } $DeadBits{$name} = _mkMask($LAST_BIT); vec($DeadBits{'all'}, $LAST_BIT++, 1) = 1; } } } sub _error_loc { require Carp; goto &Carp::short_error_loc; # don't introduce another stack frame } sub enabled { return __chk(NORMAL, @_); } sub fatal_enabled { return __chk(FATAL, @_); } sub warn { return __chk(FATAL | MESSAGE, @_); } sub warnif { return __chk(NORMAL | FATAL | MESSAGE, @_); } # These are not part of any public interface, so we can delete them to save # space. delete @warnings::{qw(NORMAL FATAL MESSAGE)}; 1; # ex: set ro: FILE722a54e4/warnings/register.pm&#line 1 "/usr/local/lib/perl5/5.20.0/warnings/register.pm" package warnings::register; our $VERSION = '1.03'; #line 22 require warnings; # left here as cruft in case other users were using this undocumented routine # -- rjbs, 2010-09-08 sub mkMask { my ($bit) = @_; my $mask = ""; vec($mask, $bit, 1) = 1; return $mask; } sub import { shift; my @categories = @_; my $package = (caller(0))[0]; warnings::register_categories($package); warnings::register_categories($package . "::$_") for @categories; } 1; FILE619af0e7/Archive/Zip.pmD#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Archive/Zip.pm" package Archive::Zip; use 5.006; use strict; use Carp (); use Cwd (); use IO::File (); use IO::Seekable (); use Compress::Raw::Zlib (); use File::Spec (); use File::Temp (); use FileHandle (); use vars qw( $VERSION @ISA ); BEGIN { $VERSION = '1.38'; require Exporter; @ISA = qw( Exporter ); } use vars qw( $ChunkSize $ErrorHandler ); BEGIN { # This is the size we'll try to read, write, and (de)compress. # You could set it to something different if you had lots of memory # and needed more speed. $ChunkSize ||= 32768; $ErrorHandler = \&Carp::carp; } # BEGIN block is necessary here so that other modules can use the constants. use vars qw( @EXPORT_OK %EXPORT_TAGS ); BEGIN { @EXPORT_OK = ('computeCRC32'); %EXPORT_TAGS = ( CONSTANTS => [ qw( FA_MSDOS FA_UNIX GPBF_ENCRYPTED_MASK GPBF_DEFLATING_COMPRESSION_MASK GPBF_HAS_DATA_DESCRIPTOR_MASK COMPRESSION_STORED COMPRESSION_DEFLATED COMPRESSION_LEVEL_NONE COMPRESSION_LEVEL_DEFAULT COMPRESSION_LEVEL_FASTEST COMPRESSION_LEVEL_BEST_COMPRESSION IFA_TEXT_FILE_MASK IFA_TEXT_FILE IFA_BINARY_FILE ) ], MISC_CONSTANTS => [ qw( FA_AMIGA FA_VAX_VMS FA_VM_CMS FA_ATARI_ST FA_OS2_HPFS FA_MACINTOSH FA_Z_SYSTEM FA_CPM FA_TOPS20 FA_WINDOWS_NTFS FA_QDOS FA_ACORN FA_VFAT FA_MVS FA_BEOS FA_TANDEM FA_THEOS GPBF_IMPLODING_8K_SLIDING_DICTIONARY_MASK GPBF_IMPLODING_3_SHANNON_FANO_TREES_MASK GPBF_IS_COMPRESSED_PATCHED_DATA_MASK COMPRESSION_SHRUNK DEFLATING_COMPRESSION_NORMAL DEFLATING_COMPRESSION_MAXIMUM DEFLATING_COMPRESSION_FAST DEFLATING_COMPRESSION_SUPER_FAST COMPRESSION_REDUCED_1 COMPRESSION_REDUCED_2 COMPRESSION_REDUCED_3 COMPRESSION_REDUCED_4 COMPRESSION_IMPLODED COMPRESSION_TOKENIZED COMPRESSION_DEFLATED_ENHANCED COMPRESSION_PKWARE_DATA_COMPRESSION_LIBRARY_IMPLODED ) ], ERROR_CODES => [ qw( AZ_OK AZ_STREAM_END AZ_ERROR AZ_FORMAT_ERROR AZ_IO_ERROR ) ], # For Internal Use Only PKZIP_CONSTANTS => [ qw( SIGNATURE_FORMAT SIGNATURE_LENGTH LOCAL_FILE_HEADER_SIGNATURE LOCAL_FILE_HEADER_FORMAT LOCAL_FILE_HEADER_LENGTH CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE DATA_DESCRIPTOR_FORMAT DATA_DESCRIPTOR_LENGTH DATA_DESCRIPTOR_SIGNATURE DATA_DESCRIPTOR_FORMAT_NO_SIG DATA_DESCRIPTOR_LENGTH_NO_SIG CENTRAL_DIRECTORY_FILE_HEADER_FORMAT CENTRAL_DIRECTORY_FILE_HEADER_LENGTH END_OF_CENTRAL_DIRECTORY_SIGNATURE END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING END_OF_CENTRAL_DIRECTORY_FORMAT END_OF_CENTRAL_DIRECTORY_LENGTH ) ], # For Internal Use Only UTILITY_METHODS => [ qw( _error _printError _ioError _formatError _subclassResponsibility _binmode _isSeekable _newFileHandle _readSignature _asZipDirName ) ], ); # Add all the constant names and error code names to @EXPORT_OK Exporter::export_ok_tags( qw( CONSTANTS ERROR_CODES PKZIP_CONSTANTS UTILITY_METHODS MISC_CONSTANTS ) ); } # Error codes use constant AZ_OK => 0; use constant AZ_STREAM_END => 1; use constant AZ_ERROR => 2; use constant AZ_FORMAT_ERROR => 3; use constant AZ_IO_ERROR => 4; # File types # Values of Archive::Zip::Member->fileAttributeFormat() use constant FA_MSDOS => 0; use constant FA_AMIGA => 1; use constant FA_VAX_VMS => 2; use constant FA_UNIX => 3; use constant FA_VM_CMS => 4; use constant FA_ATARI_ST => 5; use constant FA_OS2_HPFS => 6; use constant FA_MACINTOSH => 7; use constant FA_Z_SYSTEM => 8; use constant FA_CPM => 9; use constant FA_TOPS20 => 10; use constant FA_WINDOWS_NTFS => 11; use constant FA_QDOS => 12; use constant FA_ACORN => 13; use constant FA_VFAT => 14; use constant FA_MVS => 15; use constant FA_BEOS => 16; use constant FA_TANDEM => 17; use constant FA_THEOS => 18; # general-purpose bit flag masks # Found in Archive::Zip::Member->bitFlag() use constant GPBF_ENCRYPTED_MASK => 1 << 0; use constant GPBF_DEFLATING_COMPRESSION_MASK => 3 << 1; use constant GPBF_HAS_DATA_DESCRIPTOR_MASK => 1 << 3; # deflating compression types, if compressionMethod == COMPRESSION_DEFLATED # ( Archive::Zip::Member->bitFlag() & GPBF_DEFLATING_COMPRESSION_MASK ) use constant DEFLATING_COMPRESSION_NORMAL => 0 << 1; use constant DEFLATING_COMPRESSION_MAXIMUM => 1 << 1; use constant DEFLATING_COMPRESSION_FAST => 2 << 1; use constant DEFLATING_COMPRESSION_SUPER_FAST => 3 << 1; # compression method # these two are the only ones supported in this module use constant COMPRESSION_STORED => 0; # file is stored (no compression) use constant COMPRESSION_DEFLATED => 8; # file is Deflated use constant COMPRESSION_LEVEL_NONE => 0; use constant COMPRESSION_LEVEL_DEFAULT => -1; use constant COMPRESSION_LEVEL_FASTEST => 1; use constant COMPRESSION_LEVEL_BEST_COMPRESSION => 9; # internal file attribute bits # Found in Archive::Zip::Member::internalFileAttributes() use constant IFA_TEXT_FILE_MASK => 1; use constant IFA_TEXT_FILE => 1; use constant IFA_BINARY_FILE => 0; # PKZIP file format miscellaneous constants (for internal use only) use constant SIGNATURE_FORMAT => "V"; use constant SIGNATURE_LENGTH => 4; # these lengths are without the signature. use constant LOCAL_FILE_HEADER_SIGNATURE => 0x04034b50; use constant LOCAL_FILE_HEADER_FORMAT => "v3 V4 v2"; use constant LOCAL_FILE_HEADER_LENGTH => 26; # PKZIP docs don't mention the signature, but Info-Zip writes it. use constant DATA_DESCRIPTOR_SIGNATURE => 0x08074b50; use constant DATA_DESCRIPTOR_FORMAT => "V3"; use constant DATA_DESCRIPTOR_LENGTH => 12; # but the signature is apparently optional. use constant DATA_DESCRIPTOR_FORMAT_NO_SIG => "V2"; use constant DATA_DESCRIPTOR_LENGTH_NO_SIG => 8; use constant CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE => 0x02014b50; use constant CENTRAL_DIRECTORY_FILE_HEADER_FORMAT => "C2 v3 V4 v5 V2"; use constant CENTRAL_DIRECTORY_FILE_HEADER_LENGTH => 42; use constant END_OF_CENTRAL_DIRECTORY_SIGNATURE => 0x06054b50; use constant END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING => pack( "V", END_OF_CENTRAL_DIRECTORY_SIGNATURE ); use constant END_OF_CENTRAL_DIRECTORY_FORMAT => "v4 V2 v"; use constant END_OF_CENTRAL_DIRECTORY_LENGTH => 18; use constant GPBF_IMPLODING_8K_SLIDING_DICTIONARY_MASK => 1 << 1; use constant GPBF_IMPLODING_3_SHANNON_FANO_TREES_MASK => 1 << 2; use constant GPBF_IS_COMPRESSED_PATCHED_DATA_MASK => 1 << 5; # the rest of these are not supported in this module use constant COMPRESSION_SHRUNK => 1; # file is Shrunk use constant COMPRESSION_REDUCED_1 => 2; # file is Reduced CF=1 use constant COMPRESSION_REDUCED_2 => 3; # file is Reduced CF=2 use constant COMPRESSION_REDUCED_3 => 4; # file is Reduced CF=3 use constant COMPRESSION_REDUCED_4 => 5; # file is Reduced CF=4 use constant COMPRESSION_IMPLODED => 6; # file is Imploded use constant COMPRESSION_TOKENIZED => 7; # reserved for Tokenizing compr. use constant COMPRESSION_DEFLATED_ENHANCED => 9; # reserved for enh. Deflating use constant COMPRESSION_PKWARE_DATA_COMPRESSION_LIBRARY_IMPLODED => 10; # Load the various required classes require Archive::Zip::Archive; require Archive::Zip::Member; require Archive::Zip::FileMember; require Archive::Zip::DirectoryMember; require Archive::Zip::ZipFileMember; require Archive::Zip::NewFileMember; require Archive::Zip::StringMember; use constant ZIPARCHIVECLASS => 'Archive::Zip::Archive'; use constant ZIPMEMBERCLASS => 'Archive::Zip::Member'; # Convenience functions sub _ISA ($$) { # Can't rely on Scalar::Util, so use the next best way local $@; !! eval { ref $_[0] and $_[0]->isa($_[1]) }; } sub _CAN ($$) { local $@; !! eval { ref $_[0] and $_[0]->can($_[1]) }; } ##################################################################### # Methods sub new { my $class = shift; return $class->ZIPARCHIVECLASS->new(@_); } sub computeCRC32 { my ( $data, $crc ); if ( ref( $_[0] ) eq 'HASH' ) { $data = $_[0]->{string}; $crc = $_[0]->{checksum}; } else { $data = shift; $data = shift if ref($data); $crc = shift; } return Compress::Raw::Zlib::crc32( $data, $crc ); } # Report or change chunk size used for reading and writing. # Also sets Zlib's default buffer size (eventually). sub setChunkSize { shift if ref( $_[0] ) eq 'Archive::Zip::Archive'; my $chunkSize = ( ref( $_[0] ) eq 'HASH' ) ? shift->{chunkSize} : shift; my $oldChunkSize = $Archive::Zip::ChunkSize; $Archive::Zip::ChunkSize = $chunkSize if ($chunkSize); return $oldChunkSize; } sub chunkSize { return $Archive::Zip::ChunkSize; } sub setErrorHandler { my $errorHandler = ( ref( $_[0] ) eq 'HASH' ) ? shift->{subroutine} : shift; $errorHandler = \&Carp::carp unless defined($errorHandler); my $oldErrorHandler = $Archive::Zip::ErrorHandler; $Archive::Zip::ErrorHandler = $errorHandler; return $oldErrorHandler; } ###################################################################### # Private utility functions (not methods). sub _printError { my $string = join ( ' ', @_, "\n" ); my $oldCarpLevel = $Carp::CarpLevel; $Carp::CarpLevel += 2; &{$ErrorHandler} ($string); $Carp::CarpLevel = $oldCarpLevel; } # This is called on format errors. sub _formatError { shift if ref( $_[0] ); _printError( 'format error:', @_ ); return AZ_FORMAT_ERROR; } # This is called on IO errors. sub _ioError { shift if ref( $_[0] ); _printError( 'IO error:', @_, ':', $! ); return AZ_IO_ERROR; } # This is called on generic errors. sub _error { shift if ref( $_[0] ); _printError( 'error:', @_ ); return AZ_ERROR; } # Called when a subclass should have implemented # something but didn't sub _subclassResponsibility { Carp::croak("subclass Responsibility\n"); } # Try to set the given file handle or object into binary mode. sub _binmode { my $fh = shift; return _CAN( $fh, 'binmode' ) ? $fh->binmode() : binmode($fh); } # Attempt to guess whether file handle is seekable. # Because of problems with Windows, this only returns true when # the file handle is a real file. sub _isSeekable { my $fh = shift; return 0 unless ref $fh; _ISA ($fh, "IO::Scalar") # IO::Scalar objects are brokenly-seekable and return 0; _ISA ($fh, "IO::String") and return 1; if (_ISA ($fh, "IO::Seekable")) { # Unfortunately, some things like FileHandle objects # return true for Seekable, but AREN'T!!!!! _ISA ($fh, "FileHandle") and return 0; return 1; } # open my $fh, "+<", \$data; ref $fh eq "GLOB" && eval { seek $fh, 0, 1 } and return 1; _CAN ($fh, "stat") and return -f $fh; return (_CAN ($fh, "seek") and _CAN ($fh, "tell")) ? 1 : 0; } # Print to the filehandle, while making sure the pesky Perl special global # variables don't interfere. sub _print { my ($self, $fh, @data) = @_; local $\; return $fh->print(@data); } # Return an opened IO::Handle # my ( $status, fh ) = _newFileHandle( 'fileName', 'w' ); # Can take a filename, file handle, or ref to GLOB # Or, if given something that is a ref but not an IO::Handle, # passes back the same thing. sub _newFileHandle { my $fd = shift; my $status = 1; my $handle; if ( ref($fd) ) { if ( _ISA($fd, 'IO::Scalar') or _ISA($fd, 'IO::String') ) { $handle = $fd; } elsif ( _ISA($fd, 'IO::Handle') or ref($fd) eq 'GLOB' ) { $handle = IO::File->new; $status = $handle->fdopen( $fd, @_ ); } else { $handle = $fd; } } else { $handle = IO::File->new; $status = $handle->open( $fd, @_ ); } return ( $status, $handle ); } # Returns next signature from given file handle, leaves # file handle positioned afterwards. # In list context, returns ($status, $signature) # ( $status, $signature) = _readSignature( $fh, $fileName ); sub _readSignature { my $fh = shift; my $fileName = shift; my $expectedSignature = shift; # optional my $signatureData; my $bytesRead = $fh->read( $signatureData, SIGNATURE_LENGTH ); if ( $bytesRead != SIGNATURE_LENGTH ) { return _ioError("reading header signature"); } my $signature = unpack( SIGNATURE_FORMAT, $signatureData ); my $status = AZ_OK; # compare with expected signature, if any, or any known signature. if ( ( defined($expectedSignature) && $signature != $expectedSignature ) || ( !defined($expectedSignature) && $signature != CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE && $signature != LOCAL_FILE_HEADER_SIGNATURE && $signature != END_OF_CENTRAL_DIRECTORY_SIGNATURE && $signature != DATA_DESCRIPTOR_SIGNATURE ) ) { my $errmsg = sprintf( "bad signature: 0x%08x", $signature ); if ( _isSeekable($fh) ) { $errmsg .= sprintf( " at offset %d", $fh->tell() - SIGNATURE_LENGTH ); } $status = _formatError("$errmsg in file $fileName"); } return ( $status, $signature ); } # Utility method to make and open a temp file. # Will create $temp_dir if it does not exist. # Returns file handle and name: # # my ($fh, $name) = Archive::Zip::tempFile(); # my ($fh, $name) = Archive::Zip::tempFile('mytempdir'); # sub tempFile { my $dir = ( ref( $_[0] ) eq 'HASH' ) ? shift->{tempDir} : shift; my ( $fh, $filename ) = File::Temp::tempfile( SUFFIX => '.zip', UNLINK => 1, $dir ? ( DIR => $dir ) : () ); return ( undef, undef ) unless $fh; my ( $status, $newfh ) = _newFileHandle( $fh, 'w+' ); return ( $newfh, $filename ); } # Return the normalized directory name as used in a zip file (path # separators become slashes, etc.). # Will translate internal slashes in path components (i.e. on Macs) to # underscores. Discards volume names. # When $forceDir is set, returns paths with trailing slashes (or arrays # with trailing blank members). # # If third argument is a reference, returns volume information there. # # input output # . ('.') '.' # ./a ('a') a # ./a/b ('a','b') a/b # ./a/b/ ('a','b') a/b # a/b/ ('a','b') a/b # /a/b/ ('','a','b') a/b # c:\a\b\c.doc ('','a','b','c.doc') a/b/c.doc # on Windows # "i/o maps:whatever" ('i_o maps', 'whatever') "i_o maps/whatever" # on Macs sub _asZipDirName { my $name = shift; my $forceDir = shift; my $volReturn = shift; my ( $volume, $directories, $file ) = File::Spec->splitpath( File::Spec->canonpath($name), $forceDir ); $$volReturn = $volume if ( ref($volReturn) ); my @dirs = map { $_ =~ s{/}{_}g; $_ } File::Spec->splitdir($directories); if ( @dirs > 0 ) { pop (@dirs) unless $dirs[-1] } # remove empty component push ( @dirs, defined($file) ? $file : '' ); #return wantarray ? @dirs : join ( '/', @dirs ); my $normalised_path = join '/', @dirs; # Leading directory separators should not be stored in zip archives. # Example: # C:\a\b\c\ a/b/c # C:\a\b\c.txt a/b/c.txt # /a/b/c/ a/b/c # /a/b/c.txt a/b/c.txt $normalised_path =~ s{^/}{}; # remove leading separator return $normalised_path; } # Return an absolute local name for a zip name. # Assume a directory if zip name has trailing slash. # Takes an optional volume name in FS format (like 'a:'). # sub _asLocalName { my $name = shift; # zip format my $volume = shift; $volume = '' unless defined($volume); # local FS format my @paths = split ( /\//, $name ); my $filename = pop (@paths); $filename = '' unless defined($filename); my $localDirs = @paths ? File::Spec->catdir(@paths) : ''; my $localName = File::Spec->catpath( $volume, $localDirs, $filename ); unless ( $volume ) { $localName = File::Spec->rel2abs( $localName, Cwd::getcwd() ); } return $localName; } 1; __END__ #line 2136 FILEa4b46559/Archive/Zip/Archive.pmx#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Archive/Zip/Archive.pm" package Archive::Zip::Archive; # Represents a generic ZIP archive use strict; use File::Path; use File::Find (); use File::Spec (); use File::Copy (); use File::Basename; use Cwd; use vars qw( $VERSION @ISA ); BEGIN { $VERSION = '1.38'; @ISA = qw( Archive::Zip ); if ( $^O eq 'MSWin32' ) { require Win32; require Encode; Encode->import( qw{ encode_utf8 decode_utf8 } ); } } use Archive::Zip qw( :CONSTANTS :ERROR_CODES :PKZIP_CONSTANTS :UTILITY_METHODS ); our $UNICODE; # Note that this returns undef on read errors, else new zip object. sub new { my $class = shift; my $self = bless( { 'diskNumber' => 0, 'diskNumberWithStartOfCentralDirectory' => 0, 'numberOfCentralDirectoriesOnThisDisk' => 0, # should be # of members 'numberOfCentralDirectories' => 0, # should be # of members 'centralDirectorySize' => 0, # must re-compute on write 'centralDirectoryOffsetWRTStartingDiskNumber' => 0, # must re-compute 'writeEOCDOffset' => 0, 'writeCentralDirectoryOffset' => 0, 'zipfileComment' => '', 'eocdOffset' => 0, 'fileName' => '' }, $class ); $self->{'members'} = []; my $fileName = ( ref( $_[0] ) eq 'HASH' ) ? shift->{filename} : shift; if ($fileName) { my $status = $self->read($fileName); return $status == AZ_OK ? $self : undef; } return $self; } sub storeSymbolicLink { my $self = shift; $self->{'storeSymbolicLink'} = shift; } sub members { @{ shift->{'members'} }; } sub numberOfMembers { scalar( shift->members() ); } sub memberNames { my $self = shift; return map { $_->fileName() } $self->members(); } # return ref to member with given name or undef sub memberNamed { my $self = shift; my $fileName = ( ref( $_[0] ) eq 'HASH' ) ? shift->{zipName} : shift; foreach my $member ( $self->members() ) { return $member if $member->fileName() eq $fileName; } return undef; } sub membersMatching { my $self = shift; my $pattern = ( ref( $_[0] ) eq 'HASH' ) ? shift->{regex} : shift; return grep { $_->fileName() =~ /$pattern/ } $self->members(); } sub diskNumber { shift->{'diskNumber'}; } sub diskNumberWithStartOfCentralDirectory { shift->{'diskNumberWithStartOfCentralDirectory'}; } sub numberOfCentralDirectoriesOnThisDisk { shift->{'numberOfCentralDirectoriesOnThisDisk'}; } sub numberOfCentralDirectories { shift->{'numberOfCentralDirectories'}; } sub centralDirectorySize { shift->{'centralDirectorySize'}; } sub centralDirectoryOffsetWRTStartingDiskNumber { shift->{'centralDirectoryOffsetWRTStartingDiskNumber'}; } sub zipfileComment { my $self = shift; my $comment = $self->{'zipfileComment'}; if (@_) { my $new_comment = ( ref( $_[0] ) eq 'HASH' ) ? shift->{comment} : shift; $self->{'zipfileComment'} = pack( 'C0a*', $new_comment ); # avoid Unicode } return $comment; } sub eocdOffset { shift->{'eocdOffset'}; } # Return the name of the file last read. sub fileName { shift->{'fileName'}; } sub removeMember { my $self = shift; my $member = ( ref( $_[0] ) eq 'HASH' ) ? shift->{memberOrZipName} : shift; $member = $self->memberNamed($member) unless ref($member); return undef unless $member; my @newMembers = grep { $_ != $member } $self->members(); $self->{'members'} = \@newMembers; return $member; } sub replaceMember { my $self = shift; my ( $oldMember, $newMember ); if ( ref( $_[0] ) eq 'HASH' ) { $oldMember = $_[0]->{memberOrZipName}; $newMember = $_[0]->{newMember}; } else { ( $oldMember, $newMember ) = @_; } $oldMember = $self->memberNamed($oldMember) unless ref($oldMember); return undef unless $oldMember; return undef unless $newMember; my @newMembers = map { ( $_ == $oldMember ) ? $newMember : $_ } $self->members(); $self->{'members'} = \@newMembers; return $oldMember; } sub extractMember { my $self = shift; my ( $member, $name ); if ( ref( $_[0] ) eq 'HASH' ) { $member = $_[0]->{memberOrZipName}; $name = $_[0]->{name}; } else { ( $member, $name ) = @_; } $member = $self->memberNamed($member) unless ref($member); return _error('member not found') unless $member; my $originalSize = $member->compressedSize(); my ( $volumeName, $dirName, $fileName ); if ( defined($name) ) { ( $volumeName, $dirName, $fileName ) = File::Spec->splitpath($name); $dirName = File::Spec->catpath( $volumeName, $dirName, '' ); } else { $name = $member->fileName(); ( $dirName = $name ) =~ s{[^/]*$}{}; $dirName = Archive::Zip::_asLocalName($dirName); $name = Archive::Zip::_asLocalName($name); } if ( $dirName && !-d $dirName ) { mkpath($dirName); return _ioError("can't create dir $dirName") if ( !-d $dirName ); } my $rc = $member->extractToFileNamed( $name, @_ ); # TODO refactor this fix into extractToFileNamed() $member->{'compressedSize'} = $originalSize; return $rc; } sub extractMemberWithoutPaths { my $self = shift; my ( $member, $name ); if ( ref( $_[0] ) eq 'HASH' ) { $member = $_[0]->{memberOrZipName}; $name = $_[0]->{name}; } else { ( $member, $name ) = @_; } $member = $self->memberNamed($member) unless ref($member); return _error('member not found') unless $member; my $originalSize = $member->compressedSize(); return AZ_OK if $member->isDirectory(); unless ($name) { $name = $member->fileName(); $name =~ s{.*/}{}; # strip off directories, if any $name = Archive::Zip::_asLocalName($name); } my $rc = $member->extractToFileNamed( $name, @_ ); $member->{'compressedSize'} = $originalSize; return $rc; } sub addMember { my $self = shift; my $newMember = ( ref( $_[0] ) eq 'HASH' ) ? shift->{member} : shift; push( @{ $self->{'members'} }, $newMember ) if $newMember; return $newMember; } sub addFile { my $self = shift; my ( $fileName, $newName, $compressionLevel ); if ( ref( $_[0] ) eq 'HASH' ) { $fileName = $_[0]->{filename}; $newName = $_[0]->{zipName}; $compressionLevel = $_[0]->{compressionLevel}; } else { ( $fileName, $newName, $compressionLevel ) = @_; } if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { $fileName = Win32::GetANSIPathName($fileName); } my $newMember = $self->ZIPMEMBERCLASS->newFromFile( $fileName, $newName ); $newMember->desiredCompressionLevel($compressionLevel); if ( $self->{'storeSymbolicLink'} && -l $fileName ) { my $newMember = $self->ZIPMEMBERCLASS->newFromString(readlink $fileName, $newName); # For symbolic links, External File Attribute is set to 0xA1FF0000 by Info-ZIP $newMember->{'externalFileAttributes'} = 0xA1FF0000; $self->addMember($newMember); } else { $self->addMember($newMember); } if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { $newMember->{'fileName'} = encode_utf8( Win32::GetLongPathName($fileName) ); } return $newMember; } sub addString { my $self = shift; my ( $stringOrStringRef, $name, $compressionLevel ); if ( ref( $_[0] ) eq 'HASH' ) { $stringOrStringRef = $_[0]->{string}; $name = $_[0]->{zipName}; $compressionLevel = $_[0]->{compressionLevel}; } else { ( $stringOrStringRef, $name, $compressionLevel ) = @_;; } my $newMember = $self->ZIPMEMBERCLASS->newFromString( $stringOrStringRef, $name ); $newMember->desiredCompressionLevel($compressionLevel); return $self->addMember($newMember); } sub addDirectory { my $self = shift; my ( $name, $newName ); if ( ref( $_[0] ) eq 'HASH' ) { $name = $_[0]->{directoryName}; $newName = $_[0]->{zipName}; } else { ( $name, $newName ) = @_; } if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { $name = Win32::GetANSIPathName($name); } my $newMember = $self->ZIPMEMBERCLASS->newDirectoryNamed( $name, $newName ); if ( $self->{'storeSymbolicLink'} && -l $name ) { my $link = readlink $name; ( $newName =~ s{/$}{} ) if $newName; # Strip trailing / my $newMember = $self->ZIPMEMBERCLASS->newFromString($link, $newName); # For symbolic links, External File Attribute is set to 0xA1FF0000 by Info-ZIP $newMember->{'externalFileAttributes'} = 0xA1FF0000; $self->addMember($newMember); } else { $self->addMember($newMember); } if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { $newMember->{'fileName'} = encode_utf8( Win32::GetLongPathName($name) ); } return $newMember; } # add either a file or a directory. sub addFileOrDirectory { my $self = shift; my ( $name, $newName, $compressionLevel ); if ( ref( $_[0] ) eq 'HASH' ) { $name = $_[0]->{name}; $newName = $_[0]->{zipName}; $compressionLevel = $_[0]->{compressionLevel}; } else { ( $name, $newName, $compressionLevel ) = @_; } if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { $name = Win32::GetANSIPathName($name); } $name =~ s{/$}{}; if ( $newName ) { $newName =~ s{/$}{}; } else { $newName = $name; } if ( -f $name ) { return $self->addFile( $name, $newName, $compressionLevel ); } elsif ( -d $name ) { return $self->addDirectory( $name, $newName ); } else { return _error("$name is neither a file nor a directory"); } } sub contents { my $self = shift; my ( $member, $newContents ); if ( ref( $_[0] ) eq 'HASH' ) { $member = $_[0]->{memberOrZipName}; $newContents = $_[0]->{contents}; } else { ( $member, $newContents ) = @_; } return _error('No member name given') unless $member; $member = $self->memberNamed($member) unless ref($member); return undef unless $member; return $member->contents($newContents); } sub writeToFileNamed { my $self = shift; my $fileName = ( ref( $_[0] ) eq 'HASH' ) ? shift->{filename} : shift; # local FS format foreach my $member ( $self->members() ) { if ( $member->_usesFileNamed($fileName) ) { return _error( "$fileName is needed by member " . $member->fileName() . "; consider using overwrite() or overwriteAs() instead." ); } } my ( $status, $fh ) = _newFileHandle( $fileName, 'w' ); return _ioError("Can't open $fileName for write") unless $status; my $retval = $self->writeToFileHandle( $fh, 1 ); $fh->close(); $fh = undef; return $retval; } # It is possible to write data to the FH before calling this, # perhaps to make a self-extracting archive. sub writeToFileHandle { my $self = shift; my ( $fh, $fhIsSeekable ); if ( ref( $_[0] ) eq 'HASH' ) { $fh = $_[0]->{fileHandle}; $fhIsSeekable = exists( $_[0]->{seek} ) ? $_[0]->{seek} : _isSeekable($fh); } else { $fh = shift; $fhIsSeekable = @_ ? shift : _isSeekable($fh); } return _error('No filehandle given') unless $fh; return _ioError('filehandle not open') unless $fh->opened(); _binmode($fh); # Find out where the current position is. my $offset = $fhIsSeekable ? $fh->tell() : 0; $offset = 0 if $offset < 0; foreach my $member ( $self->members() ) { my $retval = $member->_writeToFileHandle( $fh, $fhIsSeekable, $offset ); $member->endRead(); return $retval if $retval != AZ_OK; $offset += $member->_localHeaderSize() + $member->_writeOffset(); $offset += $member->hasDataDescriptor() ? DATA_DESCRIPTOR_LENGTH + SIGNATURE_LENGTH : 0; # changed this so it reflects the last successful position $self->{'writeCentralDirectoryOffset'} = $offset; } return $self->writeCentralDirectory($fh); } # Write zip back to the original file, # as safely as possible. # Returns AZ_OK if successful. sub overwrite { my $self = shift; return $self->overwriteAs( $self->{'fileName'} ); } # Write zip to the specified file, # as safely as possible. # Returns AZ_OK if successful. sub overwriteAs { my $self = shift; my $zipName = ( ref( $_[0] ) eq 'HASH' ) ? $_[0]->{filename} : shift; return _error("no filename in overwriteAs()") unless defined($zipName); my ( $fh, $tempName ) = Archive::Zip::tempFile(); return _error( "Can't open temp file", $! ) unless $fh; ( my $backupName = $zipName ) =~ s{(\.[^.]*)?$}{.zbk}; my $status = $self->writeToFileHandle($fh); $fh->close(); $fh = undef; if ( $status != AZ_OK ) { unlink($tempName); _printError("Can't write to $tempName"); return $status; } my $err; # rename the zip if ( -f $zipName && !rename( $zipName, $backupName ) ) { $err = $!; unlink($tempName); return _error( "Can't rename $zipName as $backupName", $err ); } # move the temp to the original name (possibly copying) unless ( File::Copy::move( $tempName, $zipName ) || File::Copy::copy( $tempName, $zipName) ) { $err = $!; rename( $backupName, $zipName ); unlink($tempName); return _error( "Can't move $tempName to $zipName", $err ); } # unlink the backup if ( -f $backupName && !unlink($backupName) ) { $err = $!; return _error( "Can't unlink $backupName", $err ); } return AZ_OK; } # Used only during writing sub _writeCentralDirectoryOffset { shift->{'writeCentralDirectoryOffset'}; } sub _writeEOCDOffset { shift->{'writeEOCDOffset'}; } # Expects to have _writeEOCDOffset() set sub _writeEndOfCentralDirectory { my ( $self, $fh ) = @_; $self->_print($fh, END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING) or return _ioError('writing EOCD Signature'); my $zipfileCommentLength = length( $self->zipfileComment() ); my $header = pack( END_OF_CENTRAL_DIRECTORY_FORMAT, 0, # {'diskNumber'}, 0, # {'diskNumberWithStartOfCentralDirectory'}, $self->numberOfMembers(), # {'numberOfCentralDirectoriesOnThisDisk'}, $self->numberOfMembers(), # {'numberOfCentralDirectories'}, $self->_writeEOCDOffset() - $self->_writeCentralDirectoryOffset(), $self->_writeCentralDirectoryOffset(), $zipfileCommentLength ); $self->_print($fh, $header) or return _ioError('writing EOCD header'); if ($zipfileCommentLength) { $self->_print($fh, $self->zipfileComment() ) or return _ioError('writing zipfile comment'); } return AZ_OK; } # $offset can be specified to truncate a zip file. sub writeCentralDirectory { my $self = shift; my ( $fh, $offset ); if ( ref( $_[0] ) eq 'HASH' ) { $fh = $_[0]->{fileHandle}; $offset = $_[0]->{offset}; } else { ( $fh, $offset ) = @_; } if ( defined($offset) ) { $self->{'writeCentralDirectoryOffset'} = $offset; $fh->seek( $offset, IO::Seekable::SEEK_SET ) or return _ioError('seeking to write central directory'); } else { $offset = $self->_writeCentralDirectoryOffset(); } foreach my $member ( $self->members() ) { my $status = $member->_writeCentralDirectoryFileHeader($fh); return $status if $status != AZ_OK; $offset += $member->_centralDirectoryHeaderSize(); $self->{'writeEOCDOffset'} = $offset; } return $self->_writeEndOfCentralDirectory($fh); } sub read { my $self = shift; my $fileName = ( ref( $_[0] ) eq 'HASH' ) ? shift->{filename} : shift; return _error('No filename given') unless $fileName; my ( $status, $fh ) = _newFileHandle( $fileName, 'r' ); return _ioError("opening $fileName for read") unless $status; $status = $self->readFromFileHandle( $fh, $fileName ); return $status if $status != AZ_OK; $fh->close(); $self->{'fileName'} = $fileName; return AZ_OK; } sub readFromFileHandle { my $self = shift; my ( $fh, $fileName ); if ( ref( $_[0] ) eq 'HASH' ) { $fh = $_[0]->{fileHandle}; $fileName = $_[0]->{filename}; } else { ( $fh, $fileName ) = @_; } $fileName = $fh unless defined($fileName); return _error('No filehandle given') unless $fh; return _ioError('filehandle not open') unless $fh->opened(); _binmode($fh); $self->{'fileName'} = "$fh"; # TODO: how to support non-seekable zips? return _error('file not seekable') unless _isSeekable($fh); $fh->seek( 0, 0 ); # rewind the file my $status = $self->_findEndOfCentralDirectory($fh); return $status if $status != AZ_OK; my $eocdPosition = $fh->tell(); $status = $self->_readEndOfCentralDirectory($fh); return $status if $status != AZ_OK; $fh->seek( $eocdPosition - $self->centralDirectorySize(), IO::Seekable::SEEK_SET ) or return _ioError("Can't seek $fileName"); # Try to detect garbage at beginning of archives # This should be 0 $self->{'eocdOffset'} = $eocdPosition - $self->centralDirectorySize() # here - $self->centralDirectoryOffsetWRTStartingDiskNumber(); for ( ; ; ) { my $newMember = $self->ZIPMEMBERCLASS->_newFromZipFile( $fh, $fileName, $self->eocdOffset() ); my $signature; ( $status, $signature ) = _readSignature( $fh, $fileName ); return $status if $status != AZ_OK; last if $signature == END_OF_CENTRAL_DIRECTORY_SIGNATURE; $status = $newMember->_readCentralDirectoryFileHeader(); return $status if $status != AZ_OK; $status = $newMember->endRead(); return $status if $status != AZ_OK; $newMember->_becomeDirectoryIfNecessary(); push( @{ $self->{'members'} }, $newMember ); } return AZ_OK; } # Read EOCD, starting from position before signature. # Return AZ_OK on success. sub _readEndOfCentralDirectory { my $self = shift; my $fh = shift; # Skip past signature $fh->seek( SIGNATURE_LENGTH, IO::Seekable::SEEK_CUR ) or return _ioError("Can't seek past EOCD signature"); my $header = ''; my $bytesRead = $fh->read( $header, END_OF_CENTRAL_DIRECTORY_LENGTH ); if ( $bytesRead != END_OF_CENTRAL_DIRECTORY_LENGTH ) { return _ioError("reading end of central directory"); } my $zipfileCommentLength; ( $self->{'diskNumber'}, $self->{'diskNumberWithStartOfCentralDirectory'}, $self->{'numberOfCentralDirectoriesOnThisDisk'}, $self->{'numberOfCentralDirectories'}, $self->{'centralDirectorySize'}, $self->{'centralDirectoryOffsetWRTStartingDiskNumber'}, $zipfileCommentLength ) = unpack( END_OF_CENTRAL_DIRECTORY_FORMAT, $header ); if ($zipfileCommentLength) { my $zipfileComment = ''; $bytesRead = $fh->read( $zipfileComment, $zipfileCommentLength ); if ( $bytesRead != $zipfileCommentLength ) { return _ioError("reading zipfile comment"); } $self->{'zipfileComment'} = $zipfileComment; } return AZ_OK; } # Seek in my file to the end, then read backwards until we find the # signature of the central directory record. Leave the file positioned right # before the signature. Returns AZ_OK if success. sub _findEndOfCentralDirectory { my $self = shift; my $fh = shift; my $data = ''; $fh->seek( 0, IO::Seekable::SEEK_END ) or return _ioError("seeking to end"); my $fileLength = $fh->tell(); if ( $fileLength < END_OF_CENTRAL_DIRECTORY_LENGTH + 4 ) { return _formatError("file is too short"); } my $seekOffset = 0; my $pos = -1; for ( ; ; ) { $seekOffset += 512; $seekOffset = $fileLength if ( $seekOffset > $fileLength ); $fh->seek( -$seekOffset, IO::Seekable::SEEK_END ) or return _ioError("seek failed"); my $bytesRead = $fh->read( $data, $seekOffset ); if ( $bytesRead != $seekOffset ) { return _ioError("read failed"); } $pos = rindex( $data, END_OF_CENTRAL_DIRECTORY_SIGNATURE_STRING ); last if ( $pos >= 0 or $seekOffset == $fileLength or $seekOffset >= $Archive::Zip::ChunkSize ); } if ( $pos >= 0 ) { $fh->seek( $pos - $seekOffset, IO::Seekable::SEEK_CUR ) or return _ioError("seeking to EOCD"); return AZ_OK; } else { return _formatError("can't find EOCD signature"); } } # Used to avoid taint problems when chdir'ing. # Not intended to increase security in any way; just intended to shut up the -T # complaints. If your Cwd module is giving you unreliable returns from cwd() # you have bigger problems than this. sub _untaintDir { my $dir = shift; $dir =~ m/\A(.+)\z/s; return $1; } sub addTree { my $self = shift; my ( $root, $dest, $pred, $compressionLevel ); if ( ref( $_[0] ) eq 'HASH' ) { $root = $_[0]->{root}; $dest = $_[0]->{zipName}; $pred = $_[0]->{select}; $compressionLevel = $_[0]->{compressionLevel}; } else { ( $root, $dest, $pred, $compressionLevel ) = @_; } return _error("root arg missing in call to addTree()") unless defined($root); $dest = '' unless defined($dest); $pred = sub { -r } unless defined($pred); my @files; my $startDir = _untaintDir( cwd() ); return _error( 'undef returned by _untaintDir on cwd ', cwd() ) unless $startDir; # This avoids chdir'ing in Find, in a way compatible with older # versions of File::Find. my $wanted = sub { local $main::_ = $File::Find::name; my $dir = _untaintDir($File::Find::dir); chdir($startDir); if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { push( @files, Win32::GetANSIPathName($File::Find::name) ) if (&$pred); $dir = Win32::GetANSIPathName($dir); } else { push( @files, $File::Find::name ) if (&$pred); } chdir($dir); }; if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { $root = Win32::GetANSIPathName($root); } File::Find::find( $wanted, $root ); my $rootZipName = _asZipDirName( $root, 1 ); # with trailing slash my $pattern = $rootZipName eq './' ? '^' : "^\Q$rootZipName\E"; $dest = _asZipDirName( $dest, 1 ); # with trailing slash foreach my $fileName (@files) { my $isDir; if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { $isDir = -d Win32::GetANSIPathName($fileName); } else { $isDir = -d $fileName; } # normalize, remove leading ./ my $archiveName = _asZipDirName( $fileName, $isDir ); if ( $archiveName eq $rootZipName ) { $archiveName = $dest } else { $archiveName =~ s{$pattern}{$dest} } next if $archiveName =~ m{^\.?/?$}; # skip current dir my $member = $isDir ? $self->addDirectory( $fileName, $archiveName ) : $self->addFile( $fileName, $archiveName ); $member->desiredCompressionLevel($compressionLevel); return _error("add $fileName failed in addTree()") if !$member; } return AZ_OK; } sub addTreeMatching { my $self = shift; my ( $root, $dest, $pattern, $pred, $compressionLevel ); if ( ref( $_[0] ) eq 'HASH' ) { $root = $_[0]->{root}; $dest = $_[0]->{zipName}; $pattern = $_[0]->{pattern}; $pred = $_[0]->{select}; $compressionLevel = $_[0]->{compressionLevel}; } else { ( $root, $dest, $pattern, $pred, $compressionLevel ) = @_; } return _error("root arg missing in call to addTreeMatching()") unless defined($root); $dest = '' unless defined($dest); return _error("pattern missing in call to addTreeMatching()") unless defined($pattern); my $matcher = $pred ? sub { m{$pattern} && &$pred } : sub { m{$pattern} && -r }; return $self->addTree( $root, $dest, $matcher, $compressionLevel ); } # $zip->extractTree( $root, $dest [, $volume] ); # # $root and $dest are Unix-style. # $volume is in local FS format. # sub extractTree { my $self = shift; my ( $root, $dest, $volume ); if ( ref( $_[0] ) eq 'HASH' ) { $root = $_[0]->{root}; $dest = $_[0]->{zipName}; $volume = $_[0]->{volume}; } else { ( $root, $dest, $volume ) = @_; } $root = '' unless defined($root); if ( defined $dest ) { if ( $dest !~ m{/$} ) { $dest .= '/'; } } else { $dest = './'; } my $pattern = "^\Q$root"; my @members = $self->membersMatching($pattern); foreach my $member (@members) { my $fileName = $member->fileName(); # in Unix format $fileName =~ s{$pattern}{$dest}; # in Unix format # convert to platform format: $fileName = Archive::Zip::_asLocalName( $fileName, $volume ); my $status = $member->extractToFileNamed($fileName); return $status if $status != AZ_OK; } return AZ_OK; } # $zip->updateMember( $memberOrName, $fileName ); # Returns (possibly updated) member, if any; undef on errors. sub updateMember { my $self = shift; my ( $oldMember, $fileName ); if ( ref( $_[0] ) eq 'HASH' ) { $oldMember = $_[0]->{memberOrZipName}; $fileName = $_[0]->{name}; } else { ( $oldMember, $fileName ) = @_; } if ( !defined($fileName) ) { _error("updateMember(): missing fileName argument"); return undef; } my @newStat = stat($fileName); if ( !@newStat ) { _ioError("Can't stat $fileName"); return undef; } my $isDir = -d _; my $memberName; if ( ref($oldMember) ) { $memberName = $oldMember->fileName(); } else { $oldMember = $self->memberNamed( $memberName = $oldMember ) || $self->memberNamed( $memberName = _asZipDirName( $oldMember, $isDir ) ); } unless ( defined($oldMember) && $oldMember->lastModTime() == $newStat[9] && $oldMember->isDirectory() == $isDir && ( $isDir || ( $oldMember->uncompressedSize() == $newStat[7] ) ) ) { # create the new member my $newMember = $isDir ? $self->ZIPMEMBERCLASS->newDirectoryNamed( $fileName, $memberName ) : $self->ZIPMEMBERCLASS->newFromFile( $fileName, $memberName ); unless ( defined($newMember) ) { _error("creation of member $fileName failed in updateMember()"); return undef; } # replace old member or append new one if ( defined($oldMember) ) { $self->replaceMember( $oldMember, $newMember ); } else { $self->addMember($newMember); } return $newMember; } return $oldMember; } # $zip->updateTree( $root, [ $dest, [ $pred [, $mirror]]] ); # # This takes the same arguments as addTree, but first checks to see # whether the file or directory already exists in the zip file. # # If the fourth argument $mirror is true, then delete all my members # if corresponding files were not found. sub updateTree { my $self = shift; my ( $root, $dest, $pred, $mirror, $compressionLevel ); if ( ref( $_[0] ) eq 'HASH' ) { $root = $_[0]->{root}; $dest = $_[0]->{zipName}; $pred = $_[0]->{select}; $mirror = $_[0]->{mirror}; $compressionLevel = $_[0]->{compressionLevel}; } else { ( $root, $dest, $pred, $mirror, $compressionLevel ) = @_; } return _error("root arg missing in call to updateTree()") unless defined($root); $dest = '' unless defined($dest); $pred = sub { -r } unless defined($pred); $dest = _asZipDirName( $dest, 1 ); my $rootZipName = _asZipDirName( $root, 1 ); # with trailing slash my $pattern = $rootZipName eq './' ? '^' : "^\Q$rootZipName\E"; my @files; my $startDir = _untaintDir( cwd() ); return _error( 'undef returned by _untaintDir on cwd ', cwd() ) unless $startDir; # This avoids chdir'ing in Find, in a way compatible with older # versions of File::Find. my $wanted = sub { local $main::_ = $File::Find::name; my $dir = _untaintDir($File::Find::dir); chdir($startDir); push( @files, $File::Find::name ) if (&$pred); chdir($dir); }; File::Find::find( $wanted, $root ); # Now @files has all the files that I could potentially be adding to # the zip. Only add the ones that are necessary. # For each file (updated or not), add its member name to @done. my %done; foreach my $fileName (@files) { my @newStat = stat($fileName); my $isDir = -d _; # normalize, remove leading ./ my $memberName = _asZipDirName( $fileName, $isDir ); if ( $memberName eq $rootZipName ) { $memberName = $dest } else { $memberName =~ s{$pattern}{$dest} } next if $memberName =~ m{^\.?/?$}; # skip current dir $done{$memberName} = 1; my $changedMember = $self->updateMember( $memberName, $fileName ); $changedMember->desiredCompressionLevel($compressionLevel); return _error("updateTree failed to update $fileName") unless ref($changedMember); } # @done now has the archive names corresponding to all the found files. # If we're mirroring, delete all those members that aren't in @done. if ($mirror) { foreach my $member ( $self->members() ) { $self->removeMember($member) unless $done{ $member->fileName() }; } } return AZ_OK; } 1; FILE'975d3240/Archive/Zip/DirectoryMember.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Archive/Zip/DirectoryMember.pm" package Archive::Zip::DirectoryMember; use strict; use File::Path; use vars qw( $VERSION @ISA ); BEGIN { $VERSION = '1.38'; @ISA = qw( Archive::Zip::Member ); } use Archive::Zip qw( :ERROR_CODES :UTILITY_METHODS ); sub _newNamed { my $class = shift; my $fileName = shift; # FS name my $newName = shift; # Zip name $newName = _asZipDirName($fileName) unless $newName; my $self = $class->new(@_); $self->{'externalFileName'} = $fileName; $self->fileName($newName); if ( -e $fileName ) { # -e does NOT do a full stat, so we need to do one now if ( -d _ ) { my @stat = stat(_); $self->unixFileAttributes( $stat[2] ); my $mod_t = $stat[9]; if ( $^O eq 'MSWin32' and !$mod_t ) { $mod_t = time(); } $self->setLastModFileDateTimeFromUnix($mod_t); } else { # hmm.. trying to add a non-directory? _error( $fileName, ' exists but is not a directory' ); return undef; } } else { $self->unixFileAttributes( $self->DEFAULT_DIRECTORY_PERMISSIONS ); $self->setLastModFileDateTimeFromUnix( time() ); } return $self; } sub externalFileName { shift->{'externalFileName'}; } sub isDirectory { return 1; } sub extractToFileNamed { my $self = shift; my $name = shift; # local FS name my $attribs = $self->unixFileAttributes() & 07777; mkpath( $name, 0, $attribs ); # croaks on error utime( $self->lastModTime(), $self->lastModTime(), $name ); return AZ_OK; } sub fileName { my $self = shift; my $newName = shift; $newName =~ s{/?$}{/} if defined($newName); return $self->SUPER::fileName($newName); } # So people don't get too confused. This way it looks like the problem # is in their code... sub contents { return wantarray ? ( undef, AZ_OK ) : undef; } 1; FILE"2ef40172/Archive/Zip/FileMember.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Archive/Zip/FileMember.pm" package Archive::Zip::FileMember; use strict; use vars qw( $VERSION @ISA ); BEGIN { $VERSION = '1.38'; @ISA = qw ( Archive::Zip::Member ); } use Archive::Zip qw( :UTILITY_METHODS ); sub externalFileName { shift->{'externalFileName'}; } # Return true if I depend on the named file sub _usesFileNamed { my $self = shift; my $fileName = shift; my $xfn = $self->externalFileName(); return undef if ref($xfn); return $xfn eq $fileName; } sub fh { my $self = shift; $self->_openFile() if !defined( $self->{'fh'} ) || !$self->{'fh'}->opened(); return $self->{'fh'}; } # opens my file handle from my file name sub _openFile { my $self = shift; my ( $status, $fh ) = _newFileHandle( $self->externalFileName(), 'r' ); if ( !$status ) { _ioError( "Can't open", $self->externalFileName() ); return undef; } $self->{'fh'} = $fh; _binmode($fh); return $fh; } # Make sure I close my file handle sub endRead { my $self = shift; undef $self->{'fh'}; # _closeFile(); return $self->SUPER::endRead(@_); } sub _become { my $self = shift; my $newClass = shift; return $self if ref($self) eq $newClass; delete( $self->{'externalFileName'} ); delete( $self->{'fh'} ); return $self->SUPER::_become($newClass); } 1; FILE2136e227/Archive/Zip/Member.pm9#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Archive/Zip/Member.pm" package Archive::Zip::Member; # A generic member of an archive use strict; use vars qw( $VERSION @ISA ); BEGIN { $VERSION = '1.38'; @ISA = qw( Archive::Zip ); if ( $^O eq 'MSWin32' ) { require Win32; require Encode; Encode->import( qw{ decode_utf8 } ); } } use Archive::Zip qw( :CONSTANTS :MISC_CONSTANTS :ERROR_CODES :PKZIP_CONSTANTS :UTILITY_METHODS ); use Time::Local (); use Compress::Raw::Zlib qw( Z_OK Z_STREAM_END MAX_WBITS ); use File::Path; use File::Basename; use constant ZIPFILEMEMBERCLASS => 'Archive::Zip::ZipFileMember'; use constant NEWFILEMEMBERCLASS => 'Archive::Zip::NewFileMember'; use constant STRINGMEMBERCLASS => 'Archive::Zip::StringMember'; use constant DIRECTORYMEMBERCLASS => 'Archive::Zip::DirectoryMember'; # Unix perms for default creation of files/dirs. use constant DEFAULT_DIRECTORY_PERMISSIONS => 040755; use constant DEFAULT_FILE_PERMISSIONS => 0100666; use constant DIRECTORY_ATTRIB => 040000; use constant FILE_ATTRIB => 0100000; # Returns self if successful, else undef # Assumes that fh is positioned at beginning of central directory file header. # Leaves fh positioned immediately after file header or EOCD signature. sub _newFromZipFile { my $class = shift; my $self = $class->ZIPFILEMEMBERCLASS->_newFromZipFile(@_); return $self; } sub newFromString { my $class = shift; my ( $stringOrStringRef, $fileName ); if ( ref( $_[0] ) eq 'HASH' ) { $stringOrStringRef = $_[0]->{string}; $fileName = $_[0]->{zipName}; } else { ( $stringOrStringRef, $fileName ) = @_; } my $self = $class->STRINGMEMBERCLASS->_newFromString( $stringOrStringRef, $fileName ); return $self; } sub newFromFile { my $class = shift; my ( $fileName, $zipName ); if ( ref( $_[0] ) eq 'HASH' ) { $fileName = $_[0]->{fileName}; $zipName = $_[0]->{zipName}; } else { ( $fileName, $zipName ) = @_; } my $self = $class->NEWFILEMEMBERCLASS->_newFromFileNamed( $fileName, $zipName ); return $self; } sub newDirectoryNamed { my $class = shift; my ( $directoryName, $newName ); if ( ref( $_[0] ) eq 'HASH' ) { $directoryName = $_[0]->{directoryName}; $newName = $_[0]->{zipName}; } else { ( $directoryName, $newName ) = @_; } my $self = $class->DIRECTORYMEMBERCLASS->_newNamed( $directoryName, $newName ); return $self; } sub new { my $class = shift; my $self = { 'lastModFileDateTime' => 0, 'fileAttributeFormat' => FA_UNIX, 'versionMadeBy' => 20, 'versionNeededToExtract' => 20, 'bitFlag' => ($Archive::Zip::UNICODE ? 0x0800 : 0), 'compressionMethod' => COMPRESSION_STORED, 'desiredCompressionMethod' => COMPRESSION_STORED, 'desiredCompressionLevel' => COMPRESSION_LEVEL_NONE, 'internalFileAttributes' => 0, 'externalFileAttributes' => 0, # set later 'fileName' => '', 'cdExtraField' => '', 'localExtraField' => '', 'fileComment' => '', 'crc32' => 0, 'compressedSize' => 0, 'uncompressedSize' => 0, 'isSymbolicLink' => 0, 'password' => undef, # password for encrypted data 'crc32c' => -1, # crc for decrypted data @_ }; bless( $self, $class ); $self->unixFileAttributes( $self->DEFAULT_FILE_PERMISSIONS ); return $self; } sub _becomeDirectoryIfNecessary { my $self = shift; $self->_become(DIRECTORYMEMBERCLASS) if $self->isDirectory(); return $self; } # Morph into given class (do whatever cleanup I need to do) sub _become { return bless( $_[0], $_[1] ); } sub versionMadeBy { shift->{'versionMadeBy'}; } sub fileAttributeFormat { my $self = shift; if (@_) { $self->{fileAttributeFormat} = ( ref( $_[0] ) eq 'HASH' ) ? $_[0]->{format} : $_[0]; } else { return $self->{fileAttributeFormat}; } } sub versionNeededToExtract { shift->{'versionNeededToExtract'}; } sub bitFlag { my $self = shift; # Set General Purpose Bit Flags according to the desiredCompressionLevel setting if ( $self->desiredCompressionLevel == 1 || $self->desiredCompressionLevel == 2 ) { $self->{'bitFlag'} = DEFLATING_COMPRESSION_FAST; } elsif ( $self->desiredCompressionLevel == 3 || $self->desiredCompressionLevel == 4 || $self->desiredCompressionLevel == 5 || $self->desiredCompressionLevel == 6 || $self->desiredCompressionLevel == 7 ) { $self->{'bitFlag'} = DEFLATING_COMPRESSION_NORMAL; } elsif ( $self->desiredCompressionLevel == 8 || $self->desiredCompressionLevel == 9 ) { $self->{'bitFlag'} = DEFLATING_COMPRESSION_MAXIMUM; } if ($Archive::Zip::UNICODE) { $self->{'bitFlag'} |= 0x0800; } $self->{'bitFlag'}; } sub password { my $self = shift; $self->{'password'} = shift if @_; $self->{'password'}; } sub compressionMethod { shift->{'compressionMethod'}; } sub desiredCompressionMethod { my $self = shift; my $newDesiredCompressionMethod = ( ref( $_[0] ) eq 'HASH' ) ? shift->{compressionMethod} : shift; my $oldDesiredCompressionMethod = $self->{'desiredCompressionMethod'}; if ( defined($newDesiredCompressionMethod) ) { $self->{'desiredCompressionMethod'} = $newDesiredCompressionMethod; if ( $newDesiredCompressionMethod == COMPRESSION_STORED ) { $self->{'desiredCompressionLevel'} = 0; $self->{'bitFlag'} &= ~GPBF_HAS_DATA_DESCRIPTOR_MASK; } elsif ( $oldDesiredCompressionMethod == COMPRESSION_STORED ) { $self->{'desiredCompressionLevel'} = COMPRESSION_LEVEL_DEFAULT; } } return $oldDesiredCompressionMethod; } sub desiredCompressionLevel { my $self = shift; my $newDesiredCompressionLevel = ( ref( $_[0] ) eq 'HASH' ) ? shift->{compressionLevel} : shift; my $oldDesiredCompressionLevel = $self->{'desiredCompressionLevel'}; if ( defined($newDesiredCompressionLevel) ) { $self->{'desiredCompressionLevel'} = $newDesiredCompressionLevel; $self->{'desiredCompressionMethod'} = ( $newDesiredCompressionLevel ? COMPRESSION_DEFLATED : COMPRESSION_STORED ); } return $oldDesiredCompressionLevel; } sub fileName { my $self = shift; my $newName = shift; if ( defined $newName ) { $newName =~ s{[\\/]+}{/}g; # deal with dos/windoze problems $self->{'fileName'} = $newName; } return $self->{'fileName'}; } sub lastModFileDateTime { my $modTime = shift->{'lastModFileDateTime'}; $modTime =~ m/^(\d+)$/; # untaint return $1; } sub lastModTime { my $self = shift; return _dosToUnixTime( $self->lastModFileDateTime() ); } sub setLastModFileDateTimeFromUnix { my $self = shift; my $time_t = shift; $self->{'lastModFileDateTime'} = _unixToDosTime($time_t); } sub internalFileAttributes { shift->{'internalFileAttributes'}; } sub externalFileAttributes { shift->{'externalFileAttributes'}; } # Convert UNIX permissions into proper value for zip file # Usable as a function or a method sub _mapPermissionsFromUnix { my $self = shift; my $mode = shift; my $attribs = $mode << 16; # Microsoft Windows Explorer needs this bit set for directories if ( $mode & DIRECTORY_ATTRIB ) { $attribs |= 16; } return $attribs; # TODO: map more MS-DOS perms } # Convert ZIP permissions into Unix ones # # This was taken from Info-ZIP group's portable UnZip # zipfile-extraction program, version 5.50. # http://www.info-zip.org/pub/infozip/ # # See the mapattr() function in unix/unix.c # See the attribute format constants in unzpriv.h # # XXX Note that there's one situation that is not implemented # yet that depends on the "extra field." sub _mapPermissionsToUnix { my $self = shift; my $format = $self->{'fileAttributeFormat'}; my $attribs = $self->{'externalFileAttributes'}; my $mode = 0; if ( $format == FA_AMIGA ) { $attribs = $attribs >> 17 & 7; # Amiga RWE bits $mode = $attribs << 6 | $attribs << 3 | $attribs; return $mode; } if ( $format == FA_THEOS ) { $attribs &= 0xF1FFFFFF; if ( ( $attribs & 0xF0000000 ) != 0x40000000 ) { $attribs &= 0x01FFFFFF; # not a dir, mask all ftype bits } else { $attribs &= 0x41FFFFFF; # leave directory bit as set } } if ( $format == FA_UNIX || $format == FA_VAX_VMS || $format == FA_ACORN || $format == FA_ATARI_ST || $format == FA_BEOS || $format == FA_QDOS || $format == FA_TANDEM ) { $mode = $attribs >> 16; return $mode if $mode != 0 or not $self->localExtraField; # warn("local extra field is: ", $self->localExtraField, "\n"); # XXX This condition is not implemented # I'm just including the comments from the info-zip section for now. # Some (non-Info-ZIP) implementations of Zip for Unix and # VMS (and probably others ??) leave 0 in the upper 16-bit # part of the external_file_attributes field. Instead, they # store file permission attributes in some extra field. # As a work-around, we search for the presence of one of # these extra fields and fall back to the MSDOS compatible # part of external_file_attributes if one of the known # e.f. types has been detected. # Later, we might implement extraction of the permission # bits from the VMS extra field. But for now, the work-around # should be sufficient to provide "readable" extracted files. # (For ASI Unix e.f., an experimental remap from the e.f. # mode value IS already provided!) } # PKWARE's PKZip for Unix marks entries as FA_MSDOS, but stores the # Unix attributes in the upper 16 bits of the external attributes # field, just like Info-ZIP's Zip for Unix. We try to use that # value, after a check for consistency with the MSDOS attribute # bits (see below). if ( $format == FA_MSDOS ) { $mode = $attribs >> 16; } # FA_MSDOS, FA_OS2_HPFS, FA_WINDOWS_NTFS, FA_MACINTOSH, FA_TOPS20 $attribs = !( $attribs & 1 ) << 1 | ( $attribs & 0x10 ) >> 4; # keep previous $mode setting when its "owner" # part appears to be consistent with DOS attribute flags! return $mode if ( $mode & 0700 ) == ( 0400 | $attribs << 6 ); $mode = 0444 | $attribs << 6 | $attribs << 3 | $attribs; return $mode; } sub unixFileAttributes { my $self = shift; my $oldPerms = $self->_mapPermissionsToUnix; my $perms; if ( @_ ) { $perms = ( ref( $_[0] ) eq 'HASH' ) ? $_[0]->{attributes} : $_[0]; if ( $self->isDirectory ) { $perms &= ~FILE_ATTRIB; $perms |= DIRECTORY_ATTRIB; } else { $perms &= ~DIRECTORY_ATTRIB; $perms |= FILE_ATTRIB; } $self->{externalFileAttributes} = $self->_mapPermissionsFromUnix($perms); } return $oldPerms; } sub localExtraField { my $self = shift; if (@_) { $self->{localExtraField} = ( ref( $_[0] ) eq 'HASH' ) ? $_[0]->{field} : $_[0]; } else { return $self->{localExtraField}; } } sub cdExtraField { my $self = shift; if (@_) { $self->{cdExtraField} = ( ref( $_[0] ) eq 'HASH' ) ? $_[0]->{field} : $_[0]; } else { return $self->{cdExtraField}; } } sub extraFields { my $self = shift; return $self->localExtraField() . $self->cdExtraField(); } sub fileComment { my $self = shift; if (@_) { $self->{fileComment} = ( ref( $_[0] ) eq 'HASH' ) ? pack( 'C0a*', $_[0]->{comment} ) : pack( 'C0a*', $_[0] ); } else { return $self->{fileComment}; } } sub hasDataDescriptor { my $self = shift; if (@_) { my $shouldHave = shift; if ($shouldHave) { $self->{'bitFlag'} |= GPBF_HAS_DATA_DESCRIPTOR_MASK; } else { $self->{'bitFlag'} &= ~GPBF_HAS_DATA_DESCRIPTOR_MASK; } } return $self->{'bitFlag'} & GPBF_HAS_DATA_DESCRIPTOR_MASK; } sub crc32 { shift->{'crc32'}; } sub crc32String { sprintf( "%08x", shift->{'crc32'} ); } sub compressedSize { shift->{'compressedSize'}; } sub uncompressedSize { shift->{'uncompressedSize'}; } sub isEncrypted { shift->{'bitFlag'} & GPBF_ENCRYPTED_MASK; } sub isTextFile { my $self = shift; my $bit = $self->internalFileAttributes() & IFA_TEXT_FILE_MASK; if (@_) { my $flag = ( ref( $_[0] ) eq 'HASH' ) ? shift->{flag} : shift; $self->{'internalFileAttributes'} &= ~IFA_TEXT_FILE_MASK; $self->{'internalFileAttributes'} |= ( $flag ? IFA_TEXT_FILE: IFA_BINARY_FILE ); } return $bit == IFA_TEXT_FILE; } sub isBinaryFile { my $self = shift; my $bit = $self->internalFileAttributes() & IFA_TEXT_FILE_MASK; if (@_) { my $flag = shift; $self->{'internalFileAttributes'} &= ~IFA_TEXT_FILE_MASK; $self->{'internalFileAttributes'} |= ( $flag ? IFA_BINARY_FILE: IFA_TEXT_FILE ); } return $bit == IFA_BINARY_FILE; } sub extractToFileNamed { my $self = shift; # local FS name my $name = ( ref( $_[0] ) eq 'HASH' ) ? $_[0]->{name} : $_[0]; $self->{'isSymbolicLink'} = 0; # Check if the file / directory is a symbolic link or not if ( $self->{'externalFileAttributes'} == 0xA1FF0000 ) { $self->{'isSymbolicLink'} = 1; $self->{'newName'} = $name; my ( $status, $fh ) = _newFileHandle( $name, 'r' ); my $retval = $self->extractToFileHandle($fh); $fh->close(); } else { #return _writeSymbolicLink($self, $name) if $self->isSymbolicLink(); my ( $status, $fh ); if ( $^O eq 'MSWin32' && $Archive::Zip::UNICODE ) { $name = decode_utf8( Win32::GetFullPathName($name) ); mkpath_win32($name); if ( $self->{'compressedSize'} == 0 ) { return; } else { Win32::CreateFile($name); } ( $status, $fh ) = _newFileHandle( Win32::GetANSIPathName($name), 'w' ); } else { mkpath( dirname($name) ); # croaks on error ( $status, $fh ) = _newFileHandle( $name, 'w' ); } return _ioError("Can't open file $name for write") unless $status; my $retval = $self->extractToFileHandle($fh); $fh->close(); chmod ($self->unixFileAttributes(), $name) or return _error("Can't chmod() ${name}: $!"); utime( $self->lastModTime(), $self->lastModTime(), $name ); return $retval; } } sub mkpath_win32 { my $path = shift; use File::Spec; my ( $volume, @path ) = File::Spec->splitdir($path); $path = File::Spec->catfile( $volume, shift @path ); pop @path; while (@path) { $path = File::Spec->catfile( $path, shift @path ); Win32::CreateDirectory($path); } } sub _writeSymbolicLink { my $self = shift; my $name = shift; my $chunkSize = $Archive::Zip::ChunkSize; #my ( $outRef, undef ) = $self->readChunk($chunkSize); my $fh; my $retval = $self->extractToFileHandle($fh); my ( $outRef, undef ) = $self->readChunk(100); } sub isSymbolicLink { my $self = shift; if ( $self->{'externalFileAttributes'} == 0xA1FF0000 ) { $self->{'isSymbolicLink'} = 1; } else { return 0; } 1; } sub isDirectory { return 0; } sub externalFileName { return undef; } # The following are used when copying data sub _writeOffset { shift->{'writeOffset'}; } sub _readOffset { shift->{'readOffset'}; } sub writeLocalHeaderRelativeOffset { shift->{'writeLocalHeaderRelativeOffset'}; } sub wasWritten { shift->{'wasWritten'} } sub _dataEnded { shift->{'dataEnded'}; } sub _readDataRemaining { shift->{'readDataRemaining'}; } sub _inflater { shift->{'inflater'}; } sub _deflater { shift->{'deflater'}; } # Return the total size of my local header sub _localHeaderSize { my $self = shift; { use bytes; return SIGNATURE_LENGTH + LOCAL_FILE_HEADER_LENGTH + length( $self->fileName() ) + length( $self->localExtraField() ); } } # Return the total size of my CD header sub _centralDirectoryHeaderSize { my $self = shift; { use bytes; return SIGNATURE_LENGTH + CENTRAL_DIRECTORY_FILE_HEADER_LENGTH + length( $self->fileName() ) + length( $self->cdExtraField() ) + length( $self->fileComment() ); } } # DOS date/time format # 0-4 (5) Second divided by 2 # 5-10 (6) Minute (0-59) # 11-15 (5) Hour (0-23 on a 24-hour clock) # 16-20 (5) Day of the month (1-31) # 21-24 (4) Month (1 = January, 2 = February, etc.) # 25-31 (7) Year offset from 1980 (add 1980 to get actual year) # Convert DOS date/time format to unix time_t format # NOT AN OBJECT METHOD! sub _dosToUnixTime { my $dt = shift; return time() unless defined($dt); my $year = ( ( $dt >> 25 ) & 0x7f ) + 80; my $mon = ( ( $dt >> 21 ) & 0x0f ) - 1; my $mday = ( ( $dt >> 16 ) & 0x1f ); my $hour = ( ( $dt >> 11 ) & 0x1f ); my $min = ( ( $dt >> 5 ) & 0x3f ); my $sec = ( ( $dt << 1 ) & 0x3e ); # catch errors my $time_t = eval { Time::Local::timelocal( $sec, $min, $hour, $mday, $mon, $year ); }; return time() if ($@); return $time_t; } # Note, this is not exactly UTC 1980, it's 1980 + 12 hours and 1 # minute so that nothing timezoney can muck us up. my $safe_epoch = 315576060; # convert a unix time to DOS date/time # NOT AN OBJECT METHOD! sub _unixToDosTime { my $time_t = shift; unless ($time_t) { _error("Tried to add member with zero or undef value for time"); $time_t = $safe_epoch; } if ( $time_t < $safe_epoch ) { _ioError("Unsupported date before 1980 encountered, moving to 1980"); $time_t = $safe_epoch; } my ( $sec, $min, $hour, $mday, $mon, $year ) = localtime($time_t); my $dt = 0; $dt += ( $sec >> 1 ); $dt += ( $min << 5 ); $dt += ( $hour << 11 ); $dt += ( $mday << 16 ); $dt += ( ( $mon + 1 ) << 21 ); $dt += ( ( $year - 80 ) << 25 ); return $dt; } sub head { my ($self, $mode) = (@_, 0); use bytes; return pack LOCAL_FILE_HEADER_FORMAT, $self->versionNeededToExtract(), $self->{'bitFlag'}, $self->desiredCompressionMethod(), $self->lastModFileDateTime(), $self->crc32(), $mode ? $self->_writeOffset() # compressed size : $self->compressedSize(), # may need to be re-written later $self->uncompressedSize(), length( $self->fileName() ), length( $self->localExtraField() ); } # Write my local header to a file handle. # Stores the offset to the start of the header in my # writeLocalHeaderRelativeOffset member. # Returns AZ_OK on success. sub _writeLocalFileHeader { my $self = shift; my $fh = shift; my $signatureData = pack( SIGNATURE_FORMAT, LOCAL_FILE_HEADER_SIGNATURE ); $self->_print($fh, $signatureData) or return _ioError("writing local header signature"); my $header = $self->head(0); $self->_print($fh, $header) or return _ioError("writing local header"); # Check for a valid filename or a filename equal to a literal `0' if ( $self->fileName() || $self->fileName eq '0' ) { $self->_print($fh, $self->fileName() ) or return _ioError("writing local header filename"); } if ( $self->localExtraField() ) { $self->_print($fh, $self->localExtraField() ) or return _ioError("writing local extra field"); } return AZ_OK; } sub _writeCentralDirectoryFileHeader { my $self = shift; my $fh = shift; my $sigData = pack( SIGNATURE_FORMAT, CENTRAL_DIRECTORY_FILE_HEADER_SIGNATURE ); $self->_print($fh, $sigData) or return _ioError("writing central directory header signature"); my ( $fileNameLength, $extraFieldLength, $fileCommentLength ); { use bytes; $fileNameLength = length( $self->fileName() ); $extraFieldLength = length( $self->cdExtraField() ); $fileCommentLength = length( $self->fileComment() ); } my $header = pack( CENTRAL_DIRECTORY_FILE_HEADER_FORMAT, $self->versionMadeBy(), $self->fileAttributeFormat(), $self->versionNeededToExtract(), $self->bitFlag(), $self->desiredCompressionMethod(), $self->lastModFileDateTime(), $self->crc32(), # these three fields should have been updated $self->_writeOffset(), # by writing the data stream out $self->uncompressedSize(), # $fileNameLength, $extraFieldLength, $fileCommentLength, 0, # {'diskNumberStart'}, $self->internalFileAttributes(), $self->externalFileAttributes(), $self->writeLocalHeaderRelativeOffset() ); $self->_print($fh, $header) or return _ioError("writing central directory header"); if ($fileNameLength) { $self->_print($fh, $self->fileName() ) or return _ioError("writing central directory header signature"); } if ($extraFieldLength) { $self->_print($fh, $self->cdExtraField() ) or return _ioError("writing central directory extra field"); } if ($fileCommentLength) { $self->_print($fh, $self->fileComment() ) or return _ioError("writing central directory file comment"); } return AZ_OK; } # This writes a data descriptor to the given file handle. # Assumes that crc32, writeOffset, and uncompressedSize are # set correctly (they should be after a write). # Further, the local file header should have the # GPBF_HAS_DATA_DESCRIPTOR_MASK bit set. sub _writeDataDescriptor { my $self = shift; my $fh = shift; my $header = pack( SIGNATURE_FORMAT . DATA_DESCRIPTOR_FORMAT, DATA_DESCRIPTOR_SIGNATURE, $self->crc32(), $self->_writeOffset(), # compressed size $self->uncompressedSize() ); $self->_print($fh, $header) or return _ioError("writing data descriptor"); return AZ_OK; } # Re-writes the local file header with new crc32 and compressedSize fields. # To be called after writing the data stream. # Assumes that filename and extraField sizes didn't change since last written. sub _refreshLocalFileHeader { my $self = shift; my $fh = shift; my $here = $fh->tell(); $fh->seek( $self->writeLocalHeaderRelativeOffset() + SIGNATURE_LENGTH, IO::Seekable::SEEK_SET ) or return _ioError("seeking to rewrite local header"); my $header = $self->head(1); $self->_print($fh, $header) or return _ioError("re-writing local header"); $fh->seek( $here, IO::Seekable::SEEK_SET ) or return _ioError("seeking after rewrite of local header"); return AZ_OK; } sub readChunk { my $self = shift; my $chunkSize = ( ref( $_[0] ) eq 'HASH' ) ? $_[0]->{chunkSize} : $_[0]; if ( $self->readIsDone() ) { $self->endRead(); my $dummy = ''; return ( \$dummy, AZ_STREAM_END ); } $chunkSize = $Archive::Zip::ChunkSize if not defined($chunkSize); $chunkSize = $self->_readDataRemaining() if $chunkSize > $self->_readDataRemaining(); my $buffer = ''; my $outputRef; my ( $bytesRead, $status ) = $self->_readRawChunk( \$buffer, $chunkSize ); return ( \$buffer, $status ) unless $status == AZ_OK; $buffer && $self->isEncrypted and $buffer = $self->_decode($buffer); $self->{'readDataRemaining'} -= $bytesRead; $self->{'readOffset'} += $bytesRead; if ( $self->compressionMethod() == COMPRESSION_STORED ) { $self->{'crc32'} = $self->computeCRC32( $buffer, $self->{'crc32'} ); } ( $outputRef, $status ) = &{ $self->{'chunkHandler'} }( $self, \$buffer ); $self->{'writeOffset'} += length($$outputRef); $self->endRead() if $self->readIsDone(); return ( $outputRef, $status ); } # Read the next raw chunk of my data. Subclasses MUST implement. # my ( $bytesRead, $status) = $self->_readRawChunk( \$buffer, $chunkSize ); sub _readRawChunk { my $self = shift; return $self->_subclassResponsibility(); } # A place holder to catch rewindData errors if someone ignores # the error code. sub _noChunk { my $self = shift; return ( \undef, _error("trying to copy chunk when init failed") ); } # Basically a no-op so that I can have a consistent interface. # ( $outputRef, $status) = $self->_copyChunk( \$buffer ); sub _copyChunk { my ( $self, $dataRef ) = @_; return ( $dataRef, AZ_OK ); } # ( $outputRef, $status) = $self->_deflateChunk( \$buffer ); sub _deflateChunk { my ( $self, $buffer ) = @_; my ( $status ) = $self->_deflater()->deflate( $buffer, my $out ); if ( $self->_readDataRemaining() == 0 ) { my $extraOutput; ( $status ) = $self->_deflater()->flush($extraOutput); $out .= $extraOutput; $self->endRead(); return ( \$out, AZ_STREAM_END ); } elsif ( $status == Z_OK ) { return ( \$out, AZ_OK ); } else { $self->endRead(); my $retval = _error( 'deflate error', $status ); my $dummy = ''; return ( \$dummy, $retval ); } } # ( $outputRef, $status) = $self->_inflateChunk( \$buffer ); sub _inflateChunk { my ( $self, $buffer ) = @_; my ( $status ) = $self->_inflater()->inflate( $buffer, my $out ); my $retval; $self->endRead() unless $status == Z_OK; if ( $status == Z_OK || $status == Z_STREAM_END ) { $retval = ( $status == Z_STREAM_END ) ? AZ_STREAM_END: AZ_OK; return ( \$out, $retval ); } else { $retval = _error( 'inflate error', $status ); my $dummy = ''; return ( \$dummy, $retval ); } } sub rewindData { my $self = shift; my $status; # set to trap init errors $self->{'chunkHandler'} = $self->can('_noChunk'); # Work around WinZip bug with 0-length DEFLATED files $self->desiredCompressionMethod(COMPRESSION_STORED) if $self->uncompressedSize() == 0; # assume that we're going to read the whole file, and compute the CRC anew. $self->{'crc32'} = 0 if ( $self->compressionMethod() == COMPRESSION_STORED ); # These are the only combinations of methods we deal with right now. if ( $self->compressionMethod() == COMPRESSION_STORED and $self->desiredCompressionMethod() == COMPRESSION_DEFLATED ) { ( $self->{'deflater'}, $status ) = Compress::Raw::Zlib::Deflate->new( '-Level' => $self->desiredCompressionLevel(), '-WindowBits' => -MAX_WBITS(), # necessary magic '-Bufsize' => $Archive::Zip::ChunkSize, @_ ); # pass additional options return _error( 'deflateInit error:', $status ) unless $status == Z_OK; $self->{'chunkHandler'} = $self->can('_deflateChunk'); } elsif ( $self->compressionMethod() == COMPRESSION_DEFLATED and $self->desiredCompressionMethod() == COMPRESSION_STORED ) { ( $self->{'inflater'}, $status ) = Compress::Raw::Zlib::Inflate->new( '-WindowBits' => -MAX_WBITS(), # necessary magic '-Bufsize' => $Archive::Zip::ChunkSize, @_ ); # pass additional options return _error( 'inflateInit error:', $status ) unless $status == Z_OK; $self->{'chunkHandler'} = $self->can('_inflateChunk'); } elsif ( $self->compressionMethod() == $self->desiredCompressionMethod() ) { $self->{'chunkHandler'} = $self->can('_copyChunk'); } else { return _error( sprintf( "Unsupported compression combination: read %d, write %d", $self->compressionMethod(), $self->desiredCompressionMethod() ) ); } $self->{'readDataRemaining'} = ( $self->compressionMethod() == COMPRESSION_STORED ) ? $self->uncompressedSize() : $self->compressedSize(); $self->{'dataEnded'} = 0; $self->{'readOffset'} = 0; return AZ_OK; } sub endRead { my $self = shift; delete $self->{'inflater'}; delete $self->{'deflater'}; $self->{'dataEnded'} = 1; $self->{'readDataRemaining'} = 0; return AZ_OK; } sub readIsDone { my $self = shift; return ( $self->_dataEnded() or !$self->_readDataRemaining() ); } sub contents { my $self = shift; my $newContents = shift; if ( defined($newContents) ) { # change our type and call the subclass contents method. $self->_become(STRINGMEMBERCLASS); return $self->contents( pack( 'C0a*', $newContents ) ) ; # in case of Unicode } else { my $oldCompression = $self->desiredCompressionMethod(COMPRESSION_STORED); my $status = $self->rewindData(@_); if ( $status != AZ_OK ) { $self->endRead(); return $status; } my $retval = ''; while ( $status == AZ_OK ) { my $ref; ( $ref, $status ) = $self->readChunk( $self->_readDataRemaining() ); # did we get it in one chunk? if ( length($$ref) == $self->uncompressedSize() ) { $retval = $$ref; } else { $retval .= $$ref } } $self->desiredCompressionMethod($oldCompression); $self->endRead(); $status = AZ_OK if $status == AZ_STREAM_END; $retval = undef unless $status == AZ_OK; return wantarray ? ( $retval, $status ) : $retval; } } sub extractToFileHandle { my $self = shift; my $fh = ( ref( $_[0] ) eq 'HASH' ) ? shift->{fileHandle} : shift; _binmode($fh); my $oldCompression = $self->desiredCompressionMethod(COMPRESSION_STORED); my $status = $self->rewindData(@_); $status = $self->_writeData($fh) if $status == AZ_OK; $self->desiredCompressionMethod($oldCompression); $self->endRead(); return $status; } # write local header and data stream to file handle sub _writeToFileHandle { my $self = shift; my $fh = shift; my $fhIsSeekable = shift; my $offset = shift; return _error("no member name given for $self") if $self->fileName() eq ''; $self->{'writeLocalHeaderRelativeOffset'} = $offset; $self->{'wasWritten'} = 0; # Determine if I need to write a data descriptor # I need to do this if I can't refresh the header # and I don't know compressed size or crc32 fields. my $headerFieldsUnknown = ( ( $self->uncompressedSize() > 0 ) and ($self->compressionMethod() == COMPRESSION_STORED or $self->desiredCompressionMethod() == COMPRESSION_DEFLATED ) ); # Set both compressedSize and uncompressedSize to 0 if either of them is 0 if ( $self->uncompressedSize == 0 || $self->uncompressedSize == 0 ) { $self->{'compressedSize'} = 0; $self->{'uncompressedSize'} = 0; } my $shouldWriteDataDescriptor = ( $headerFieldsUnknown and not $fhIsSeekable ); $self->hasDataDescriptor(1) if ($shouldWriteDataDescriptor); $self->{'writeOffset'} = 0; my $status = $self->rewindData(); ( $status = $self->_writeLocalFileHeader($fh) ) if $status == AZ_OK; ( $status = $self->_writeData($fh) ) if $status == AZ_OK; if ( $status == AZ_OK ) { $self->{'wasWritten'} = 1; if ( $self->hasDataDescriptor() ) { $status = $self->_writeDataDescriptor($fh); } elsif ($headerFieldsUnknown) { $status = $self->_refreshLocalFileHeader($fh); } } return $status; } # Copy my (possibly compressed) data to given file handle. # Returns C on success sub _writeData { my $self = shift; my $writeFh = shift; # If symbolic link, just create one if the operating system is Linux, Unix, BSD or VMS # TODO: Add checks for other operating systems if ( $self->{'isSymbolicLink'} == 1 && $^O eq 'linux' ) { my $chunkSize = $Archive::Zip::ChunkSize; my ( $outRef, $status ) = $self->readChunk($chunkSize); symlink $$outRef, $self->{'newName'}; } else { return AZ_OK if ( $self->uncompressedSize() == 0 ); my $status; my $chunkSize = $Archive::Zip::ChunkSize; while ( $self->_readDataRemaining() > 0 ) { my $outRef; ( $outRef, $status ) = $self->readChunk($chunkSize); return $status if ( $status != AZ_OK and $status != AZ_STREAM_END ); if ( length($$outRef) > 0 ) { $self->_print($writeFh, $$outRef) or return _ioError("write error during copy"); } last if $status == AZ_STREAM_END; } $self->{'compressedSize'} = $self->_writeOffset(); } return AZ_OK; } # Return true if I depend on the named file sub _usesFileNamed { return 0; } # ############################################################################## # # Decrypt section # # H.Merijn Brand (Tux) 2011-06-28 # # ############################################################################## # This code is derived from the crypt source of unzip-6.0 dated 05 Jan 2007 # Its license states: # # --8<--- # Copyright (c) 1990-2007 Info-ZIP. All rights reserved. # See the accompanying file LICENSE, version 2005-Feb-10 or later # (the contents of which are also included in (un)zip.h) for terms of use. # If, for some reason, all these files are missing, the Info-ZIP license # also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html # # crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] # The main encryption/decryption source code for Info-Zip software was # originally written in Europe. To the best of our knowledge, it can # be freely distributed in both source and object forms from any country, # including the USA under License Exception TSU of the U.S. Export # Administration Regulations (section 740.13(e)) of 6 June 2002. # NOTE on copyright history: # Previous versions of this source package (up to version 2.8) were # not copyrighted and put in the public domain. If you cannot comply # with the Info-Zip LICENSE, you may want to look for one of those # public domain versions. # # This encryption code is a direct transcription of the algorithm from # Roger Schlafly, described by Phil Katz in the file appnote.txt. This # file (appnote.txt) is distributed with the PKZIP program (even in the # version without encryption capabilities). # -->8--- # As of January 2000, US export regulations were amended to allow export # of free encryption source code from the US. As of June 2002, these # regulations were further relaxed to allow export of encryption binaries # associated with free encryption source code. The Zip 2.31, UnZip 5.52 # and Wiz 5.02 archives now include full crypto source code. As of the # Zip 2.31 release, all official binaries include encryption support; the # former "zcr" archives ceased to exist. # (Note that restrictions may still exist in other countries, of course.) # For now, we just support the decrypt stuff # All below methods are supposed to be private # use Data::Peek; my @keys; my @crct = do { my $xor = 0xedb88320; my @crc = (0) x 1024; # generate a crc for every 8-bit value foreach my $n (0 .. 255) { my $c = $n; $c = $c & 1 ? $xor ^ ($c >> 1) : $c >> 1 for 1 .. 8; $crc[$n] = _revbe ($c); } # generate crc for each value followed by one, two, and three zeros */ foreach my $n (0 .. 255) { my $c = ($crc[($crc[$n] >> 24) ^ 0] ^ ($crc[$n] << 8)) & 0xffffffff; $crc[$_ * 256 + $n] = $c for 1 .. 3; } map { _revbe ($crc[$_]) } 0 .. 1023; }; sub _crc32 { my ($c, $b) = @_; return ($crct[($c ^ $b) & 0xff] ^ ($c >> 8)); } # _crc32 sub _revbe { my $w = shift; return (($w >> 24) + (($w >> 8) & 0xff00) + (($w & 0xff00) << 8) + (($w & 0xff) << 24)); } # _revbe sub _update_keys { use integer; my $c = shift; # signed int $keys[0] = _crc32 ($keys[0], $c); $keys[1] = (($keys[1] + ($keys[0] & 0xff)) * 0x08088405 + 1) & 0xffffffff; my $keyshift = $keys[1] >> 24; $keys[2] = _crc32 ($keys[2], $keyshift); } # _update_keys sub _zdecode ($) { my $c = shift; my $t = ($keys[2] & 0xffff) | 2; _update_keys ($c ^= ((($t * ($t ^ 1)) >> 8) & 0xff)); return $c; } # _zdecode sub _decode { my $self = shift; my $buff = shift; $self->isEncrypted or return $buff; my $pass = $self->password; defined $pass or return ""; @keys = (0x12345678, 0x23456789, 0x34567890); _update_keys ($_) for unpack "C*", $pass; # DDumper { uk => [ @keys ] }; my $head = substr $buff, 0, 12, ""; my @head = map { _zdecode ($_) } unpack "C*", $head; my $x = $self->{externalFileAttributes} ? ($self->{lastModFileDateTime} >> 8) & 0xff : $self->{crc32} >> 24; $head[-1] == $x or return ""; # Password fail # Worth checking ... $self->{crc32c} = (unpack LOCAL_FILE_HEADER_FORMAT, pack "C*", @head)[3]; # DHexDump ($buff); $buff = pack "C*" => map { _zdecode ($_) } unpack "C*" => $buff; # DHexDump ($buff); return $buff; } # _decode 1; FILE%fb42f028/Archive/Zip/NewFileMember.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Archive/Zip/NewFileMember.pm" package Archive::Zip::NewFileMember; use strict; use vars qw( $VERSION @ISA ); BEGIN { $VERSION = '1.38'; @ISA = qw ( Archive::Zip::FileMember ); } use Archive::Zip qw( :CONSTANTS :ERROR_CODES :UTILITY_METHODS ); # Given a file name, set up for eventual writing. sub _newFromFileNamed { my $class = shift; my $fileName = shift; # local FS format my $newName = shift; $newName = _asZipDirName($fileName) unless defined($newName); return undef unless ( stat($fileName) && -r _ && !-d _ ); my $self = $class->new(@_); $self->{'fileName'} = $newName; $self->{'externalFileName'} = $fileName; $self->{'compressionMethod'} = COMPRESSION_STORED; my @stat = stat(_); $self->{'compressedSize'} = $self->{'uncompressedSize'} = $stat[7]; $self->desiredCompressionMethod( ( $self->compressedSize() > 0 ) ? COMPRESSION_DEFLATED : COMPRESSION_STORED ); $self->unixFileAttributes( $stat[2] ); $self->setLastModFileDateTimeFromUnix( $stat[9] ); $self->isTextFile( -T _ ); return $self; } sub rewindData { my $self = shift; my $status = $self->SUPER::rewindData(@_); return $status unless $status == AZ_OK; return AZ_IO_ERROR unless $self->fh(); $self->fh()->clearerr(); $self->fh()->seek( 0, IO::Seekable::SEEK_SET ) or return _ioError( "rewinding", $self->externalFileName() ); return AZ_OK; } # Return bytes read. Note that first parameter is a ref to a buffer. # my $data; # my ( $bytesRead, $status) = $self->readRawChunk( \$data, $chunkSize ); sub _readRawChunk { my ( $self, $dataRef, $chunkSize ) = @_; return ( 0, AZ_OK ) unless $chunkSize; my $bytesRead = $self->fh()->read( $$dataRef, $chunkSize ) or return ( 0, _ioError("reading data") ); return ( $bytesRead, AZ_OK ); } # If I already exist, extraction is a no-op. sub extractToFileNamed { my $self = shift; my $name = shift; # local FS name if ( File::Spec->rel2abs($name) eq File::Spec->rel2abs( $self->externalFileName() ) and -r $name ) { return AZ_OK; } else { return $self->SUPER::extractToFileNamed( $name, @_ ); } } 1; FILE$41fae915/Archive/Zip/StringMember.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Archive/Zip/StringMember.pm" package Archive::Zip::StringMember; use strict; use vars qw( $VERSION @ISA ); BEGIN { $VERSION = '1.38'; @ISA = qw( Archive::Zip::Member ); } use Archive::Zip qw( :CONSTANTS :ERROR_CODES ); # Create a new string member. Default is COMPRESSION_STORED. # Can take a ref to a string as well. sub _newFromString { my $class = shift; my $string = shift; my $name = shift; my $self = $class->new(@_); $self->contents($string); $self->fileName($name) if defined($name); # Set the file date to now $self->setLastModFileDateTimeFromUnix( time() ); $self->unixFileAttributes( $self->DEFAULT_FILE_PERMISSIONS ); return $self; } sub _become { my $self = shift; my $newClass = shift; return $self if ref($self) eq $newClass; delete( $self->{'contents'} ); return $self->SUPER::_become($newClass); } # Get or set my contents. Note that we do not call the superclass # version of this, because it calls us. sub contents { my $self = shift; my $string = shift; if ( defined($string) ) { $self->{'contents'} = pack( 'C0a*', ( ref($string) eq 'SCALAR' ) ? $$string : $string ); $self->{'uncompressedSize'} = $self->{'compressedSize'} = length( $self->{'contents'} ); $self->{'compressionMethod'} = COMPRESSION_STORED; } return $self->{'contents'}; } # Return bytes read. Note that first parameter is a ref to a buffer. # my $data; # my ( $bytesRead, $status) = $self->readRawChunk( \$data, $chunkSize ); sub _readRawChunk { my ( $self, $dataRef, $chunkSize ) = @_; $$dataRef = substr( $self->contents(), $self->_readOffset(), $chunkSize ); return ( length($$dataRef), AZ_OK ); } 1; FILE%6d909d57/Archive/Zip/ZipFileMember.pm67#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Archive/Zip/ZipFileMember.pm" package Archive::Zip::ZipFileMember; use strict; use vars qw( $VERSION @ISA ); BEGIN { $VERSION = '1.38'; @ISA = qw ( Archive::Zip::FileMember ); } use Archive::Zip qw( :CONSTANTS :ERROR_CODES :PKZIP_CONSTANTS :UTILITY_METHODS ); # Create a new Archive::Zip::ZipFileMember # given a filename and optional open file handle # sub _newFromZipFile { my $class = shift; my $fh = shift; my $externalFileName = shift; my $possibleEocdOffset = shift; # normally 0 my $self = $class->new( 'crc32' => 0, 'diskNumberStart' => 0, 'localHeaderRelativeOffset' => 0, 'dataOffset' => 0, # localHeaderRelativeOffset + header length @_ ); $self->{'externalFileName'} = $externalFileName; $self->{'fh'} = $fh; $self->{'possibleEocdOffset'} = $possibleEocdOffset; return $self; } sub isDirectory { my $self = shift; return ( substr( $self->fileName, -1, 1 ) eq '/' and $self->uncompressedSize == 0 ); } # Seek to the beginning of the local header, just past the signature. # Verify that the local header signature is in fact correct. # Update the localHeaderRelativeOffset if necessary by adding the possibleEocdOffset. # Returns status. sub _seekToLocalHeader { my $self = shift; my $where = shift; # optional my $previousWhere = shift; # optional $where = $self->localHeaderRelativeOffset() unless defined($where); # avoid loop on certain corrupt files (from Julian Field) return _formatError("corrupt zip file") if defined($previousWhere) && $where == $previousWhere; my $status; my $signature; $status = $self->fh()->seek( $where, IO::Seekable::SEEK_SET ); return _ioError("seeking to local header") unless $status; ( $status, $signature ) = _readSignature( $self->fh(), $self->externalFileName(), LOCAL_FILE_HEADER_SIGNATURE ); return $status if $status == AZ_IO_ERROR; # retry with EOCD offset if any was given. if ( $status == AZ_FORMAT_ERROR && $self->{'possibleEocdOffset'} ) { $status = $self->_seekToLocalHeader( $self->localHeaderRelativeOffset() + $self->{'possibleEocdOffset'}, $where ); if ( $status == AZ_OK ) { $self->{'localHeaderRelativeOffset'} += $self->{'possibleEocdOffset'}; $self->{'possibleEocdOffset'} = 0; } } return $status; } # Because I'm going to delete the file handle, read the local file # header if the file handle is seekable. If it is not, I assume that # I've already read the local header. # Return ( $status, $self ) sub _become { my $self = shift; my $newClass = shift; return $self if ref($self) eq $newClass; my $status = AZ_OK; if ( _isSeekable( $self->fh() ) ) { my $here = $self->fh()->tell(); $status = $self->_seekToLocalHeader(); $status = $self->_readLocalFileHeader() if $status == AZ_OK; $self->fh()->seek( $here, IO::Seekable::SEEK_SET ); return $status unless $status == AZ_OK; } delete( $self->{'eocdCrc32'} ); delete( $self->{'diskNumberStart'} ); delete( $self->{'localHeaderRelativeOffset'} ); delete( $self->{'dataOffset'} ); return $self->SUPER::_become($newClass); } sub diskNumberStart { shift->{'diskNumberStart'}; } sub localHeaderRelativeOffset { shift->{'localHeaderRelativeOffset'}; } sub dataOffset { shift->{'dataOffset'}; } # Skip local file header, updating only extra field stuff. # Assumes that fh is positioned before signature. sub _skipLocalFileHeader { my $self = shift; my $header; my $bytesRead = $self->fh()->read( $header, LOCAL_FILE_HEADER_LENGTH ); if ( $bytesRead != LOCAL_FILE_HEADER_LENGTH ) { return _ioError("reading local file header"); } my $fileNameLength; my $extraFieldLength; my $bitFlag; ( undef, # $self->{'versionNeededToExtract'}, $bitFlag, undef, # $self->{'compressionMethod'}, undef, # $self->{'lastModFileDateTime'}, undef, # $crc32, undef, # $compressedSize, undef, # $uncompressedSize, $fileNameLength, $extraFieldLength ) = unpack( LOCAL_FILE_HEADER_FORMAT, $header ); if ($fileNameLength) { $self->fh()->seek( $fileNameLength, IO::Seekable::SEEK_CUR ) or return _ioError("skipping local file name"); } if ($extraFieldLength) { $bytesRead = $self->fh()->read( $self->{'localExtraField'}, $extraFieldLength ); if ( $bytesRead != $extraFieldLength ) { return _ioError("reading local extra field"); } } $self->{'dataOffset'} = $self->fh()->tell(); if ( $bitFlag & GPBF_HAS_DATA_DESCRIPTOR_MASK ) { # Read the crc32, compressedSize, and uncompressedSize from the # extended data descriptor, which directly follows the compressed data. # # Skip over the compressed file data (assumes that EOCD compressedSize # was correct) $self->fh()->seek( $self->{'compressedSize'}, IO::Seekable::SEEK_CUR ) or return _ioError("seeking to extended local header"); # these values should be set correctly from before. my $oldCrc32 = $self->{'eocdCrc32'}; my $oldCompressedSize = $self->{'compressedSize'}; my $oldUncompressedSize = $self->{'uncompressedSize'}; my $status = $self->_readDataDescriptor(); return $status unless $status == AZ_OK; # The buffer withe encrypted data is prefixed with a new # encrypted 12 byte header. The size only changes when # the buffer is also compressed $self->isEncrypted && $oldUncompressedSize > $self->{uncompressedSize} and $oldUncompressedSize -= DATA_DESCRIPTOR_LENGTH; return _formatError( "CRC or size mismatch while skipping data descriptor") if ( $oldCrc32 != $self->{'crc32'} || $oldUncompressedSize != $self->{'uncompressedSize'} ); } return AZ_OK; } # Read from a local file header into myself. Returns AZ_OK if successful. # Assumes that fh is positioned after signature. # Note that crc32, compressedSize, and uncompressedSize will be 0 if # GPBF_HAS_DATA_DESCRIPTOR_MASK is set in the bitFlag. sub _readLocalFileHeader { my $self = shift; my $header; my $bytesRead = $self->fh()->read( $header, LOCAL_FILE_HEADER_LENGTH ); if ( $bytesRead != LOCAL_FILE_HEADER_LENGTH ) { return _ioError("reading local file header"); } my $fileNameLength; my $crc32; my $compressedSize; my $uncompressedSize; my $extraFieldLength; ( $self->{'versionNeededToExtract'}, $self->{'bitFlag'}, $self->{'compressionMethod'}, $self->{'lastModFileDateTime'}, $crc32, $compressedSize, $uncompressedSize, $fileNameLength, $extraFieldLength ) = unpack( LOCAL_FILE_HEADER_FORMAT, $header ); if ($fileNameLength) { my $fileName; $bytesRead = $self->fh()->read( $fileName, $fileNameLength ); if ( $bytesRead != $fileNameLength ) { return _ioError("reading local file name"); } $self->fileName($fileName); } if ($extraFieldLength) { $bytesRead = $self->fh()->read( $self->{'localExtraField'}, $extraFieldLength ); if ( $bytesRead != $extraFieldLength ) { return _ioError("reading local extra field"); } } $self->{'dataOffset'} = $self->fh()->tell(); if ( $self->hasDataDescriptor() ) { # Read the crc32, compressedSize, and uncompressedSize from the # extended data descriptor. # Skip over the compressed file data (assumes that EOCD compressedSize # was correct) $self->fh()->seek( $self->{'compressedSize'}, IO::Seekable::SEEK_CUR ) or return _ioError("seeking to extended local header"); my $status = $self->_readDataDescriptor(); return $status unless $status == AZ_OK; } else { return _formatError( "CRC or size mismatch after reading data descriptor") if ( $self->{'crc32'} != $crc32 || $self->{'uncompressedSize'} != $uncompressedSize ); } return AZ_OK; } # This will read the data descriptor, which is after the end of compressed file # data in members that have GPBF_HAS_DATA_DESCRIPTOR_MASK set in their bitFlag. # The only reliable way to find these is to rely on the EOCD compressedSize. # Assumes that file is positioned immediately after the compressed data. # Returns status; sets crc32, compressedSize, and uncompressedSize. sub _readDataDescriptor { my $self = shift; my $signatureData; my $header; my $crc32; my $compressedSize; my $uncompressedSize; my $bytesRead = $self->fh()->read( $signatureData, SIGNATURE_LENGTH ); return _ioError("reading header signature") if $bytesRead != SIGNATURE_LENGTH; my $signature = unpack( SIGNATURE_FORMAT, $signatureData ); # unfortunately, the signature appears to be optional. if ( $signature == DATA_DESCRIPTOR_SIGNATURE && ( $signature != $self->{'crc32'} ) ) { $bytesRead = $self->fh()->read( $header, DATA_DESCRIPTOR_LENGTH ); return _ioError("reading data descriptor") if $bytesRead != DATA_DESCRIPTOR_LENGTH; ( $crc32, $compressedSize, $uncompressedSize ) = unpack( DATA_DESCRIPTOR_FORMAT, $header ); } else { $bytesRead = $self->fh()->read( $header, DATA_DESCRIPTOR_LENGTH_NO_SIG ); return _ioError("reading data descriptor") if $bytesRead != DATA_DESCRIPTOR_LENGTH_NO_SIG; $crc32 = $signature; ( $compressedSize, $uncompressedSize ) = unpack( DATA_DESCRIPTOR_FORMAT_NO_SIG, $header ); } $self->{'eocdCrc32'} = $self->{'crc32'} unless defined( $self->{'eocdCrc32'} ); $self->{'crc32'} = $crc32; $self->{'compressedSize'} = $compressedSize; $self->{'uncompressedSize'} = $uncompressedSize; return AZ_OK; } # Read a Central Directory header. Return AZ_OK on success. # Assumes that fh is positioned right after the signature. sub _readCentralDirectoryFileHeader { my $self = shift; my $fh = $self->fh(); my $header = ''; my $bytesRead = $fh->read( $header, CENTRAL_DIRECTORY_FILE_HEADER_LENGTH ); if ( $bytesRead != CENTRAL_DIRECTORY_FILE_HEADER_LENGTH ) { return _ioError("reading central dir header"); } my ( $fileNameLength, $extraFieldLength, $fileCommentLength ); ( $self->{'versionMadeBy'}, $self->{'fileAttributeFormat'}, $self->{'versionNeededToExtract'}, $self->{'bitFlag'}, $self->{'compressionMethod'}, $self->{'lastModFileDateTime'}, $self->{'crc32'}, $self->{'compressedSize'}, $self->{'uncompressedSize'}, $fileNameLength, $extraFieldLength, $fileCommentLength, $self->{'diskNumberStart'}, $self->{'internalFileAttributes'}, $self->{'externalFileAttributes'}, $self->{'localHeaderRelativeOffset'} ) = unpack( CENTRAL_DIRECTORY_FILE_HEADER_FORMAT, $header ); $self->{'eocdCrc32'} = $self->{'crc32'}; if ($fileNameLength) { $bytesRead = $fh->read( $self->{'fileName'}, $fileNameLength ); if ( $bytesRead != $fileNameLength ) { _ioError("reading central dir filename"); } } if ($extraFieldLength) { $bytesRead = $fh->read( $self->{'cdExtraField'}, $extraFieldLength ); if ( $bytesRead != $extraFieldLength ) { return _ioError("reading central dir extra field"); } } if ($fileCommentLength) { $bytesRead = $fh->read( $self->{'fileComment'}, $fileCommentLength ); if ( $bytesRead != $fileCommentLength ) { return _ioError("reading central dir file comment"); } } # NK 10/21/04: added to avoid problems with manipulated headers if ( $self->{'uncompressedSize'} != $self->{'compressedSize'} and $self->{'compressionMethod'} == COMPRESSION_STORED ) { $self->{'uncompressedSize'} = $self->{'compressedSize'}; } $self->desiredCompressionMethod( $self->compressionMethod() ); return AZ_OK; } sub rewindData { my $self = shift; my $status = $self->SUPER::rewindData(@_); return $status unless $status == AZ_OK; return AZ_IO_ERROR unless $self->fh(); $self->fh()->clearerr(); # Seek to local file header. # The only reason that I'm doing this this way is that the extraField # length seems to be different between the CD header and the LF header. $status = $self->_seekToLocalHeader(); return $status unless $status == AZ_OK; # skip local file header $status = $self->_skipLocalFileHeader(); return $status unless $status == AZ_OK; # Seek to beginning of file data $self->fh()->seek( $self->dataOffset(), IO::Seekable::SEEK_SET ) or return _ioError("seeking to beginning of file data"); return AZ_OK; } # Return bytes read. Note that first parameter is a ref to a buffer. # my $data; # my ( $bytesRead, $status) = $self->readRawChunk( \$data, $chunkSize ); sub _readRawChunk { my ( $self, $dataRef, $chunkSize ) = @_; return ( 0, AZ_OK ) unless $chunkSize; my $bytesRead = $self->fh()->read( $$dataRef, $chunkSize ) or return ( 0, _ioError("reading data") ); return ( $bytesRead, AZ_OK ); } 1; FILE3cdcde02/Compress/Zlib.pm>3#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/Compress/Zlib.pm" package Compress::Zlib; require 5.006 ; require Exporter; use Carp ; use IO::Handle ; use Scalar::Util qw(dualvar); use IO::Compress::Base::Common 2.066 ; use Compress::Raw::Zlib 2.066 ; use IO::Compress::Gzip 2.066 ; use IO::Uncompress::Gunzip 2.066 ; use strict ; use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS); $VERSION = '2.066'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @ISA = qw(Exporter); # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. @EXPORT = qw( deflateInit inflateInit compress uncompress gzopen $gzerrno ); push @EXPORT, @Compress::Raw::Zlib::EXPORT ; @EXPORT_OK = qw(memGunzip memGzip zlib_version); %EXPORT_TAGS = ( ALL => \@EXPORT ); BEGIN { *zlib_version = \&Compress::Raw::Zlib::zlib_version; } use constant FLAG_APPEND => 1 ; use constant FLAG_CRC => 2 ; use constant FLAG_ADLER => 4 ; use constant FLAG_CONSUME_INPUT => 8 ; our (@my_z_errmsg); @my_z_errmsg = ( "need dictionary", # Z_NEED_DICT 2 "stream end", # Z_STREAM_END 1 "", # Z_OK 0 "file error", # Z_ERRNO (-1) "stream error", # Z_STREAM_ERROR (-2) "data error", # Z_DATA_ERROR (-3) "insufficient memory", # Z_MEM_ERROR (-4) "buffer error", # Z_BUF_ERROR (-5) "incompatible version",# Z_VERSION_ERROR(-6) ); sub _set_gzerr { my $value = shift ; if ($value == 0) { $Compress::Zlib::gzerrno = 0 ; } elsif ($value == Z_ERRNO() || $value > 2) { $Compress::Zlib::gzerrno = $! ; } else { $Compress::Zlib::gzerrno = dualvar($value+0, $my_z_errmsg[2 - $value]); } return $value ; } sub _set_gzerr_undef { _set_gzerr(@_); return undef; } sub _save_gzerr { my $gz = shift ; my $test_eof = shift ; my $value = $gz->errorNo() || 0 ; my $eof = $gz->eof() ; if ($test_eof) { # gzread uses Z_STREAM_END to denote a successful end $value = Z_STREAM_END() if $gz->eof() && $value == 0 ; } _set_gzerr($value) ; } sub gzopen($$) { my ($file, $mode) = @_ ; my $gz ; my %defOpts = (Level => Z_DEFAULT_COMPRESSION(), Strategy => Z_DEFAULT_STRATEGY(), ); my $writing ; $writing = ! ($mode =~ /r/i) ; $writing = ($mode =~ /[wa]/i) ; $defOpts{Level} = $1 if $mode =~ /(\d)/; $defOpts{Strategy} = Z_FILTERED() if $mode =~ /f/i; $defOpts{Strategy} = Z_HUFFMAN_ONLY() if $mode =~ /h/i; $defOpts{Append} = 1 if $mode =~ /a/i; my $infDef = $writing ? 'deflate' : 'inflate'; my @params = () ; croak "gzopen: file parameter is not a filehandle or filename" unless isaFilehandle $file || isaFilename $file || (ref $file && ref $file eq 'SCALAR'); return undef unless $mode =~ /[rwa]/i ; _set_gzerr(0) ; if ($writing) { $gz = new IO::Compress::Gzip($file, Minimal => 1, AutoClose => 1, %defOpts) or $Compress::Zlib::gzerrno = $IO::Compress::Gzip::GzipError; } else { $gz = new IO::Uncompress::Gunzip($file, Transparent => 1, Append => 0, AutoClose => 1, MultiStream => 1, Strict => 0) or $Compress::Zlib::gzerrno = $IO::Uncompress::Gunzip::GunzipError; } return undef if ! defined $gz ; bless [$gz, $infDef], 'Compress::Zlib::gzFile'; } sub Compress::Zlib::gzFile::gzread { my $self = shift ; return _set_gzerr(Z_STREAM_ERROR()) if $self->[1] ne 'inflate'; my $len = defined $_[1] ? $_[1] : 4096 ; my $gz = $self->[0] ; if ($self->gzeof() || $len == 0) { # Zap the output buffer to match ver 1 behaviour. $_[0] = "" ; _save_gzerr($gz, 1); return 0 ; } my $status = $gz->read($_[0], $len) ; _save_gzerr($gz, 1); return $status ; } sub Compress::Zlib::gzFile::gzreadline { my $self = shift ; my $gz = $self->[0] ; { # Maintain backward compatibility with 1.x behaviour # It didn't support $/, so this can't either. local $/ = "\n" ; $_[0] = $gz->getline() ; } _save_gzerr($gz, 1); return defined $_[0] ? length $_[0] : 0 ; } sub Compress::Zlib::gzFile::gzwrite { my $self = shift ; my $gz = $self->[0] ; return _set_gzerr(Z_STREAM_ERROR()) if $self->[1] ne 'deflate'; $] >= 5.008 and (utf8::downgrade($_[0], 1) or croak "Wide character in gzwrite"); my $status = $gz->write($_[0]) ; _save_gzerr($gz); return $status ; } sub Compress::Zlib::gzFile::gztell { my $self = shift ; my $gz = $self->[0] ; my $status = $gz->tell() ; _save_gzerr($gz); return $status ; } sub Compress::Zlib::gzFile::gzseek { my $self = shift ; my $offset = shift ; my $whence = shift ; my $gz = $self->[0] ; my $status ; eval { $status = $gz->seek($offset, $whence) ; }; if ($@) { my $error = $@; $error =~ s/^.*: /gzseek: /; $error =~ s/ at .* line \d+\s*$//; croak $error; } _save_gzerr($gz); return $status ; } sub Compress::Zlib::gzFile::gzflush { my $self = shift ; my $f = shift ; my $gz = $self->[0] ; my $status = $gz->flush($f) ; my $err = _save_gzerr($gz); return $status ? 0 : $err; } sub Compress::Zlib::gzFile::gzclose { my $self = shift ; my $gz = $self->[0] ; my $status = $gz->close() ; my $err = _save_gzerr($gz); return $status ? 0 : $err; } sub Compress::Zlib::gzFile::gzeof { my $self = shift ; my $gz = $self->[0] ; return 0 if $self->[1] ne 'inflate'; my $status = $gz->eof() ; _save_gzerr($gz); return $status ; } sub Compress::Zlib::gzFile::gzsetparams { my $self = shift ; croak "Usage: Compress::Zlib::gzFile::gzsetparams(file, level, strategy)" unless @_ eq 2 ; my $gz = $self->[0] ; my $level = shift ; my $strategy = shift; return _set_gzerr(Z_STREAM_ERROR()) if $self->[1] ne 'deflate'; my $status = *$gz->{Compress}->deflateParams(-Level => $level, -Strategy => $strategy); _save_gzerr($gz); return $status ; } sub Compress::Zlib::gzFile::gzerror { my $self = shift ; my $gz = $self->[0] ; return $Compress::Zlib::gzerrno ; } sub compress($;$) { my ($x, $output, $err, $in) =('', '', '', '') ; if (ref $_[0] ) { $in = $_[0] ; croak "not a scalar reference" unless ref $in eq 'SCALAR' ; } else { $in = \$_[0] ; } $] >= 5.008 and (utf8::downgrade($$in, 1) or croak "Wide character in compress"); my $level = (@_ == 2 ? $_[1] : Z_DEFAULT_COMPRESSION() ); $x = Compress::Raw::Zlib::_deflateInit(FLAG_APPEND, $level, Z_DEFLATED, MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, 4096, '') or return undef ; $err = $x->deflate($in, $output) ; return undef unless $err == Z_OK() ; $err = $x->flush($output) ; return undef unless $err == Z_OK() ; return $output ; } sub uncompress($) { my ($output, $in) =('', '') ; if (ref $_[0] ) { $in = $_[0] ; croak "not a scalar reference" unless ref $in eq 'SCALAR' ; } else { $in = \$_[0] ; } $] >= 5.008 and (utf8::downgrade($$in, 1) or croak "Wide character in uncompress"); my ($obj, $status) = Compress::Raw::Zlib::_inflateInit(0, MAX_WBITS, 4096, "") ; $status == Z_OK or return undef; $obj->inflate($in, $output) == Z_STREAM_END or return undef; return $output; } sub deflateInit(@) { my ($got) = ParseParameters(0, { 'bufsize' => [IO::Compress::Base::Common::Parse_unsigned, 4096], 'level' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_COMPRESSION()], 'method' => [IO::Compress::Base::Common::Parse_unsigned, Z_DEFLATED()], 'windowbits' => [IO::Compress::Base::Common::Parse_signed, MAX_WBITS()], 'memlevel' => [IO::Compress::Base::Common::Parse_unsigned, MAX_MEM_LEVEL()], 'strategy' => [IO::Compress::Base::Common::Parse_unsigned, Z_DEFAULT_STRATEGY()], 'dictionary' => [IO::Compress::Base::Common::Parse_any, ""], }, @_ ) ; croak "Compress::Zlib::deflateInit: Bufsize must be >= 1, you specified " . $got->getValue('bufsize') unless $got->getValue('bufsize') >= 1; my $obj ; my $status = 0 ; ($obj, $status) = Compress::Raw::Zlib::_deflateInit(0, $got->getValue('level'), $got->getValue('method'), $got->getValue('windowbits'), $got->getValue('memlevel'), $got->getValue('strategy'), $got->getValue('bufsize'), $got->getValue('dictionary')) ; my $x = ($status == Z_OK() ? bless $obj, "Zlib::OldDeflate" : undef) ; return wantarray ? ($x, $status) : $x ; } sub inflateInit(@) { my ($got) = ParseParameters(0, { 'bufsize' => [IO::Compress::Base::Common::Parse_unsigned, 4096], 'windowbits' => [IO::Compress::Base::Common::Parse_signed, MAX_WBITS()], 'dictionary' => [IO::Compress::Base::Common::Parse_any, ""], }, @_) ; croak "Compress::Zlib::inflateInit: Bufsize must be >= 1, you specified " . $got->getValue('bufsize') unless $got->getValue('bufsize') >= 1; my $status = 0 ; my $obj ; ($obj, $status) = Compress::Raw::Zlib::_inflateInit(FLAG_CONSUME_INPUT, $got->getValue('windowbits'), $got->getValue('bufsize'), $got->getValue('dictionary')) ; my $x = ($status == Z_OK() ? bless $obj, "Zlib::OldInflate" : undef) ; wantarray ? ($x, $status) : $x ; } package Zlib::OldDeflate ; our (@ISA); @ISA = qw(Compress::Raw::Zlib::deflateStream); sub deflate { my $self = shift ; my $output ; my $status = $self->SUPER::deflate($_[0], $output) ; wantarray ? ($output, $status) : $output ; } sub flush { my $self = shift ; my $output ; my $flag = shift || Compress::Zlib::Z_FINISH(); my $status = $self->SUPER::flush($output, $flag) ; wantarray ? ($output, $status) : $output ; } package Zlib::OldInflate ; our (@ISA); @ISA = qw(Compress::Raw::Zlib::inflateStream); sub inflate { my $self = shift ; my $output ; my $status = $self->SUPER::inflate($_[0], $output) ; wantarray ? ($output, $status) : $output ; } package Compress::Zlib ; use IO::Compress::Gzip::Constants 2.066 ; sub memGzip($) { _set_gzerr(0); my $x = Compress::Raw::Zlib::_deflateInit(FLAG_APPEND|FLAG_CRC, Z_BEST_COMPRESSION, Z_DEFLATED, -MAX_WBITS(), MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY, 4096, '') or return undef ; # if the deflation buffer isn't a reference, make it one my $string = (ref $_[0] ? $_[0] : \$_[0]) ; $] >= 5.008 and (utf8::downgrade($$string, 1) or croak "Wide character in memGzip"); my $out; my $status ; $x->deflate($string, $out) == Z_OK or return undef ; $x->flush($out) == Z_OK or return undef ; return IO::Compress::Gzip::Constants::GZIP_MINIMUM_HEADER . $out . pack("V V", $x->crc32(), $x->total_in()); } sub _removeGzipHeader($) { my $string = shift ; return Z_DATA_ERROR() if length($$string) < GZIP_MIN_HEADER_SIZE ; my ($magic1, $magic2, $method, $flags, $time, $xflags, $oscode) = unpack ('CCCCVCC', $$string); return Z_DATA_ERROR() unless $magic1 == GZIP_ID1 and $magic2 == GZIP_ID2 and $method == Z_DEFLATED() and !($flags & GZIP_FLG_RESERVED) ; substr($$string, 0, GZIP_MIN_HEADER_SIZE) = '' ; # skip extra field if ($flags & GZIP_FLG_FEXTRA) { return Z_DATA_ERROR() if length($$string) < GZIP_FEXTRA_HEADER_SIZE ; my ($extra_len) = unpack ('v', $$string); $extra_len += GZIP_FEXTRA_HEADER_SIZE; return Z_DATA_ERROR() if length($$string) < $extra_len ; substr($$string, 0, $extra_len) = ''; } # skip orig name if ($flags & GZIP_FLG_FNAME) { my $name_end = index ($$string, GZIP_NULL_BYTE); return Z_DATA_ERROR() if $name_end == -1 ; substr($$string, 0, $name_end + 1) = ''; } # skip comment if ($flags & GZIP_FLG_FCOMMENT) { my $comment_end = index ($$string, GZIP_NULL_BYTE); return Z_DATA_ERROR() if $comment_end == -1 ; substr($$string, 0, $comment_end + 1) = ''; } # skip header crc if ($flags & GZIP_FLG_FHCRC) { return Z_DATA_ERROR() if length ($$string) < GZIP_FHCRC_SIZE ; substr($$string, 0, GZIP_FHCRC_SIZE) = ''; } return Z_OK(); } sub _ret_gun_error { $Compress::Zlib::gzerrno = $IO::Uncompress::Gunzip::GunzipError; return undef; } sub memGunzip($) { # if the buffer isn't a reference, make it one my $string = (ref $_[0] ? $_[0] : \$_[0]); $] >= 5.008 and (utf8::downgrade($$string, 1) or croak "Wide character in memGunzip"); _set_gzerr(0); my $status = _removeGzipHeader($string) ; $status == Z_OK() or return _set_gzerr_undef($status); my $bufsize = length $$string > 4096 ? length $$string : 4096 ; my $x = Compress::Raw::Zlib::_inflateInit(FLAG_CRC | FLAG_CONSUME_INPUT, -MAX_WBITS(), $bufsize, '') or return _ret_gun_error(); my $output = '' ; $status = $x->inflate($string, $output); if ( $status == Z_OK() ) { _set_gzerr(Z_DATA_ERROR()); return undef; } return _ret_gun_error() if ($status != Z_STREAM_END()); if (length $$string >= 8) { my ($crc, $len) = unpack ("VV", substr($$string, 0, 8)); substr($$string, 0, 8) = ''; return _set_gzerr_undef(Z_DATA_ERROR()) unless $len == length($output) and $crc == Compress::Raw::Zlib::crc32($output); } else { $$string = ''; } return $output; } # Autoload methods go after __END__, and are processed by the autosplit program. 1; __END__ #line 1508 FILEa42b0176/File/GlobMapper.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/File/GlobMapper.pm" package File::GlobMapper; use strict; use warnings; use Carp; our ($CSH_GLOB); BEGIN { if ($] < 5.006) { require File::BSDGlob; import File::BSDGlob qw(:glob) ; $CSH_GLOB = File::BSDGlob::GLOB_CSH() ; *globber = \&File::BSDGlob::csh_glob; } else { require File::Glob; import File::Glob qw(:glob) ; $CSH_GLOB = File::Glob::GLOB_CSH() ; #*globber = \&File::Glob::bsd_glob; *globber = \&File::Glob::csh_glob; } } our ($Error); our ($VERSION, @EXPORT_OK); $VERSION = '1.000'; @EXPORT_OK = qw( globmap ); our ($noPreBS, $metachars, $matchMetaRE, %mapping, %wildCount); $noPreBS = '(? '([^/]*)', '?' => '([^/])', '.' => '\.', '[' => '([', '(' => '(', ')' => ')', ); %wildCount = map { $_ => 1 } qw/ * ? . { ( [ /; sub globmap ($$;) { my $inputGlob = shift ; my $outputGlob = shift ; my $obj = new File::GlobMapper($inputGlob, $outputGlob, @_) or croak "globmap: $Error" ; return $obj->getFileMap(); } sub new { my $class = shift ; my $inputGlob = shift ; my $outputGlob = shift ; # TODO -- flags needs to default to whatever File::Glob does my $flags = shift || $CSH_GLOB ; #my $flags = shift ; $inputGlob =~ s/^\s*\<\s*//; $inputGlob =~ s/\s*\>\s*$//; $outputGlob =~ s/^\s*\<\s*//; $outputGlob =~ s/\s*\>\s*$//; my %object = ( InputGlob => $inputGlob, OutputGlob => $outputGlob, GlobFlags => $flags, Braces => 0, WildCount => 0, Pairs => [], Sigil => '#', ); my $self = bless \%object, ref($class) || $class ; $self->_parseInputGlob() or return undef ; $self->_parseOutputGlob() or return undef ; my @inputFiles = globber($self->{InputGlob}, $flags) ; if (GLOB_ERROR) { $Error = $!; return undef ; } #if (whatever) { my $missing = grep { ! -e $_ } @inputFiles ; if ($missing) { $Error = "$missing input files do not exist"; return undef ; } } $self->{InputFiles} = \@inputFiles ; $self->_getFiles() or return undef ; return $self; } sub _retError { my $string = shift ; $Error = "$string in input fileglob" ; return undef ; } sub _unmatched { my $delimeter = shift ; _retError("Unmatched $delimeter"); return undef ; } sub _parseBit { my $self = shift ; my $string = shift ; my $out = ''; my $depth = 0 ; while ($string =~ s/(.*?)$noPreBS(,|$matchMetaRE)//) { $out .= quotemeta($1) ; $out .= $mapping{$2} if defined $mapping{$2}; ++ $self->{WildCount} if $wildCount{$2} ; if ($2 eq ',') { return _unmatched "(" if $depth ; $out .= '|'; } elsif ($2 eq '(') { ++ $depth ; } elsif ($2 eq ')') { return _unmatched ")" if ! $depth ; -- $depth ; } elsif ($2 eq '[') { # TODO -- quotemeta & check no '/' # TODO -- check for \] & other \ within the [] $string =~ s#(.*?\])## or return _unmatched "[" ; $out .= "$1)" ; } elsif ($2 eq ']') { return _unmatched "]" ; } elsif ($2 eq '{' || $2 eq '}') { return _retError "Nested {} not allowed" ; } } $out .= quotemeta $string; return _unmatched "(" if $depth ; return $out ; } sub _parseInputGlob { my $self = shift ; my $string = $self->{InputGlob} ; my $inGlob = ''; # Multiple concatenated *'s don't make sense #$string =~ s#\*\*+#*# ; # TODO -- Allow space to delimit patterns? #my @strings = split /\s+/, $string ; #for my $str (@strings) my $out = ''; my $depth = 0 ; while ($string =~ s/(.*?)$noPreBS($matchMetaRE)//) { $out .= quotemeta($1) ; $out .= $mapping{$2} if defined $mapping{$2}; ++ $self->{WildCount} if $wildCount{$2} ; if ($2 eq '(') { ++ $depth ; } elsif ($2 eq ')') { return _unmatched ")" if ! $depth ; -- $depth ; } elsif ($2 eq '[') { # TODO -- quotemeta & check no '/' or '(' or ')' # TODO -- check for \] & other \ within the [] $string =~ s#(.*?\])## or return _unmatched "["; $out .= "$1)" ; } elsif ($2 eq ']') { return _unmatched "]" ; } elsif ($2 eq '}') { return _unmatched "}" ; } elsif ($2 eq '{') { # TODO -- check no '/' within the {} # TODO -- check for \} & other \ within the {} my $tmp ; unless ( $string =~ s/(.*?)$noPreBS\}//) { return _unmatched "{"; } #$string =~ s#(.*?)\}##; #my $alt = join '|', # map { quotemeta $_ } # split "$noPreBS,", $1 ; my $alt = $self->_parseBit($1); defined $alt or return 0 ; $out .= "($alt)" ; ++ $self->{Braces} ; } } return _unmatched "(" if $depth ; $out .= quotemeta $string ; $self->{InputGlob} =~ s/$noPreBS[\(\)]//g; $self->{InputPattern} = $out ; #print "# INPUT '$self->{InputGlob}' => '$out'\n"; return 1 ; } sub _parseOutputGlob { my $self = shift ; my $string = $self->{OutputGlob} ; my $maxwild = $self->{WildCount}; if ($self->{GlobFlags} & GLOB_TILDE) #if (1) { $string =~ s{ ^ ~ # find a leading tilde ( # save this in $1 [^/] # a non-slash character * # repeated 0 or more times (0 means me) ) }{ $1 ? (getpwnam($1))[7] : ( $ENV{HOME} || $ENV{LOGDIR} ) }ex; } # max #1 must be == to max no of '*' in input while ( $string =~ m/#(\d)/g ) { croak "Max wild is #$maxwild, you tried #$1" if $1 > $maxwild ; } my $noPreBS = '(?{OutputGlob}' => '$string'\n"; $self->{OutputPattern} = $string ; return 1 ; } sub _getFiles { my $self = shift ; my %outInMapping = (); my %inFiles = () ; foreach my $inFile (@{ $self->{InputFiles} }) { next if $inFiles{$inFile} ++ ; my $outFile = $inFile ; if ( $inFile =~ m/$self->{InputPattern}/ ) { no warnings 'uninitialized'; eval "\$outFile = $self->{OutputPattern};" ; if (defined $outInMapping{$outFile}) { $Error = "multiple input files map to one output file"; return undef ; } $outInMapping{$outFile} = $inFile; push @{ $self->{Pairs} }, [$inFile, $outFile]; } } return 1 ; } sub getFileMap { my $self = shift ; return $self->{Pairs} ; } sub getHash { my $self = shift ; return { map { $_->[0] => $_->[1] } @{ $self->{Pairs} } } ; } 1; __END__ #line 680FILE'cd3469f4/IO/Compress/Adapter/Deflate.pm #line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Compress/Adapter/Deflate.pm" package IO::Compress::Adapter::Deflate ; use strict; use warnings; use bytes; use IO::Compress::Base::Common 2.066 qw(:Status); use Compress::Raw::Zlib 2.066 qw( !crc32 !adler32 ) ; require Exporter; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, @EXPORT, %DEFLATE_CONSTANTS); $VERSION = '2.066'; @ISA = qw(Exporter); @EXPORT_OK = @Compress::Raw::Zlib::DEFLATE_CONSTANTS; %EXPORT_TAGS = %Compress::Raw::Zlib::DEFLATE_CONSTANTS; @EXPORT = @EXPORT_OK; %DEFLATE_CONSTANTS = %EXPORT_TAGS ; sub mkCompObject { my $crc32 = shift ; my $adler32 = shift ; my $level = shift ; my $strategy = shift ; my ($def, $status) = new Compress::Raw::Zlib::Deflate -AppendOutput => 1, -CRC32 => $crc32, -ADLER32 => $adler32, -Level => $level, -Strategy => $strategy, -WindowBits => - MAX_WBITS; return (undef, "Cannot create Deflate object: $status", $status) if $status != Z_OK; return bless {'Def' => $def, 'Error' => '', } ; } sub compr { my $self = shift ; my $def = $self->{Def}; my $status = $def->deflate($_[0], $_[1]) ; $self->{ErrorNo} = $status; if ($status != Z_OK) { $self->{Error} = "Deflate Error: $status"; return STATUS_ERROR; } return STATUS_OK; } sub flush { my $self = shift ; my $def = $self->{Def}; my $opt = $_[1] || Z_FINISH; my $status = $def->flush($_[0], $opt); $self->{ErrorNo} = $status; if ($status != Z_OK) { $self->{Error} = "Deflate Error: $status"; return STATUS_ERROR; } return STATUS_OK; } sub close { my $self = shift ; my $def = $self->{Def}; $def->flush($_[0], Z_FINISH) if defined $def ; } sub reset { my $self = shift ; my $def = $self->{Def}; my $status = $def->deflateReset() ; $self->{ErrorNo} = $status; if ($status != Z_OK) { $self->{Error} = "Deflate Error: $status"; return STATUS_ERROR; } return STATUS_OK; } sub deflateParams { my $self = shift ; my $def = $self->{Def}; my $status = $def->deflateParams(@_); $self->{ErrorNo} = $status; if ($status != Z_OK) { $self->{Error} = "deflateParams Error: $status"; return STATUS_ERROR; } return STATUS_OK; } #sub total_out #{ # my $self = shift ; # $self->{Def}->total_out(); #} # #sub total_in #{ # my $self = shift ; # $self->{Def}->total_in(); #} sub compressedBytes { my $self = shift ; $self->{Def}->compressedBytes(); } sub uncompressedBytes { my $self = shift ; $self->{Def}->uncompressedBytes(); } sub crc32 { my $self = shift ; $self->{Def}->crc32(); } sub adler32 { my $self = shift ; $self->{Def}->adler32(); } 1; __END__ FILE10ec34ca/IO/Compress/Base.pmXk#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Compress/Base.pm" package IO::Compress::Base ; require 5.006 ; use strict ; use warnings; use IO::Compress::Base::Common 2.066 ; use IO::File (); ; use Scalar::Util (); #use File::Glob; #require Exporter ; use Carp() ; use Symbol(); #use bytes; our (@ISA, $VERSION); @ISA = qw(Exporter IO::File); $VERSION = '2.066'; #Can't locate object method "SWASHNEW" via package "utf8" (perhaps you forgot to load "utf8"?) at .../ext/Compress-Zlib/Gzip/blib/lib/Compress/Zlib/Common.pm line 16. sub saveStatus { my $self = shift ; ${ *$self->{ErrorNo} } = shift() + 0 ; ${ *$self->{Error} } = '' ; return ${ *$self->{ErrorNo} } ; } sub saveErrorString { my $self = shift ; my $retval = shift ; ${ *$self->{Error} } = shift ; ${ *$self->{ErrorNo} } = shift() + 0 if @_ ; return $retval; } sub croakError { my $self = shift ; $self->saveErrorString(0, $_[0]); Carp::croak $_[0]; } sub closeError { my $self = shift ; my $retval = shift ; my $errno = *$self->{ErrorNo}; my $error = ${ *$self->{Error} }; $self->close(); *$self->{ErrorNo} = $errno ; ${ *$self->{Error} } = $error ; return $retval; } sub error { my $self = shift ; return ${ *$self->{Error} } ; } sub errorNo { my $self = shift ; return ${ *$self->{ErrorNo} } ; } sub writeAt { my $self = shift ; my $offset = shift; my $data = shift; if (defined *$self->{FH}) { my $here = tell(*$self->{FH}); return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) if $here < 0 ; seek(*$self->{FH}, $offset, IO::Handle::SEEK_SET) or return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) ; defined *$self->{FH}->write($data, length $data) or return $self->saveErrorString(undef, $!, $!) ; seek(*$self->{FH}, $here, IO::Handle::SEEK_SET) or return $self->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) ; } else { substr(${ *$self->{Buffer} }, $offset, length($data)) = $data ; } return 1; } sub outputPayload { my $self = shift ; return $self->output(@_); } sub output { my $self = shift ; my $data = shift ; my $last = shift ; return 1 if length $data == 0 && ! $last ; if ( *$self->{FilterContainer} ) { *_ = \$data; &{ *$self->{FilterContainer} }(); } if (length $data) { if ( defined *$self->{FH} ) { defined *$self->{FH}->write( $data, length $data ) or return $self->saveErrorString(0, $!, $!); } else { ${ *$self->{Buffer} } .= $data ; } } return 1; } sub getOneShotParams { return ( 'multistream' => [IO::Compress::Base::Common::Parse_boolean, 1], ); } our %PARAMS = ( # Generic Parameters 'autoclose' => [IO::Compress::Base::Common::Parse_boolean, 0], 'encode' => [IO::Compress::Base::Common::Parse_any, undef], 'strict' => [IO::Compress::Base::Common::Parse_boolean, 1], 'append' => [IO::Compress::Base::Common::Parse_boolean, 0], 'binmodein' => [IO::Compress::Base::Common::Parse_boolean, 0], 'filtercontainer' => [IO::Compress::Base::Common::Parse_code, undef], ); sub checkParams { my $self = shift ; my $class = shift ; my $got = shift || IO::Compress::Base::Parameters::new(); $got->parse( { %PARAMS, $self->getExtraParams(), *$self->{OneShot} ? $self->getOneShotParams() : (), }, @_) or $self->croakError("${class}: " . $got->getError()) ; return $got ; } sub _create { my $obj = shift; my $got = shift; *$obj->{Closed} = 1 ; my $class = ref $obj; $obj->croakError("$class: Missing Output parameter") if ! @_ && ! $got ; my $outValue = shift ; my $oneShot = 1 ; if (! $got) { $oneShot = 0 ; $got = $obj->checkParams($class, undef, @_) or return undef ; } my $lax = ! $got->getValue('strict') ; my $outType = IO::Compress::Base::Common::whatIsOutput($outValue); $obj->ckOutputParam($class, $outValue) or return undef ; if ($outType eq 'buffer') { *$obj->{Buffer} = $outValue; } else { my $buff = "" ; *$obj->{Buffer} = \$buff ; } # Merge implies Append my $merge = $got->getValue('merge') ; my $appendOutput = $got->getValue('append') || $merge ; *$obj->{Append} = $appendOutput; *$obj->{FilterContainer} = $got->getValue('filtercontainer') ; if ($merge) { # Switch off Merge mode if output file/buffer is empty/doesn't exist if (($outType eq 'buffer' && length $$outValue == 0 ) || ($outType ne 'buffer' && (! -e $outValue || (-w _ && -z _))) ) { $merge = 0 } } # If output is a file, check that it is writable #no warnings; #if ($outType eq 'filename' && -e $outValue && ! -w _) # { return $obj->saveErrorString(undef, "Output file '$outValue' is not writable" ) } $obj->ckParams($got) or $obj->croakError("${class}: " . $obj->error()); if ($got->getValue('encode')) { my $want_encoding = $got->getValue('encode'); *$obj->{Encoding} = IO::Compress::Base::Common::getEncoding($obj, $class, $want_encoding); my $x = *$obj->{Encoding}; } else { *$obj->{Encoding} = undef; } $obj->saveStatus(STATUS_OK) ; my $status ; if (! $merge) { *$obj->{Compress} = $obj->mkComp($got) or return undef; *$obj->{UnCompSize} = new U64 ; *$obj->{CompSize} = new U64 ; if ( $outType eq 'buffer') { ${ *$obj->{Buffer} } = '' unless $appendOutput ; } else { if ($outType eq 'handle') { *$obj->{FH} = $outValue ; setBinModeOutput(*$obj->{FH}) ; #$outValue->flush() ; *$obj->{Handle} = 1 ; if ($appendOutput) { seek(*$obj->{FH}, 0, IO::Handle::SEEK_END) or return $obj->saveErrorString(undef, "Cannot seek to end of output filehandle: $!", $!) ; } } elsif ($outType eq 'filename') { no warnings; my $mode = '>' ; $mode = '>>' if $appendOutput; *$obj->{FH} = new IO::File "$mode $outValue" or return $obj->saveErrorString(undef, "cannot open file '$outValue': $!", $!) ; *$obj->{StdIO} = ($outValue eq '-'); setBinModeOutput(*$obj->{FH}) ; } } *$obj->{Header} = $obj->mkHeader($got) ; $obj->output( *$obj->{Header} ) or return undef; $obj->beforePayload(); } else { *$obj->{Compress} = $obj->createMerge($outValue, $outType) or return undef; } *$obj->{Closed} = 0 ; *$obj->{AutoClose} = $got->getValue('autoclose') ; *$obj->{Output} = $outValue; *$obj->{ClassName} = $class; *$obj->{Got} = $got; *$obj->{OneShot} = 0 ; return $obj ; } sub ckOutputParam { my $self = shift ; my $from = shift ; my $outType = IO::Compress::Base::Common::whatIsOutput($_[0]); $self->croakError("$from: output parameter not a filename, filehandle or scalar ref") if ! $outType ; #$self->croakError("$from: output filename is undef or null string") #if $outType eq 'filename' && (! defined $_[0] || $_[0] eq '') ; $self->croakError("$from: output buffer is read-only") if $outType eq 'buffer' && Scalar::Util::readonly(${ $_[0] }); return 1; } sub _def { my $obj = shift ; my $class= (caller)[0] ; my $name = (caller(1))[3] ; $obj->croakError("$name: expected at least 1 parameters\n") unless @_ >= 1 ; my $input = shift ; my $haveOut = @_ ; my $output = shift ; my $x = new IO::Compress::Base::Validator($class, *$obj->{Error}, $name, $input, $output) or return undef ; push @_, $output if $haveOut && $x->{Hash}; *$obj->{OneShot} = 1 ; my $got = $obj->checkParams($name, undef, @_) or return undef ; $x->{Got} = $got ; # if ($x->{Hash}) # { # while (my($k, $v) = each %$input) # { # $v = \$input->{$k} # unless defined $v ; # # $obj->_singleTarget($x, 1, $k, $v, @_) # or return undef ; # } # # return keys %$input ; # } if ($x->{GlobMap}) { $x->{oneInput} = 1 ; foreach my $pair (@{ $x->{Pairs} }) { my ($from, $to) = @$pair ; $obj->_singleTarget($x, 1, $from, $to, @_) or return undef ; } return scalar @{ $x->{Pairs} } ; } if (! $x->{oneOutput} ) { my $inFile = ($x->{inType} eq 'filenames' || $x->{inType} eq 'filename'); $x->{inType} = $inFile ? 'filename' : 'buffer'; foreach my $in ($x->{oneInput} ? $input : @$input) { my $out ; $x->{oneInput} = 1 ; $obj->_singleTarget($x, $inFile, $in, \$out, @_) or return undef ; push @$output, \$out ; #if ($x->{outType} eq 'array') # { push @$output, \$out } #else # { $output->{$in} = \$out } } return 1 ; } # finally the 1 to 1 and n to 1 return $obj->_singleTarget($x, 1, $input, $output, @_); Carp::croak "should not be here" ; } sub _singleTarget { my $obj = shift ; my $x = shift ; my $inputIsFilename = shift; my $input = shift; if ($x->{oneInput}) { $obj->getFileInfo($x->{Got}, $input) if isaScalar($input) || (isaFilename($input) and $inputIsFilename) ; my $z = $obj->_create($x->{Got}, @_) or return undef ; defined $z->_wr2($input, $inputIsFilename) or return $z->closeError(undef) ; return $z->close() ; } else { my $afterFirst = 0 ; my $inputIsFilename = ($x->{inType} ne 'array'); my $keep = $x->{Got}->clone(); #for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input) for my $element ( @$input) { my $isFilename = isaFilename($element); if ( $afterFirst ++ ) { defined addInterStream($obj, $element, $isFilename) or return $obj->closeError(undef) ; } else { $obj->getFileInfo($x->{Got}, $element) if isaScalar($element) || $isFilename; $obj->_create($x->{Got}, @_) or return undef ; } defined $obj->_wr2($element, $isFilename) or return $obj->closeError(undef) ; *$obj->{Got} = $keep->clone(); } return $obj->close() ; } } sub _wr2 { my $self = shift ; my $source = shift ; my $inputIsFilename = shift; my $input = $source ; if (! $inputIsFilename) { $input = \$source if ! ref $source; } if ( ref $input && ref $input eq 'SCALAR' ) { return $self->syswrite($input, @_) ; } if ( ! ref $input || isaFilehandle($input)) { my $isFilehandle = isaFilehandle($input) ; my $fh = $input ; if ( ! $isFilehandle ) { $fh = new IO::File "<$input" or return $self->saveErrorString(undef, "cannot open file '$input': $!", $!) ; } binmode $fh if *$self->{Got}->valueOrDefault('binmodein') ; my $status ; my $buff ; my $count = 0 ; while ($status = read($fh, $buff, 16 * 1024)) { $count += length $buff; defined $self->syswrite($buff, @_) or return undef ; } return $self->saveErrorString(undef, $!, $!) if ! defined $status ; if ( (!$isFilehandle || *$self->{AutoClose}) && $input ne '-') { $fh->close() or return undef ; } return $count ; } Carp::croak "Should not be here"; return undef; } sub addInterStream { my $self = shift ; my $input = shift ; my $inputIsFilename = shift ; if (*$self->{Got}->getValue('multistream')) { $self->getFileInfo(*$self->{Got}, $input) #if isaFilename($input) and $inputIsFilename ; if isaScalar($input) || isaFilename($input) ; # TODO -- newStream needs to allow gzip/zip header to be modified return $self->newStream(); } elsif (*$self->{Got}->getValue('autoflush')) { #return $self->flush(Z_FULL_FLUSH); } return 1 ; } sub getFileInfo { } sub TIEHANDLE { return $_[0] if ref($_[0]); die "OOPS\n" ; } sub UNTIE { my $self = shift ; } sub DESTROY { my $self = shift ; local ($., $@, $!, $^E, $?); $self->close() ; # TODO - memory leak with 5.8.0 - this isn't called until # global destruction # %{ *$self } = () ; undef $self ; } sub filterUncompressed { } sub syswrite { my $self = shift ; my $buffer ; if (ref $_[0] ) { $self->croakError( *$self->{ClassName} . "::write: not a scalar reference" ) unless ref $_[0] eq 'SCALAR' ; $buffer = $_[0] ; } else { $buffer = \$_[0] ; } if (@_ > 1) { my $slen = defined $$buffer ? length($$buffer) : 0; my $len = $slen; my $offset = 0; $len = $_[1] if $_[1] < $len; if (@_ > 2) { $offset = $_[2] || 0; $self->croakError(*$self->{ClassName} . "::write: offset outside string") if $offset > $slen; if ($offset < 0) { $offset += $slen; $self->croakError( *$self->{ClassName} . "::write: offset outside string") if $offset < 0; } my $rem = $slen - $offset; $len = $rem if $rem < $len; } $buffer = \substr($$buffer, $offset, $len) ; } return 0 if (! defined $$buffer || length $$buffer == 0) && ! *$self->{FlushPending}; # *$self->{Pending} .= $$buffer ; # # return length $$buffer # if (length *$self->{Pending} < 1024 * 16 && ! *$self->{FlushPending}) ; # # $$buffer = *$self->{Pending} ; # *$self->{Pending} = ''; if (*$self->{Encoding}) { $$buffer = *$self->{Encoding}->encode($$buffer); } else { $] >= 5.008 and ( utf8::downgrade($$buffer, 1) or Carp::croak "Wide character in " . *$self->{ClassName} . "::write:"); } $self->filterUncompressed($buffer); my $buffer_length = defined $$buffer ? length($$buffer) : 0 ; *$self->{UnCompSize}->add($buffer_length) ; my $outBuffer=''; my $status = *$self->{Compress}->compr($buffer, $outBuffer) ; return $self->saveErrorString(undef, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; *$self->{CompSize}->add(length $outBuffer) ; $self->outputPayload($outBuffer) or return undef; return $buffer_length; } sub print { my $self = shift; #if (ref $self) { # $self = *$self{GLOB} ; #} if (defined $\) { if (defined $,) { defined $self->syswrite(join($,, @_) . $\); } else { defined $self->syswrite(join("", @_) . $\); } } else { if (defined $,) { defined $self->syswrite(join($,, @_)); } else { defined $self->syswrite(join("", @_)); } } } sub printf { my $self = shift; my $fmt = shift; defined $self->syswrite(sprintf($fmt, @_)); } sub _flushCompressed { my $self = shift ; my $outBuffer=''; my $status = *$self->{Compress}->flush($outBuffer, @_) ; return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; if ( defined *$self->{FH} ) { *$self->{FH}->clearerr(); } *$self->{CompSize}->add(length $outBuffer) ; $self->outputPayload($outBuffer) or return 0; return 1; } sub flush { my $self = shift ; $self->_flushCompressed(@_) or return 0; if ( defined *$self->{FH} ) { defined *$self->{FH}->flush() or return $self->saveErrorString(0, $!, $!); } return 1; } sub beforePayload { } sub _newStream { my $self = shift ; my $got = shift; my $class = ref $self; $self->_writeTrailer() or return 0 ; $self->ckParams($got) or $self->croakError("newStream: $self->{Error}"); if ($got->getValue('encode')) { my $want_encoding = $got->getValue('encode'); *$self->{Encoding} = IO::Compress::Base::Common::getEncoding($self, $class, $want_encoding); } else { *$self->{Encoding} = undef; } *$self->{Compress} = $self->mkComp($got) or return 0; *$self->{Header} = $self->mkHeader($got) ; $self->output(*$self->{Header} ) or return 0; *$self->{UnCompSize}->reset(); *$self->{CompSize}->reset(); $self->beforePayload(); return 1 ; } sub newStream { my $self = shift ; my $got = $self->checkParams('newStream', *$self->{Got}, @_) or return 0 ; $self->_newStream($got); # *$self->{Compress} = $self->mkComp($got) # or return 0; # # *$self->{Header} = $self->mkHeader($got) ; # $self->output(*$self->{Header} ) # or return 0; # # *$self->{UnCompSize}->reset(); # *$self->{CompSize}->reset(); # # $self->beforePayload(); # # return 1 ; } sub reset { my $self = shift ; return *$self->{Compress}->reset() ; } sub _writeTrailer { my $self = shift ; my $trailer = ''; my $status = *$self->{Compress}->close($trailer) ; return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; *$self->{CompSize}->add(length $trailer) ; $trailer .= $self->mkTrailer(); defined $trailer or return 0; return $self->output($trailer); } sub _writeFinalTrailer { my $self = shift ; return $self->output($self->mkFinalTrailer()); } sub close { my $self = shift ; return 1 if *$self->{Closed} || ! *$self->{Compress} ; *$self->{Closed} = 1 ; untie *$self if $] >= 5.008 ; *$self->{FlushPending} = 1 ; $self->_writeTrailer() or return 0 ; $self->_writeFinalTrailer() or return 0 ; $self->output( "", 1 ) or return 0; if (defined *$self->{FH}) { if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) { $! = 0 ; *$self->{FH}->close() or return $self->saveErrorString(0, $!, $!); } delete *$self->{FH} ; # This delete can set $! in older Perls, so reset the errno $! = 0 ; } return 1; } #sub total_in #sub total_out #sub msg # #sub crc #{ # my $self = shift ; # return *$self->{Compress}->crc32() ; #} # #sub msg #{ # my $self = shift ; # return *$self->{Compress}->msg() ; #} # #sub dict_adler #{ # my $self = shift ; # return *$self->{Compress}->dict_adler() ; #} # #sub get_Level #{ # my $self = shift ; # return *$self->{Compress}->get_Level() ; #} # #sub get_Strategy #{ # my $self = shift ; # return *$self->{Compress}->get_Strategy() ; #} sub tell { my $self = shift ; return *$self->{UnCompSize}->get32bit() ; } sub eof { my $self = shift ; return *$self->{Closed} ; } sub seek { my $self = shift ; my $position = shift; my $whence = shift ; my $here = $self->tell() ; my $target = 0 ; #use IO::Handle qw(SEEK_SET SEEK_CUR SEEK_END); use IO::Handle ; if ($whence == IO::Handle::SEEK_SET) { $target = $position ; } elsif ($whence == IO::Handle::SEEK_CUR || $whence == IO::Handle::SEEK_END) { $target = $here + $position ; } else { $self->croakError(*$self->{ClassName} . "::seek: unknown value, $whence, for whence parameter"); } # short circuit if seeking to current offset return 1 if $target == $here ; # Outlaw any attempt to seek backwards $self->croakError(*$self->{ClassName} . "::seek: cannot seek backwards") if $target < $here ; # Walk the file to the new offset my $offset = $target - $here ; my $buffer ; defined $self->syswrite("\x00" x $offset) or return 0; return 1 ; } sub binmode { 1; # my $self = shift ; # return defined *$self->{FH} # ? binmode *$self->{FH} # : 1 ; } sub fileno { my $self = shift ; return defined *$self->{FH} ? *$self->{FH}->fileno() : undef ; } sub opened { my $self = shift ; return ! *$self->{Closed} ; } sub autoflush { my $self = shift ; return defined *$self->{FH} ? *$self->{FH}->autoflush(@_) : undef ; } sub input_line_number { return undef ; } sub _notAvailable { my $name = shift ; return sub { Carp::croak "$name Not Available: File opened only for output" ; } ; } *read = _notAvailable('read'); *READ = _notAvailable('read'); *readline = _notAvailable('readline'); *READLINE = _notAvailable('readline'); *getc = _notAvailable('getc'); *GETC = _notAvailable('getc'); *FILENO = \&fileno; *PRINT = \&print; *PRINTF = \&printf; *WRITE = \&syswrite; *write = \&syswrite; *SEEK = \&seek; *TELL = \&tell; *EOF = \&eof; *CLOSE = \&close; *BINMODE = \&binmode; #*sysread = \&_notAvailable; #*syswrite = \&_write; 1; __END__ #line 1049 FILE#0ebf7b0e/IO/Compress/Base/Common.pmZ#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Compress/Base/Common.pm" package IO::Compress::Base::Common; use strict ; use warnings; use bytes; use Carp; use Scalar::Util qw(blessed readonly); use File::GlobMapper; require Exporter; our ($VERSION, @ISA, @EXPORT, %EXPORT_TAGS, $HAS_ENCODE); @ISA = qw(Exporter); $VERSION = '2.066'; @EXPORT = qw( isaFilehandle isaFilename isaScalar whatIsInput whatIsOutput isaFileGlobString cleanFileGlobString oneTarget setBinModeInput setBinModeOutput ckInOutParams createSelfTiedObject isGeMax32 MAX32 WANT_CODE WANT_EXT WANT_UNDEF WANT_HASH STATUS_OK STATUS_ENDSTREAM STATUS_EOF STATUS_ERROR ); %EXPORT_TAGS = ( Status => [qw( STATUS_OK STATUS_ENDSTREAM STATUS_EOF STATUS_ERROR )]); use constant STATUS_OK => 0; use constant STATUS_ENDSTREAM => 1; use constant STATUS_EOF => 2; use constant STATUS_ERROR => -1; use constant MAX16 => 0xFFFF ; use constant MAX32 => 0xFFFFFFFF ; use constant MAX32cmp => 0xFFFFFFFF + 1 - 1; # for 5.6.x on 32-bit need to force an non-IV value sub isGeMax32 { return $_[0] >= MAX32cmp ; } sub hasEncode() { if (! defined $HAS_ENCODE) { eval { require Encode; Encode->import(); }; $HAS_ENCODE = $@ ? 0 : 1 ; } return $HAS_ENCODE; } sub getEncoding($$$) { my $obj = shift; my $class = shift ; my $want_encoding = shift ; $obj->croakError("$class: Encode module needed to use -Encode") if ! hasEncode(); my $encoding = Encode::find_encoding($want_encoding); $obj->croakError("$class: Encoding '$want_encoding' is not available") if ! $encoding; return $encoding; } our ($needBinmode); $needBinmode = ($^O eq 'MSWin32' || ($] >= 5.006 && eval ' ${^UNICODE} || ${^UTF8LOCALE} ')) ? 1 : 1 ; sub setBinModeInput($) { my $handle = shift ; binmode $handle if $needBinmode; } sub setBinModeOutput($) { my $handle = shift ; binmode $handle if $needBinmode; } sub isaFilehandle($) { use utf8; # Pragma needed to keep Perl 5.6.0 happy return (defined $_[0] and (UNIVERSAL::isa($_[0],'GLOB') or UNIVERSAL::isa($_[0],'IO::Handle') or UNIVERSAL::isa(\$_[0],'GLOB')) ) } sub isaScalar { return ( defined($_[0]) and ref($_[0]) eq 'SCALAR' and defined ${ $_[0] } ) ; } sub isaFilename($) { return (defined $_[0] and ! ref $_[0] and UNIVERSAL::isa(\$_[0], 'SCALAR')); } sub isaFileGlobString { return defined $_[0] && $_[0] =~ /^<.*>$/; } sub cleanFileGlobString { my $string = shift ; $string =~ s/^\s*<\s*(.*)\s*>\s*$/$1/; return $string; } use constant WANT_CODE => 1 ; use constant WANT_EXT => 2 ; use constant WANT_UNDEF => 4 ; #use constant WANT_HASH => 8 ; use constant WANT_HASH => 0 ; sub whatIsInput($;$) { my $got = whatIs(@_); if (defined $got && $got eq 'filename' && defined $_[0] && $_[0] eq '-') { #use IO::File; $got = 'handle'; $_[0] = *STDIN; #$_[0] = new IO::File("<-"); } return $got; } sub whatIsOutput($;$) { my $got = whatIs(@_); if (defined $got && $got eq 'filename' && defined $_[0] && $_[0] eq '-') { $got = 'handle'; $_[0] = *STDOUT; #$_[0] = new IO::File(">-"); } return $got; } sub whatIs ($;$) { return 'handle' if isaFilehandle($_[0]); my $wantCode = defined $_[1] && $_[1] & WANT_CODE ; my $extended = defined $_[1] && $_[1] & WANT_EXT ; my $undef = defined $_[1] && $_[1] & WANT_UNDEF ; my $hash = defined $_[1] && $_[1] & WANT_HASH ; return 'undef' if ! defined $_[0] && $undef ; if (ref $_[0]) { return '' if blessed($_[0]); # is an object #return '' if UNIVERSAL::isa($_[0], 'UNIVERSAL'); # is an object return 'buffer' if UNIVERSAL::isa($_[0], 'SCALAR'); return 'array' if UNIVERSAL::isa($_[0], 'ARRAY') && $extended ; return 'hash' if UNIVERSAL::isa($_[0], 'HASH') && $hash ; return 'code' if UNIVERSAL::isa($_[0], 'CODE') && $wantCode ; return ''; } return 'fileglob' if $extended && isaFileGlobString($_[0]); return 'filename'; } sub oneTarget { return $_[0] =~ /^(code|handle|buffer|filename)$/; } sub IO::Compress::Base::Validator::new { my $class = shift ; my $Class = shift ; my $error_ref = shift ; my $reportClass = shift ; my %data = (Class => $Class, Error => $error_ref, reportClass => $reportClass, ) ; my $obj = bless \%data, $class ; local $Carp::CarpLevel = 1; my $inType = $data{inType} = whatIsInput($_[0], WANT_EXT|WANT_HASH); my $outType = $data{outType} = whatIsOutput($_[1], WANT_EXT|WANT_HASH); my $oneInput = $data{oneInput} = oneTarget($inType); my $oneOutput = $data{oneOutput} = oneTarget($outType); if (! $inType) { $obj->croakError("$reportClass: illegal input parameter") ; #return undef ; } # if ($inType eq 'hash') # { # $obj->{Hash} = 1 ; # $obj->{oneInput} = 1 ; # return $obj->validateHash($_[0]); # } if (! $outType) { $obj->croakError("$reportClass: illegal output parameter") ; #return undef ; } if ($inType ne 'fileglob' && $outType eq 'fileglob') { $obj->croakError("Need input fileglob for outout fileglob"); } # if ($inType ne 'fileglob' && $outType eq 'hash' && $inType ne 'filename' ) # { # $obj->croakError("input must ne filename or fileglob when output is a hash"); # } if ($inType eq 'fileglob' && $outType eq 'fileglob') { $data{GlobMap} = 1 ; $data{inType} = $data{outType} = 'filename'; my $mapper = new File::GlobMapper($_[0], $_[1]); if ( ! $mapper ) { return $obj->saveErrorString($File::GlobMapper::Error) ; } $data{Pairs} = $mapper->getFileMap(); return $obj; } $obj->croakError("$reportClass: input and output $inType are identical") if $inType eq $outType && $_[0] eq $_[1] && $_[0] ne '-' ; if ($inType eq 'fileglob') # && $outType ne 'fileglob' { my $glob = cleanFileGlobString($_[0]); my @inputs = glob($glob); if (@inputs == 0) { # TODO -- legal or die? die "globmap matched zero file -- legal or die???" ; } elsif (@inputs == 1) { $obj->validateInputFilenames($inputs[0]) or return undef; $_[0] = $inputs[0] ; $data{inType} = 'filename' ; $data{oneInput} = 1; } else { $obj->validateInputFilenames(@inputs) or return undef; $_[0] = [ @inputs ] ; $data{inType} = 'filenames' ; } } elsif ($inType eq 'filename') { $obj->validateInputFilenames($_[0]) or return undef; } elsif ($inType eq 'array') { $data{inType} = 'filenames' ; $obj->validateInputArray($_[0]) or return undef ; } return $obj->saveErrorString("$reportClass: output buffer is read-only") if $outType eq 'buffer' && readonly(${ $_[1] }); if ($outType eq 'filename' ) { $obj->croakError("$reportClass: output filename is undef or null string") if ! defined $_[1] || $_[1] eq '' ; if (-e $_[1]) { if (-d _ ) { return $obj->saveErrorString("output file '$_[1]' is a directory"); } } } return $obj ; } sub IO::Compress::Base::Validator::saveErrorString { my $self = shift ; ${ $self->{Error} } = shift ; return undef; } sub IO::Compress::Base::Validator::croakError { my $self = shift ; $self->saveErrorString($_[0]); croak $_[0]; } sub IO::Compress::Base::Validator::validateInputFilenames { my $self = shift ; foreach my $filename (@_) { $self->croakError("$self->{reportClass}: input filename is undef or null string") if ! defined $filename || $filename eq '' ; next if $filename eq '-'; if (! -e $filename ) { return $self->saveErrorString("input file '$filename' does not exist"); } if (-d _ ) { return $self->saveErrorString("input file '$filename' is a directory"); } # if (! -r _ ) # { # return $self->saveErrorString("cannot open file '$filename': $!"); # } } return 1 ; } sub IO::Compress::Base::Validator::validateInputArray { my $self = shift ; if ( @{ $_[0] } == 0 ) { return $self->saveErrorString("empty array reference") ; } foreach my $element ( @{ $_[0] } ) { my $inType = whatIsInput($element); if (! $inType) { $self->croakError("unknown input parameter") ; } elsif($inType eq 'filename') { $self->validateInputFilenames($element) or return undef ; } else { $self->croakError("not a filename") ; } } return 1 ; } #sub IO::Compress::Base::Validator::validateHash #{ # my $self = shift ; # my $href = shift ; # # while (my($k, $v) = each %$href) # { # my $ktype = whatIsInput($k); # my $vtype = whatIsOutput($v, WANT_EXT|WANT_UNDEF) ; # # if ($ktype ne 'filename') # { # return $self->saveErrorString("hash key not filename") ; # } # # my %valid = map { $_ => 1 } qw(filename buffer array undef handle) ; # if (! $valid{$vtype}) # { # return $self->saveErrorString("hash value not ok") ; # } # } # # return $self ; #} sub createSelfTiedObject { my $class = shift || (caller)[0] ; my $error_ref = shift ; my $obj = bless Symbol::gensym(), ref($class) || $class; tie *$obj, $obj if $] >= 5.005; *$obj->{Closed} = 1 ; $$error_ref = ''; *$obj->{Error} = $error_ref ; my $errno = 0 ; *$obj->{ErrorNo} = \$errno ; return $obj; } #package Parse::Parameters ; # # #require Exporter; #our ($VERSION, @ISA, @EXPORT); #$VERSION = '2.000_08'; #@ISA = qw(Exporter); $EXPORT_TAGS{Parse} = [qw( ParseParameters Parse_any Parse_unsigned Parse_signed Parse_boolean Parse_string Parse_code Parse_writable_scalar ) ]; push @EXPORT, @{ $EXPORT_TAGS{Parse} } ; use constant Parse_any => 0x01; use constant Parse_unsigned => 0x02; use constant Parse_signed => 0x04; use constant Parse_boolean => 0x08; use constant Parse_string => 0x10; use constant Parse_code => 0x20; #use constant Parse_store_ref => 0x100 ; #use constant Parse_multiple => 0x100 ; use constant Parse_writable => 0x200 ; use constant Parse_writable_scalar => 0x400 | Parse_writable ; use constant OFF_PARSED => 0 ; use constant OFF_TYPE => 1 ; use constant OFF_DEFAULT => 2 ; use constant OFF_FIXED => 3 ; #use constant OFF_FIRST_ONLY => 4 ; #use constant OFF_STICKY => 5 ; use constant IxError => 0; use constant IxGot => 1 ; sub ParseParameters { my $level = shift || 0 ; my $sub = (caller($level + 1))[3] ; local $Carp::CarpLevel = 1 ; return $_[1] if @_ == 2 && defined $_[1] && UNIVERSAL::isa($_[1], "IO::Compress::Base::Parameters"); my $p = new IO::Compress::Base::Parameters() ; $p->parse(@_) or croak "$sub: $p->[IxError]" ; return $p; } use strict; use warnings; use Carp; sub Init { my $default = shift ; my %got ; my $obj = IO::Compress::Base::Parameters::new(); while (my ($key, $v) = each %$default) { croak "need 2 params [@$v]" if @$v != 2 ; my ($type, $value) = @$v ; # my ($first_only, $sticky, $type, $value) = @$v ; my $sticky = 0; my $x ; $obj->_checkType($key, \$value, $type, 0, \$x) or return undef ; $key = lc $key; # if (! $sticky) { # $x = [] # if $type & Parse_multiple; # $got{$key} = [0, $type, $value, $x, $first_only, $sticky] ; $got{$key} = [0, $type, $value, $x] ; # } # # $got{$key}[OFF_PARSED] = 0 ; } return bless \%got, "IO::Compress::Base::Parameters::Defaults" ; } sub IO::Compress::Base::Parameters::new { #my $class = shift ; my $obj; $obj->[IxError] = ''; $obj->[IxGot] = {} ; return bless $obj, 'IO::Compress::Base::Parameters' ; } sub IO::Compress::Base::Parameters::setError { my $self = shift ; my $error = shift ; my $retval = @_ ? shift : undef ; $self->[IxError] = $error ; return $retval; } sub IO::Compress::Base::Parameters::getError { my $self = shift ; return $self->[IxError] ; } sub IO::Compress::Base::Parameters::parse { my $self = shift ; my $default = shift ; my $got = $self->[IxGot] ; my $firstTime = keys %{ $got } == 0 ; my (@Bad) ; my @entered = () ; # Allow the options to be passed as a hash reference or # as the complete hash. if (@_ == 0) { @entered = () ; } elsif (@_ == 1) { my $href = $_[0] ; return $self->setError("Expected even number of parameters, got 1") if ! defined $href or ! ref $href or ref $href ne "HASH" ; foreach my $key (keys %$href) { push @entered, $key ; push @entered, \$href->{$key} ; } } else { my $count = @_; return $self->setError("Expected even number of parameters, got $count") if $count % 2 != 0 ; for my $i (0.. $count / 2 - 1) { push @entered, $_[2 * $i] ; push @entered, \$_[2 * $i + 1] ; } } foreach my $key (keys %$default) { my ($type, $value) = @{ $default->{$key} } ; if ($firstTime) { $got->{$key} = [0, $type, $value, $value] ; } else { $got->{$key}[OFF_PARSED] = 0 ; } } my %parsed = (); for my $i (0.. @entered / 2 - 1) { my $key = $entered[2* $i] ; my $value = $entered[2* $i+1] ; #print "Key [$key] Value [$value]" ; #print defined $$value ? "[$$value]\n" : "[undef]\n"; $key =~ s/^-// ; my $canonkey = lc $key; if ($got->{$canonkey}) { my $type = $got->{$canonkey}[OFF_TYPE] ; my $parsed = $parsed{$canonkey}; ++ $parsed{$canonkey}; return $self->setError("Muliple instances of '$key' found") if $parsed ; my $s ; $self->_checkType($key, $value, $type, 1, \$s) or return undef ; $value = $$value ; $got->{$canonkey} = [1, $type, $value, $s] ; } else { push (@Bad, $key) } } if (@Bad) { my ($bad) = join(", ", @Bad) ; return $self->setError("unknown key value(s) $bad") ; } return 1; } sub IO::Compress::Base::Parameters::_checkType { my $self = shift ; my $key = shift ; my $value = shift ; my $type = shift ; my $validate = shift ; my $output = shift; #local $Carp::CarpLevel = $level ; #print "PARSE $type $key $value $validate $sub\n" ; if ($type & Parse_writable_scalar) { return $self->setError("Parameter '$key' not writable") if readonly $$value ; if (ref $$value) { return $self->setError("Parameter '$key' not a scalar reference") if ref $$value ne 'SCALAR' ; $$output = $$value ; } else { return $self->setError("Parameter '$key' not a scalar") if ref $value ne 'SCALAR' ; $$output = $value ; } return 1; } $value = $$value ; if ($type & Parse_any) { $$output = $value ; return 1; } elsif ($type & Parse_unsigned) { return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'") if ! defined $value ; return $self->setError("Parameter '$key' must be an unsigned int, got '$value'") if $value !~ /^\d+$/; $$output = defined $value ? $value : 0 ; return 1; } elsif ($type & Parse_signed) { return $self->setError("Parameter '$key' must be a signed int, got 'undef'") if ! defined $value ; return $self->setError("Parameter '$key' must be a signed int, got '$value'") if $value !~ /^-?\d+$/; $$output = defined $value ? $value : 0 ; return 1 ; } elsif ($type & Parse_boolean) { return $self->setError("Parameter '$key' must be an int, got '$value'") if defined $value && $value !~ /^\d*$/; $$output = defined $value && $value != 0 ? 1 : 0 ; return 1; } elsif ($type & Parse_string) { $$output = defined $value ? $value : "" ; return 1; } elsif ($type & Parse_code) { return $self->setError("Parameter '$key' must be a code reference, got '$value'") if (! defined $value || ref $value ne 'CODE') ; $$output = defined $value ? $value : "" ; return 1; } $$output = $value ; return 1; } sub IO::Compress::Base::Parameters::parsed { return $_[0]->[IxGot]{$_[1]}[OFF_PARSED] ; } sub IO::Compress::Base::Parameters::getValue { return $_[0]->[IxGot]{$_[1]}[OFF_FIXED] ; } sub IO::Compress::Base::Parameters::setValue { $_[0]->[IxGot]{$_[1]}[OFF_PARSED] = 1; $_[0]->[IxGot]{$_[1]}[OFF_DEFAULT] = $_[2] ; $_[0]->[IxGot]{$_[1]}[OFF_FIXED] = $_[2] ; } sub IO::Compress::Base::Parameters::valueRef { return $_[0]->[IxGot]{$_[1]}[OFF_FIXED] ; } sub IO::Compress::Base::Parameters::valueOrDefault { my $self = shift ; my $name = shift ; my $default = shift ; my $value = $self->[IxGot]{$name}[OFF_DEFAULT] ; return $value if defined $value ; return $default ; } sub IO::Compress::Base::Parameters::wantValue { return defined $_[0]->[IxGot]{$_[1]}[OFF_DEFAULT] ; } sub IO::Compress::Base::Parameters::clone { my $self = shift ; my $obj = [] ; my %got ; my $hash = $self->[IxGot] ; for my $k (keys %{ $hash }) { $got{$k} = [ @{ $hash->{$k} } ]; } $obj->[IxError] = $self->[IxError]; $obj->[IxGot] = \%got ; return bless $obj, 'IO::Compress::Base::Parameters' ; } package U64; use constant MAX32 => 0xFFFFFFFF ; use constant HI_1 => MAX32 + 1 ; use constant LOW => 0 ; use constant HIGH => 1; sub new { return bless [ 0, 0 ], $_[0] if @_ == 1 ; return bless [ $_[1], 0 ], $_[0] if @_ == 2 ; return bless [ $_[2], $_[1] ], $_[0] if @_ == 3 ; } sub newUnpack_V64 { my ($low, $hi) = unpack "V V", $_[0] ; bless [ $low, $hi ], "U64"; } sub newUnpack_V32 { my $string = shift; my $low = unpack "V", $string ; bless [ $low, 0 ], "U64"; } sub reset { $_[0]->[HIGH] = $_[0]->[LOW] = 0; } sub clone { bless [ @{$_[0]} ], ref $_[0] ; } sub getHigh { return $_[0]->[HIGH]; } sub getLow { return $_[0]->[LOW]; } sub get32bit { return $_[0]->[LOW]; } sub get64bit { # Not using << here because the result will still be # a 32-bit value on systems where int size is 32-bits return $_[0]->[HIGH] * HI_1 + $_[0]->[LOW]; } sub add { # my $self = shift; my $value = $_[1]; if (ref $value eq 'U64') { $_[0]->[HIGH] += $value->[HIGH] ; $value = $value->[LOW]; } elsif ($value > MAX32) { $_[0]->[HIGH] += int($value / HI_1) ; $value = $value % HI_1; } my $available = MAX32 - $_[0]->[LOW] ; if ($value > $available) { ++ $_[0]->[HIGH] ; $_[0]->[LOW] = $value - $available - 1; } else { $_[0]->[LOW] += $value ; } } sub add32 { # my $self = shift; my $value = $_[1]; if ($value > MAX32) { $_[0]->[HIGH] += int($value / HI_1) ; $value = $value % HI_1; } my $available = MAX32 - $_[0]->[LOW] ; if ($value > $available) { ++ $_[0]->[HIGH] ; $_[0]->[LOW] = $value - $available - 1; } else { $_[0]->[LOW] += $value ; } } sub subtract { my $self = shift; my $value = shift; if (ref $value eq 'U64') { if ($value->[HIGH]) { die "bad" if $self->[HIGH] == 0 || $value->[HIGH] > $self->[HIGH] ; $self->[HIGH] -= $value->[HIGH] ; } $value = $value->[LOW] ; } if ($value > $self->[LOW]) { -- $self->[HIGH] ; $self->[LOW] = MAX32 - $value + $self->[LOW] + 1 ; } else { $self->[LOW] -= $value; } } sub equal { my $self = shift; my $other = shift; return $self->[LOW] == $other->[LOW] && $self->[HIGH] == $other->[HIGH] ; } sub gt { my $self = shift; my $other = shift; return $self->cmp($other) > 0 ; } sub cmp { my $self = shift; my $other = shift ; if ($self->[LOW] == $other->[LOW]) { return $self->[HIGH] - $other->[HIGH] ; } else { return $self->[LOW] - $other->[LOW] ; } } sub is64bit { return $_[0]->[HIGH] > 0 ; } sub isAlmost64bit { return $_[0]->[HIGH] > 0 || $_[0]->[LOW] == MAX32 ; } sub getPacked_V64 { return pack "V V", @{ $_[0] } ; } sub getPacked_V32 { return pack "V", $_[0]->[LOW] ; } sub pack_V64 { return pack "V V", $_[0], 0; } sub full32 { return $_[0] == MAX32 ; } sub Value_VV64 { my $buffer = shift; my ($lo, $hi) = unpack ("V V" , $buffer); no warnings 'uninitialized'; return $hi * HI_1 + $lo; } package IO::Compress::Base::Common; 1; FILEbba060f4/IO/Compress/Gzip.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Compress/Gzip.pm" package IO::Compress::Gzip ; require 5.006 ; use strict ; use warnings; use bytes; require Exporter ; use IO::Compress::RawDeflate 2.066 () ; use IO::Compress::Adapter::Deflate 2.066 ; use IO::Compress::Base::Common 2.066 qw(:Status ); use IO::Compress::Gzip::Constants 2.066 ; use IO::Compress::Zlib::Extra 2.066 ; BEGIN { if (defined &utf8::downgrade ) { *noUTF8 = \&utf8::downgrade } else { *noUTF8 = sub {} } } our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $GzipError); $VERSION = '2.066'; $GzipError = '' ; @ISA = qw(Exporter IO::Compress::RawDeflate); @EXPORT_OK = qw( $GzipError gzip ) ; %EXPORT_TAGS = %IO::Compress::RawDeflate::DEFLATE_CONSTANTS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$GzipError); $obj->_create(undef, @_); } sub gzip { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$GzipError); return $obj->_def(@_); } #sub newHeader #{ # my $self = shift ; # #return GZIP_MINIMUM_HEADER ; # return $self->mkHeader(*$self->{Got}); #} sub getExtraParams { my $self = shift ; return ( # zlib behaviour $self->getZlibParams(), # Gzip header fields 'minimal' => [IO::Compress::Base::Common::Parse_boolean, 0], 'comment' => [IO::Compress::Base::Common::Parse_any, undef], 'name' => [IO::Compress::Base::Common::Parse_any, undef], 'time' => [IO::Compress::Base::Common::Parse_any, undef], 'textflag' => [IO::Compress::Base::Common::Parse_boolean, 0], 'headercrc' => [IO::Compress::Base::Common::Parse_boolean, 0], 'os_code' => [IO::Compress::Base::Common::Parse_unsigned, $Compress::Raw::Zlib::gzip_os_code], 'extrafield'=> [IO::Compress::Base::Common::Parse_any, undef], 'extraflags'=> [IO::Compress::Base::Common::Parse_any, undef], ); } sub ckParams { my $self = shift ; my $got = shift ; # gzip always needs crc32 $got->setValue('crc32' => 1); return 1 if $got->getValue('merge') ; my $strict = $got->getValue('strict') ; { if (! $got->parsed('time') ) { # Modification time defaults to now. $got->setValue(time => time) ; } # Check that the Name & Comment don't have embedded NULLs # Also check that they only contain ISO 8859-1 chars. if ($got->parsed('name') && defined $got->getValue('name')) { my $name = $got->getValue('name'); return $self->saveErrorString(undef, "Null Character found in Name", Z_DATA_ERROR) if $strict && $name =~ /\x00/ ; return $self->saveErrorString(undef, "Non ISO 8859-1 Character found in Name", Z_DATA_ERROR) if $strict && $name =~ /$GZIP_FNAME_INVALID_CHAR_RE/o ; } if ($got->parsed('comment') && defined $got->getValue('comment')) { my $comment = $got->getValue('comment'); return $self->saveErrorString(undef, "Null Character found in Comment", Z_DATA_ERROR) if $strict && $comment =~ /\x00/ ; return $self->saveErrorString(undef, "Non ISO 8859-1 Character found in Comment", Z_DATA_ERROR) if $strict && $comment =~ /$GZIP_FCOMMENT_INVALID_CHAR_RE/o; } if ($got->parsed('os_code') ) { my $value = $got->getValue('os_code'); return $self->saveErrorString(undef, "OS_Code must be between 0 and 255, got '$value'") if $value < 0 || $value > 255 ; } # gzip only supports Deflate at present $got->setValue('method' => Z_DEFLATED) ; if ( ! $got->parsed('extraflags')) { $got->setValue('extraflags' => 2) if $got->getValue('level') == Z_BEST_COMPRESSION ; $got->setValue('extraflags' => 4) if $got->getValue('level') == Z_BEST_SPEED ; } my $data = $got->getValue('extrafield') ; if (defined $data) { my $bad = IO::Compress::Zlib::Extra::parseExtraField($data, $strict, 1) ; return $self->saveErrorString(undef, "Error with ExtraField Parameter: $bad", Z_DATA_ERROR) if $bad ; $got->setValue('extrafield' => $data) ; } } return 1; } sub mkTrailer { my $self = shift ; return pack("V V", *$self->{Compress}->crc32(), *$self->{UnCompSize}->get32bit()); } sub getInverseClass { return ('IO::Uncompress::Gunzip', \$IO::Uncompress::Gunzip::GunzipError); } sub getFileInfo { my $self = shift ; my $params = shift; my $filename = shift ; return if IO::Compress::Base::Common::isaScalar($filename); my $defaultTime = (stat($filename))[9] ; $params->setValue('name' => $filename) if ! $params->parsed('name') ; $params->setValue('time' => $defaultTime) if ! $params->parsed('time') ; } sub mkHeader { my $self = shift ; my $param = shift ; # short-circuit if a minimal header is requested. return GZIP_MINIMUM_HEADER if $param->getValue('minimal') ; # METHOD my $method = $param->valueOrDefault('method', GZIP_CM_DEFLATED) ; # FLAGS my $flags = GZIP_FLG_DEFAULT ; $flags |= GZIP_FLG_FTEXT if $param->getValue('textflag') ; $flags |= GZIP_FLG_FHCRC if $param->getValue('headercrc') ; $flags |= GZIP_FLG_FEXTRA if $param->wantValue('extrafield') ; $flags |= GZIP_FLG_FNAME if $param->wantValue('name') ; $flags |= GZIP_FLG_FCOMMENT if $param->wantValue('comment') ; # MTIME my $time = $param->valueOrDefault('time', GZIP_MTIME_DEFAULT) ; # EXTRA FLAGS my $extra_flags = $param->valueOrDefault('extraflags', GZIP_XFL_DEFAULT); # OS CODE my $os_code = $param->valueOrDefault('os_code', GZIP_OS_DEFAULT) ; my $out = pack("C4 V C C", GZIP_ID1, # ID1 GZIP_ID2, # ID2 $method, # Compression Method $flags, # Flags $time, # Modification Time $extra_flags, # Extra Flags $os_code, # Operating System Code ) ; # EXTRA if ($flags & GZIP_FLG_FEXTRA) { my $extra = $param->getValue('extrafield') ; $out .= pack("v", length $extra) . $extra ; } # NAME if ($flags & GZIP_FLG_FNAME) { my $name .= $param->getValue('name') ; $name =~ s/\x00.*$//; $out .= $name ; # Terminate the filename with NULL unless it already is $out .= GZIP_NULL_BYTE if !length $name or substr($name, 1, -1) ne GZIP_NULL_BYTE ; } # COMMENT if ($flags & GZIP_FLG_FCOMMENT) { my $comment .= $param->getValue('comment') ; $comment =~ s/\x00.*$//; $out .= $comment ; # Terminate the comment with NULL unless it already is $out .= GZIP_NULL_BYTE if ! length $comment or substr($comment, 1, -1) ne GZIP_NULL_BYTE; } # HEADER CRC $out .= pack("v", Compress::Raw::Zlib::crc32($out) & 0x00FF ) if $param->getValue('headercrc') ; noUTF8($out); return $out ; } sub mkFinalTrailer { return ''; } 1; __END__ #line 1252 FILE&920ae285/IO/Compress/Gzip/Constants.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Compress/Gzip/Constants.pm" package IO::Compress::Gzip::Constants; use strict ; use warnings; use bytes; require Exporter; our ($VERSION, @ISA, @EXPORT, %GZIP_OS_Names); our ($GZIP_FNAME_INVALID_CHAR_RE, $GZIP_FCOMMENT_INVALID_CHAR_RE); $VERSION = '2.066'; @ISA = qw(Exporter); @EXPORT= qw( GZIP_ID_SIZE GZIP_ID1 GZIP_ID2 GZIP_FLG_DEFAULT GZIP_FLG_FTEXT GZIP_FLG_FHCRC GZIP_FLG_FEXTRA GZIP_FLG_FNAME GZIP_FLG_FCOMMENT GZIP_FLG_RESERVED GZIP_CM_DEFLATED GZIP_MIN_HEADER_SIZE GZIP_TRAILER_SIZE GZIP_MTIME_DEFAULT GZIP_XFL_DEFAULT GZIP_FEXTRA_HEADER_SIZE GZIP_FEXTRA_MAX_SIZE GZIP_FEXTRA_SUBFIELD_HEADER_SIZE GZIP_FEXTRA_SUBFIELD_ID_SIZE GZIP_FEXTRA_SUBFIELD_LEN_SIZE GZIP_FEXTRA_SUBFIELD_MAX_SIZE $GZIP_FNAME_INVALID_CHAR_RE $GZIP_FCOMMENT_INVALID_CHAR_RE GZIP_FHCRC_SIZE GZIP_ISIZE_MAX GZIP_ISIZE_MOD_VALUE GZIP_NULL_BYTE GZIP_OS_DEFAULT %GZIP_OS_Names GZIP_MINIMUM_HEADER ); # Constant names derived from RFC 1952 use constant GZIP_ID_SIZE => 2 ; use constant GZIP_ID1 => 0x1F; use constant GZIP_ID2 => 0x8B; use constant GZIP_MIN_HEADER_SIZE => 10 ;# minimum gzip header size use constant GZIP_TRAILER_SIZE => 8 ; use constant GZIP_FLG_DEFAULT => 0x00 ; use constant GZIP_FLG_FTEXT => 0x01 ; use constant GZIP_FLG_FHCRC => 0x02 ; # called CONTINUATION in gzip use constant GZIP_FLG_FEXTRA => 0x04 ; use constant GZIP_FLG_FNAME => 0x08 ; use constant GZIP_FLG_FCOMMENT => 0x10 ; #use constant GZIP_FLG_ENCRYPTED => 0x20 ; # documented in gzip sources use constant GZIP_FLG_RESERVED => (0x20 | 0x40 | 0x80) ; use constant GZIP_XFL_DEFAULT => 0x00 ; use constant GZIP_MTIME_DEFAULT => 0x00 ; use constant GZIP_FEXTRA_HEADER_SIZE => 2 ; use constant GZIP_FEXTRA_MAX_SIZE => 0xFFFF ; use constant GZIP_FEXTRA_SUBFIELD_ID_SIZE => 2 ; use constant GZIP_FEXTRA_SUBFIELD_LEN_SIZE => 2 ; use constant GZIP_FEXTRA_SUBFIELD_HEADER_SIZE => GZIP_FEXTRA_SUBFIELD_ID_SIZE + GZIP_FEXTRA_SUBFIELD_LEN_SIZE; use constant GZIP_FEXTRA_SUBFIELD_MAX_SIZE => GZIP_FEXTRA_MAX_SIZE - GZIP_FEXTRA_SUBFIELD_HEADER_SIZE ; if (ord('A') == 193) { # EBCDIC $GZIP_FNAME_INVALID_CHAR_RE = '[\x00-\x3f\xff]'; $GZIP_FCOMMENT_INVALID_CHAR_RE = '[\x00-\x0a\x11-\x14\x16-\x3f\xff]'; } else { $GZIP_FNAME_INVALID_CHAR_RE = '[\x00-\x1F\x7F-\x9F]'; $GZIP_FCOMMENT_INVALID_CHAR_RE = '[\x00-\x09\x11-\x1F\x7F-\x9F]'; } use constant GZIP_FHCRC_SIZE => 2 ; # aka CONTINUATION in gzip use constant GZIP_CM_DEFLATED => 8 ; use constant GZIP_NULL_BYTE => "\x00"; use constant GZIP_ISIZE_MAX => 0xFFFFFFFF ; use constant GZIP_ISIZE_MOD_VALUE => GZIP_ISIZE_MAX + 1 ; # OS Names sourced from http://www.gzip.org/format.txt use constant GZIP_OS_DEFAULT=> 0xFF ; %GZIP_OS_Names = ( 0 => 'MS-DOS', 1 => 'Amiga', 2 => 'VMS', 3 => 'Unix', 4 => 'VM/CMS', 5 => 'Atari TOS', 6 => 'HPFS (OS/2, NT)', 7 => 'Macintosh', 8 => 'Z-System', 9 => 'CP/M', 10 => 'TOPS-20', 11 => 'NTFS (NT)', 12 => 'SMS QDOS', 13 => 'Acorn RISCOS', 14 => 'VFAT file system (Win95, NT)', 15 => 'MVS', 16 => 'BeOS', 17 => 'Tandem/NSK', 18 => 'THEOS', GZIP_OS_DEFAULT() => 'Unknown', ) ; use constant GZIP_MINIMUM_HEADER => pack("C4 V C C", GZIP_ID1, GZIP_ID2, GZIP_CM_DEFLATED, GZIP_FLG_DEFAULT, GZIP_MTIME_DEFAULT, GZIP_XFL_DEFAULT, GZIP_OS_DEFAULT) ; 1; FILE"24435f33/IO/Compress/RawDeflate.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Compress/RawDeflate.pm" package IO::Compress::RawDeflate ; # create RFC1951 # use strict ; use warnings; use bytes; use IO::Compress::Base 2.066 ; use IO::Compress::Base::Common 2.066 qw(:Status ); use IO::Compress::Adapter::Deflate 2.066 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %DEFLATE_CONSTANTS, %EXPORT_TAGS, $RawDeflateError); $VERSION = '2.066'; $RawDeflateError = ''; @ISA = qw(Exporter IO::Compress::Base); @EXPORT_OK = qw( $RawDeflateError rawdeflate ) ; push @EXPORT_OK, @IO::Compress::Adapter::Deflate::EXPORT_OK ; %EXPORT_TAGS = %IO::Compress::Adapter::Deflate::DEFLATE_CONSTANTS; { my %seen; foreach (keys %EXPORT_TAGS ) { push @{$EXPORT_TAGS{constants}}, grep { !$seen{$_}++ } @{ $EXPORT_TAGS{$_} } } $EXPORT_TAGS{all} = $EXPORT_TAGS{constants} ; } %DEFLATE_CONSTANTS = %EXPORT_TAGS; #push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$RawDeflateError); return $obj->_create(undef, @_); } sub rawdeflate { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$RawDeflateError); return $obj->_def(@_); } sub ckParams { my $self = shift ; my $got = shift; return 1 ; } sub mkComp { my $self = shift ; my $got = shift ; my ($obj, $errstr, $errno) = IO::Compress::Adapter::Deflate::mkCompObject( $got->getValue('crc32'), $got->getValue('adler32'), $got->getValue('level'), $got->getValue('strategy') ); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; return $obj; } sub mkHeader { my $self = shift ; return ''; } sub mkTrailer { my $self = shift ; return ''; } sub mkFinalTrailer { return ''; } #sub newHeader #{ # my $self = shift ; # return ''; #} sub getExtraParams { my $self = shift ; return getZlibParams(); } use IO::Compress::Base::Common 2.066 qw(:Parse); use Compress::Raw::Zlib 2.066 qw(Z_DEFLATED Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY); our %PARAMS = ( #'method' => [IO::Compress::Base::Common::Parse_unsigned, Z_DEFLATED], 'level' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_COMPRESSION], 'strategy' => [IO::Compress::Base::Common::Parse_signed, Z_DEFAULT_STRATEGY], 'crc32' => [IO::Compress::Base::Common::Parse_boolean, 0], 'adler32' => [IO::Compress::Base::Common::Parse_boolean, 0], 'merge' => [IO::Compress::Base::Common::Parse_boolean, 0], ); sub getZlibParams { return %PARAMS; } sub getInverseClass { return ('IO::Uncompress::RawInflate', \$IO::Uncompress::RawInflate::RawInflateError); } sub getFileInfo { my $self = shift ; my $params = shift; my $file = shift ; } use IO::Seekable qw(SEEK_SET); sub createMerge { my $self = shift ; my $outValue = shift ; my $outType = shift ; my ($invClass, $error_ref) = $self->getInverseClass(); eval "require $invClass" or die "aaaahhhh" ; my $inf = $invClass->new( $outValue, Transparent => 0, #Strict => 1, AutoClose => 0, Scan => 1) or return $self->saveErrorString(undef, "Cannot create InflateScan object: $$error_ref" ) ; my $end_offset = 0; $inf->scan() or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $inf->errorNo) ; $inf->zap($end_offset) or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $inf->errorNo) ; my $def = *$self->{Compress} = $inf->createDeflate(); *$self->{Header} = *$inf->{Info}{Header}; *$self->{UnCompSize} = *$inf->{UnCompSize}->clone(); *$self->{CompSize} = *$inf->{CompSize}->clone(); # TODO -- fix this #*$self->{CompSize} = new U64(0, *$self->{UnCompSize_32bit}); if ( $outType eq 'buffer') { substr( ${ *$self->{Buffer} }, $end_offset) = '' } elsif ($outType eq 'handle' || $outType eq 'filename') { *$self->{FH} = *$inf->{FH} ; delete *$inf->{FH}; *$self->{FH}->flush() ; *$self->{Handle} = 1 if $outType eq 'handle'; #seek(*$self->{FH}, $end_offset, SEEK_SET) *$self->{FH}->seek($end_offset, SEEK_SET) or return $self->saveErrorString(undef, $!, $!) ; } return $def ; } #### zlib specific methods sub deflateParams { my $self = shift ; my $level = shift ; my $strategy = shift ; my $status = *$self->{Compress}->deflateParams(Level => $level, Strategy => $strategy) ; return $self->saveErrorString(0, *$self->{Compress}{Error}, *$self->{Compress}{ErrorNo}) if $status == STATUS_ERROR; return 1; } 1; __END__ #line 996 FILE"23b6620d/IO/Compress/Zlib/Extra.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Compress/Zlib/Extra.pm" package IO::Compress::Zlib::Extra; require 5.006 ; use strict ; use warnings; use bytes; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS); $VERSION = '2.066'; use IO::Compress::Gzip::Constants 2.066 ; sub ExtraFieldError { return $_[0]; return "Error with ExtraField Parameter: $_[0]" ; } sub validateExtraFieldPair { my $pair = shift ; my $strict = shift; my $gzipMode = shift ; return ExtraFieldError("Not an array ref") unless ref $pair && ref $pair eq 'ARRAY'; return ExtraFieldError("SubField must have two parts") unless @$pair == 2 ; return ExtraFieldError("SubField ID is a reference") if ref $pair->[0] ; return ExtraFieldError("SubField Data is a reference") if ref $pair->[1] ; # ID is exactly two chars return ExtraFieldError("SubField ID not two chars long") unless length $pair->[0] == GZIP_FEXTRA_SUBFIELD_ID_SIZE ; # Check that the 2nd byte of the ID isn't 0 return ExtraFieldError("SubField ID 2nd byte is 0x00") if $strict && $gzipMode && substr($pair->[0], 1, 1) eq "\x00" ; return ExtraFieldError("SubField Data too long") if length $pair->[1] > GZIP_FEXTRA_SUBFIELD_MAX_SIZE ; return undef ; } sub parseRawExtra { my $data = shift ; my $extraRef = shift; my $strict = shift; my $gzipMode = shift ; #my $lax = shift ; #return undef # if $lax ; my $XLEN = length $data ; return ExtraFieldError("Too Large") if $XLEN > GZIP_FEXTRA_MAX_SIZE; my $offset = 0 ; while ($offset < $XLEN) { return ExtraFieldError("Truncated in FEXTRA Body Section") if $offset + GZIP_FEXTRA_SUBFIELD_HEADER_SIZE > $XLEN ; my $id = substr($data, $offset, GZIP_FEXTRA_SUBFIELD_ID_SIZE); $offset += GZIP_FEXTRA_SUBFIELD_ID_SIZE; my $subLen = unpack("v", substr($data, $offset, GZIP_FEXTRA_SUBFIELD_LEN_SIZE)); $offset += GZIP_FEXTRA_SUBFIELD_LEN_SIZE ; return ExtraFieldError("Truncated in FEXTRA Body Section") if $offset + $subLen > $XLEN ; my $bad = validateExtraFieldPair( [$id, substr($data, $offset, $subLen)], $strict, $gzipMode ); return $bad if $bad ; push @$extraRef, [$id => substr($data, $offset, $subLen)] if defined $extraRef;; $offset += $subLen ; } return undef ; } sub findID { my $id_want = shift ; my $data = shift; my $XLEN = length $data ; my $offset = 0 ; while ($offset < $XLEN) { return undef if $offset + GZIP_FEXTRA_SUBFIELD_HEADER_SIZE > $XLEN ; my $id = substr($data, $offset, GZIP_FEXTRA_SUBFIELD_ID_SIZE); $offset += GZIP_FEXTRA_SUBFIELD_ID_SIZE; my $subLen = unpack("v", substr($data, $offset, GZIP_FEXTRA_SUBFIELD_LEN_SIZE)); $offset += GZIP_FEXTRA_SUBFIELD_LEN_SIZE ; return undef if $offset + $subLen > $XLEN ; return substr($data, $offset, $subLen) if $id eq $id_want ; $offset += $subLen ; } return undef ; } sub mkSubField { my $id = shift ; my $data = shift ; return $id . pack("v", length $data) . $data ; } sub parseExtraField { my $dataRef = $_[0]; my $strict = $_[1]; my $gzipMode = $_[2]; #my $lax = @_ == 2 ? $_[1] : 1; # ExtraField can be any of # # -ExtraField => $data # # -ExtraField => [$id1, $data1, # $id2, $data2] # ... # ] # # -ExtraField => [ [$id1 => $data1], # [$id2 => $data2], # ... # ] # # -ExtraField => { $id1 => $data1, # $id2 => $data2, # ... # } if ( ! ref $dataRef ) { return undef if ! $strict; return parseRawExtra($dataRef, undef, 1, $gzipMode); } my $data = $dataRef; my $out = '' ; if (ref $data eq 'ARRAY') { if (ref $data->[0]) { foreach my $pair (@$data) { return ExtraFieldError("Not list of lists") unless ref $pair eq 'ARRAY' ; my $bad = validateExtraFieldPair($pair, $strict, $gzipMode) ; return $bad if $bad ; $out .= mkSubField(@$pair); } } else { return ExtraFieldError("Not even number of elements") unless @$data % 2 == 0; for (my $ix = 0; $ix <= @$data -1 ; $ix += 2) { my $bad = validateExtraFieldPair([$data->[$ix], $data->[$ix+1]], $strict, $gzipMode) ; return $bad if $bad ; $out .= mkSubField($data->[$ix], $data->[$ix+1]); } } } elsif (ref $data eq 'HASH') { while (my ($id, $info) = each %$data) { my $bad = validateExtraFieldPair([$id, $info], $strict, $gzipMode); return $bad if $bad ; $out .= mkSubField($id, $info); } } else { return ExtraFieldError("Not a scalar, array ref or hash ref") ; } return ExtraFieldError("Too Large") if length $out > GZIP_FEXTRA_MAX_SIZE; $_[0] = $out ; return undef; } 1; __END__ FILE)9745e981/IO/Uncompress/Adapter/Inflate.pm !#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Uncompress/Adapter/Inflate.pm" package IO::Uncompress::Adapter::Inflate; use strict; use warnings; #use bytes; use IO::Compress::Base::Common 2.066 qw(:Status); use Compress::Raw::Zlib 2.066 qw(Z_OK Z_BUF_ERROR Z_STREAM_END Z_FINISH MAX_WBITS); our ($VERSION); $VERSION = '2.066'; sub mkUncompObject { my $crc32 = shift || 1; my $adler32 = shift || 1; my $scan = shift || 0; my $inflate ; my $status ; if ($scan) { ($inflate, $status) = new Compress::Raw::Zlib::InflateScan #LimitOutput => 1, CRC32 => $crc32, ADLER32 => $adler32, WindowBits => - MAX_WBITS ; } else { ($inflate, $status) = new Compress::Raw::Zlib::Inflate AppendOutput => 1, LimitOutput => 1, CRC32 => $crc32, ADLER32 => $adler32, WindowBits => - MAX_WBITS ; } return (undef, "Could not create Inflation object: $status", $status) if $status != Z_OK ; return bless {'Inf' => $inflate, 'CompSize' => 0, 'UnCompSize' => 0, 'Error' => '', 'ConsumesInput' => 1, } ; } sub uncompr { my $self = shift ; my $from = shift ; my $to = shift ; my $eof = shift ; my $inf = $self->{Inf}; my $status = $inf->inflate($from, $to, $eof); $self->{ErrorNo} = $status; if ($status != Z_OK && $status != Z_STREAM_END && $status != Z_BUF_ERROR) { $self->{Error} = "Inflation Error: $status"; return STATUS_ERROR; } return STATUS_OK if $status == Z_BUF_ERROR ; # ??? return STATUS_OK if $status == Z_OK ; return STATUS_ENDSTREAM if $status == Z_STREAM_END ; return STATUS_ERROR ; } sub reset { my $self = shift ; $self->{Inf}->inflateReset(); return STATUS_OK ; } #sub count #{ # my $self = shift ; # $self->{Inf}->inflateCount(); #} sub crc32 { my $self = shift ; $self->{Inf}->crc32(); } sub compressedBytes { my $self = shift ; $self->{Inf}->compressedBytes(); } sub uncompressedBytes { my $self = shift ; $self->{Inf}->uncompressedBytes(); } sub adler32 { my $self = shift ; $self->{Inf}->adler32(); } sub sync { my $self = shift ; ( $self->{Inf}->inflateSync(@_) == Z_OK) ? STATUS_OK : STATUS_ERROR ; } sub getLastBlockOffset { my $self = shift ; $self->{Inf}->getLastBlockOffset(); } sub getEndOffset { my $self = shift ; $self->{Inf}->getEndOffset(); } sub resetLastBlockByte { my $self = shift ; $self->{Inf}->resetLastBlockByte(@_); } sub createDeflateStream { my $self = shift ; my $deflate = $self->{Inf}->createDeflateStream(@_); return bless {'Def' => $deflate, 'CompSize' => 0, 'UnCompSize' => 0, 'Error' => '', }, 'IO::Compress::Adapter::Deflate'; } 1; __END__ FILE552a6648/IO/Uncompress/Base.pm!#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Uncompress/Base.pm" package IO::Uncompress::Base ; use strict ; use warnings; #use bytes; our (@ISA, $VERSION, @EXPORT_OK, %EXPORT_TAGS); @ISA = qw(Exporter IO::File); $VERSION = '2.066'; use constant G_EOF => 0 ; use constant G_ERR => -1 ; use IO::Compress::Base::Common 2.066 ; use IO::File ; use Symbol; use Scalar::Util (); use List::Util (); use Carp ; %EXPORT_TAGS = ( ); push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; sub smartRead { my $self = $_[0]; my $out = $_[1]; my $size = $_[2]; $$out = "" ; my $offset = 0 ; my $status = 1; if (defined *$self->{InputLength}) { return 0 if *$self->{InputLengthRemaining} <= 0 ; $size = List::Util::min($size, *$self->{InputLengthRemaining}); } if ( length *$self->{Prime} ) { $$out = substr(*$self->{Prime}, 0, $size) ; substr(*$self->{Prime}, 0, $size) = '' ; if (length $$out == $size) { *$self->{InputLengthRemaining} -= length $$out if defined *$self->{InputLength}; return length $$out ; } $offset = length $$out ; } my $get_size = $size - $offset ; if (defined *$self->{FH}) { if ($offset) { # Not using this # # *$self->{FH}->read($$out, $get_size, $offset); # # because the filehandle may not support the offset parameter # An example is Net::FTP my $tmp = ''; $status = *$self->{FH}->read($tmp, $get_size) ; substr($$out, $offset) = $tmp if defined $status && $status > 0 ; } else { $status = *$self->{FH}->read($$out, $get_size) } } elsif (defined *$self->{InputEvent}) { my $got = 1 ; while (length $$out < $size) { last if ($got = *$self->{InputEvent}->($$out, $get_size)) <= 0; } if (length $$out > $size ) { *$self->{Prime} = substr($$out, $size, length($$out)); substr($$out, $size, length($$out)) = ''; } *$self->{EventEof} = 1 if $got <= 0 ; } else { no warnings 'uninitialized'; my $buf = *$self->{Buffer} ; $$buf = '' unless defined $$buf ; substr($$out, $offset) = substr($$buf, *$self->{BufferOffset}, $get_size); if (*$self->{ConsumeInput}) { substr($$buf, 0, $get_size) = '' } else { *$self->{BufferOffset} += length($$out) - $offset } } *$self->{InputLengthRemaining} -= length($$out) #- $offset if defined *$self->{InputLength}; if (! defined $status) { $self->saveStatus($!) ; return STATUS_ERROR; } $self->saveStatus(length $$out < 0 ? STATUS_ERROR : STATUS_OK) ; return length $$out; } sub pushBack { my $self = shift ; return if ! defined $_[0] || length $_[0] == 0 ; if (defined *$self->{FH} || defined *$self->{InputEvent} ) { *$self->{Prime} = $_[0] . *$self->{Prime} ; *$self->{InputLengthRemaining} += length($_[0]); } else { my $len = length $_[0]; if($len > *$self->{BufferOffset}) { *$self->{Prime} = substr($_[0], 0, $len - *$self->{BufferOffset}) . *$self->{Prime} ; *$self->{InputLengthRemaining} = *$self->{InputLength}; *$self->{BufferOffset} = 0 } else { *$self->{InputLengthRemaining} += length($_[0]); *$self->{BufferOffset} -= length($_[0]) ; } } } sub smartSeek { my $self = shift ; my $offset = shift ; my $truncate = shift; my $position = shift || SEEK_SET; # TODO -- need to take prime into account if (defined *$self->{FH}) { *$self->{FH}->seek($offset, $position) } else { if ($position == SEEK_END) { *$self->{BufferOffset} = length ${ *$self->{Buffer} } + $offset ; } elsif ($position == SEEK_CUR) { *$self->{BufferOffset} += $offset ; } else { *$self->{BufferOffset} = $offset ; } substr(${ *$self->{Buffer} }, *$self->{BufferOffset}) = '' if $truncate; return 1; } } sub smartTell { my $self = shift ; if (defined *$self->{FH}) { return *$self->{FH}->tell() } else { return *$self->{BufferOffset} } } sub smartWrite { my $self = shift ; my $out_data = shift ; if (defined *$self->{FH}) { # flush needed for 5.8.0 defined *$self->{FH}->write($out_data, length $out_data) && defined *$self->{FH}->flush() ; } else { my $buf = *$self->{Buffer} ; substr($$buf, *$self->{BufferOffset}, length $out_data) = $out_data ; *$self->{BufferOffset} += length($out_data) ; return 1; } } sub smartReadExact { return $_[0]->smartRead($_[1], $_[2]) == $_[2]; } sub smartEof { my ($self) = $_[0]; local $.; return 0 if length *$self->{Prime} || *$self->{PushMode}; if (defined *$self->{FH}) { # Could use # # *$self->{FH}->eof() # # here, but this can cause trouble if # the filehandle is itself a tied handle, but it uses sysread. # Then we get into mixing buffered & non-buffered IO, # which will cause trouble my $info = $self->getErrInfo(); my $buffer = ''; my $status = $self->smartRead(\$buffer, 1); $self->pushBack($buffer) if length $buffer; $self->setErrInfo($info); return $status == 0 ; } elsif (defined *$self->{InputEvent}) { *$self->{EventEof} } else { *$self->{BufferOffset} >= length(${ *$self->{Buffer} }) } } sub clearError { my $self = shift ; *$self->{ErrorNo} = 0 ; ${ *$self->{Error} } = '' ; } sub getErrInfo { my $self = shift ; return [ *$self->{ErrorNo}, ${ *$self->{Error} } ] ; } sub setErrInfo { my $self = shift ; my $ref = shift; *$self->{ErrorNo} = $ref->[0] ; ${ *$self->{Error} } = $ref->[1] ; } sub saveStatus { my $self = shift ; my $errno = shift() + 0 ; *$self->{ErrorNo} = $errno; ${ *$self->{Error} } = '' ; return *$self->{ErrorNo} ; } sub saveErrorString { my $self = shift ; my $retval = shift ; ${ *$self->{Error} } = shift ; *$self->{ErrorNo} = @_ ? shift() + 0 : STATUS_ERROR ; return $retval; } sub croakError { my $self = shift ; $self->saveErrorString(0, $_[0]); croak $_[0]; } sub closeError { my $self = shift ; my $retval = shift ; my $errno = *$self->{ErrorNo}; my $error = ${ *$self->{Error} }; $self->close(); *$self->{ErrorNo} = $errno ; ${ *$self->{Error} } = $error ; return $retval; } sub error { my $self = shift ; return ${ *$self->{Error} } ; } sub errorNo { my $self = shift ; return *$self->{ErrorNo}; } sub HeaderError { my ($self) = shift; return $self->saveErrorString(undef, "Header Error: $_[0]", STATUS_ERROR); } sub TrailerError { my ($self) = shift; return $self->saveErrorString(G_ERR, "Trailer Error: $_[0]", STATUS_ERROR); } sub TruncatedHeader { my ($self) = shift; return $self->HeaderError("Truncated in $_[0] Section"); } sub TruncatedTrailer { my ($self) = shift; return $self->TrailerError("Truncated in $_[0] Section"); } sub postCheckParams { return 1; } sub checkParams { my $self = shift ; my $class = shift ; my $got = shift || IO::Compress::Base::Parameters::new(); my $Valid = { 'blocksize' => [IO::Compress::Base::Common::Parse_unsigned, 16 * 1024], 'autoclose' => [IO::Compress::Base::Common::Parse_boolean, 0], 'strict' => [IO::Compress::Base::Common::Parse_boolean, 0], 'append' => [IO::Compress::Base::Common::Parse_boolean, 0], 'prime' => [IO::Compress::Base::Common::Parse_any, undef], 'multistream' => [IO::Compress::Base::Common::Parse_boolean, 0], 'transparent' => [IO::Compress::Base::Common::Parse_any, 1], 'scan' => [IO::Compress::Base::Common::Parse_boolean, 0], 'inputlength' => [IO::Compress::Base::Common::Parse_unsigned, undef], 'binmodeout' => [IO::Compress::Base::Common::Parse_boolean, 0], #'decode' => [IO::Compress::Base::Common::Parse_any, undef], #'consumeinput' => [IO::Compress::Base::Common::Parse_boolean, 0], $self->getExtraParams(), #'Todo - Revert to ordinary file on end Z_STREAM_END'=> 0, # ContinueAfterEof } ; $Valid->{trailingdata} = [IO::Compress::Base::Common::Parse_writable_scalar, undef] if *$self->{OneShot} ; $got->parse($Valid, @_ ) or $self->croakError("${class}: " . $got->getError()) ; $self->postCheckParams($got) or $self->croakError("${class}: " . $self->error()) ; return $got; } sub _create { my $obj = shift; my $got = shift; my $append_mode = shift ; my $class = ref $obj; $obj->croakError("$class: Missing Input parameter") if ! @_ && ! $got ; my $inValue = shift ; *$obj->{OneShot} = 0 ; if (! $got) { $got = $obj->checkParams($class, undef, @_) or return undef ; } my $inType = whatIsInput($inValue, 1); $obj->ckInputParam($class, $inValue, 1) or return undef ; *$obj->{InNew} = 1; $obj->ckParams($got) or $obj->croakError("${class}: " . *$obj->{Error}); if ($inType eq 'buffer' || $inType eq 'code') { *$obj->{Buffer} = $inValue ; *$obj->{InputEvent} = $inValue if $inType eq 'code' ; } else { if ($inType eq 'handle') { *$obj->{FH} = $inValue ; *$obj->{Handle} = 1 ; # Need to rewind for Scan *$obj->{FH}->seek(0, SEEK_SET) if $got->getValue('scan'); } else { no warnings ; my $mode = '<'; $mode = '+<' if $got->getValue('scan'); *$obj->{StdIO} = ($inValue eq '-'); *$obj->{FH} = new IO::File "$mode $inValue" or return $obj->saveErrorString(undef, "cannot open file '$inValue': $!", $!) ; } *$obj->{LineNo} = $. = 0; setBinModeInput(*$obj->{FH}) ; my $buff = "" ; *$obj->{Buffer} = \$buff ; } # if ($got->getValue('decode')) { # my $want_encoding = $got->getValue('decode'); # *$obj->{Encoding} = IO::Compress::Base::Common::getEncoding($obj, $class, $want_encoding); # } # else { # *$obj->{Encoding} = undef; # } *$obj->{InputLength} = $got->parsed('inputlength') ? $got->getValue('inputlength') : undef ; *$obj->{InputLengthRemaining} = $got->getValue('inputlength'); *$obj->{BufferOffset} = 0 ; *$obj->{AutoClose} = $got->getValue('autoclose'); *$obj->{Strict} = $got->getValue('strict'); *$obj->{BlockSize} = $got->getValue('blocksize'); *$obj->{Append} = $got->getValue('append'); *$obj->{AppendOutput} = $append_mode || $got->getValue('append'); *$obj->{ConsumeInput} = $got->getValue('consumeinput'); *$obj->{Transparent} = $got->getValue('transparent'); *$obj->{MultiStream} = $got->getValue('multistream'); # TODO - move these two into RawDeflate *$obj->{Scan} = $got->getValue('scan'); *$obj->{ParseExtra} = $got->getValue('parseextra') || $got->getValue('strict') ; *$obj->{Type} = ''; *$obj->{Prime} = $got->getValue('prime') || '' ; *$obj->{Pending} = ''; *$obj->{Plain} = 0; *$obj->{PlainBytesRead} = 0; *$obj->{InflatedBytesRead} = 0; *$obj->{UnCompSize} = new U64; *$obj->{CompSize} = new U64; *$obj->{TotalInflatedBytesRead} = 0; *$obj->{NewStream} = 0 ; *$obj->{EventEof} = 0 ; *$obj->{ClassName} = $class ; *$obj->{Params} = $got ; if (*$obj->{ConsumeInput}) { *$obj->{InNew} = 0; *$obj->{Closed} = 0; return $obj } my $status = $obj->mkUncomp($got); return undef unless defined $status; *$obj->{InNew} = 0; *$obj->{Closed} = 0; if ($status) { # Need to try uncompressing to catch the case # where the compressed file uncompresses to an # empty string - so eof is set immediately. my $out_buffer = ''; $status = $obj->read(\$out_buffer); if ($status < 0) { *$obj->{ReadStatus} = [ $status, $obj->error(), $obj->errorNo() ]; } $obj->ungetc($out_buffer) if length $out_buffer; } else { return undef unless *$obj->{Transparent}; $obj->clearError(); *$obj->{Type} = 'plain'; *$obj->{Plain} = 1; $obj->pushBack(*$obj->{HeaderPending}) ; } push @{ *$obj->{InfoList} }, *$obj->{Info} ; $obj->saveStatus(STATUS_OK) ; *$obj->{InNew} = 0; *$obj->{Closed} = 0; return $obj; } sub ckInputParam { my $self = shift ; my $from = shift ; my $inType = whatIsInput($_[0], $_[1]); $self->croakError("$from: input parameter not a filename, filehandle, array ref or scalar ref") if ! $inType ; # if ($inType eq 'filename' ) # { # return $self->saveErrorString(1, "$from: input filename is undef or null string", STATUS_ERROR) # if ! defined $_[0] || $_[0] eq '' ; # # if ($_[0] ne '-' && ! -e $_[0] ) # { # return $self->saveErrorString(1, # "input file '$_[0]' does not exist", STATUS_ERROR); # } # } return 1; } sub _inf { my $obj = shift ; my $class = (caller)[0] ; my $name = (caller(1))[3] ; $obj->croakError("$name: expected at least 1 parameters\n") unless @_ >= 1 ; my $input = shift ; my $haveOut = @_ ; my $output = shift ; my $x = new IO::Compress::Base::Validator($class, *$obj->{Error}, $name, $input, $output) or return undef ; push @_, $output if $haveOut && $x->{Hash}; *$obj->{OneShot} = 1 ; my $got = $obj->checkParams($name, undef, @_) or return undef ; if ($got->parsed('trailingdata')) { # my $value = $got->valueRef('TrailingData'); # warn "TD $value "; # #$value = $$value; ## warn "TD $value $$value "; # # return retErr($obj, "Parameter 'TrailingData' not writable") # if readonly $$value ; # # if (ref $$value) # { # return retErr($obj,"Parameter 'TrailingData' not a scalar reference") # if ref $$value ne 'SCALAR' ; # # *$obj->{TrailingData} = $$value ; # } # else # { # return retErr($obj,"Parameter 'TrailingData' not a scalar") # if ref $value ne 'SCALAR' ; # # *$obj->{TrailingData} = $value ; # } *$obj->{TrailingData} = $got->getValue('trailingdata'); } *$obj->{MultiStream} = $got->getValue('multistream'); $got->setValue('multistream', 0); $x->{Got} = $got ; # if ($x->{Hash}) # { # while (my($k, $v) = each %$input) # { # $v = \$input->{$k} # unless defined $v ; # # $obj->_singleTarget($x, $k, $v, @_) # or return undef ; # } # # return keys %$input ; # } if ($x->{GlobMap}) { $x->{oneInput} = 1 ; foreach my $pair (@{ $x->{Pairs} }) { my ($from, $to) = @$pair ; $obj->_singleTarget($x, $from, $to, @_) or return undef ; } return scalar @{ $x->{Pairs} } ; } if (! $x->{oneOutput} ) { my $inFile = ($x->{inType} eq 'filenames' || $x->{inType} eq 'filename'); $x->{inType} = $inFile ? 'filename' : 'buffer'; foreach my $in ($x->{oneInput} ? $input : @$input) { my $out ; $x->{oneInput} = 1 ; $obj->_singleTarget($x, $in, $output, @_) or return undef ; } return 1 ; } # finally the 1 to 1 and n to 1 return $obj->_singleTarget($x, $input, $output, @_); croak "should not be here" ; } sub retErr { my $x = shift ; my $string = shift ; ${ $x->{Error} } = $string ; return undef ; } sub _singleTarget { my $self = shift ; my $x = shift ; my $input = shift; my $output = shift; my $buff = ''; $x->{buff} = \$buff ; my $fh ; if ($x->{outType} eq 'filename') { my $mode = '>' ; $mode = '>>' if $x->{Got}->getValue('append') ; $x->{fh} = new IO::File "$mode $output" or return retErr($x, "cannot open file '$output': $!") ; binmode $x->{fh} if $x->{Got}->valueOrDefault('binmodeout'); } elsif ($x->{outType} eq 'handle') { $x->{fh} = $output; binmode $x->{fh} if $x->{Got}->valueOrDefault('binmodeout'); if ($x->{Got}->getValue('append')) { seek($x->{fh}, 0, SEEK_END) or return retErr($x, "Cannot seek to end of output filehandle: $!") ; } } elsif ($x->{outType} eq 'buffer' ) { $$output = '' unless $x->{Got}->getValue('append'); $x->{buff} = $output ; } if ($x->{oneInput}) { defined $self->_rd2($x, $input, $output) or return undef; } else { for my $element ( ($x->{inType} eq 'hash') ? keys %$input : @$input) { defined $self->_rd2($x, $element, $output) or return undef ; } } if ( ($x->{outType} eq 'filename' && $output ne '-') || ($x->{outType} eq 'handle' && $x->{Got}->getValue('autoclose'))) { $x->{fh}->close() or return retErr($x, $!); delete $x->{fh}; } return 1 ; } sub _rd2 { my $self = shift ; my $x = shift ; my $input = shift; my $output = shift; my $z = IO::Compress::Base::Common::createSelfTiedObject($x->{Class}, *$self->{Error}); $z->_create($x->{Got}, 1, $input, @_) or return undef ; my $status ; my $fh = $x->{fh}; while (1) { while (($status = $z->read($x->{buff})) > 0) { if ($fh) { local $\; print $fh ${ $x->{buff} } or return $z->saveErrorString(undef, "Error writing to output file: $!", $!); ${ $x->{buff} } = '' ; } } if (! $x->{oneOutput} ) { my $ot = $x->{outType} ; if ($ot eq 'array') { push @$output, $x->{buff} } elsif ($ot eq 'hash') { $output->{$input} = $x->{buff} } my $buff = ''; $x->{buff} = \$buff; } last if $status < 0 || $z->smartEof(); last unless *$self->{MultiStream}; $status = $z->nextStream(); last unless $status == 1 ; } return $z->closeError(undef) if $status < 0 ; ${ *$self->{TrailingData} } = $z->trailingData() if defined *$self->{TrailingData} ; $z->close() or return undef ; return 1 ; } sub TIEHANDLE { return $_[0] if ref($_[0]); die "OOPS\n" ; } sub UNTIE { my $self = shift ; } sub getHeaderInfo { my $self = shift ; wantarray ? @{ *$self->{InfoList} } : *$self->{Info}; } sub readBlock { my $self = shift ; my $buff = shift ; my $size = shift ; if (defined *$self->{CompressedInputLength}) { if (*$self->{CompressedInputLengthRemaining} == 0) { delete *$self->{CompressedInputLength}; *$self->{CompressedInputLengthDone} = 1; return STATUS_OK ; } $size = List::Util::min($size, *$self->{CompressedInputLengthRemaining} ); *$self->{CompressedInputLengthRemaining} -= $size ; } my $status = $self->smartRead($buff, $size) ; return $self->saveErrorString(STATUS_ERROR, "Error Reading Data: $!", $!) if $status == STATUS_ERROR ; if ($status == 0 ) { *$self->{Closed} = 1 ; *$self->{EndStream} = 1 ; return $self->saveErrorString(STATUS_ERROR, "unexpected end of file", STATUS_ERROR); } return STATUS_OK; } sub postBlockChk { return STATUS_OK; } sub _raw_read { # return codes # >0 - ok, number of bytes read # =0 - ok, eof # <0 - not ok my $self = shift ; return G_EOF if *$self->{Closed} ; return G_EOF if *$self->{EndStream} ; my $buffer = shift ; my $scan_mode = shift ; if (*$self->{Plain}) { my $tmp_buff ; my $len = $self->smartRead(\$tmp_buff, *$self->{BlockSize}) ; return $self->saveErrorString(G_ERR, "Error reading data: $!", $!) if $len == STATUS_ERROR ; if ($len == 0 ) { *$self->{EndStream} = 1 ; } else { *$self->{PlainBytesRead} += $len ; $$buffer .= $tmp_buff; } return $len ; } if (*$self->{NewStream}) { $self->gotoNextStream() > 0 or return G_ERR; # For the headers that actually uncompressed data, put the # uncompressed data into the output buffer. $$buffer .= *$self->{Pending} ; my $len = length *$self->{Pending} ; *$self->{Pending} = ''; return $len; } my $temp_buf = ''; my $outSize = 0; my $status = $self->readBlock(\$temp_buf, *$self->{BlockSize}, $outSize) ; return G_ERR if $status == STATUS_ERROR ; my $buf_len = 0; if ($status == STATUS_OK) { my $beforeC_len = length $temp_buf; my $before_len = defined $$buffer ? length $$buffer : 0 ; $status = *$self->{Uncomp}->uncompr(\$temp_buf, $buffer, defined *$self->{CompressedInputLengthDone} || $self->smartEof(), $outSize); # Remember the input buffer if it wasn't consumed completely $self->pushBack($temp_buf) if *$self->{Uncomp}{ConsumesInput}; return $self->saveErrorString(G_ERR, *$self->{Uncomp}{Error}, *$self->{Uncomp}{ErrorNo}) if $self->saveStatus($status) == STATUS_ERROR; $self->postBlockChk($buffer, $before_len) == STATUS_OK or return G_ERR; $buf_len = defined $$buffer ? length($$buffer) - $before_len : 0; *$self->{CompSize}->add($beforeC_len - length $temp_buf) ; *$self->{InflatedBytesRead} += $buf_len ; *$self->{TotalInflatedBytesRead} += $buf_len ; *$self->{UnCompSize}->add($buf_len) ; $self->filterUncompressed($buffer, $before_len); # if (*$self->{Encoding}) { # use Encode ; # *$self->{PendingDecode} .= substr($$buffer, $before_len) ; # my $got = *$self->{Encoding}->decode(*$self->{PendingDecode}, Encode::FB_QUIET) ; # substr($$buffer, $before_len) = $got; # } } if ($status == STATUS_ENDSTREAM) { *$self->{EndStream} = 1 ; my $trailer; my $trailer_size = *$self->{Info}{TrailerLength} ; my $got = 0; if (*$self->{Info}{TrailerLength}) { $got = $self->smartRead(\$trailer, $trailer_size) ; } if ($got == $trailer_size) { $self->chkTrailer($trailer) == STATUS_OK or return G_ERR; } else { return $self->TrailerError("trailer truncated. Expected " . "$trailer_size bytes, got $got") if *$self->{Strict}; $self->pushBack($trailer) ; } # TODO - if want file pointer, do it here if (! $self->smartEof()) { *$self->{NewStream} = 1 ; if (*$self->{MultiStream}) { *$self->{EndStream} = 0 ; return $buf_len ; } } } # return the number of uncompressed bytes read return $buf_len ; } sub reset { my $self = shift ; return *$self->{Uncomp}->reset(); } sub filterUncompressed { } #sub isEndStream #{ # my $self = shift ; # return *$self->{NewStream} || # *$self->{EndStream} ; #} sub nextStream { my $self = shift ; my $status = $self->gotoNextStream(); $status == 1 or return $status ; *$self->{TotalInflatedBytesRead} = 0 ; *$self->{LineNo} = $. = 0; return 1; } sub gotoNextStream { my $self = shift ; if (! *$self->{NewStream}) { my $status = 1; my $buffer ; # TODO - make this more efficient if know the offset for the end of # the stream and seekable $status = $self->read($buffer) while $status > 0 ; return $status if $status < 0; } *$self->{NewStream} = 0 ; *$self->{EndStream} = 0 ; *$self->{CompressedInputLengthDone} = undef ; *$self->{CompressedInputLength} = undef ; $self->reset(); *$self->{UnCompSize}->reset(); *$self->{CompSize}->reset(); my $magic = $self->ckMagic(); if ( ! defined $magic) { if (! *$self->{Transparent} || $self->eof()) { *$self->{EndStream} = 1 ; return 0; } $self->clearError(); *$self->{Type} = 'plain'; *$self->{Plain} = 1; $self->pushBack(*$self->{HeaderPending}) ; } else { *$self->{Info} = $self->readHeader($magic); if ( ! defined *$self->{Info} ) { *$self->{EndStream} = 1 ; return -1; } } push @{ *$self->{InfoList} }, *$self->{Info} ; return 1; } sub streamCount { my $self = shift ; return 1 if ! defined *$self->{InfoList}; return scalar @{ *$self->{InfoList} } ; } #sub read #{ # my $status = myRead(@_); # return undef if $status < 0; # return $status; #} sub read { # return codes # >0 - ok, number of bytes read # =0 - ok, eof # <0 - not ok my $self = shift ; if (defined *$self->{ReadStatus} ) { my $status = *$self->{ReadStatus}[0]; $self->saveErrorString( @{ *$self->{ReadStatus} } ); delete *$self->{ReadStatus} ; return $status ; } return G_EOF if *$self->{Closed} ; my $buffer ; if (ref $_[0] ) { $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only") if Scalar::Util::readonly(${ $_[0] }); $self->croakError(*$self->{ClassName} . "::read: not a scalar reference $_[0]" ) unless ref $_[0] eq 'SCALAR' ; $buffer = $_[0] ; } else { $self->croakError(*$self->{ClassName} . "::read: buffer parameter is read-only") if Scalar::Util::readonly($_[0]); $buffer = \$_[0] ; } my $length = $_[1] ; my $offset = $_[2] || 0; if (! *$self->{AppendOutput}) { if (! $offset) { $$buffer = '' ; } else { if ($offset > length($$buffer)) { $$buffer .= "\x00" x ($offset - length($$buffer)); } else { substr($$buffer, $offset) = ''; } } } elsif (! defined $$buffer) { $$buffer = '' ; } return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ; # the core read will return 0 if asked for 0 bytes return 0 if defined $length && $length == 0 ; $length = $length || 0; $self->croakError(*$self->{ClassName} . "::read: length parameter is negative") if $length < 0 ; # Short-circuit if this is a simple read, with no length # or offset specified. unless ( $length || $offset) { if (length *$self->{Pending}) { $$buffer .= *$self->{Pending} ; my $len = length *$self->{Pending}; *$self->{Pending} = '' ; return $len ; } else { my $len = 0; $len = $self->_raw_read($buffer) while ! *$self->{EndStream} && $len == 0 ; return $len ; } } # Need to jump through more hoops - either length or offset # or both are specified. my $out_buffer = *$self->{Pending} ; *$self->{Pending} = ''; while (! *$self->{EndStream} && length($out_buffer) < $length) { my $buf_len = $self->_raw_read(\$out_buffer); return $buf_len if $buf_len < 0 ; } $length = length $out_buffer if length($out_buffer) < $length ; return 0 if $length == 0 ; $$buffer = '' if ! defined $$buffer; $offset = length $$buffer if *$self->{AppendOutput} ; *$self->{Pending} = $out_buffer; $out_buffer = \*$self->{Pending} ; substr($$buffer, $offset) = substr($$out_buffer, 0, $length) ; substr($$out_buffer, 0, $length) = '' ; return $length ; } sub _getline { my $self = shift ; my $status = 0 ; # Slurp Mode if ( ! defined $/ ) { my $data ; 1 while ($status = $self->read($data)) > 0 ; return ($status, \$data); } # Record Mode if ( ref $/ eq 'SCALAR' && ${$/} =~ /^\d+$/ && ${$/} > 0) { my $reclen = ${$/} ; my $data ; $status = $self->read($data, $reclen) ; return ($status, \$data); } # Paragraph Mode if ( ! length $/ ) { my $paragraph ; while (($status = $self->read($paragraph)) > 0 ) { if ($paragraph =~ s/^(.*?\n\n+)//s) { *$self->{Pending} = $paragraph ; my $par = $1 ; return (1, \$par); } } return ($status, \$paragraph); } # $/ isn't empty, or a reference, so it's Line Mode. { my $line ; my $p = \*$self->{Pending} ; while (($status = $self->read($line)) > 0 ) { my $offset = index($line, $/); if ($offset >= 0) { my $l = substr($line, 0, $offset + length $/ ); substr($line, 0, $offset + length $/) = ''; $$p = $line; return (1, \$l); } } return ($status, \$line); } } sub getline { my $self = shift; if (defined *$self->{ReadStatus} ) { $self->saveErrorString( @{ *$self->{ReadStatus} } ); delete *$self->{ReadStatus} ; return undef; } return undef if *$self->{Closed} || (!length *$self->{Pending} && *$self->{EndStream}) ; my $current_append = *$self->{AppendOutput} ; *$self->{AppendOutput} = 1; my ($status, $lineref) = $self->_getline(); *$self->{AppendOutput} = $current_append; return undef if $status < 0 || length $$lineref == 0 ; $. = ++ *$self->{LineNo} ; return $$lineref ; } sub getlines { my $self = shift; $self->croakError(*$self->{ClassName} . "::getlines: called in scalar context\n") unless wantarray; my($line, @lines); push(@lines, $line) while defined($line = $self->getline); return @lines; } sub READLINE { goto &getlines if wantarray; goto &getline; } sub getc { my $self = shift; my $buf; return $buf if $self->read($buf, 1); return undef; } sub ungetc { my $self = shift; *$self->{Pending} = "" unless defined *$self->{Pending} ; *$self->{Pending} = $_[0] . *$self->{Pending} ; } sub trailingData { my $self = shift ; if (defined *$self->{FH} || defined *$self->{InputEvent} ) { return *$self->{Prime} ; } else { my $buf = *$self->{Buffer} ; my $offset = *$self->{BufferOffset} ; return substr($$buf, $offset) ; } } sub eof { my $self = shift ; return (*$self->{Closed} || (!length *$self->{Pending} && ( $self->smartEof() || *$self->{EndStream}))) ; } sub tell { my $self = shift ; my $in ; if (*$self->{Plain}) { $in = *$self->{PlainBytesRead} ; } else { $in = *$self->{TotalInflatedBytesRead} ; } my $pending = length *$self->{Pending} ; return 0 if $pending > $in ; return $in - $pending ; } sub close { # todo - what to do if close is called before the end of the gzip file # do we remember any trailing data? my $self = shift ; return 1 if *$self->{Closed} ; untie *$self if $] >= 5.008 ; my $status = 1 ; if (defined *$self->{FH}) { if ((! *$self->{Handle} || *$self->{AutoClose}) && ! *$self->{StdIO}) { local $.; $! = 0 ; $status = *$self->{FH}->close(); return $self->saveErrorString(0, $!, $!) if !*$self->{InNew} && $self->saveStatus($!) != 0 ; } delete *$self->{FH} ; $! = 0 ; } *$self->{Closed} = 1 ; return 1; } sub DESTROY { my $self = shift ; local ($., $@, $!, $^E, $?); $self->close() ; } sub seek { my $self = shift ; my $position = shift; my $whence = shift ; my $here = $self->tell() ; my $target = 0 ; if ($whence == SEEK_SET) { $target = $position ; } elsif ($whence == SEEK_CUR) { $target = $here + $position ; } elsif ($whence == SEEK_END) { $target = $position ; $self->croakError(*$self->{ClassName} . "::seek: SEEK_END not allowed") ; } else { $self->croakError(*$self->{ClassName} ."::seek: unknown value, $whence, for whence parameter"); } # short circuit if seeking to current offset if ($target == $here) { # On ordinary filehandles, seeking to the current # position also clears the EOF condition, so we # emulate this behavior locally while simultaneously # cascading it to the underlying filehandle if (*$self->{Plain}) { *$self->{EndStream} = 0; seek(*$self->{FH},0,1) if *$self->{FH}; } return 1; } # Outlaw any attempt to seek backwards $self->croakError( *$self->{ClassName} ."::seek: cannot seek backwards") if $target < $here ; # Walk the file to the new offset my $offset = $target - $here ; my $got; while (($got = $self->read(my $buffer, List::Util::min($offset, *$self->{BlockSize})) ) > 0) { $offset -= $got; last if $offset == 0 ; } $here = $self->tell() ; return $offset == 0 ? 1 : 0 ; } sub fileno { my $self = shift ; return defined *$self->{FH} ? fileno *$self->{FH} : undef ; } sub binmode { 1; # my $self = shift ; # return defined *$self->{FH} # ? binmode *$self->{FH} # : 1 ; } sub opened { my $self = shift ; return ! *$self->{Closed} ; } sub autoflush { my $self = shift ; return defined *$self->{FH} ? *$self->{FH}->autoflush(@_) : undef ; } sub input_line_number { my $self = shift ; my $last = *$self->{LineNo}; $. = *$self->{LineNo} = $_[1] if @_ ; return $last; } *BINMODE = \&binmode; *SEEK = \&seek; *READ = \&read; *sysread = \&read; *TELL = \&tell; *EOF = \&eof; *FILENO = \&fileno; *CLOSE = \&close; sub _notAvailable { my $name = shift ; return sub { croak "$name Not Available: File opened only for intput" ; } ; } *print = _notAvailable('print'); *PRINT = _notAvailable('print'); *printf = _notAvailable('printf'); *PRINTF = _notAvailable('printf'); *write = _notAvailable('write'); *WRITE = _notAvailable('write'); #*sysread = \&read; #*syswrite = \&_notAvailable; package IO::Uncompress::Base ; 1 ; __END__ #line 1557 FILE 9cd5ff4f/IO/Uncompress/Gunzip.pmG#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Uncompress/Gunzip.pm" package IO::Uncompress::Gunzip ; require 5.006 ; # for RFC1952 use strict ; use warnings; use bytes; use IO::Uncompress::RawInflate 2.066 ; use Compress::Raw::Zlib 2.066 () ; use IO::Compress::Base::Common 2.066 qw(:Status ); use IO::Compress::Gzip::Constants 2.066 ; use IO::Compress::Zlib::Extra 2.066 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, $GunzipError); @ISA = qw( Exporter IO::Uncompress::RawInflate ); @EXPORT_OK = qw( $GunzipError gunzip ); %EXPORT_TAGS = %IO::Uncompress::RawInflate::DEFLATE_CONSTANTS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); $GunzipError = ''; $VERSION = '2.066'; sub new { my $class = shift ; $GunzipError = ''; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$GunzipError); $obj->_create(undef, 0, @_); } sub gunzip { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$GunzipError); return $obj->_inf(@_) ; } sub getExtraParams { return ( 'parseextra' => [IO::Compress::Base::Common::Parse_boolean, 0] ) ; } sub ckParams { my $self = shift ; my $got = shift ; # gunzip always needs crc32 $got->setValue('crc32' => 1); return 1; } sub ckMagic { my $self = shift; my $magic ; $self->smartReadExact(\$magic, GZIP_ID_SIZE); *$self->{HeaderPending} = $magic ; return $self->HeaderError("Minimum header size is " . GZIP_MIN_HEADER_SIZE . " bytes") if length $magic != GZIP_ID_SIZE ; return $self->HeaderError("Bad Magic") if ! isGzipMagic($magic) ; *$self->{Type} = 'rfc1952'; return $magic ; } sub readHeader { my $self = shift; my $magic = shift; return $self->_readGzipHeader($magic); } sub chkTrailer { my $self = shift; my $trailer = shift; # Check CRC & ISIZE my ($CRC32, $ISIZE) = unpack("V V", $trailer) ; *$self->{Info}{CRC32} = $CRC32; *$self->{Info}{ISIZE} = $ISIZE; if (*$self->{Strict}) { return $self->TrailerError("CRC mismatch") if $CRC32 != *$self->{Uncomp}->crc32() ; my $exp_isize = *$self->{UnCompSize}->get32bit(); return $self->TrailerError("ISIZE mismatch. Got $ISIZE" . ", expected $exp_isize") if $ISIZE != $exp_isize ; } return STATUS_OK; } sub isGzipMagic { my $buffer = shift ; return 0 if length $buffer < GZIP_ID_SIZE ; my ($id1, $id2) = unpack("C C", $buffer) ; return $id1 == GZIP_ID1 && $id2 == GZIP_ID2 ; } sub _readFullGzipHeader($) { my ($self) = @_ ; my $magic = '' ; $self->smartReadExact(\$magic, GZIP_ID_SIZE); *$self->{HeaderPending} = $magic ; return $self->HeaderError("Minimum header size is " . GZIP_MIN_HEADER_SIZE . " bytes") if length $magic != GZIP_ID_SIZE ; return $self->HeaderError("Bad Magic") if ! isGzipMagic($magic) ; my $status = $self->_readGzipHeader($magic); delete *$self->{Transparent} if ! defined $status ; return $status ; } sub _readGzipHeader($) { my ($self, $magic) = @_ ; my ($HeaderCRC) ; my ($buffer) = '' ; $self->smartReadExact(\$buffer, GZIP_MIN_HEADER_SIZE - GZIP_ID_SIZE) or return $self->HeaderError("Minimum header size is " . GZIP_MIN_HEADER_SIZE . " bytes") ; my $keep = $magic . $buffer ; *$self->{HeaderPending} = $keep ; # now split out the various parts my ($cm, $flag, $mtime, $xfl, $os) = unpack("C C V C C", $buffer) ; $cm == GZIP_CM_DEFLATED or return $self->HeaderError("Not Deflate (CM is $cm)") ; # check for use of reserved bits return $self->HeaderError("Use of Reserved Bits in FLG field.") if $flag & GZIP_FLG_RESERVED ; my $EXTRA ; my @EXTRA = () ; if ($flag & GZIP_FLG_FEXTRA) { $EXTRA = "" ; $self->smartReadExact(\$buffer, GZIP_FEXTRA_HEADER_SIZE) or return $self->TruncatedHeader("FEXTRA Length") ; my ($XLEN) = unpack("v", $buffer) ; $self->smartReadExact(\$EXTRA, $XLEN) or return $self->TruncatedHeader("FEXTRA Body"); $keep .= $buffer . $EXTRA ; if ($XLEN && *$self->{'ParseExtra'}) { my $bad = IO::Compress::Zlib::Extra::parseRawExtra($EXTRA, \@EXTRA, 1, 1); return $self->HeaderError($bad) if defined $bad; } } my $origname ; if ($flag & GZIP_FLG_FNAME) { $origname = "" ; while (1) { $self->smartReadExact(\$buffer, 1) or return $self->TruncatedHeader("FNAME"); last if $buffer eq GZIP_NULL_BYTE ; $origname .= $buffer } $keep .= $origname . GZIP_NULL_BYTE ; return $self->HeaderError("Non ISO 8859-1 Character found in Name") if *$self->{Strict} && $origname =~ /$GZIP_FNAME_INVALID_CHAR_RE/o ; } my $comment ; if ($flag & GZIP_FLG_FCOMMENT) { $comment = ""; while (1) { $self->smartReadExact(\$buffer, 1) or return $self->TruncatedHeader("FCOMMENT"); last if $buffer eq GZIP_NULL_BYTE ; $comment .= $buffer } $keep .= $comment . GZIP_NULL_BYTE ; return $self->HeaderError("Non ISO 8859-1 Character found in Comment") if *$self->{Strict} && $comment =~ /$GZIP_FCOMMENT_INVALID_CHAR_RE/o ; } if ($flag & GZIP_FLG_FHCRC) { $self->smartReadExact(\$buffer, GZIP_FHCRC_SIZE) or return $self->TruncatedHeader("FHCRC"); $HeaderCRC = unpack("v", $buffer) ; my $crc16 = Compress::Raw::Zlib::crc32($keep) & 0xFF ; return $self->HeaderError("CRC16 mismatch.") if *$self->{Strict} && $crc16 != $HeaderCRC; $keep .= $buffer ; } # Assume compression method is deflated for xfl tests #if ($xfl) { #} *$self->{Type} = 'rfc1952'; return { 'Type' => 'rfc1952', 'FingerprintLength' => 2, 'HeaderLength' => length $keep, 'TrailerLength' => GZIP_TRAILER_SIZE, 'Header' => $keep, 'isMinimalHeader' => $keep eq GZIP_MINIMUM_HEADER ? 1 : 0, 'MethodID' => $cm, 'MethodName' => $cm == GZIP_CM_DEFLATED ? "Deflated" : "Unknown" , 'TextFlag' => $flag & GZIP_FLG_FTEXT ? 1 : 0, 'HeaderCRCFlag' => $flag & GZIP_FLG_FHCRC ? 1 : 0, 'NameFlag' => $flag & GZIP_FLG_FNAME ? 1 : 0, 'CommentFlag' => $flag & GZIP_FLG_FCOMMENT ? 1 : 0, 'ExtraFlag' => $flag & GZIP_FLG_FEXTRA ? 1 : 0, 'Name' => $origname, 'Comment' => $comment, 'Time' => $mtime, 'OsID' => $os, 'OsName' => defined $GZIP_OS_Names{$os} ? $GZIP_OS_Names{$os} : "Unknown", 'HeaderCRC' => $HeaderCRC, 'Flags' => $flag, 'ExtraFlags' => $xfl, 'ExtraFieldRaw' => $EXTRA, 'ExtraField' => [ @EXTRA ], #'CompSize'=> $compsize, #'CRC32'=> $CRC32, #'OrigSize'=> $ISIZE, } } 1; __END__ #line 1126 FILE$6b268b60/IO/Uncompress/RawInflate.pm"W#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/IO/Uncompress/RawInflate.pm" package IO::Uncompress::RawInflate ; # for RFC1951 use strict ; use warnings; #use bytes; use Compress::Raw::Zlib 2.066 ; use IO::Compress::Base::Common 2.066 qw(:Status ); use IO::Uncompress::Base 2.066 ; use IO::Uncompress::Adapter::Inflate 2.066 ; require Exporter ; our ($VERSION, @ISA, @EXPORT_OK, %EXPORT_TAGS, %DEFLATE_CONSTANTS, $RawInflateError); $VERSION = '2.066'; $RawInflateError = ''; @ISA = qw( Exporter IO::Uncompress::Base ); @EXPORT_OK = qw( $RawInflateError rawinflate ) ; %DEFLATE_CONSTANTS = (); %EXPORT_TAGS = %IO::Uncompress::Base::EXPORT_TAGS ; push @{ $EXPORT_TAGS{all} }, @EXPORT_OK ; Exporter::export_ok_tags('all'); #{ # # Execute at runtime # my %bad; # for my $module (qw(Compress::Raw::Zlib IO::Compress::Base::Common IO::Uncompress::Base IO::Uncompress::Adapter::Inflate)) # { # my $ver = ${ $module . "::VERSION"} ; # # $bad{$module} = $ver # if $ver ne $VERSION; # } # # if (keys %bad) # { # my $string = join "\n", map { "$_ $bad{$_}" } keys %bad; # die caller(0)[0] . "needs version $VERSION mismatch\n$string\n"; # } #} sub new { my $class = shift ; my $obj = IO::Compress::Base::Common::createSelfTiedObject($class, \$RawInflateError); $obj->_create(undef, 0, @_); } sub rawinflate { my $obj = IO::Compress::Base::Common::createSelfTiedObject(undef, \$RawInflateError); return $obj->_inf(@_); } sub getExtraParams { return (); } sub ckParams { my $self = shift ; my $got = shift ; return 1; } sub mkUncomp { my $self = shift ; my $got = shift ; my ($obj, $errstr, $errno) = IO::Uncompress::Adapter::Inflate::mkUncompObject( $got->getValue('crc32'), $got->getValue('adler32'), $got->getValue('scan'), ); return $self->saveErrorString(undef, $errstr, $errno) if ! defined $obj; *$self->{Uncomp} = $obj; my $magic = $self->ckMagic() or return 0; *$self->{Info} = $self->readHeader($magic) or return undef ; return 1; } sub ckMagic { my $self = shift; return $self->_isRaw() ; } sub readHeader { my $self = shift; my $magic = shift ; return { 'Type' => 'rfc1951', 'FingerprintLength' => 0, 'HeaderLength' => 0, 'TrailerLength' => 0, 'Header' => '' }; } sub chkTrailer { return STATUS_OK ; } sub _isRaw { my $self = shift ; my $got = $self->_isRawx(@_); if ($got) { *$self->{Pending} = *$self->{HeaderPending} ; } else { $self->pushBack(*$self->{HeaderPending}); *$self->{Uncomp}->reset(); } *$self->{HeaderPending} = ''; return $got ; } sub _isRawx { my $self = shift ; my $magic = shift ; $magic = '' unless defined $magic ; my $buffer = ''; $self->smartRead(\$buffer, *$self->{BlockSize}) >= 0 or return $self->saveErrorString(undef, "No data to read"); my $temp_buf = $magic . $buffer ; *$self->{HeaderPending} = $temp_buf ; $buffer = ''; my $status = *$self->{Uncomp}->uncompr(\$temp_buf, \$buffer, $self->smartEof()) ; return $self->saveErrorString(undef, *$self->{Uncomp}{Error}, STATUS_ERROR) if $status == STATUS_ERROR; $self->pushBack($temp_buf) ; return $self->saveErrorString(undef, "unexpected end of file", STATUS_ERROR) if $self->smartEof() && $status != STATUS_ENDSTREAM; #my $buf_len = *$self->{Uncomp}->uncompressedBytes(); my $buf_len = length $buffer; if ($status == STATUS_ENDSTREAM) { if (*$self->{MultiStream} && (length $temp_buf || ! $self->smartEof())){ *$self->{NewStream} = 1 ; *$self->{EndStream} = 0 ; } else { *$self->{EndStream} = 1 ; } } *$self->{HeaderPending} = $buffer ; *$self->{InflatedBytesRead} = $buf_len ; *$self->{TotalInflatedBytesRead} += $buf_len ; *$self->{Type} = 'rfc1951'; $self->saveStatus(STATUS_OK); return { 'Type' => 'rfc1951', 'HeaderLength' => 0, 'TrailerLength' => 0, 'Header' => '' }; } sub inflateSync { my $self = shift ; # inflateSync is a no-op in Plain mode return 1 if *$self->{Plain} ; return 0 if *$self->{Closed} ; #return G_EOF if !length *$self->{Pending} && *$self->{EndStream} ; return 0 if ! length *$self->{Pending} && *$self->{EndStream} ; # Disable CRC check *$self->{Strict} = 0 ; my $status ; while (1) { my $temp_buf ; if (length *$self->{Pending} ) { $temp_buf = *$self->{Pending} ; *$self->{Pending} = ''; } else { $status = $self->smartRead(\$temp_buf, *$self->{BlockSize}) ; return $self->saveErrorString(0, "Error Reading Data") if $status < 0 ; if ($status == 0 ) { *$self->{EndStream} = 1 ; return $self->saveErrorString(0, "unexpected end of file", STATUS_ERROR); } } $status = *$self->{Uncomp}->sync($temp_buf) ; if ($status == STATUS_OK) { *$self->{Pending} .= $temp_buf ; return 1 ; } last unless $status == STATUS_ERROR ; } return 0; } #sub performScan #{ # my $self = shift ; # # my $status ; # my $end_offset = 0; # # $status = $self->scan() # #or return $self->saveErrorString(undef, "Error Scanning: $$error_ref", $self->errorNo) ; # or return $self->saveErrorString(G_ERR, "Error Scanning: $status") # # $status = $self->zap($end_offset) # or return $self->saveErrorString(G_ERR, "Error Zapping: $status"); # #or return $self->saveErrorString(undef, "Error Zapping: $$error_ref", $self->errorNo) ; # # #(*$obj->{Deflate}, $status) = $inf->createDeflate(); # ## *$obj->{Header} = *$inf->{Info}{Header}; ## *$obj->{UnCompSize_32bit} = ## *$obj->{BytesWritten} = *$inf->{UnCompSize_32bit} ; ## *$obj->{CompSize_32bit} = *$inf->{CompSize_32bit} ; # # ## if ( $outType eq 'buffer') ## { substr( ${ *$self->{Buffer} }, $end_offset) = '' } ## elsif ($outType eq 'handle' || $outType eq 'filename') { ## *$self->{FH} = *$inf->{FH} ; ## delete *$inf->{FH}; ## *$obj->{FH}->flush() ; ## *$obj->{Handle} = 1 if $outType eq 'handle'; ## ## #seek(*$obj->{FH}, $end_offset, SEEK_SET) ## *$obj->{FH}->seek($end_offset, SEEK_SET) ## or return $obj->saveErrorString(undef, $!, $!) ; ## } # #} sub scan { my $self = shift ; return 1 if *$self->{Closed} ; return 1 if !length *$self->{Pending} && *$self->{EndStream} ; my $buffer = '' ; my $len = 0; $len = $self->_raw_read(\$buffer, 1) while ! *$self->{EndStream} && $len >= 0 ; #return $len if $len < 0 ? $len : 0 ; return $len < 0 ? 0 : 1 ; } sub zap { my $self = shift ; my $headerLength = *$self->{Info}{HeaderLength}; my $block_offset = $headerLength + *$self->{Uncomp}->getLastBlockOffset(); $_[0] = $headerLength + *$self->{Uncomp}->getEndOffset(); #printf "# End $_[0], headerlen $headerLength \n";; #printf "# block_offset $block_offset %x\n", $block_offset; my $byte ; ( $self->smartSeek($block_offset) && $self->smartRead(\$byte, 1) ) or return $self->saveErrorString(0, $!, $!); #printf "#byte is %x\n", unpack('C*',$byte); *$self->{Uncomp}->resetLastBlockByte($byte); #printf "#to byte is %x\n", unpack('C*',$byte); ( $self->smartSeek($block_offset) && $self->smartWrite($byte) ) or return $self->saveErrorString(0, $!, $!); #$self->smartSeek($end_offset, 1); return 1 ; } sub createDeflate { my $self = shift ; my ($def, $status) = *$self->{Uncomp}->createDeflateStream( -AppendOutput => 1, -WindowBits => - MAX_WBITS, -CRC32 => *$self->{Params}->getValue('crc32'), -ADLER32 => *$self->{Params}->getValue('adler32'), ); return wantarray ? ($status, $def) : $def ; } 1; __END__ #line 1126 FILE33ca3c1e/PAR.pmo#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/PAR.pm" package PAR; $PAR::VERSION = '1.007'; use 5.006; use strict; use warnings; use Config '%Config'; use Carp qw/croak/; # If the 'prefork' module is available, we # register various run-time loaded modules with it. # That way, there is more shared memory in a forking # environment. BEGIN { if (eval 'require prefork') { prefork->import($_) for qw/ Archive::Zip File::Glob File::Spec File::Temp LWP::Simple PAR::Heavy /; # not including Archive::Unzip::Burst which only makes sense # in the context of a PAR::Packer'ed executable anyway. } } use PAR::SetupProgname; use PAR::SetupTemp; #line 311 use vars qw(@PAR_INC); # explicitly stated PAR library files (preferred) use vars qw(@PAR_INC_LAST); # explicitly stated PAR library files (fallback) use vars qw(%PAR_INC); # sets {$par}{$file} for require'd modules use vars qw(@LibCache %LibCache); # I really miss pseudohash. use vars qw($LastAccessedPAR $LastTempFile); use vars qw(@RepositoryObjects); # If we have PAR::Repository::Client support, we # put the ::Client objects in here. use vars qw(@PriorityRepositoryObjects); # repositories which are preferred over local stuff use vars qw(@UpgradeRepositoryObjects); # If we have PAR::Repository::Client's in upgrade mode # put the ::Client objects in here *as well*. use vars qw(%FileCache); # The Zip-file file-name-cache # Layout: # $FileCache{$ZipObj}{$FileName} = $Member use vars qw(%ArchivesExtracted); # Associates archive-zip-object => full extraction path my $ver = $Config{version}; my $arch = $Config{archname}; my $progname = $ENV{PAR_PROGNAME} || $0; my $is_insensitive_fs = ( -s $progname and (-s lc($progname) || -1) == (-s uc($progname) || -1) and (-s lc($progname) || -1) == -s $progname ); # lexical for import(), and _import_foo() functions to control unpar() my %unpar_options; # called on "use PAR" sub import { my $class = shift; PAR::SetupProgname::set_progname(); PAR::SetupTemp::set_par_temp_env(); $progname = $ENV{PAR_PROGNAME} ||= $0; $is_insensitive_fs = (-s $progname and (-s lc($progname) || -1) == (-s uc($progname) || -1)); my @args = @_; # Insert PAR hook in @INC. unshift @INC, \&find_par unless grep { $_ eq \&find_par } @INC; push @INC, \&find_par_last unless grep { $_ eq \&find_par_last } @INC; # process args to use PAR 'foo.par', { opts }, ...; foreach my $par (@args) { if (ref($par) eq 'HASH') { # we have been passed a hash reference _import_hash_ref($par); } elsif ($par =~ /[?*{}\[\]]/) { # implement globbing for PAR archives require File::Glob; foreach my $matched (File::Glob::glob($par)) { push @PAR_INC, unpar($matched, undef, undef, 1); } } else { # ordinary string argument => file push @PAR_INC, unpar($par, undef, undef, 1); } } return if $PAR::__import; local $PAR::__import = 1; require PAR::Heavy; PAR::Heavy::_init_dynaloader(); # The following code is executed for the case where the # running program is itself a PAR archive. # ==> run script/main.pl if (unpar($progname)) { # XXX - handle META.yml here! push @PAR_INC, unpar($progname, undef, undef, 1); _extract_inc($progname); if ($LibCache{$progname}) { # XXX bad: this us just a good guess require File::Spec; $ArchivesExtracted{$progname} = File::Spec->catdir($ENV{PAR_TEMP}, 'inc'); } my $zip = $LibCache{$progname}; my $member = _first_member( $zip, "script/main.pl", "main.pl", ); if ($progname and !$member) { require File::Spec; my @path = File::Spec->splitdir($progname); my $filename = pop @path; $member = _first_member( $zip, "script/".$filename, "script/".$filename.".pl", $filename, $filename.".pl", ) } # finally take $ARGV[0] as the hint for file to run if (defined $ARGV[0] and !$member) { $member = _first_member( $zip, "script/$ARGV[0]", "script/$ARGV[0].pl", $ARGV[0], "$ARGV[0].pl", ) or die qq(PAR.pm: Can't open perl script "$ARGV[0]": No such file or directory); shift @ARGV; } if (!$member) { die "Usage: $0 script_file_name.\n"; } _run_member($member); } } # import() helper for the "use PAR {...};" syntax. sub _import_hash_ref { my $opt = shift; # hash slice assignment -- pass all of the options into unpar local @unpar_options{keys(%$opt)} = values(%$opt); # check for incompatible options: if ( exists $opt->{repository} and exists $opt->{file} ) { croak("Invalid PAR loading options. Cannot have a 'repository' and 'file' option at the same time."); } elsif ( exists $opt->{file} and (exists $opt->{install} or exists $opt->{upgrade}) ) { my $e = exists($opt->{install}) ? 'install' : 'upgrade'; croak("Invalid PAR loading options. Cannot combine 'file' and '$e' options."); } elsif ( not exists $opt->{repository} and not exists $opt->{file} ) { croak("Invalid PAR loading options. Need at least one of 'file' or 'repository' options."); } # load from file if (exists $opt->{file}) { croak("Cannot load undefined PAR archive") if not defined $opt->{file}; # for files, we default to loading from PAR archive first my $fallback = $opt->{fallback}; $fallback = 0 if not defined $fallback; if (not $fallback) { # load from this PAR arch preferably push @PAR_INC, unpar($opt->{file}, undef, undef, 1); } else { # load from this PAR arch as fallback push @PAR_INC_LAST, unpar($opt->{file}, undef, undef, 1); } } else { # Deal with repositories elsewhere my $client = _import_repository($opt); return() if not $client; if (defined $opt->{run}) { # run was specified # run the specified script from the repository $client->run_script( $opt->{run} ); return 1; } return 1; } # run was specified # run the specified script from inside the PAR file. if (defined $opt->{run}) { my $script = $opt->{run}; require PAR::Heavy; PAR::Heavy::_init_dynaloader(); # XXX - handle META.yml here! _extract_inc($opt->{file}); my $zip = $LibCache{$opt->{file}}; my $member = _first_member( $zip, (($script !~ /^script\//) ? ("script/$script", "script/$script.pl") : ()), $script, "$script.pl", ); if (not defined $member) { croak("Cannot run script '$script' from PAR file '$opt->{file}'. Script couldn't be found in PAR file."); } _run_member_from_par($member); } return(); } # This sub is invoked by _import_hash_ref if a {repository} # option is found # Returns the repository client object on success. sub _import_repository { my $opt = shift; my $url = $opt->{repository}; eval "require PAR::Repository::Client; 1;"; if ($@ or not eval PAR::Repository::Client->VERSION >= 0.04) { croak "In order to use the 'use PAR { repository => 'url' };' syntax, you need to install the PAR::Repository::Client module (version 0.04 or later) from CPAN. This module does not seem to be installed as indicated by the following error message: $@"; } if ($opt->{upgrade} and not eval PAR::Repository::Client->VERSION >= 0.22) { croak "In order to use the 'upgrade' option, you need to install the PAR::Repository::Client module (version 0.22 or later) from CPAN"; } if ($opt->{dependencies} and not eval PAR::Repository::Client->VERSION >= 0.23) { croak "In order to use the 'dependencies' option, you need to install the PAR::Repository::Client module (version 0.23 or later) from CPAN"; } my $obj; # Support existing clients passed in as objects. if (ref($url) and UNIVERSAL::isa($url, 'PAR::Repository::Client')) { $obj = $url; } else { $obj = PAR::Repository::Client->new( uri => $url, auto_install => $opt->{install}, auto_upgrade => $opt->{upgrade}, static_dependencies => $opt->{dependencies}, ); } if (exists($opt->{fallback}) and not $opt->{fallback}) { unshift @PriorityRepositoryObjects, $obj; # repository beats local stuff } else { push @RepositoryObjects, $obj; # local stuff beats repository } # these are tracked separately so we can check for upgrades early push @UpgradeRepositoryObjects, $obj if $opt->{upgrade}; return $obj; } # Given an Archive::Zip obj and a list of files/paths, # this function returns the Archive::Zip::Member for the # first of the files found in the ZIP. If none is found, # returns the empty list. sub _first_member { my $zip = shift; foreach my $name (@_) { my $member = _cached_member_named($zip, $name); return $member if $member; } return; } # Given an Archive::Zip object, this finds the first # Archive::Zip member whose file name matches the # regular expression sub _first_member_matching { my $zip = shift; my $regex = shift; my $cache = $FileCache{$zip}; $cache = $FileCache{$zip} = _make_file_cache($zip) if not $cache; foreach my $name (keys %$cache) { if ($name =~ $regex) { return $cache->{$name}; } } return(); } sub _run_member_from_par { my $member = shift; my $clear_stack = shift; my ($fh, $is_new, $filename) = _tempfile($member->crc32String . ".pl"); if ($is_new) { my $file = $member->fileName; print $fh "package main;\n"; print $fh "#line 1 \"$file\"\n"; $member->extractToFileHandle($fh); seek ($fh, 0, 0); } $ENV{PAR_0} = $filename; # for Pod::Usage { do $filename; CORE::exit($1) if ($@ =~/^_TK_EXIT_\((\d+)\)/); die $@ if $@; exit; } } sub _run_member { my $member = shift; my $clear_stack = shift; my ($fh, $is_new, $filename) = _tempfile($member->crc32String . ".pl"); if ($is_new) { my $file = $member->fileName; print $fh "package main; shift \@INC;\n"; if (defined &Internals::PAR::CLEARSTACK and $clear_stack) { print $fh "Internals::PAR::CLEARSTACK();\n"; } print $fh "#line 1 \"$file\"\n"; $member->extractToFileHandle($fh); seek ($fh, 0, 0); } unshift @INC, sub { $fh }; $ENV{PAR_0} = $filename; # for Pod::Usage { do 'main'; CORE::exit($1) if ($@ =~/^_TK_EXIT_\((\d+)\)/); die $@ if $@; exit; } } sub _run_external_file { my $filename = shift; my $clear_stack = shift; require 5.008; open my $ffh, '<', $filename or die "Can't open perl script \"$filename\": $!"; my $clearstack = ''; if (defined &Internals::PAR::CLEARSTACK and $clear_stack) { $clear_stack = "Internals::PAR::CLEARSTACK();\n"; } my $string = "package main; shift \@INC;\n$clearstack#line 1 \"$filename\"\n" . do { local $/ = undef; <$ffh> }; close $ffh; open my $fh, '<', \$string or die "Can't open file handle to string: $!"; unshift @INC, sub { $fh }; $ENV{PAR_0} = $filename; # for Pod::Usage { do 'main'; CORE::exit($1) if ($@ =~/^_TK_EXIT_\((\d+)\)/); die $@ if $@; exit; } } # extract the contents of a .par (or .exe) or any # Archive::Zip handle to the PAR_TEMP/inc directory. # returns that directory. sub _extract_inc { my $file_or_azip_handle = shift; my $force_extract = shift; my $inc = "$PAR::SetupTemp::PARTemp/inc"; my $dlext = defined($Config{dlext}) ? $Config::Config{dlext} : ''; my $inc_exists = -d $inc; my $is_handle = ref($file_or_azip_handle) && $file_or_azip_handle->isa('Archive::Zip::Archive'); require File::Spec; if (!$inc_exists or $force_extract) { for (1 .. 10) { mkdir("$inc.lock", 0755) and last; sleep 1 } undef $@; if (!$is_handle) { # First try to unzip the *fast* way. eval { require Archive::Unzip::Burst; Archive::Unzip::Burst::unzip($file_or_azip_handle, $inc) and die "Could not unzip '$file_or_azip_handle' into '$inc'. Error: $!"; die; }; # This means the fast module is there, but didn't work. if ($@ =~ /^Could not unzip/) { die $@; } } # either failed to load Archive::Unzip::Burst or got an A::Zip handle # fallback to slow way. if ($is_handle || $@) { my $zip; if (!$is_handle) { open my $fh, '<', $file_or_azip_handle or die "Cannot find '$file_or_azip_handle': $!"; binmode($fh); bless($fh, 'IO::File'); $zip = Archive::Zip->new; ( $zip->readFromFileHandle($fh, $file_or_azip_handle) == Archive::Zip::AZ_OK() ) or die "Read '$file_or_azip_handle' error: $!"; } else { $zip = $file_or_azip_handle; } mkdir($inc) if not -d $inc; for ( $zip->memberNames() ) { s{^/}{}; # Skip DLLs (these will be handled by the dynaloader hook) # except for those placed in File::ShareDir directories. next if (m{\.\Q$dlext\E[^/]*$} && !m{^lib/auto/share/(dist|module)/}); my $outfile = File::Spec->catfile($inc, $_); next if -e $outfile and not -w _; $zip->extractMember($_, "$inc/" . $_); } } rmdir("$inc.lock"); $ArchivesExtracted{$is_handle ? $file_or_azip_handle->fileName() : $file_or_azip_handle} = $inc; } # add the freshly extracted directories to @INC, # but make sure there's no duplicates my %inc_exists = map { ($_, 1) } @INC; unshift @INC, grep !exists($inc_exists{$_}), grep -d, map File::Spec->catdir($inc, @$_), [ 'lib' ], [ 'arch' ], [ $arch ], [ $ver ], [ $ver, $arch ], []; return $inc; } # This is the hook placed in @INC for loading PAR's # before any other stuff in @INC sub find_par { my @args = @_; # if there are repositories in upgrade mode, check them # first. If so, this is expensive, of course! if (@UpgradeRepositoryObjects) { my $module = $args[1]; $module =~ s/\.pm$//; $module =~ s/\//::/g; foreach my $client (@UpgradeRepositoryObjects) { my $local_file = $client->upgrade_module($module); # break the require if upgrade_module has been required already # to avoid infinite recursion if (exists $INC{$args[1]}) { # Oh dear. Check for the possible return values of the INC sub hooks in # perldoc -f require before trying to understand this. # Then, realize that if you pass undef for the file handle, perl (5.8.9) # does NOT use the subroutine. Thus the hacky GLOB ref. my $line = 1; no warnings; return (\*I_AM_NOT_HERE, sub {$line ? ($_="1;",$line=0,return(1)) : ($_="",return(0))}); } # Note: This is likely not necessary as the module has been installed # into the system by upgrade_module if it was available at all. # If it was already loaded, this will not be reached (see return right above). # If it could not be loaded from the system and neither found in the repository, # we simply want to have the normal error message, too! # #if ($local_file) { # # XXX load with fallback - is that right? # return _find_par_internals([$PAR_INC_LAST[-1]], @args); #} } } my $rv = _find_par_internals(\@PAR_INC, @args); return $rv if defined $rv or not @PriorityRepositoryObjects; # the repositories that are prefered over locally installed modules my $module = $args[1]; $module =~ s/\.pm$//; $module =~ s/\//::/g; foreach my $client (@PriorityRepositoryObjects) { my $local_file = $client->get_module($module, 0); # 1 == fallback if ($local_file) { # Not loaded as fallback (cf. PRIORITY) thus look at PAR_INC # instead of PAR_INC_LAST return _find_par_internals([$PAR_INC[-1]], @args); } } return(); } # This is the hook placed in @INC for loading PAR's # AFTER any other stuff in @INC # It also deals with loading from repositories as a # fallback-fallback ;) sub find_par_last { my @args = @_; # Try the local PAR files first my $rv = _find_par_internals(\@PAR_INC_LAST, @args); return $rv if defined $rv; # No repositories => return return $rv if not @RepositoryObjects; my $module = $args[1]; $module =~ s/\.pm$//; $module =~ s/\//::/g; foreach my $client (@RepositoryObjects) { my $local_file = $client->get_module($module, 1); # 1 == fallback if ($local_file) { # Loaded as fallback thus look at PAR_INC_LAST return _find_par_internals([$PAR_INC_LAST[-1]], @args); } } return $rv; } # This routine implements loading modules from PARs # both for loading PARs preferably or as fallback. # To distinguish the cases, the first parameter should # be a reference to the corresponding @PAR_INC* array. sub _find_par_internals { my ($INC_ARY, $self, $file, $member_only) = @_; my $scheme; foreach (@$INC_ARY ? @$INC_ARY : @INC) { my $path = $_; if ($] < 5.008001) { # reassemble from "perl -Ischeme://path" autosplitting $path = "$scheme:$path" if !@$INC_ARY and $path and $path =~ m!//! and $scheme and $scheme =~ /^\w+$/; $scheme = $path; } my $rv = unpar($path, $file, $member_only, 1) or next; $PAR_INC{$path}{$file} = 1; $INC{$file} = $LastTempFile if (lc($file) =~ /^(?!tk).*\.pm$/); return $rv; } return; } sub reload_libs { my @par_files = @_; @par_files = sort keys %LibCache unless @par_files; foreach my $par (@par_files) { my $inc_ref = $PAR_INC{$par} or next; delete $LibCache{$par}; delete $FileCache{$par}; foreach my $file (sort keys %$inc_ref) { delete $INC{$file}; require $file; } } } #sub find_zip_member { # my $file = pop; # # foreach my $zip (@LibCache) { # my $member = _first_member($zip, $file) or next; # return $member; # } # # return; #} sub read_file { my $file = pop; foreach my $zip (@LibCache) { my $member = _first_member($zip, $file) or next; return scalar $member->contents; } return; } sub par_handle { my $par = pop; return $LibCache{$par}; } my %escapes; sub unpar { my ($par, $file, $member_only, $allow_other_ext) = @_; return if not defined $par; my $zip = $LibCache{$par}; my @rv = $par; # a guard against (currently unimplemented) recursion return if $PAR::__unpar; local $PAR::__unpar = 1; unless ($zip) { # URL use case ==> download if ($par =~ m!^\w+://!) { require File::Spec; require LWP::Simple; # reflector support $par .= "pm=$file" if $par =~ /[?&;]/; # prepare cache directory $ENV{PAR_CACHE} ||= '_par'; mkdir $ENV{PAR_CACHE}, 0777; if (!-d $ENV{PAR_CACHE}) { $ENV{PAR_CACHE} = File::Spec->catdir(File::Spec->tmpdir, 'par'); mkdir $ENV{PAR_CACHE}, 0777; return unless -d $ENV{PAR_CACHE}; } # Munge URL into local file name # FIXME: This might result in unbelievably long file names! # I have run into the file/path length limitations of linux # with similar code in PAR::Repository::Client. # I suspect this is even worse on Win32. # -- Steffen my $file = $par; if (!%escapes) { $escapes{chr($_)} = sprintf("%%%02X", $_) for 0..255; } { use bytes; $file =~ s/([^\w\.])/$escapes{$1}/g; } $file = File::Spec->catfile( $ENV{PAR_CACHE}, $file); LWP::Simple::mirror( $par, $file ); return unless -e $file and -f _; $par = $file; } # Got the .par as a string. (reference to scalar, of course) elsif (ref($par) eq 'SCALAR') { my ($fh) = _tempfile(); print $fh $$par; $par = $fh; } # If the par is not a valid .par file name and we're being strict # about this, then also check whether "$par.par" exists elsif (!(($allow_other_ext or $par =~ /\.par\z/i) and -f $par)) { $par .= ".par"; return unless -f $par; } require Archive::Zip; $zip = Archive::Zip->new; my @file; if (!ref $par) { @file = $par; open my $fh, '<', $par; binmode($fh); $par = $fh; bless($par, 'IO::File'); } Archive::Zip::setErrorHandler(sub {}); my $rv = $zip->readFromFileHandle($par, @file); Archive::Zip::setErrorHandler(undef); return unless $rv == Archive::Zip::AZ_OK(); push @LibCache, $zip; $LibCache{$_[0]} = $zip; $FileCache{$_[0]} = _make_file_cache($zip); # only recursive case -- appears to be unused and unimplemented foreach my $member ( _cached_members_matching($zip, "^par/(?:$Config{version}/)?(?:$Config{archname}/)?" ) ) { next if $member->isDirectory; my $content = $member->contents(); next unless $content =~ /^PK\003\004/; push @rv, unpar(\$content, undef, undef, 1); } # extract all shlib dlls from the .par to $ENV{PAR_TEMP} # Intended to fix problem with Alien::wxWidgets/Wx... # NOTE auto/foo/foo.so|dll will get handled by the dynaloader # hook, so no need to pull it out here. # Allow this to be disabled so caller can do their own caching # via import({no_shlib_unpack => 1, file => foo.par}) if(not $unpar_options{no_shlib_unpack} and defined $ENV{PAR_TEMP}) { my @members = _cached_members_matching( $zip, qr#^shlib/$Config{archname}/.*\.\Q$Config{dlext}\E(?:\.|$)# ); foreach my $member (@members) { next if $member->isDirectory; my $member_name = $member->fileName; next unless $member_name =~ m{ \/([^/]+)$ }x or $member_name =~ m{ ^([^/]+)$ }; my $extract_name = $1; my $dest_name = File::Spec->catfile($ENV{PAR_TEMP}, $extract_name); # but don't extract it if we've already got one $member->extractToFileNamed($dest_name) unless(-e $dest_name); } } # Now push this path into usual library search paths my $separator = $Config{path_sep}; my $tempdir = $ENV{PAR_TEMP}; foreach my $key (qw( LD_LIBRARY_PATH LIB_PATH LIBRARY_PATH PATH DYLD_LIBRARY_PATH )) { if (defined $ENV{$key} and $ENV{$key} ne '') { # Check whether it's already in the path. If so, don't # append the PAR temp dir in order not to overflow the # maximum length for ENV vars. $ENV{$key} .= $separator . $tempdir unless grep { $_ eq $tempdir } split $separator, $ENV{$key}; } else { $ENV{$key} = $tempdir; } } } $LastAccessedPAR = $zip; return @rv unless defined $file; my $member = _first_member($zip, "lib/$file", "arch/$file", "$arch/$file", "$ver/$file", "$ver/$arch/$file", $file, ) or return; return $member if $member_only; my ($fh, $is_new); ($fh, $is_new, $LastTempFile) = _tempfile($member->crc32String . ".pm"); die "Bad Things Happened..." unless $fh; if ($is_new) { $member->extractToFileHandle($fh); seek ($fh, 0, 0); } return $fh; } sub _tempfile { my ($fh, $filename); if ($ENV{PAR_CLEAN} or !@_) { require File::Temp; if (defined &File::Temp::tempfile) { # under Win32, the file is created with O_TEMPORARY, # and will be deleted by the C runtime; having File::Temp # delete it has the only effect of giving ugly warnings ($fh, $filename) = File::Temp::tempfile( DIR => $PAR::SetupTemp::PARTemp, UNLINK => ($^O ne 'MSWin32' and $^O !~ /hpux/), ) or die "Cannot create temporary file: $!"; binmode($fh); return ($fh, 1, $filename); } } require File::Spec; # untainting tempfile path local $_ = File::Spec->catfile( $PAR::SetupTemp::PARTemp, $_[0] ); /^(.+)$/ and $filename = $1; if (-r $filename) { open $fh, '<', $filename or die $!; binmode($fh); return ($fh, 0, $filename); } open $fh, '+>', $filename or die $!; binmode($fh); return ($fh, 1, $filename); } # Given an Archive::Zip object, this generates a hash of # file_name_in_zip => file object # and returns a reference to that. # If we broke the encapsulation of A::Zip::Member and # accessed $member->{fileName} directly, that would be # *significantly* faster. sub _make_file_cache { my $zip = shift; if (not ref($zip)) { croak("_make_file_cache needs an Archive::Zip object as argument."); } my $cache = {}; foreach my $member ($zip->members) { $cache->{$member->fileName()} = $member; } return $cache; } # given an Archive::Zip object, this finds the cached hash # of Archive::Zip member names => members, # and returns all member objects whose file names match # a regexp # Without file caching, it just uses $zip->membersMatching sub _cached_members_matching { my $zip = shift; my $regex = shift; my $cache = $FileCache{$zip}; $cache = $FileCache{$zip} = _make_file_cache($zip) if not $cache; return map {$cache->{$_}} grep { $_ =~ $regex } keys %$cache; } # access named zip file member through cache. Fall # back to using Archive::Zip (slow) sub _cached_member_named { my $zip = shift; my $name = shift; my $cache = $FileCache{$zip}; $cache = $FileCache{$zip} = _make_file_cache($zip) if not $cache; return $cache->{$name}; } # Attempt to clean up the temporary directory if # --> We're running in clean mode # --> It's defined # --> It's an existing directory # --> It's empty END { if (exists $ENV{PAR_CLEAN} and $ENV{PAR_CLEAN} and exists $ENV{PAR_TEMP} and defined $ENV{PAR_TEMP} and -d $ENV{PAR_TEMP} ) { local($!); # paranoid: ignore potential errors without clobbering a global variable! rmdir($ENV{PAR_TEMP}); } } 1; __END__ #line 1249 FILEe4d89e60/PAR/Dist.pmy#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/PAR/Dist.pm" package PAR::Dist; use 5.006; use strict; require Exporter; use vars qw/$VERSION @ISA @EXPORT @EXPORT_OK $DEBUG/; $VERSION = '0.49'; # Change version in POD, too! @ISA = 'Exporter'; @EXPORT = qw/ blib_to_par install_par uninstall_par sign_par verify_par merge_par remove_man get_meta generate_blib_stub /; @EXPORT_OK = qw/ parse_dist_name contains_binaries /; $DEBUG = 0; use Carp qw/carp croak/; use File::Spec; #line 142 sub blib_to_par { @_ = (path => @_) if @_ == 1; my %args = @_; require Config; # don't use 'my $foo ... if ...' it creates a static variable! my $quiet = $args{quiet} || 0; my $dist; my $path = $args{path}; $dist = File::Spec->rel2abs($args{dist}) if $args{dist}; my $name = $args{name}; my $version = $args{version}; my $suffix = $args{suffix} || "$Config::Config{archname}-$Config::Config{version}.par"; my $cwd; if (defined $path) { require Cwd; $cwd = Cwd::cwd(); chdir $path; } _build_blib() unless -d "blib"; my @files; open MANIFEST, ">", File::Spec->catfile("blib", "MANIFEST") or die $!; open META, ">", File::Spec->catfile("blib", "META.yml") or die $!; require File::Find; File::Find::find( sub { next unless $File::Find::name; (-r && !-d) and push ( @files, substr($File::Find::name, 5) ); } , 'blib' ); print MANIFEST join( "\n", ' ', (sort @files), q( # ) ); close MANIFEST; # if MYMETA.yml exists, that takes precedence over META.yml my $meta_file_name = "META.yml"; my $mymeta_file_name = "MYMETA.yml"; $meta_file_name = -s $mymeta_file_name ? $mymeta_file_name : $meta_file_name; if (open(OLD_META, $meta_file_name)) { while () { if (/^distribution_type:/) { print META "distribution_type: par\n"; } else { print META $_; } if (/^name:\s+(.*)/) { $name ||= $1; $name =~ s/::/-/g; } elsif (/^version:\s+.*Module::Build::Version/) { while () { /^\s+original:\s+(.*)/ or next; $version ||= $1; last; } } elsif (/^version:\s+(.*)/) { $version ||= $1; } } close OLD_META; close META; } if ((!$name or !$version) and open(MAKEFILE, "Makefile")) { while () { if (/^DISTNAME\s+=\s+(.*)$/) { $name ||= $1; } elsif (/^VERSION\s+=\s+(.*)$/) { $version ||= $1; } } } if (not defined($name) or not defined($version)) { # could not determine name or version. Error. my $what; if (not defined $name) { $what = 'name'; $what .= ' and version' if not defined $version; } elsif (not defined $version) { $what = 'version'; } carp("I was unable to determine the $what of the PAR distribution. Please create a Makefile or META.yml file from which we can infer the information or just specify the missing information as an option to blib_to_par."); return(); } $name =~ s/\s+$//; $version =~ s/\s+$//; my $file = "$name-$version-$suffix"; unlink $file if -f $file; print META << "YAML" if fileno(META); name: $name version: $version build_requires: {} conflicts: {} dist_name: $file distribution_type: par dynamic_config: 0 generated_by: 'PAR::Dist version $PAR::Dist::VERSION' license: unknown YAML close META; mkdir('blib', 0777); chdir('blib'); require Cwd; my $zipoutfile = File::Spec->catfile(File::Spec->updir, $file); _zip(dist => $zipoutfile); chdir(File::Spec->updir); unlink File::Spec->catfile("blib", "MANIFEST"); unlink File::Spec->catfile("blib", "META.yml"); $dist ||= File::Spec->catfile($cwd, $file) if $cwd; if ($dist and $file ne $dist) { if ( File::Copy::copy($file, $dist) ) { unlink $file; } else { die "Cannot copy $file: $!"; } $file = $dist; } my $pathname = File::Spec->rel2abs($file); if ($^O eq 'MSWin32') { $pathname =~ s!\\!/!g; $pathname =~ s!:!|!g; }; print << "." if !$quiet; Successfully created binary distribution '$file'. Its contents are accessible in compliant browsers as: jar:file://$pathname!/MANIFEST . chdir $cwd if $cwd; return $file; } sub _build_blib { if (-e 'Build') { _system_wrapper($^X, "Build"); } elsif (-e 'Makefile') { _system_wrapper($Config::Config{make}); } elsif (-e 'Build.PL') { _system_wrapper($^X, "Build.PL"); _system_wrapper($^X, "Build"); } elsif (-e 'Makefile.PL') { _system_wrapper($^X, "Makefile.PL"); _system_wrapper($Config::Config{make}); } } #line 401 sub install_par { my %args = &_args; _install_or_uninstall(%args, action => 'install'); } #line 422 sub uninstall_par { my %args = &_args; _install_or_uninstall(%args, action => 'uninstall'); } sub _install_or_uninstall { my %args = &_args; my $name = $args{name}; my $action = $args{action}; my %ENV_copy = %ENV; $ENV{PERL_INSTALL_ROOT} = $args{prefix} if defined $args{prefix}; require Cwd; my $old_dir = Cwd::cwd(); my ($dist, $tmpdir) = _unzip_to_tmpdir( dist => $args{dist}, subdir => 'blib' ); if ( open (META, File::Spec->catfile('blib', 'META.yml')) ) { while () { next unless /^name:\s+(.*)/; $name = $1; $name =~ s/\s+$//; last; } close META; } return if not defined $name or $name eq ''; if (-d 'script') { require ExtUtils::MY; foreach my $file (glob("script/*")) { next unless -T $file; ExtUtils::MY->fixin($file); chmod(0555, $file); } } $name =~ s{::|-}{/}g; require ExtUtils::Install; if ($action eq 'install') { my $target = _installation_target( File::Spec->curdir, $name, \%args ); my $custom_targets = $args{custom_targets} || {}; $target->{$_} = $custom_targets->{$_} foreach keys %{$custom_targets}; my $uninstall_shadows = $args{uninstall_shadows}; my $verbose = $args{verbose}; ExtUtils::Install::install($target, $verbose, 0, $uninstall_shadows); } elsif ($action eq 'uninstall') { require Config; my $verbose = $args{verbose}; ExtUtils::Install::uninstall( $args{packlist_read}||"$Config::Config{installsitearch}/auto/$name/.packlist", $verbose ); } %ENV = %ENV_copy; chdir($old_dir); File::Path::rmtree([$tmpdir]); return 1; } # Returns the default installation target as used by # ExtUtils::Install::install(). First parameter should be the base # directory containing the blib/ we're installing from. # Second parameter should be the name of the distribution for the packlist # paths. Third parameter may be a hash reference with user defined keys for # the target hash. In fact, any contents that do not start with 'inst_' are # skipped. sub _installation_target { require Config; my $dir = shift; my $name = shift; my $user = shift || {}; # accepted sources (and user overrides) my %sources = ( inst_lib => File::Spec->catdir($dir,"blib","lib"), inst_archlib => File::Spec->catdir($dir,"blib","arch"), inst_bin => File::Spec->catdir($dir,'blib','bin'), inst_script => File::Spec->catdir($dir,'blib','script'), inst_man1dir => File::Spec->catdir($dir,'blib','man1'), inst_man3dir => File::Spec->catdir($dir,'blib','man3'), packlist_read => 'read', packlist_write => 'write', ); my $par_has_archlib = _directory_not_empty( $sources{inst_archlib} ); # default targets my $target = { read => $Config::Config{sitearchexp}."/auto/$name/.packlist", write => $Config::Config{installsitearch}."/auto/$name/.packlist", $sources{inst_lib} => ($par_has_archlib ? $Config::Config{installsitearch} : $Config::Config{installsitelib}), $sources{inst_archlib} => $Config::Config{installsitearch}, $sources{inst_bin} => $Config::Config{installbin} , $sources{inst_script} => $Config::Config{installscript}, $sources{inst_man1dir} => $Config::Config{installman1dir}, $sources{inst_man3dir} => $Config::Config{installman3dir}, }; # Included for future support for ${flavour}perl external lib installation # if ($Config::Config{flavour_perl}) { # my $ext = File::Spec->catdir($dir, 'blib', 'ext'); # # from => to # $sources{inst_external_lib} = File::Spec->catdir($ext, 'lib'); # $sources{inst_external_bin} = File::Spec->catdir($ext, 'bin'); # $sources{inst_external_include} = File::Spec->catdir($ext, 'include'); # $sources{inst_external_src} = File::Spec->catdir($ext, 'src'); # $target->{ $sources{inst_external_lib} } = $Config::Config{flavour_install_lib}; # $target->{ $sources{inst_external_bin} } = $Config::Config{flavour_install_bin}; # $target->{ $sources{inst_external_include} } = $Config::Config{flavour_install_include}; # $target->{ $sources{inst_external_src} } = $Config::Config{flavour_install_src}; # } # insert user overrides foreach my $key (keys %$user) { my $value = $user->{$key}; if (not defined $value and $key ne 'packlist_read' and $key ne 'packlist_write') { # undef means "remove" delete $target->{ $sources{$key} }; } elsif (exists $sources{$key}) { # overwrite stuff, don't let the user create new entries $target->{ $sources{$key} } = $value; } } # apply the automatic inst_lib => inst_archlib conversion again # if the user asks for it and there is an archlib in the .par if ($user->{auto_inst_lib_conversion} and $par_has_archlib) { $target->{inst_lib} = $target->{inst_archlib}; } return $target; } sub _directory_not_empty { require File::Find; my($dir) = @_; my $files = 0; File::Find::find(sub { return if $_ eq ".exists"; if (-f) { $File::Find::prune++; $files = 1; } }, $dir); return $files; } #line 589 sub sign_par { my %args = &_args; _verify_or_sign(%args, action => 'sign'); } #line 604 sub verify_par { my %args = &_args; $! = _verify_or_sign(%args, action => 'verify'); return ( $! == Module::Signature::SIGNATURE_OK() ); } #line 633 sub merge_par { my $base_par = shift; my @additional_pars = @_; require Cwd; require File::Copy; require File::Path; require File::Find; # parameter checking if (not defined $base_par) { croak "First argument to merge_par() must be the .par archive to modify."; } if (not -f $base_par or not -r _ or not -w _) { croak "'$base_par' is not a file or you do not have enough permissions to read and modify it."; } foreach (@additional_pars) { if (not -f $_ or not -r _) { croak "'$_' is not a file or you do not have enough permissions to read it."; } } # The unzipping will change directories. Remember old dir. my $old_cwd = Cwd::cwd(); # Unzip the base par to a temp. dir. (undef, my $base_dir) = _unzip_to_tmpdir( dist => $base_par, subdir => 'blib' ); my $blibdir = File::Spec->catdir($base_dir, 'blib'); # move the META.yml to the (main) temp. dir. my $main_meta_file = File::Spec->catfile($base_dir, 'META.yml'); File::Copy::move( File::Spec->catfile($blibdir, 'META.yml'), $main_meta_file ); # delete (incorrect) MANIFEST unlink File::Spec->catfile($blibdir, 'MANIFEST'); # extract additional pars and merge foreach my $par (@additional_pars) { # restore original directory because the par path # might have been relative! chdir($old_cwd); (undef, my $add_dir) = _unzip_to_tmpdir( dist => $par ); # merge the meta (at least the provides info) into the main meta.yml my $meta_file = File::Spec->catfile($add_dir, 'META.yml'); if (-f $meta_file) { _merge_meta($main_meta_file, $meta_file); } my @files; my @dirs; # I hate File::Find # And I hate writing portable code, too. File::Find::find( {wanted =>sub { my $file = $File::Find::name; push @files, $file if -f $file; push @dirs, $file if -d _; }}, $add_dir ); my ($vol, $subdir, undef) = File::Spec->splitpath( $add_dir, 1); my @dir = File::Spec->splitdir( $subdir ); # merge directory structure foreach my $dir (@dirs) { my ($v, $d, undef) = File::Spec->splitpath( $dir, 1 ); my @d = File::Spec->splitdir( $d ); shift @d foreach @dir; # remove tmp dir from path my $target = File::Spec->catdir( $blibdir, @d ); mkdir($target); } # merge files foreach my $file (@files) { my ($v, $d, $f) = File::Spec->splitpath( $file ); my @d = File::Spec->splitdir( $d ); shift @d foreach @dir; # remove tmp dir from path my $target = File::Spec->catfile( File::Spec->catdir( $blibdir, @d ), $f ); File::Copy::copy($file, $target) or die "Could not copy '$file' to '$target': $!"; } chdir($old_cwd); File::Path::rmtree([$add_dir]); } # delete (copied) MANIFEST and META.yml unlink File::Spec->catfile($blibdir, 'MANIFEST'); unlink File::Spec->catfile($blibdir, 'META.yml'); chdir($base_dir); my $resulting_par_file = Cwd::abs_path(blib_to_par(quiet => 1)); chdir($old_cwd); File::Copy::move($resulting_par_file, $base_par); File::Path::rmtree([$base_dir]); } sub _merge_meta { my $meta_orig_file = shift; my $meta_extra_file = shift; return() if not defined $meta_orig_file or not -f $meta_orig_file; return 1 if not defined $meta_extra_file or not -f $meta_extra_file; my $yaml_functions = _get_yaml_functions(); die "Cannot merge META.yml files without a YAML reader/writer" if !exists $yaml_functions->{LoadFile} or !exists $yaml_functions->{DumpFile}; my $orig_meta = $yaml_functions->{LoadFile}->($meta_orig_file); my $extra_meta = $yaml_functions->{LoadFile}->($meta_extra_file); # I seem to remember there was this incompatibility between the different # YAML implementations with regards to "document" handling: my $orig_tree = (ref($orig_meta) eq 'ARRAY' ? $orig_meta->[0] : $orig_meta); my $extra_tree = (ref($extra_meta) eq 'ARRAY' ? $extra_meta->[0] : $extra_meta); _merge_provides($orig_tree, $extra_tree); _merge_requires($orig_tree, $extra_tree); $yaml_functions->{DumpFile}->($meta_orig_file, $orig_meta); return 1; } # merge the two-level provides sections of META.yml sub _merge_provides { my $orig_hash = shift; my $extra_hash = shift; return() if not exists $extra_hash->{provides}; $orig_hash->{provides} ||= {}; my $orig_provides = $orig_hash->{provides}; my $extra_provides = $extra_hash->{provides}; # two level clone is enough wrt META spec 1.4 # overwrite the original provides since we're also overwriting the files. foreach my $module (keys %$extra_provides) { my $extra_mod_hash = $extra_provides->{$module}; my %mod_hash; $mod_hash{$_} = $extra_mod_hash->{$_} for keys %$extra_mod_hash; $orig_provides->{$module} = \%mod_hash; } } # merge the single-level requires-like sections of META.yml sub _merge_requires { my $orig_hash = shift; my $extra_hash = shift; foreach my $type (qw(requires build_requires configure_requires recommends)) { next if not exists $extra_hash->{$type}; $orig_hash->{$type} ||= {}; # one level clone is enough wrt META spec 1.4 foreach my $module (keys %{ $extra_hash->{$type} }) { # FIXME there should be a version comparison here, BUT how are we going to do that without a guaranteed version.pm? $orig_hash->{$type}{$module} = $extra_hash->{$type}{$module}; # assign version and module name } } } #line 822 sub remove_man { my %args = &_args; my $par = $args{dist}; require Cwd; require File::Copy; require File::Path; require File::Find; # parameter checking if (not defined $par) { croak "First argument to remove_man() must be the .par archive to modify."; } if (not -f $par or not -r _ or not -w _) { croak "'$par' is not a file or you do not have enough permissions to read and modify it."; } # The unzipping will change directories. Remember old dir. my $old_cwd = Cwd::cwd(); # Unzip the base par to a temp. dir. (undef, my $base_dir) = _unzip_to_tmpdir( dist => $par, subdir => 'blib' ); my $blibdir = File::Spec->catdir($base_dir, 'blib'); # move the META.yml to the (main) temp. dir. File::Copy::move( File::Spec->catfile($blibdir, 'META.yml'), File::Spec->catfile($base_dir, 'META.yml') ); # delete (incorrect) MANIFEST unlink File::Spec->catfile($blibdir, 'MANIFEST'); opendir DIRECTORY, 'blib' or die $!; my @dirs = grep { /^blib\/(?:man\d*|html)$/ } grep { -d $_ } map { File::Spec->catfile('blib', $_) } readdir DIRECTORY; close DIRECTORY; File::Path::rmtree(\@dirs); chdir($base_dir); my $resulting_par_file = Cwd::abs_path(blib_to_par()); chdir($old_cwd); File::Copy::move($resulting_par_file, $par); File::Path::rmtree([$base_dir]); } #line 888 sub get_meta { my %args = &_args; my $dist = $args{dist}; return undef if not defined $dist or not -r $dist; require Cwd; require File::Path; # The unzipping will change directories. Remember old dir. my $old_cwd = Cwd::cwd(); # Unzip the base par to a temp. dir. (undef, my $base_dir) = _unzip_to_tmpdir( dist => $dist, subdir => 'blib' ); my $blibdir = File::Spec->catdir($base_dir, 'blib'); my $meta = File::Spec->catfile($blibdir, 'META.yml'); if (not -r $meta) { return undef; } open FH, '<', $meta or die "Could not open file '$meta' for reading: $!"; local $/ = undef; my $meta_text = ; close FH; chdir($old_cwd); File::Path::rmtree([$base_dir]); return $meta_text; } sub _unzip { my %args = &_args; my $dist = $args{dist}; my $path = $args{path} || File::Spec->curdir; return unless -f $dist; # Try fast unzipping first if (eval { require Archive::Unzip::Burst; 1 }) { my $return = !Archive::Unzip::Burst::unzip($dist, $path); return if $return; # true return value == error (a la system call) } # Then slow unzipping if (eval { require Archive::Zip; 1 }) { my $zip = Archive::Zip->new; local %SIG; $SIG{__WARN__} = sub { print STDERR $_[0] unless $_[0] =~ /\bstat\b/ }; return unless $zip->read($dist) == Archive::Zip::AZ_OK() and $zip->extractTree('', "$path/") == Archive::Zip::AZ_OK(); } # Then fall back to the system else { undef $!; if (_system_wrapper(unzip => $dist, '-d', $path)) { die "Failed to unzip '$dist' to path '$path': Could neither load " . "Archive::Zip nor (successfully) run the system 'unzip' (unzip said: $!)"; } } return 1; } sub _zip { my %args = &_args; my $dist = $args{dist}; if (eval { require Archive::Zip; 1 }) { my $zip = Archive::Zip->new; $zip->addTree( File::Spec->curdir, '' ); $zip->writeToFileNamed( $dist ) == Archive::Zip::AZ_OK() or die $!; } else { undef $!; if (_system_wrapper(qw(zip -r), $dist, File::Spec->curdir)) { die "Failed to zip '" .File::Spec->curdir(). "' to '$dist': Could neither load " . "Archive::Zip nor (successfully) run the system 'zip' (zip said: $!)"; } } return 1; } # This sub munges the arguments to most of the PAR::Dist functions # into a hash. On the way, it downloads PAR archives as necessary, etc. sub _args { # default to the first .par in the CWD if (not @_) { @_ = (glob('*.par'))[0]; } # single argument => it's a distribution file name or URL @_ = (dist => @_) if @_ == 1; my %args = @_; $args{name} ||= $args{dist}; # If we are installing from an URL, we want to munge the # distribution name so that it is in form "Module-Name" if (defined $args{name}) { $args{name} =~ s/^\w+:\/\///; my @elems = parse_dist_name($args{name}); # @elems is name, version, arch, perlversion if (defined $elems[0]) { $args{name} = $elems[0]; } else { $args{name} =~ s/^.*\/([^\/]+)$/$1/; $args{name} =~ s/^([0-9A-Za-z_-]+)-\d+\..+$/$1/; } } # append suffix if there is none if ($args{dist} and not $args{dist} =~ /\.[a-zA-Z_][^.]*$/) { require Config; my $suffix = $args{suffix}; $suffix ||= "$Config::Config{archname}-$Config::Config{version}.par"; $args{dist} .= "-$suffix"; } # download if it's an URL if ($args{dist} and $args{dist} =~ m!^\w+://!) { $args{dist} = _fetch(dist => $args{dist}) } return %args; } # Download PAR archive, but only if necessary (mirror!) my %escapes; sub _fetch { my %args = @_; if ($args{dist} =~ s/^file:\/\///) { return $args{dist} if -e $args{dist}; return; } require LWP::Simple; $ENV{PAR_TEMP} ||= File::Spec->catdir(File::Spec->tmpdir, 'par'); mkdir $ENV{PAR_TEMP}, 0777; %escapes = map { chr($_) => sprintf("%%%02X", $_) } 0..255 unless %escapes; $args{dist} =~ s{^cpan://((([a-zA-Z])[a-zA-Z])[-_a-zA-Z]+)/} {http://www.cpan.org/modules/by-authors/id/\U$3/$2/$1\E/}; my $file = $args{dist}; $file =~ s/([^\w\.])/$escapes{$1}/g; $file = File::Spec->catfile( $ENV{PAR_TEMP}, $file); my $rc = LWP::Simple::mirror( $args{dist}, $file ); if (!LWP::Simple::is_success($rc) and $rc != 304) { die "Error $rc: ", LWP::Simple::status_message($rc), " ($args{dist})\n"; } return $file if -e $file; return; } sub _verify_or_sign { my %args = &_args; require File::Path; require Module::Signature; die "Module::Signature version 0.25 required" unless Module::Signature->VERSION >= 0.25; require Cwd; my $cwd = Cwd::cwd(); my $action = $args{action}; my ($dist, $tmpdir) = _unzip_to_tmpdir($args{dist}); $action ||= (-e 'SIGNATURE' ? 'verify' : 'sign'); if ($action eq 'sign') { open FH, '>SIGNATURE' unless -e 'SIGNATURE'; open FH, 'MANIFEST' or die $!; local $/; my $out = ; if ($out !~ /^SIGNATURE(?:\s|$)/m) { $out =~ s/^(?!\s)/SIGNATURE\n/m; open FH, '>MANIFEST' or die $!; print FH $out; } close FH; $args{overwrite} = 1 unless exists $args{overwrite}; $args{skip} = 0 unless exists $args{skip}; } my $rv = Module::Signature->can($action)->(%args); _zip(dist => $dist) if $action eq 'sign'; File::Path::rmtree([$tmpdir]); chdir($cwd); return $rv; } sub _unzip_to_tmpdir { my %args = &_args; require File::Temp; my $dist = File::Spec->rel2abs($args{dist}); my $tmpdirname = File::Spec->catdir(File::Spec->tmpdir, "parXXXXX"); my $tmpdir = File::Temp::mkdtemp($tmpdirname) or die "Could not create temporary directory from template '$tmpdirname': $!"; my $path = $tmpdir; $path = File::Spec->catdir($tmpdir, $args{subdir}) if defined $args{subdir}; _unzip(dist => $dist, path => $path); chdir $tmpdir; return ($dist, $tmpdir); } #line 1136 sub parse_dist_name { my $file = shift; return(undef, undef, undef, undef) if not defined $file; (undef, undef, $file) = File::Spec->splitpath($file); my $version = qr/v?(?:\d+(?:_\d+)?|\d*(?:\.\d+(?:_\d+)?)+)/; $file =~ s/\.(?:par|tar\.gz|tar)$//i; my @elem = split /-/, $file; my (@dn, $dv, @arch, $pv); while (@elem) { my $e = shift @elem; if ( $e =~ /^$version$/o and not(# if not next token also a version # (assumes an arch string doesnt start with a version...) @elem and $elem[0] =~ /^$version$/o ) ) { $dv = $e; last; } push @dn, $e; } my $dn; $dn = join('-', @dn) if @dn; if (not @elem) { return( $dn, $dv, undef, undef); } while (@elem) { my $e = shift @elem; if ($e =~ /^(?:$version|any_version)$/) { $pv = $e; last; } push @arch, $e; } my $arch; $arch = join('-', @arch) if @arch; return($dn, $dv, $arch, $pv); } #line 1212 sub generate_blib_stub { my %args = &_args; my $dist = $args{dist}; require Config; my $name = $args{name}; my $version = $args{version}; my $suffix = $args{suffix}; my ($parse_name, $parse_version, $archname, $perlversion) = parse_dist_name($dist); $name ||= $parse_name; $version ||= $parse_version; $suffix = "$archname-$perlversion" if (not defined $suffix or $suffix eq '') and $archname and $perlversion; $suffix ||= "$Config::Config{archname}-$Config::Config{version}"; if ( grep { not defined $_ } ($name, $version, $suffix) ) { warn "Could not determine distribution meta information from distribution name '$dist'"; return(); } $suffix =~ s/\.par$//; if (not -f 'META.yml') { open META, '>', 'META.yml' or die "Could not open META.yml file for writing: $!"; print META << "YAML" if fileno(META); name: $name version: $version build_requires: {} conflicts: {} dist_name: $name-$version-$suffix.par distribution_type: par dynamic_config: 0 generated_by: 'PAR::Dist version $PAR::Dist::VERSION' license: unknown YAML close META; } mkdir('blib'); mkdir(File::Spec->catdir('blib', 'lib')); mkdir(File::Spec->catdir('blib', 'script')); return 1; } #line 1280 sub contains_binaries { require File::Find; my %args = &_args; my $dist = $args{dist}; return undef if not defined $dist or not -r $dist; require Cwd; require File::Path; # The unzipping will change directories. Remember old dir. my $old_cwd = Cwd::cwd(); # Unzip the base par to a temp. dir. (undef, my $base_dir) = _unzip_to_tmpdir( dist => $dist, subdir => 'blib' ); my $blibdir = File::Spec->catdir($base_dir, 'blib'); my $archdir = File::Spec->catdir($blibdir, 'arch'); my $found = 0; File::Find::find( sub { $found++ if -f $_ and not /^\.exists$/; }, $archdir ); chdir($old_cwd); File::Path::rmtree([$base_dir]); return $found ? 1 : 0; } sub _system_wrapper { if ($DEBUG) { Carp::cluck("Running system call '@_' from:"); } return system(@_); } # stolen from Module::Install::Can # very much internal and subject to change or removal sub _MI_can_run { require ExtUtils::MakeMaker; my ($cmd) = @_; my $_cmd = $cmd; return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd)); for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } # Tries to load any YAML reader writer I know of # returns nothing on failure or hash reference containing # a subset of Load, Dump, LoadFile, DumpFile # entries with sub references on success. sub _get_yaml_functions { # reasoning for the ranking here: # - XS is the de-facto standard nowadays. # - YAML.pm is slow and aging # - syck is fast and reasonably complete # - Tiny is only a very small subset # - Parse... is only a reader and only deals with the same subset as ::Tiny my @modules = qw(YAML::XS YAML YAML::Tiny YAML::Syck Parse::CPAN::Meta); my %yaml_functions; foreach my $module (@modules) { eval "require $module;"; if (!$@) { warn "PAR::Dist testers/debug info: Using '$module' as YAML implementation" if $DEBUG; foreach my $sub (qw(Load Dump LoadFile DumpFile)) { no strict 'refs'; my $subref = *{"${module}::$sub"}{CODE}; if (defined $subref and ref($subref) eq 'CODE') { $yaml_functions{$sub} = $subref; } } $yaml_functions{yaml_provider} = $module; last; } } # end foreach module candidates if (not keys %yaml_functions) { warn "Cannot find a working YAML reader/writer implementation. Tried to load all of '@modules'"; } return(\%yaml_functions); } sub _check_tools { my $tools = _get_yaml_functions(); if ($DEBUG) { foreach (qw/Load Dump LoadFile DumpFile/) { warn "No YAML support for $_ found.\n" if not defined $tools->{$_}; } } $tools->{zip} = undef; # A::Zip 1.28 was a broken release... if (eval {require Archive::Zip; 1;} and $Archive::Zip::VERSION ne '1.28') { warn "Using Archive::Zip as ZIP tool.\n" if $DEBUG; $tools->{zip} = 'Archive::Zip'; } elsif (_MI_can_run("zip") and _MI_can_run("unzip")) { warn "Using zip/unzip as ZIP tool.\n" if $DEBUG; $tools->{zip} = 'zip'; } else { warn "Found neither Archive::Zip (version != 1.28) nor ZIP/UNZIP as valid ZIP tools.\n" if $DEBUG; $tools->{zip} = undef; } return $tools; } 1; #line 1429 FILE1be067de/PAR/Heavy.pm!#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/PAR/Heavy.pm" package PAR::Heavy; $PAR::Heavy::VERSION = '0.12'; #line 17 ######################################################################## # Dynamic inclusion of XS modules my ($bootstrap, $dl_findfile); # Caches for code references my ($cache_key); # The current file to find my $is_insensitive_fs = ( -s $0 and (-s lc($0) || -1) == (-s uc($0) || -1) and (-s lc($0) || -1) == -s $0 ); # Adds pre-hooks to Dynaloader's key methods sub _init_dynaloader { return if $bootstrap; return unless eval { require DynaLoader; DynaLoader::dl_findfile(); 1 }; $bootstrap = \&DynaLoader::bootstrap; $dl_findfile = \&DynaLoader::dl_findfile; local $^W; *{'DynaLoader::dl_expandspec'} = sub { return }; *{'DynaLoader::bootstrap'} = \&_bootstrap; *{'DynaLoader::dl_findfile'} = \&_dl_findfile; } # Return the cached location of .dll inside PAR first, if possible. sub _dl_findfile { return $FullCache{$cache_key} if exists $FullCache{$cache_key}; if ($is_insensitive_fs) { # We have a case-insensitive filesystem... my ($key) = grep { lc($_) eq lc($cache_key) } keys %FullCache; return $FullCache{$key} if defined $key; } return $dl_findfile->(@_); } # Find and extract .dll from PAR files for a given dynamic module. sub _bootstrap { my (@args) = @_; my ($module) = $args[0] or return; my @modparts = split(/::/, $module); my $modfname = $modparts[-1]; $modfname = &DynaLoader::mod2fname(\@modparts) if defined &DynaLoader::mod2fname; if (($^O eq 'NetWare') && (length($modfname) > 8)) { $modfname = substr($modfname, 0, 8); } my $modpname = join((($^O eq 'MacOS') ? ':' : '/'), @modparts); my $file = $cache_key = "auto/$modpname/$modfname.$DynaLoader::dl_dlext"; if ($FullCache{$file}) { # TODO: understand local $DynaLoader::do_expand = 1; return $bootstrap->(@args); } my $member; # First, try to find things in the peferentially loaded PARs: $member = PAR::_find_par_internals([@PAR::PAR_INC], undef, $file, 1) if defined &PAR::_find_par_internals; # If that failed to find the dll, let DynaLoader (try or) throw an error unless ($member) { my $filename = eval { $bootstrap->(@args) }; return $filename if not $@ and defined $filename; # Now try the fallback pars $member = PAR::_find_par_internals([@PAR::PAR_INC_LAST], undef, $file, 1) if defined &PAR::_find_par_internals; # If that fails, let dynaloader have another go JUST to throw an error # While this may seem wasteful, nothing really matters once we fail to # load shared libraries! unless ($member) { return $bootstrap->(@args); } } $FullCache{$file} = _dl_extract($member, $file); # Now extract all associated shared objs in the same auto/ dir # XXX: shouldn't this also set $FullCache{...} for those files? my $first = $member->fileName; my $path_pattern = $first; $path_pattern =~ s{[^/]*$}{}; if ($PAR::LastAccessedPAR) { foreach my $member ( $PAR::LastAccessedPAR->members ) { next if $member->isDirectory; my $name = $member->fileName; next if $name eq $first; next unless $name =~ m{^/?\Q$path_pattern\E\/[^/]*\.\Q$DynaLoader::dl_dlext\E[^/]*$}; $name =~ s{.*/}{}; _dl_extract($member, $file, $name); } } local $DynaLoader::do_expand = 1; return $bootstrap->(@args); } sub _dl_extract { my ($member, $file, $name) = @_; require File::Spec; require File::Temp; my ($fh, $filename); # fix borked tempdir from earlier versions if ($ENV{PAR_TEMP} and -e $ENV{PAR_TEMP} and !-d $ENV{PAR_TEMP}) { unlink($ENV{PAR_TEMP}); mkdir($ENV{PAR_TEMP}, 0755); } if ($ENV{PAR_CLEAN} and !$name) { ($fh, $filename) = File::Temp::tempfile( DIR => ($ENV{PAR_TEMP} || File::Spec->tmpdir), SUFFIX => ".$DynaLoader::dl_dlext", UNLINK => ($^O ne 'MSWin32' and $^O !~ /hpux/), ); ($filename) = $filename =~ /^([\x20-\xff]+)$/; } else { $filename = File::Spec->catfile( ($ENV{PAR_TEMP} || File::Spec->tmpdir), ($name || ($member->crc32String . ".$DynaLoader::dl_dlext")) ); ($filename) = $filename =~ /^([\x20-\xff]+)$/; open $fh, '>', $filename or die $! unless -r $filename and -e _ and -s _ == $member->uncompressedSize; } if ($fh) { binmode($fh); $member->extractToFileHandle($fh); close $fh; chmod 0755, $filename; } return $filename; } 1; #line 197 FILEd7bd2941/PAR/SetupProgname.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/PAR/SetupProgname.pm" package PAR::SetupProgname; $PAR::SetupProgname::VERSION = '1.002'; use 5.006; use strict; use warnings; use Config (); #line 26 # for PAR internal use only! our $Progname = $ENV{PAR_PROGNAME} || $0; # same code lives in PAR::Packer's par.pl! sub set_progname { require File::Spec; if (defined $ENV{PAR_PROGNAME} and $ENV{PAR_PROGNAME} =~ /(.+)/) { $Progname = $1; } $Progname = $0 if not defined $Progname; if (( () = File::Spec->splitdir($Progname) ) > 1 or !$ENV{PAR_PROGNAME}) { if (open my $fh, $Progname) { return if -s $fh; } if (-s "$Progname$Config::Config{_exe}") { $Progname .= $Config::Config{_exe}; return; } } foreach my $dir (split /\Q$Config::Config{path_sep}\E/, $ENV{PATH}) { next if exists $ENV{PAR_TEMP} and $dir eq $ENV{PAR_TEMP}; my $name = File::Spec->catfile($dir, "$Progname$Config::Config{_exe}"); if (-s $name) { $Progname = $name; last } $name = File::Spec->catfile($dir, "$Progname"); if (-s $name) { $Progname = $name; last } } } 1; __END__ #line 94 FILE2e794c58/PAR/SetupTemp.pm#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/PAR/SetupTemp.pm" package PAR::SetupTemp; $PAR::SetupTemp::VERSION = '1.002'; use 5.006; use strict; use warnings; use Fcntl ':mode'; use PAR::SetupProgname; #line 31 # for PAR internal use only! our $PARTemp; # The C version of this code appears in myldr/mktmpdir.c # This code also lives in PAR::Packer's par.pl as _set_par_temp! sub set_par_temp_env { PAR::SetupProgname::set_progname() unless defined $PAR::SetupProgname::Progname; if (defined $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/) { $PARTemp = $1; return; } my $stmpdir = _get_par_user_tempdir(); die "unable to create cache directory" unless $stmpdir; require File::Spec; if (!$ENV{PAR_CLEAN} and my $mtime = (stat($PAR::SetupProgname::Progname))[9]) { my $ctx = _get_digester(); # Workaround for bug in Digest::SHA 5.38 and 5.39 my $sha_version = eval { $Digest::SHA::VERSION } || 0; if ($sha_version eq '5.38' or $sha_version eq '5.39') { $ctx->addfile($PAR::SetupProgname::Progname, "b") if ($ctx); } else { if ($ctx and open(my $fh, "<$PAR::SetupProgname::Progname")) { binmode($fh); $ctx->addfile($fh); close($fh); } } $stmpdir = File::Spec->catdir( $stmpdir, "cache-" . ( $ctx ? $ctx->hexdigest : $mtime ) ); } else { $ENV{PAR_CLEAN} = 1; $stmpdir = File::Spec->catdir($stmpdir, "temp-$$"); } $ENV{PAR_TEMP} = $stmpdir; mkdir $stmpdir, 0700; $PARTemp = $1 if defined $ENV{PAR_TEMP} and $ENV{PAR_TEMP} =~ /(.+)/; } # Find any digester # Used in PAR::Repository::Client! sub _get_digester { my $ctx = eval { require Digest::SHA; Digest::SHA->new(1) } || eval { require Digest::SHA1; Digest::SHA1->new } || eval { require Digest::MD5; Digest::MD5->new }; return $ctx; } # find the per-user temporary directory (eg /tmp/par-$USER) # Used in PAR::Repository::Client! sub _get_par_user_tempdir { my $username = _find_username(); my $temp_path; foreach my $path ( (map $ENV{$_}, qw( PAR_TMPDIR TMPDIR TEMPDIR TEMP TMP )), qw( C:\\TEMP /tmp . ) ) { next unless defined $path and -d $path and -w $path; # create a temp directory that is unique per user # NOTE: $username may be in an unspecified charset/encoding; # use a name that hopefully works for all of them; # also avoid problems with platform-specific meta characters in the name $temp_path = File::Spec->catdir($path, "par-".unpack("H*", $username)); ($temp_path) = $temp_path =~ /^(.*)$/s; unless (mkdir($temp_path, 0700) || $!{EEXIST}) { warn "creation of private subdirectory $temp_path failed (errno=$!)"; return; } unless ($^O eq 'MSWin32') { my @st; unless (@st = lstat($temp_path)) { warn "stat of private subdirectory $temp_path failed (errno=$!)"; return; } if (!S_ISDIR($st[2]) || $st[4] != $< || ($st[2] & 0777) != 0700 ) { warn "private subdirectory $temp_path is unsafe (please remove it and retry your operation)"; return; } } last; } return $temp_path; } # tries hard to find out the name of the current user sub _find_username { my $username; my $pwuid; # does not work everywhere: eval {($pwuid) = getpwuid($>) if defined $>;}; if ( defined(&Win32::LoginName) ) { $username = &Win32::LoginName; } elsif (defined $pwuid) { $username = $pwuid; } else { $username = $ENV{USERNAME} || $ENV{USER} || 'SYSTEM'; } return $username; } 1; __END__ #line 186 FILEf6e62367/Compress/Raw/Zlib.pmBW#line 1 "/usr/local/lib/perl5/site_perl/5.20.0/i86pc-solaris/Compress/Raw/Zlib.pm" package Compress::Raw::Zlib; require 5.006 ; require Exporter; use Carp ; use strict ; use warnings ; use bytes ; our ($VERSION, $XS_VERSION, @ISA, @EXPORT, %EXPORT_TAGS, @EXPORT_OK, $AUTOLOAD, %DEFLATE_CONSTANTS, @DEFLATE_CONSTANTS); $VERSION = '2.066'; $XS_VERSION = $VERSION; $VERSION = eval $VERSION; @ISA = qw(Exporter); %EXPORT_TAGS = ( flush => [qw{ Z_NO_FLUSH Z_PARTIAL_FLUSH Z_SYNC_FLUSH Z_FULL_FLUSH Z_FINISH Z_BLOCK }], level => [qw{ Z_NO_COMPRESSION Z_BEST_SPEED Z_BEST_COMPRESSION Z_DEFAULT_COMPRESSION }], strategy => [qw{ Z_FILTERED Z_HUFFMAN_ONLY Z_RLE Z_FIXED Z_DEFAULT_STRATEGY }], status => [qw{ Z_OK Z_STREAM_END Z_NEED_DICT Z_ERRNO Z_STREAM_ERROR Z_DATA_ERROR Z_MEM_ERROR Z_BUF_ERROR Z_VERSION_ERROR }], ); %DEFLATE_CONSTANTS = %EXPORT_TAGS; # Items to export into callers namespace by default. Note: do not export # names by default without a very good reason. Use EXPORT_OK instead. # Do not simply export all your public functions/methods/constants. @DEFLATE_CONSTANTS = @EXPORT = qw( ZLIB_VERSION ZLIB_VERNUM OS_CODE MAX_MEM_LEVEL MAX_WBITS Z_ASCII Z_BEST_COMPRESSION Z_BEST_SPEED Z_BINARY Z_BLOCK Z_BUF_ERROR Z_DATA_ERROR Z_DEFAULT_COMPRESSION Z_DEFAULT_STRATEGY Z_DEFLATED Z_ERRNO Z_FILTERED Z_FIXED Z_FINISH Z_FULL_FLUSH Z_HUFFMAN_ONLY Z_MEM_ERROR Z_NEED_DICT Z_NO_COMPRESSION Z_NO_FLUSH Z_NULL Z_OK Z_PARTIAL_FLUSH Z_RLE Z_STREAM_END Z_STREAM_ERROR Z_SYNC_FLUSH Z_TREES Z_UNKNOWN Z_VERSION_ERROR WANT_GZIP WANT_GZIP_OR_ZLIB ); push @EXPORT, qw(crc32 adler32 DEF_WBITS); use constant WANT_GZIP => 16; use constant WANT_GZIP_OR_ZLIB => 32; sub AUTOLOAD { my($constname); ($constname = $AUTOLOAD) =~ s/.*:://; my ($error, $val) = constant($constname); Carp::croak $error if $error; no strict 'refs'; *{$AUTOLOAD} = sub { $val }; goto &{$AUTOLOAD}; } use constant FLAG_APPEND => 1 ; use constant FLAG_CRC => 2 ; use constant FLAG_ADLER => 4 ; use constant FLAG_CONSUME_INPUT => 8 ; use constant FLAG_LIMIT_OUTPUT => 16 ; eval { require XSLoader; XSLoader::load('Compress::Raw::Zlib', $XS_VERSION); 1; } or do { require DynaLoader; local @ISA = qw(DynaLoader); bootstrap Compress::Raw::Zlib $XS_VERSION ; }; use constant Parse_any => 0x01; use constant Parse_unsigned => 0x02; use constant Parse_signed => 0x04; use constant Parse_boolean => 0x08; #use constant Parse_string => 0x10; #use constant Parse_custom => 0x12; #use constant Parse_store_ref => 0x100 ; use constant OFF_PARSED => 0 ; use constant OFF_TYPE => 1 ; use constant OFF_DEFAULT => 2 ; use constant OFF_FIXED => 3 ; use constant OFF_FIRST_ONLY => 4 ; use constant OFF_STICKY => 5 ; sub ParseParameters { my $level = shift || 0 ; my $sub = (caller($level + 1))[3] ; #local $Carp::CarpLevel = 1 ; my $p = new Compress::Raw::Zlib::Parameters() ; $p->parse(@_) or croak "$sub: $p->{Error}" ; return $p; } sub Compress::Raw::Zlib::Parameters::new { my $class = shift ; my $obj = { Error => '', Got => {}, } ; #return bless $obj, ref($class) || $class || __PACKAGE__ ; return bless $obj, 'Compress::Raw::Zlib::Parameters' ; } sub Compress::Raw::Zlib::Parameters::setError { my $self = shift ; my $error = shift ; my $retval = @_ ? shift : undef ; $self->{Error} = $error ; return $retval; } #sub getError #{ # my $self = shift ; # return $self->{Error} ; #} sub Compress::Raw::Zlib::Parameters::parse { my $self = shift ; my $default = shift ; my $got = $self->{Got} ; my $firstTime = keys %{ $got } == 0 ; my (@Bad) ; my @entered = () ; # Allow the options to be passed as a hash reference or # as the complete hash. if (@_ == 0) { @entered = () ; } elsif (@_ == 1) { my $href = $_[0] ; return $self->setError("Expected even number of parameters, got 1") if ! defined $href or ! ref $href or ref $href ne "HASH" ; foreach my $key (keys %$href) { push @entered, $key ; push @entered, \$href->{$key} ; } } else { my $count = @_; return $self->setError("Expected even number of parameters, got $count") if $count % 2 != 0 ; for my $i (0.. $count / 2 - 1) { push @entered, $_[2* $i] ; push @entered, \$_[2* $i+1] ; } } while (my ($key, $v) = each %$default) { croak "need 4 params [@$v]" if @$v != 4 ; my ($first_only, $sticky, $type, $value) = @$v ; my $x ; $self->_checkType($key, \$value, $type, 0, \$x) or return undef ; $key = lc $key; if ($firstTime || ! $sticky) { $got->{$key} = [0, $type, $value, $x, $first_only, $sticky] ; } $got->{$key}[OFF_PARSED] = 0 ; } for my $i (0.. @entered / 2 - 1) { my $key = $entered[2* $i] ; my $value = $entered[2* $i+1] ; #print "Key [$key] Value [$value]" ; #print defined $$value ? "[$$value]\n" : "[undef]\n"; $key =~ s/^-// ; my $canonkey = lc $key; if ($got->{$canonkey} && ($firstTime || ! $got->{$canonkey}[OFF_FIRST_ONLY] )) { my $type = $got->{$canonkey}[OFF_TYPE] ; my $s ; $self->_checkType($key, $value, $type, 1, \$s) or return undef ; #$value = $$value unless $type & Parse_store_ref ; $value = $$value ; $got->{$canonkey} = [1, $type, $value, $s] ; } else { push (@Bad, $key) } } if (@Bad) { my ($bad) = join(", ", @Bad) ; return $self->setError("unknown key value(s) @Bad") ; } return 1; } sub Compress::Raw::Zlib::Parameters::_checkType { my $self = shift ; my $key = shift ; my $value = shift ; my $type = shift ; my $validate = shift ; my $output = shift; #local $Carp::CarpLevel = $level ; #print "PARSE $type $key $value $validate $sub\n" ; # if ( $type & Parse_store_ref) # { # #$value = $$value # # if ref ${ $value } ; # # $$output = $value ; # return 1; # } $value = $$value ; if ($type & Parse_any) { $$output = $value ; return 1; } elsif ($type & Parse_unsigned) { return $self->setError("Parameter '$key' must be an unsigned int, got 'undef'") if $validate && ! defined $value ; return $self->setError("Parameter '$key' must be an unsigned int, got '$value'") if $validate && $value !~ /^\d+$/; $$output = defined $value ? $value : 0 ; return 1; } elsif ($type & Parse_signed) { return $self->setError("Parameter '$key' must be a signed int, got 'undef'") if $validate && ! defined $value ; return $self->setError("Parameter '$key' must be a signed int, got '$value'") if $validate && $value !~ /^-?\d+$/; $$output = defined $value ? $value : 0 ; return 1 ; } elsif ($type & Parse_boolean) { return $self->setError("Parameter '$key' must be an int, got '$value'") if $validate && defined $value && $value !~ /^\d*$/; $$output = defined $value ? $value != 0 : 0 ; return 1; } # elsif ($type & Parse_string) # { # $$output = defined $value ? $value : "" ; # return 1; # } $$output = $value ; return 1; } sub Compress::Raw::Zlib::Parameters::parsed { my $self = shift ; my $name = shift ; return $self->{Got}{lc $name}[OFF_PARSED] ; } sub Compress::Raw::Zlib::Parameters::value { my $self = shift ; my $name = shift ; if (@_) { $self->{Got}{lc $name}[OFF_PARSED] = 1; $self->{Got}{lc $name}[OFF_DEFAULT] = $_[0] ; $self->{Got}{lc $name}[OFF_FIXED] = $_[0] ; } return $self->{Got}{lc $name}[OFF_FIXED] ; } our $OPTIONS_deflate = { 'AppendOutput' => [1, 1, Parse_boolean, 0], 'CRC32' => [1, 1, Parse_boolean, 0], 'ADLER32' => [1, 1, Parse_boolean, 0], 'Bufsize' => [1, 1, Parse_unsigned, 4096], 'Level' => [1, 1, Parse_signed, Z_DEFAULT_COMPRESSION()], 'Method' => [1, 1, Parse_unsigned, Z_DEFLATED()], 'WindowBits' => [1, 1, Parse_signed, MAX_WBITS()], 'MemLevel' => [1, 1, Parse_unsigned, MAX_MEM_LEVEL()], 'Strategy' => [1, 1, Parse_unsigned, Z_DEFAULT_STRATEGY()], 'Dictionary' => [1, 1, Parse_any, ""], }; sub Compress::Raw::Zlib::Deflate::new { my $pkg = shift ; my ($got) = ParseParameters(0, $OPTIONS_deflate, @_); croak "Compress::Raw::Zlib::Deflate::new: Bufsize must be >= 1, you specified " . $got->value('Bufsize') unless $got->value('Bufsize') >= 1; my $flags = 0 ; $flags |= FLAG_APPEND if $got->value('AppendOutput') ; $flags |= FLAG_CRC if $got->value('CRC32') ; $flags |= FLAG_ADLER if $got->value('ADLER32') ; my $windowBits = $got->value('WindowBits'); $windowBits += MAX_WBITS() if ($windowBits & MAX_WBITS()) == 0 ; _deflateInit($flags, $got->value('Level'), $got->value('Method'), $windowBits, $got->value('MemLevel'), $got->value('Strategy'), $got->value('Bufsize'), $got->value('Dictionary')) ; } sub Compress::Raw::Zlib::deflateStream::STORABLE_freeze { my $type = ref shift; croak "Cannot freeze $type object\n"; } sub Compress::Raw::Zlib::deflateStream::STORABLE_thaw { my $type = ref shift; croak "Cannot thaw $type object\n"; } our $OPTIONS_inflate = { 'AppendOutput' => [1, 1, Parse_boolean, 0], 'LimitOutput' => [1, 1, Parse_boolean, 0], 'CRC32' => [1, 1, Parse_boolean, 0], 'ADLER32' => [1, 1, Parse_boolean, 0], 'ConsumeInput' => [1, 1, Parse_boolean, 1], 'Bufsize' => [1, 1, Parse_unsigned, 4096], 'WindowBits' => [1, 1, Parse_signed, MAX_WBITS()], 'Dictionary' => [1, 1, Parse_any, ""], } ; sub Compress::Raw::Zlib::Inflate::new { my $pkg = shift ; my ($got) = ParseParameters(0, $OPTIONS_inflate, @_); croak "Compress::Raw::Zlib::Inflate::new: Bufsize must be >= 1, you specified " . $got->value('Bufsize') unless $got->value('Bufsize') >= 1; my $flags = 0 ; $flags |= FLAG_APPEND if $got->value('AppendOutput') ; $flags |= FLAG_CRC if $got->value('CRC32') ; $flags |= FLAG_ADLER if $got->value('ADLER32') ; $flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ; $flags |= FLAG_LIMIT_OUTPUT if $got->value('LimitOutput') ; my $windowBits = $got->value('WindowBits'); $windowBits += MAX_WBITS() if ($windowBits & MAX_WBITS()) == 0 ; _inflateInit($flags, $windowBits, $got->value('Bufsize'), $got->value('Dictionary')) ; } sub Compress::Raw::Zlib::inflateStream::STORABLE_freeze { my $type = ref shift; croak "Cannot freeze $type object\n"; } sub Compress::Raw::Zlib::inflateStream::STORABLE_thaw { my $type = ref shift; croak "Cannot thaw $type object\n"; } sub Compress::Raw::Zlib::InflateScan::new { my $pkg = shift ; my ($got) = ParseParameters(0, { 'CRC32' => [1, 1, Parse_boolean, 0], 'ADLER32' => [1, 1, Parse_boolean, 0], 'Bufsize' => [1, 1, Parse_unsigned, 4096], 'WindowBits' => [1, 1, Parse_signed, -MAX_WBITS()], 'Dictionary' => [1, 1, Parse_any, ""], }, @_) ; croak "Compress::Raw::Zlib::InflateScan::new: Bufsize must be >= 1, you specified " . $got->value('Bufsize') unless $got->value('Bufsize') >= 1; my $flags = 0 ; #$flags |= FLAG_APPEND if $got->value('AppendOutput') ; $flags |= FLAG_CRC if $got->value('CRC32') ; $flags |= FLAG_ADLER if $got->value('ADLER32') ; #$flags |= FLAG_CONSUME_INPUT if $got->value('ConsumeInput') ; _inflateScanInit($flags, $got->value('WindowBits'), $got->value('Bufsize'), '') ; } sub Compress::Raw::Zlib::inflateScanStream::createDeflateStream { my $pkg = shift ; my ($got) = ParseParameters(0, { 'AppendOutput' => [1, 1, Parse_boolean, 0], 'CRC32' => [1, 1, Parse_boolean, 0], 'ADLER32' => [1, 1, Parse_boolean, 0], 'Bufsize' => [1, 1, Parse_unsigned, 4096], 'Level' => [1, 1, Parse_signed, Z_DEFAULT_COMPRESSION()], 'Method' => [1, 1, Parse_unsigned, Z_DEFLATED()], 'WindowBits' => [1, 1, Parse_signed, - MAX_WBITS()], 'MemLevel' => [1, 1, Parse_unsigned, MAX_MEM_LEVEL()], 'Strategy' => [1, 1, Parse_unsigned, Z_DEFAULT_STRATEGY()], }, @_) ; croak "Compress::Raw::Zlib::InflateScan::createDeflateStream: Bufsize must be >= 1, you specified " . $got->value('Bufsize') unless $got->value('Bufsize') >= 1; my $flags = 0 ; $flags |= FLAG_APPEND if $got->value('AppendOutput') ; $flags |= FLAG_CRC if $got->value('CRC32') ; $flags |= FLAG_ADLER if $got->value('ADLER32') ; $pkg->_createDeflateStream($flags, $got->value('Level'), $got->value('Method'), $got->value('WindowBits'), $got->value('MemLevel'), $got->value('Strategy'), $got->value('Bufsize'), ) ; } sub Compress::Raw::Zlib::inflateScanStream::inflate { my $self = shift ; my $buffer = $_[1]; my $eof = $_[2]; my $status = $self->scan(@_); if ($status == Z_OK() && $_[2]) { my $byte = ' '; $status = $self->scan(\$byte, $_[1]) ; } return $status ; } sub Compress::Raw::Zlib::deflateStream::deflateParams { my $self = shift ; my ($got) = ParseParameters(0, { 'Level' => [1, 1, Parse_signed, undef], 'Strategy' => [1, 1, Parse_unsigned, undef], 'Bufsize' => [1, 1, Parse_unsigned, undef], }, @_) ; croak "Compress::Raw::Zlib::deflateParams needs Level and/or Strategy" unless $got->parsed('Level') + $got->parsed('Strategy') + $got->parsed('Bufsize'); croak "Compress::Raw::Zlib::Inflate::deflateParams: Bufsize must be >= 1, you specified " . $got->value('Bufsize') if $got->parsed('Bufsize') && $got->value('Bufsize') <= 1; my $flags = 0; $flags |= 1 if $got->parsed('Level') ; $flags |= 2 if $got->parsed('Strategy') ; $flags |= 4 if $got->parsed('Bufsize') ; $self->_deflateParams($flags, $got->value('Level'), $got->value('Strategy'), $got->value('Bufsize')); } 1; __END__ #line 1598 FILE'4ccf05d8/auto/Compress/Raw/Zlib/Zlib.so ELF4 4 ( @Pdd yc Y Y D `T```-`o ol,oo1(0o``>;<  !"#$&)*+,-/02469;=?ABCDFIKLNOPRWX[\^_abcdghiknoqstuwxyz{}~ %'(.13578:<>@EGHJMQSTUVYZ]`efjlmprv| '`9 =9 IPP:b ;b =e y>x -?b iSAb Bb De |Eb CFb s@Hb Ib Kb fLb -Mb Z*Ob Pb Qb PSb +Tb ZVb vWb Xb :Zb '[b S\b `^b _b $ab b 8dcb bdb (f gB Igi hQ Mi i >nd {o@ 'r rE -u %wQ v} T# ЀN \ ze ߅e De & ! J ʌ  x > (Z [ ݗj  G G Yi s   h H ]   D y l X      4     + 1 = M L V > b  p % | } Ms X     0n >   @<v < =  >  D - NI 8 M A Ny K U ] Y s z [ X  04 J1  Q z "Y( <J6   cYN k(t<6     h#   /2/ @N W X frmO  z{H  @ Q]  0V  @ #5@`D  GYb4 nzS vX   A9 ? ZW   ,? 9X X( EP`w@v9 $ dY   h' 5" )1 >Ol( 6  }"~ "s/ ( 9X @UmP  dzP6 nRG @ \Y @t5A D3* 2 #/9ANu MZlib.socrti.svalues-Xa.ccrtstuff.c__do_global_dtors_auxframe_dummyZlib.cXS_Compress__Raw__Zlib__inflateScanStream_adler32XS_Compress__Raw__Zlib__inflateScanStream_crc32XS_Compress__Raw__Zlib__inflateScanStream_getLastBufferOffsetXS_Compress__Raw__Zlib__inflateScanStream_getLastBlockOffsetXS_Compress__Raw__Zlib__inflateScanStream_uncompressedBytesXS_Compress__Raw__Zlib__inflateScanStream_compressedBytesXS_Compress__Raw__Zlib__inflateScanStream_inflateCountXS_Compress__Raw__Zlib__inflateScanStream_getEndOffsetXS_Compress__Raw__Zlib__inflateStream_get_BufsizeXS_Compress__Raw__Zlib__inflateStream_total_outXS_Compress__Raw__Zlib__inflateStream_adler32XS_Compress__Raw__Zlib__inflateStream_total_inXS_Compress__Raw__Zlib__inflateStream_dict_adlerXS_Compress__Raw__Zlib__inflateStream_crc32XS_Compress__Raw__Zlib__inflateStream_statusXS_Compress__Raw__Zlib__inflateStream_uncompressedBytesXS_Compress__Raw__Zlib__inflateStream_compressedBytesXS_Compress__Raw__Zlib__inflateStream_inflateCountXS_Compress__Raw__Zlib__deflateStream_total_outXS_Compress__Raw__Zlib__deflateStream_total_inXS_Compress__Raw__Zlib__deflateStream_uncompressedBytesXS_Compress__Raw__Zlib__deflateStream_compressedBytesXS_Compress__Raw__Zlib__deflateStream_adler32XS_Compress__Raw__Zlib__deflateStream_dict_adlerXS_Compress__Raw__Zlib__deflateStream_crc32XS_Compress__Raw__Zlib__deflateStream_statusXS_Compress__Raw__Zlib__deflateStream_get_BufsizeXS_Compress__Raw__Zlib__deflateStream_get_StrategyXS_Compress__Raw__Zlib__deflateStream_get_LevelXS_Compress__Raw__Zlib_ZLIB_VERNUMXS_Compress__Raw__Zlib__inflateStream_msgXS_Compress__Raw__Zlib__deflateStream_msgXS_Compress__Raw__Zlib_zlib_versionGetErrorStringXS_Compress__Raw__Zlib__inflateScanStream_statusPostInitStreamXS_Compress__Raw__Zlib__inflateScanStream__createDeflateStreamXS_Compress__Raw__Zlib__inflateScanStream_resetLastBlockByteXS_Compress__Raw__Zlib__inflateStream_set_AppenddeRefXS_Compress__Raw__Zlib_crc32XS_Compress__Raw__Zlib_adler32XS_Compress__Raw__Zlib__inflateScanStream_scanXS_Compress__Raw__Zlib__inflateScanStream_inflateResetXS_Compress__Raw__Zlib__inflateStream_inflateResetDispHexXS_Compress__Raw__Zlib__deflateStream_DispStreamXS_Compress__Raw__Zlib__inflateScanStream_DispStreamXS_Compress__Raw__Zlib__inflateStream_DispStreamXS_Compress__Raw__Zlib__deflateInitXS_Compress__Raw__Zlib__inflateStream_DESTROYXS_Compress__Raw__Zlib__inflateStream_inflateSyncdeRef_lXS_Compress__Raw__Zlib__inflateStream_inflateXS_Compress__Raw__Zlib__deflateStream_deflateTuneXS_Compress__Raw__Zlib__deflateStream__deflateParamsXS_Compress__Raw__Zlib__deflateStream_flushXS_Compress__Raw__Zlib__deflateStream_deflateXS_Compress__Raw__Zlib__deflateStream_deflateResetXS_Compress__Raw__Zlib__inflateInitXS_Compress__Raw__Zlib_adler32_combineXS_Compress__Raw__Zlib_crc32_combineXS_Compress__Raw__Zlib_zlibCompileFlagsXS_Compress__Raw__Zlib_constantXS_Compress__Raw__Zlib__deflateStream_DESTROYXS_Compress__Raw__Zlib__inflateScanStream_DESTROYadler32.cadler32_combine_compress.ccrc32.cgf2_matrix_timesgf2_matrix_squarecrc32_combine_deflate.cputShortMSBlongest_matchfill_windowflush_pendingdeflate_slowdeflate_fastdeflate_storedinfback.cinffast.cinflate.csyncsearchupdatewindowinftrees.cinit_blockpqdownheapscan_treesend_treecompress_blockbuild_treebi_flushbi_windupuncompr.czutil.c__do_global_ctors_auxcrtn.s_GLOBAL_OFFSET_TABLE_PL_unitcheckav_PROCEDURE_LINKAGE_TABLE_inflateGetDictionaryPerl_xs_version_bootcheckinflate_fastinflatePrimePerl_sv_2iv_flagsPL_stack_base_fini_Jv_RegisterClassesPerl_sv_setivboot_Compress__Raw__Zlibzmemcmpz_errmsginflate_tablePL_sv_undefPerl_safesysfreedeflateBoundPerl_croak_xs_usagePerl_sv_free2Perl_safesysmallocinflateBackInit_zmemcpyPerl_newSVsvmy_zcfreestrerrordeflateSetDictionaryinflateGetHeaderPerl_sv_setpv_tr_tallyinflateReset2Perl_mg_set_tr_stored_blockdeflateResetKeepPerl_sv_2bool_flags_etext_tr_flush_blockdeflateInit2_PL_curcopPerl_sv_setpvninflateEndcrc32_combine64uncompressPerl_sv_growPL_sv_yesPerl_sv_2uv_flagsdeflate_copyrightPerl_sv_setref_pvPL_sv_noinflateCopyPL_stack_spPerl_sv_pvn_force_flagsdeflatePendingdeflateInit_inflateBackinflateInit__DYNAMICinflateBackEndPerl_newSVivPerl_sv_setnv_lib_versionPerl_call_listcompress2deflateCopydeflatePrimezlibVersionPerl_croakPerl_sv_2mortalPerl_sv_utf8_downgrade_length_codePerl_sv_upgradePL_stack_maxPerl_newSVpvfputsPerl_sv_utf8_upgrade_flags_grow_end_tr_initdeflateEndadler32_combine64compressBoundmy_zcallocinflateUndermineinflateSetDictionaryPL_markstack_ptrPerl_xs_apiversion_bootcheckdeflateSetHeader__deregister_frame_info_basesPerl_sv_setuvPerl_sv_2pv_flagsPL_scopestack_ixinflateInit2___register_frame_info_basesinflate_copyrightPerl_newXSPL_opprintfputcharinflateResetKeepzErrorPerl_sv_derived_from_tr_flush_bits_tr_alignPerl_dowantarrayPerl_sv_2pvbyteget_crc_tablezmemzero_dist_codePL_compilingPerl_mg_getPerl_stack_growinflateMarkerrno_edatainflateSyncPointPerl_sv_newmortalPerl_newSVpvPerl_get_svPL_curpadmemmovePerl_sv_lenPerl_sv_pvbyten_forcelibgcc_s.so.1GCC_3.0libssp.so.0cP&y qs  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJK}M~PQRTUVWXYZv^_wtbcdefghiqzphtȚԚ  4  ęH.84<9;QS]`gly|z~didiĘqȘ ̘eИNԘ%ؘ ܘ"LEv5 - K| 8$t(D,O0u4(@{DLPP<T7X\`)dmhnlVp0txRf3_W*U@hcTș/̙ZЙaԙؙkܙG>IMxr, 's& $(o,$0Ahh,h8h<h @h(Dh0Hh8pLh@`PhHPThP@XhX0`h` dhhhhplhxxh|hhhhhhhph`hPh@h0h hhhhhhhh h(h0h8ph@`hHPhP@hX0h` hhhphx hhhhh h$h(hp,h`0hP4h@8h0@h DhHhLhPhTh`hdhhh lh(ph0th8ph@`hHPhP@hX0h` hhhphxhhUVS_u])9s 9r拃 t$nƃ[^]US\ß^t$D$\$ D$$0tt $Ѓ[]Ë$ÐUWVS,χ*^ $2()tD$E$0@tP 4<ǃE䋃(@ tr|T$$t\(@ P u@D$$V4(2@D$<$HG @t6,|D$ D$D$$$<$,~(U ,[^_]UWVS,m\ $2()tD$E$S0@tP 4<@ǃE䋃(@ tr|T$$t\(@ P u@D$$4(2@D$<$G @t6,|D$ D$D$$<$~(U ,[^_]UWVS, f[ $2()tD$E$0@tP 4<ǃE䋃(@ tu|T$$t_(@ P u@D$$4(2D$<$G @t6,|D$ D$D$$]<$e~(U ,[^_]UWVS,覃Z $2()tD$E$0@tP 4<yǃE䋃(@ |T$$Stn(@ P u@D$$)4(2ҋ)ЉD$<$ G @t6,|D$ D$@D$$<$~(U ,[^_]UWVS,.ÉX $2()tD$E$0@tP 4<ǃE䋃(@ tr|T$$t\(@ P u@D$$4(2@tD$<$G @t6,|D$ D$|D$$<$~(U ,[^_]UWVS,̀'W $2()tD$E$0@tP 4<ǃE䋃(@ tr|T$$}t\(@ P u@D$$S4(2@pD$<$EG @t6,|D$ D$D$$!<$)~(U ,[^_]UWVS,jU $2()tD$E$P0@tP 4<=ǃE䋃(@ tr|T$$t\(@ P u@D$$4(2@lD$<$G @t6,|D$ D$D$$<$~(U ,[^_]UWVS,~cT $2()tD$E$0@tP 4<ǃE䋃(@ tu|T$$t_(@ P u@D$$4(2D$<$~G @t6,|D$ D$(D$$Z<$b~(U ,[^_]UWVS,|R $2()tD$E$0@tP 4<vǃE䋃(@ tr`T$$Tt\(@ P u@D$$*4(2@DD$<$G @t6,`D$ D$D$$<$~(U ,[^_]UWVS,A{ÜQ $2()tD$E$'0@tP 4<ǃE䋃(@ tr`T$$t\(@ P u@D$$4(2@ D$<$G @t6,`D$ D$D$$<$~(U ,[^_]UWVS,y:P $2()tD$E$0@tP 4<ǃE䋃(@ tr`T$$t\(@ P u@D$$f4(2@D$<$XG @t6,`D$ D$D$$4<$<~(U ,[^_]UWVS,}xN $2()tD$E$c0@tP 4<PǃE䋃(@ tr`T$$.t\(@ P u@D$$4(2@D$<$G @t6,`D$ D$D$$<$~(U ,[^_]UWVS,wvM $2()tD$E$0@tP 4<ǃE䋃(@ tr`T$$t\(@ P u@D$$4(2@LD$<$G @t6,`D$ D$@D$$p<$x~(U ,[^_]UWVS,uL $2()tD$E$0@tP 4<ǃE䋃(@ tr`T$$jt\(@ P u@D$$@4(2@D$<$2G @t6,`D$ D$pD$$<$~(U ,[^_]UWVS,WtòJ $2()tD$E$=0@tP 4<*ǃE䋃(@ tr`T$$t\(@ P u@D$$4(2@PD$<$G @t6,`D$ D$D$$<$~(U ,[^_]UWVS,rPI $2()tD$E$0@tP 4<ǃE䋃(@ tr`T$$t\(@ P u@D$$|4(2@tD$<$nG @t6,`D$ D$D$$J<$R~(U ,[^_]UWVS,qG $2()tD$E$y0@tP 4<fǃE䋃(@ tr`T$$Dt\(@ P u@D$$4(2@pD$<$ G @t6,`D$ D$D$$<$~(U ,[^_]UWVS,1pÌF $2()tD$E$0@tP 4<ǃE䋃(@ tr`T$$t\(@ P u@D$$4(2@lD$<$G @t6,`D$ D$4D$$<$~(U ,[^_]UWVS,n*E $2()tD$E$0@tP 4<ǃE䋃(@ trhT$$t\(@ P u@D$$V4(2@ D$<$HG @t6,hD$ D$D$$$<$,~(U ,[^_]UWVS,mmC $2()tD$E$S0@tP 4<@ǃE䋃(@ trhT$$t\(@ P u@D$$4(2@D$<$G @t6,hD$ D$D$$<$~(U ,[^_]UWVS, lfB $2()tD$E$0@tP 4<ǃE䋃(@ trhT$$t\(@ P u@D$$4(2@tD$<$G @t6,hD$ D$D$$`<$h~(U ,[^_]UWVS,jA $2()tD$E$0@tP 4<|ǃE䋃(@ trhT$$Zt\(@ P u@D$$04(2@pD$<$"G @t6,hD$ D$$D$$<$~(U ,[^_]UWVS,Giâ? $2()tD$E$-0@tP 4<ǃE䋃(@ trhT$$t\(@ P u@D$$4(2@D$<$G @t6,hD$ D$XD$$<$~(U ,[^_]UWVS,g@> $2()tD$E$0@tP 4<ǃE䋃(@ trhT$$t\(@ P u@D$$l4(2@LD$<$^G @t6,hD$ D$D$$:<$B~(U ,[^_]UWVS,f< $2()tD$E$i0@tP 4<VǃE䋃(@ trhT$$4t\(@ P u@D$$ 4(2@D$<$G @t6,hD$ D$D$$<$~(U ,[^_]UWVS,!e|; $2()tD$E$0@tP 4<ǃE䋃(@ trhT$$t\(@ P u@D$$4(2@PD$<$G @t6,hD$ D$D$$v<$~~(U ,[^_]UWVS,c: $2()tD$E$0@tP 4<ǃE䋃(@ trhT$$pt\(@ P u@D$$F4(2@DD$<$8G @t6,hD$ D$ D$$<$~(U ,[^_]UWVS,]bø8 $2()tD$E$C0@tP 4<0ǃE䋃(@ trhT$$t\(@ P u@D$$4(2@hD$<$G @t6,hD$ D$D$<$"FE(0G @t<$~E( ]u}]US[u1u\$)‰x[]UWVS,Z11 $2()щtD$E$U@ |T$$tz(@ P u@D$$xPU(UTU܉}E\$($$t5,|D$ D$D$$:D$($LEJ" ,[^_]USoY/E $Q[]USLYç/EE $:[]U]} Y{/$¹,󫋃pB,tB0Ћ]}]U(]u}X'/Ɖ׋EFDFPFtFpE FTtD$D$$FtD$D$$wF]u}]UWVS\6XÑ. E$  ( u)Ήt D$E$pDP u @ED$$Eċ(DP u @ED$$E܋(D P u @ED$$Eԋ(DP u @ED$$jE؋(DP u @ED$$0EЋ(DP u @ED$$E̋(DP u @ED$$E(@ te|T$$tO(@ P uxD$$\ƅu8E.|D$ D$hD$$7E܉FXUԉV\M؉N`EЉFdỦVhN MD$8D$T$EЉD$U؉T$ MԉL$E܉D$Uȉ$E܅u.}ԋD$G|D$Mȉ $E܋F% =uB D$$E…t+0( [^_]UWVS,8RÓ( 0$  ( )ΉtD$E$"pTB t D$$Eu<tE t@E@EEtvB 80Eet3t EyuLEt@@z*u(-D$$EEE<(@ t[`T$$tE(@ P u@D$$у}u.3`D$ D$D$$(t(8 8,[^_]U(]u}OM&Ɖ@ t$F tHv F t4$FЃ w|$$&t|$D$Fu0<t,%= t D$$$Q$ Ɖ]u}]UWVS<7OÒ% $:()щUԃvD$E$Uȋ40@tP 4EEE}~:(DP u @ED$$E̍U@ t0@ u"D$4$8ux$F% =u @Ev ED$4$ƃ}D$D$$i(TBu<t u%% =u@.D$$D$D$$|U+ỦT$ủt$$c4(2D$EЉ$西UB @t$贿EЉF(U <[^_]UWVS 0\[^_]UWVS,U5ð  0$ ()։tD$E$?M@ tC@ P upD$$5ƉF $VFHu$>D$D$l$PvP T$$G|t$`<$XE( ,[^_]UWVS,54Ð  0$( )ΉtD$E$JMtM؋U@ th`T$$tR(M@ P uxD$$Ǎl@ u.\`D$ D$D$$迥@ u"D$4$!uH$菥F% =uF D$D$4$G @GGGG $oE܉GPGBtD$G D$F $צV @F @t4$ (u7譤E\$U$4$}tED$(M$֤EJ" ,[^_]UH]u}1LƉU@ t$軥Fu<t ҉twv F t4$~Fu<t6 ɉЃ wEԉD$$ףtUԉT$D$踣Ft%9 tEԉD$$艣<wD$4$赥t$D$4$荣F%)=tED$4$荥]u}]UWVS\0 0$( )NvD$E$膢JMLM̋T UȋUUM@ t\`T$$ktF(U@ P uxD$$>ǃ,`D$ D$D$$%(MT tOB tD$$H3u<t uuuD$$GDEЍE&EtK@t$菡% =u M@ED$ED$E$UB t0@ u"D$$赢u@$#MA% =u @EA D$ED$E$JG EGEKEE@ t7@ Eu%D$Ủ$!u$菠u M̋@GŰP EE@Et )9UvMЍDD$Ẻ$螢M̋EE9B vHA% =uA D$D$Ẻ$HEGM̋EB EĉGGlEEȍw U܉Uu5M̋@ UЍDD$ $MMEȉGEЉEĉGED$4$u[WHtTB% =u @E܋B D$ML$$菡Wu @@EĉW V@ +EĉEЉF~UtFVFnFUEĉE܍V Uԉ}ȃ~u/Mȋ@ ED$ $ŗUUE܉FMNMe~E؉D$Uԉ$V9uɹEut}ȉUԉEFPMMЉ+U+UVpu-G%_DG+NHG @<$ǔ(u7bE\$M̋$ED$(Ű$藔EJ" L[^_]FPMMЋFp+E+EȉFpEC(u7ғE\$M̋$Y$mUWVS\]!ø 0$( )ΉtD$E$GJM|T UMU@ tnhT$$2tX(M@ P u@D$$Ƌ@DE@ u.\hD$ D$D$$ڒ@ u"D$<$E(D Eƅx`@ ED$ 8D$|$U$#E̅t 4$褍Eĉ$~`y\UċB% =u @EB ED$Eĉ$%UT$D$U$OE̅N4$,Eĉ$诏FH1$F||E|}t`+t$|$$[Nj+EЃD$UЉT$$"EЋuЃEЉx0@t tuỦ$$E\$$7$}tED$<$O")D$t$4$}ƃ> 0L[^_]É|$}<$U}UWVS, $2()щtD$E$謊U؋P u @ED$$qE䋃(DP u @ED$$7E(DP u @ED$$E܋0@tP 4<NjE܉D$UT$E$4(2D$<$G @t<$~(U ,[^_]UWVS,4Ï $2()щtD$E$U؋P u @ED$$E䋃(DP u @ED$$詉E(DP u @ED$$oE܋0@tP 4<YNjE܉D$UT$E$螋4(2D$<$SG @t<$e~(U ,[^_]U8]u} $2()t$D$E$臇0@tP 4<t݊VU(2D$<$耇G @t<$蒇~E( ]u}]UWVS<" $2()‰tD$E$諆Mԋ0@tP 4E菆EЋ(DP u RU@ D$UT$$UE8-E8_"E86PD~ҋ)(Ƀ҃EEM̉MR0(Ƀ҃EEM̉M7(Ƀ҃ɉM>(Ƀ҃EEM̉ME(Ƀ҃EEM̉M`L(Ƀ҃EEM̉M!PRt S)SE8aE88PUt7XtqF \(҃҃q f(Ƀ҃EEM̉M2 p(Ƀ҃EEM̉MPTtCUt}R z(Ƀ҃ɉM (Ƀ҃EEM̉M^ (҃҃E-#PFtQME (Ƀ҃EEM̉M (Ƀ҃EEM̉M (Ƀ҃EEM̉MKAPL_ҋ  (Ƀ҃EEM̉M (Ƀ҃EEM̉M (Ƀ҃ɉMp (Ƀ҃ɉM; (Ƀ҃EEM̉M (҃҃ E 8&PTt Uz)E8*E8ePSt T)9E8(IE8ZYE81PSt T)jE 8}E8sE8M tRQt&td=D$$I$1UԃMԉA7D$ $$UԃMԉA +EԃD$EԉD$$~Eԋuԃ<UԉBM̉L$EЉ$}UB @t$v}VMЉN+EԃD$EԉD$$!~Eԋuԃ<UԉBD$D$MЉ $OE@ @t$|VMЉN*D$T$P$ $}UԃMԉA <[^_]UWVS, s $:()щtD$E$|@ tD@ P upD$${ƉuF $kFHu$>D$D$l${PvP T$$}E$)|( ,[^_]UWVS, d 0$ ()։tD$E$zM@ tC@ P upD$$zƉF $ }FHu$>D$D$l$zPvP T$$|G|t${<$ {E( ,[^_]UWVS,D E$ M(0σED$D$$}D$ D$|$UM)$g}t$D$$U}t$D$$9}t$D$$}t$D$4$}t$D$$|t$`D$$|t$cD$\$|t$D$$|t$!D$$u|t$ ED$$V|@t$UT$$4|@t$D$$$|t$ D$${t$:D$${t$D$${t$D$${t$D$\${t$D$p$g{t$:D$<$K{t$D$ $/{t$vD$${t$D$$zt$D$$zt$PD$X$zt$D$$$zt$D$$zt$*D$$kzt$ȺD$$Ozt$>D$$3zt$UD$$zt$WD$$yt$D$$yt$D$$yt$fD$4$yt$D$$yt$D$$oyt$bD$$Syt$BD$$7yt$@D$$yt$޳D$p$xt$|D$@$xt$D$$xt$D$$xt$VD$$xt$D$$sxt$D$$Wxt$_D$$;xt$ D$$xt$D$$xt$D$T$wt$D$$wt$D$($wt$-D$$wt$˨D$$wwt$iD$|$[wt$D$@$?wt$D$$#wt$D$$wt$aD$h$vt$D$$vt$*D$$vt$ȡD$$vBs81t$rD$D$yvD$$rXtD$\$Yv( U ,[^_]Ë$Ðt$|$l$ ljՋL$q4 )i)Ή$q$$i$)Љ‰%/)=v-=v-CэC Ћt$|$l$ UWVL$|$|$u0=C40C >1|$v|$wU#|$tl$΃9uCȺqi)Ɖ l$[(41hhhhhhhhh h h h h hh΃tǰqi)qi)Ɓ|$-|$|$l$э41PHHHHHHHH H H H H HH ΃oD$ƒ|th<΃9uȺщ։ ^_]Ël$UE$U EtUE$U E[ÐUh]u} Ø} EEEEEEEEEED$ 8D$ED$E$'rƅuCD$E$qƃtE$qDEĉE$qƉ]u}]US$OD$ED$ ED$E D$E$q$[]ËT$ L Ë$ùtt3tUWVE׾U u^_]UWV uDž ҃ ux‰m`Gtt0tu1 ^_]CUWVSq*|$t$ D$Ѓ4$ 1́3J1́3J1́3J1́3J1́3J1́3J1́3J1́3,$<$0|t 139uЃ[^_]UE$U EUE$U EË $Ë$Ð 4$|$l$ՋHppTH4$|$l$ UWV8T$4H|P8T$ plT$ xxT$P,T$D$9v+T$T$P@T$P4T$T$ 2t$(T$ T:T$$T$ :;C΋pt9t$Ft$t$+t$(t$0 $׉D$,T$4L$ щL$4)8D$D(D$L$$8D$$D$ L$8L$4D$ @L$8AD$ |$4 $L$ l$$T$4hW8PhW8PhW8PhW8PhW8PhW8PhW8P@oU8Q9D$(oL$ $l$$T$4|$ <$l$$T$4D$ $l$$T$4nT$ $l$$T$4[L$ $l$$T$4H|$ <$l$$T$45D$ $l$$T$4"T$ $l$$T$4L$ $l$$T$4D$0|$(|$ L$L$$9}(t$,Vp;D$}=L$ LL$$t$(#T$D$P9T$s,$D$,ƋD$,D$,@t9FŃ8^_]UWVS<(UƋx,?EԋFlV<+Vt)‰UV,9rvF8|$8T$$k)~p)~l)~\NL FDuf)9׺Gf0uuEF@f)9׺Gf0uu}UBmV8U܋VlU؋Nt9EUGЉU}MM܉M+EUBED$D$ $XjUB@u$ED$U܉T$UB0$fUB0'u"ED$U܉T$UB0$fUB0UEPVtVtʃFl)ȋN8VHLMNX3U#VTVH}QV8TNX~H1#NTNH#V4~D O~@f WNHVDfJVtvu}}~tw xV<9sg~t~l9s/)F‰ED$F8$i}䉾.9s$)ǁ)9G|$F8$h<[^_]U8]u}&äNjp4$hF9GFGEt8D$FD$G $rhEG FG)GF+EFuFF]u}]UWVSL%-u~tw#Ft=w } ~tFlV8TNX~H1#VTVHNDQ#F4N@fAҋNHFD~lfFt=w }  N~tv[FlV8TNX~H1#VTVHNDQ#F4N@fAҋNHFD~lfV(U܋M N(*~+D$D$$MTG0NFFDFDAFVu|VD VDVDVDVDFV‰U䋎 t MVDFFqNM:Ez,уMMzуMMzуMz$҃MPVNVRTPVNVRTPVNVRTPVNVRTFV‰U䋎 t MPVNVR TPUVVzt/RNTEFNF@UDUVFx,tFD$FD$G0$TRG0F FEF0 ~~  ȃ ~lEȺB)щ)Fqh~ltW2WW0GD$D$$QG0~EVzNMB9F }F;F u@z,t';Ev"+ED$EFD$}G0$)QG0EFE;F t5FVNyN   FF F VJ9w}}Fx,t'F9Es+ED$EFD$G0$PG0FP9V uF FIFI ~IFxNM}F;F uCVz,t'9Es"+ED$EFD$}G0$2PG0EFE;F t1F VRʃF F~FuMԋ} }EFx,t'F9Es+ED$EFD$G0$OG0}uF F[F[ ~[Fx$VU}F;F uFVz,t*9Es%+ED$EFD$MA0$=O}G0EFE;F t1F VR$ʃF F~FuMԋ} }EFx,t'F9Es+ED$EFD$G0$NG0}uFgFg~guwFx,tgFP;V vFP;V wQNW0PVNW0TFD$D$$7NG0FqFq~tu_F(buHU )E܍}t)9@GVut@Gu!~tu} ~tu!-~tu} F`V8FlfHfntVlVl9tF\)¹xN8D$ T$L$4$PFlF\!x0dž} uKF\Nl)xV8D$ L$T$4$OFlF\xF\Nl)xV8D$ L$T$4$eOFlF\hx`V3}ā~tw#Ft=w } HF`FtVluN8ML9}y}I9MR}ԋ}O9M<MԃM܋}O9M#MUuԉEЋE܋}ȉHp9uuYHp9uuMHp9uuAHp9uu5Hp9uu)Hp9uuH@9EuJB9Eu;MruԋEЉ}ĺ+UV`9sF`vxBfJxf|f 9V`)VtVlF`YV8FlfJf9ntFlF\Nl)xV8D$ L$T$4$LFlF\x}ĸ}dž} uHF\Nl)xV8D$ L$T$4$|LFlF\x{tmF\Nl)xV8D$ L$T$4$&LFlF\)x$}ĸ@U T$4$PwFtuF(} u 4$Km} tgD$ D$D$4$K} uAVLFDfDPFLDD$FD$,K~tuFlF\dž7uF(}VFVO0 PVVO0LPVVO2LPVVO3LPVVOLPVVOLPVVO LPVVO LFW2rW0bKF~؉F~]u}]UH]u}%ũUr} EE E E}k EE9ukM }9 t,zt!D$$ Hu ~D‹U 9t4k ;J JRV|M]u}]Uu}uVz*t"EtIt[tgt qtu}Bt D$F($V$F@Dt D$F($V$F@@t D$F($V$F@8t D$F($V$FD$F($V$FqD@u}]U8]u})ɧ}U :1g}$8]tGW b$X} EE E }y ]EE}~ mEE}}}E } E}} EEED$D$G($҉Ƹw>EFFUV0EF,F4EFPЉVLFTE FXD$ML$G($W F8D$F,D$G($W F@D$FLD$G($W FDdžMD$D$G($W F N ~8t~@t ~Dtu"F@G<$ E]у kЉU MEF$<$:D! ]u}]US$fED$ED$D$D$D$ D$E D$E$A$[]U8]u}æU }rD$8T$E$lDD$D$UB($R ǸExD$t$<$'DUD$G,D$B($R G8D$G,D$UB($R G@D$GLD$UB($R GDD$D$UB($R EGG8t@t Dt}uE$CW,҉T$V8T$$aCG,D$F@D$G@$FCGLD$FDD$GD$+CG D$FD$G$CWF+FGM䉏@‰ $ | 0 ]u}]Ë$ÐUu}u} U:1}8}{FV tp~$tjD$D$F($҉¸tGVBz$B(EB4B0B, u}]UWVSè}UE@Eĸ}=UĉŰMA BB,Etq}ċ4}Eċ@(EȿEUM*EFUM̋  ẼxuvimԃU밍MMЉu'uЉt$E$U uE8uUԃuvƋEԃỦBUЃtr t>uXAM K8M̉ALAT APAX EcMAEUԃmԃwSUUЉu'MЉL$u4$U uEDuUԃuvEԋU9tUEPM>}̉G@ǍEEЉuԃ}u*UЉT$M $U EԅuE }u1űv4uE̋@(EȋỦB,D$t$M $U` 9}ԋuG;uGuȉt$ED$}<$>)uu)u}E̋x@)x@RuԋU EZMMЉu'uЉt$E$U uE uUԃu vƋEԃỦB`UUЋM̉QdM ỦJ\m=w}vhMAEUBhz\MEu'MЉL$u4$U uE uUԃuvEűVhSxMԃfLFpVhm9V\w EEЉuq뾋uw MSxfDApvM̉QhE0EỦBlBLBTUM̃TMẼlEŨpUML$ED$UT$ D$ML$$uEȋEE}C u uUЃ;}r܉uMm+}}u#EȋuuUBM#uMTqnMЃqmft/ɉMM9Eȋuu} ɉMȃM9v>uEȋEE}m u uUЃ;}r܉uUMуqU+}Pu u}Ѓ׃;Mrډ}ЉuϋUMуq U+}M 9Mru%MEȋuuUBMEȋuuűEfTFp9uEȋUUủNhŰRhUM9sDűvLuȋŰJTMU!ʋMȍJRu9!EȋEEŨ:EfpuMA$E0ủFlFLFT ẼlEĉt$ẼTD$UĉT$ M̋A`D$ȃpD$$ EtuFEŰBlBPBXt$ЃXD$MĉL$ BdD$B`DBpD$$EtuFEEU} z M}v}vvEuF UVMEȉFUЋM̉Q8yD$D$$ UT$U T$$¸9Wu0U UE$$t  G ]u}]ËT$L$tRtBtJ A0UX]u}Oáeu~~u <?toG<b8ƒW<v7G8MUUЍTUĈ9uMЃG8UԃW| f  l$`c9T$~ $+<$9~t| |$ fl$ fx|$hL=hL=|$x)|$f<$L/| f  $ ,$)9~s |$ fl$ fx|$hL=hL=|$x)|$f<$L/ f  $~gt$ f fhp .xL/H)l$ ff l 6 4$+4$9~r |$ ft$ fpt$x 7xL7t$p)t$f4$L> f  $ ~gl$ f fhp .xL/H)l$ f Jf - <$)9~r t$ f|$ fpt$x 7xL7t$p)t$f4$L> f  $ ~d l$ f fhp .xL/H)l$ f  f |$t-T$;T$ɃL$ ;T$ɃT$D$ D$|$9|$,i^_]UWVSST$4Q  $t$<w)9~i?|$ fl$fxhL=hL=H)l$fL>'/f Ήx,$,)l$L$}|$ +|$ 9~yml$ fl$fx|$hL=hL=|$x+|$f|$ lmf L$ l$l$<$L$+X|$ )9~sl$ l$ f|$ fx|$xl$ /xL/H)|$f|$L/l$ f |$ωNL$w |t7L$| L$0<ol$+l$9~l?|$  f|$fxhL=hL=H)l$ fl$L=?f l$͉l$+X)9~hl$ fl$fphL5hL5H)l$fL7f ω;&|$)9~[f fphL5hL5p)fT2|$f ʉ[^_]UWV\ƉUċEBUЋx džPdžT=~WEU}f<t"PyP` ƄXfD;EuȉMM_EMЉ}PP}EE\ }fƄXt D)P~}ԋUEĉPPEԅ~ }ЉƉ4$U<}Ћ` MԋP\ ` P$U` E̋TMԉX JTT EԋUEЋM̍ fEf MXMȋEXEMԃEM8MEMB>XfzEfx` $UOP~TPT` X Mċ Mȋ}ċ}ЋMċA8}HMx}@E̸fDŽF< uEfDT=<\ PUEu MԋMMqEDEă9E}EEfA9U|YufF< E9U +Uu4uE‹M}tMEtEč‹u;}bu}}M̍AN: fuF< ftfF< fF> fN< }tj=}̉}~< tM\ 9M|:}ȍ yf};}t!}ԋ}+}ԉ}9}}fyumu< fTFfTE؃u}xO}ԋUDt3LEуfLEعփ ɃuԋEf 9}}\^_]Ã4$|$u=Px xLPfǀǀ,~'Px Pf4$|$Ã4$|$~*Px xLP~Px Pfǀǀ4$|$USÇIE  $ , | 0 8 fǀǀ[]UWVuE ~Wf fFV NTF)щf f FVM Uf~LMы~LNfTF}t)U UVM ~ V9Eu^_]UE~]U]u}KGE ~Wf fPx xLP)f f )9~^uf fpx 7xL7p)}fT2f ʉS]u}]UWVS,Fu3y,ut fuV tfuGfu=fu3fu)!fu=uf A, $  $$ ( $0 f uf~ uu勎T@T  9C Mʸ}9w(} t"ED$ UT$M L$4$t9 ~[U҉f fF~ ~LF)f Ef 8$ ~_U҉Uf fV~ ~LV)ы}f Uf E( E؋ U܉Ѓ ~X-f fFNNTF)f f-f  ~T}؉f fFNNTF)f Ef  ~g}f fFNNTF)f }#Ef ҋ ~f~ Uf fV~ ~LV)ы}f "~ f 9EaEU܉$‰ M؉ $<$UH}tz,[^_]à $t$|$hAD$T$L$f~ 7u fLrx fw |T|2f 9$t$|$ Ë$ÐUh]u}Ô@} EEEEEEEEED$8D$E$ƅuVD$E$ƃt#E$Vt'u'}DEĉE$.]u}]Ë$Ð?øU?+T$WVt$ |$L$t9u^_UWV|$l$t$t2M8t L8t 8 9w^_]ËL$T$t9uË $ÐUVS.>t&Ћu[^]Ë$US[ÿ> [US[ß>k[ 20B7PB<qneed dictionarystream endfile errorstream errordata errorinsufficient memorybuffer errorincompatible version0w,aQ mjp5c飕d2yҗ+L |~-d jHqA}mQDžӃVlkdzbeO\lcc=  n;^iLA`rqgjm Zjz  ' }Dңhi]Wbgeq6lknv+ӉZzJgo߹ホCՎ`~ѡ8ROggW?K6H+ L J6`zA`Ugn1yiFafo%6hRw G "/&U;( Z+j\1е,[d&c윣ju m ?6grWJz+{8 Ғ |! ӆBhn[&wowGZpj;f\ eibkaElx TN³9a&g`MGiIwn>JjѮZf @;7SŞϲG0򽽊º0S$6к)WTg#.zfJah]+o*7 Z- deflate 1.2.8 Copyright 1995-2013 Jean-loup Gailly and Mark Adler &_n0`nn_nnngnnnnnnn\nn     A@!  @a`10  @`Psp0  ` @ X ;x8 h( H T+t4  d$ D \ S|< l,  L R#r2  b" B Z Cz: j*  J V@3v6 f& F  ^ c~> n. N `Qq1  a! A Y ;y9 i)  I U+u5  e% E ] S}= m-  M S#s3  c# C [ C{; k+  K W@3w7 g' G  _ c? o/ O `Psp0  ` @ X ;x8 h( H T+t4  d$ D \ S|< l,  L R#r2  b" B Z Cz: j*  J V@3v6 f& F  ^ c~> n. N `Qq1  a! A Y ;y9 i)  I U+u5  e% E ] S}= m-  M S#s3  c# C [ C{; k+  K W@3w7 g' G  _ c? o/ O {{~K؀Q{gЄ߄h{'k.X}*^{     A@!  @a`10  @`Psp0  ` @ X ;x8 h( H T+t4  d$ D \ S|< l,  L R#r2  b" B Z Cz: j*  J V@3v6 f& F  ^ c~> n. N `Qq1  a! A Y ;y9 i)  I U+u5  e% E ] S}= m-  M S#s3  c# C [ C{; k+  K W@3w7 g' G  _ c? o/ O `Psp0  ` @ X ;x8 h( H T+t4  d$ D \ S|< l,  L R#r2  b" B Z Cz: j*  J V@3v6 f& F  ^ c~> n. N `Qq1  a! A Y ;y9 i)  I U+u5  e% E ] S}= m-  M S#s3  c# C [ C{; k+  K W@3w7 g' G  _ c? o/ O inflate 1.2.8 Copyright 1995-2013 Mark Adler @@ !1Aa  0@`HN #+3;CScs   L,l\<|B"bR2r J*jZ:zF&fV6vN.n^>~A!aQ1q I)iY9yE%eU5u M-m]=}   S S  3 3  s s    K K  + +  k k     [ [  ; ;  { {     G G  ' '  g g     W W  7 7  w w     O O  / /  o o     _ _  ? ?     @ `P0pH(hX8xD$dT4tC#c            (08@P`p   0@`  0@`need dictionarystream endfile errorstream errordata errorinsufficient memorybuffer errorincompatible versioninf_s%s: %s is not of type %s1.2.8s, bytes, modebuf, crc=crcInitial, offset=0Compress::Raw::Zlib::crc32buf, adler=adlerInitialCompress::Raw::Zlib::adler32s, buf, out=NULL, eof=FALSEinflateScan %02xDispStream %p- %s stream pointer is NULL stream %p zalloc %p zfree %p opaque %p state %p msg %s msg next_in %p => next_out %p avail_in %lu avail_out %lu total_in %ld total_out %ld adler %ld bufsize %ld dictionary %p dict_adler 0x%ld zip_mode %d crc32 0x%x adler32 0x%x flags 0x%x DisabledEnabled APPEND %s CRC32 %s ADLER32 %s CONSUME %s LIMIT %s window %p s, message=NULL%s: %s is not a references, bufinflateSyncs, buf, output, eof=FALSEinflates, output, f=Z_FINISHflushs, buf, outputdeflateadler1, adler2, len2crc1, crc2, len2svZ_OKZ_RLEZ_NULLZ_FIXEOS_CODZ_ASCIZ_BLOCZ_ERRNZ_TREEZ_BINARYDEF_WBITSZ_UNKNOWNMAX_WBITSZ_FILTEREDZ_DEFLATEDZ_NO_FLUSHZ_NEED_DICTZ_BUF_ERRORZ_MEM_ERRORZ_FULL_FLUSHZ_SYNC_FLUSHZ_STREAM_ENDZ_BEST_SPEEDZ_DATA_ERRORZLIB_VERSIONMAX_MEM_LEVELZ_STREAM_ERRORZ_HUFFMAN_ONLYZ_VERSION_ERRORZ_PARTIAL_FLUSHZ_NO_COMPRESSIONZ_BEST_COMPRESSIONZ_DEFAULT_STRATEGYZ_DEFAULT_COMPRESSION%s is not a valid Zlib macrov5.20.02.066Zlib.cCompress::Raw::Zlib::constantinvalid distance too far backinvalid distance codeinvalid literal/length codeinvalid stored block lengthsinvalid block typeinvalid code lengths setinvalid bit length repeatinvalid literal/lengths setinvalid distances setincorrect length checkincorrect data checkincorrect header checkunknown compression methodinvalid window sizeunknown header flags setheader crc mismatchCompress::Raw::Zlib::inflateScanStreamCompress::Raw::Zlib::inflateScanStream::adler32Compress::Raw::Zlib::inflateScanStream::crc32Compress::Raw::Zlib::inflateScanStream::getLastBufferOffsetCompress::Raw::Zlib::inflateScanStream::getLastBlockOffsetCompress::Raw::Zlib::inflateScanStream::uncompressedBytesCompress::Raw::Zlib::inflateScanStream::compressedBytesCompress::Raw::Zlib::inflateScanStream::inflateCountCompress::Raw::Zlib::inflateScanStream::getEndOffsetCompress::Raw::Zlib::inflateStreamCompress::Raw::Zlib::inflateStream::get_BufsizeCompress::Raw::Zlib::inflateStream::total_outCompress::Raw::Zlib::inflateStream::adler32Compress::Raw::Zlib::inflateStream::total_inCompress::Raw::Zlib::inflateStream::dict_adlerCompress::Raw::Zlib::inflateStream::crc32Compress::Raw::Zlib::inflateStream::statusCompress::Raw::Zlib::inflateStream::uncompressedBytesCompress::Raw::Zlib::inflateStream::compressedBytesCompress::Raw::Zlib::inflateStream::inflateCountCompress::Raw::Zlib::deflateStreamCompress::Raw::Zlib::deflateStream::total_outCompress::Raw::Zlib::deflateStream::total_inCompress::Raw::Zlib::deflateStream::uncompressedBytesCompress::Raw::Zlib::deflateStream::compressedBytesCompress::Raw::Zlib::deflateStream::adler32Compress::Raw::Zlib::deflateStream::dict_adlerCompress::Raw::Zlib::deflateStream::crc32Compress::Raw::Zlib::deflateStream::statusCompress::Raw::Zlib::deflateStream::get_BufsizeCompress::Raw::Zlib::deflateStream::get_StrategyCompress::Raw::Zlib::deflateStream::get_LevelCompress::Raw::Zlib::inflateStream::msgCompress::Raw::Zlib::deflateStream::msgCompress::Raw::Zlib::inflateScanStream::statusinf_s, flags, level, method, windowBits, memLevel, strategy, bufsizeCompress::Raw::Zlib::inflateScanStream::_createDeflateStreamCompress::Raw::Zlib::inflateScanStream::resetLastBlockByteCompress::Raw::Zlib::inflateStream::set_Append%s: buffer parameter is not a SCALAR reference%s: buffer parameter is a reference to a referenceWide character in Compress::Raw::Zlib::crc32Wide character in Compress::Raw::Zlib::adler32Compress::Raw::Zlib::inflateScanStream::scanWide character in Compress::Raw::Zlib::InflateScan::scan input parameterCompress::Raw::Zlib::inflateScanStream::inflateResetCompress::Raw::Zlib::inflateStream::inflateResetCompress::Raw::Zlib::inflateScanStream::DispStreamCompress::Raw::Zlib::inflateStream::DispStreamCompress::Raw::Zlib::deflateStream::DispStreamflags, level, method, windowBits, memLevel, strategy, bufsize, dictionaryWide character in Compress::Raw::Zlib::Deflate::new dicrionary parameterCompress::Raw::Zlib::inflateStream::DESTROYCompress::Raw::Zlib::inflateStream::inflateSyncWide character in Compress::Raw::Zlib::Inflate::inflateSync%s: buffer parameter is read-onlyCompress::Raw::Zlib::inflateStream::inflateCompress::Raw::Zlib::Inflate::inflate input parameter cannot be read-only when ConsumeInput is specifiedWide character in Compress::Raw::Zlib::Inflate::inflate input parameterWide character in Compress::Raw::Zlib::Inflate::inflate output parameters, good_length, max_lazy, nice_length, max_chainCompress::Raw::Zlib::deflateStream::deflateTunes, flags, level, strategy, bufsizeCompress::Raw::Zlib::deflateStream::_deflateParamsCompress::Raw::Zlib::deflateStream::flushWide character in Compress::Raw::Zlib::Deflate::flush input parameterCompress::Raw::Zlib::deflateStream::deflateWide character in Compress::Raw::Zlib::Deflate::deflate input parameterWide character in Compress::Raw::Zlib::Deflate::deflate output parameterCompress::Raw::Zlib::deflateStream::deflateResetflags, windowBits, bufsize, dictionaryYour vendor has not defined Zlib macro %s, usedUnexpected return type %d while processing Zlib macro %s, usedCompress::Raw::Zlib::deflateStream::DESTROYCompress::Raw::Zlib::inflateScanStream::DESTROYCompress::Raw::Zlib::zlib_versionCompress::Raw::Zlib::ZLIB_VERNUMCompress::Raw::Zlib::zlibCompileFlagsCompress::Raw::Zlib::crc32_combineCompress::Raw::Zlib::adler32_combineCompress::Raw::Zlib::_deflateInitCompress::Raw::Zlib::_inflateInitCompress::Raw::Zlib::_inflateScanInitCompress::Raw::Zlib needs zlib version 1.x Compress::Raw::Zlib::gzip_os_codetoo many length or distance symbolsinvalid code -- missing end-of-blocktoo many length or distance symbolsinvalid code -- missing end-of-blockF4V4f4v44444444455&565F5V5f5v55555555566&666F6V6f6v66666666677&767F7V7f7v77777777788&868F8V8f8v88888888899&969F9V9 M MM M M M~~~~~~~~ ~@w`|{`}`~TD l,,- (0 1 04 `9 YYZ~48<DL`DbdhHu8 Z+6<DDR4eLr`9 DH9 LP:b ;b &=e dy>x ?b SAb Bb NDe |Eb Fb @Hb Ib DKb ufLb Mb *Ob Pb <Qb oPSb Tb Vb vWb <Xb j:Zb [b \b `^b &_b Y$ab b dcb db (f $gB 3[@?Igi thQ pMi i nd o@ ,'r 2rE O-u n%wQ v} #  ЀN 5 \ @ ze u ߅e  De ! ʌ  > * (Z 2 [ ` ݗj G Yi   ! h T H x ]  y X   :   l H r H x ~ %  , ' \  ȇ  @ x    < l  ȉ  $ P     D t   " <( h. 4 Č: @ ~F (L PR xX ^ !d j @p Fv 0| N l  ̎ V     0  `   ܏      " ;Tm ΀$*06<6BPHjNTZ`Ӂflr"x=~FNg˂H|ܐ(tБ !0 ;\Ȓ!(\/6=DCKRYYD`_gnnu|Lvƃ̓ԃۃP #$/+;2G9T@aGnN{U\cjqxф.ؕDKSY`tt 0Tx '̗.? 4h : @ FR L R XF ^( d jʴ p0 v | " خ  V  ʯ  F  ij  . m 4 ~ @ 1 !M 4@\>H> T b% n} |Ms X  `xa@aa& ~   ΅~      1 M   [   ~ ~  0n *> 7kCjP@j& c z ~ ~    Ն   ΅ <   ` 1 M [G `* e j o t` y ~     X g {   )  $  u! % % %( ( r* * + + - - -  s> t>@s@!s@,@<v 7< B= L> VD e`|tq|t}`}x}xNI M Ny 0@w8|{x`~L ~ @~ @+@+49LEY [ X 04 J1 Q z $2Y8 LZ6 f  sYN 6({<6    h# G  ! 62/ GU W _ mymO  {H @ Q]  0V  @  *<@`DX  N`i4 uS vX    A9 ? ZW  ' 3? @X X( LWg~@v $ dY   h' 5" 01 EVs(  "~ "s/ '/ @X G\mP  kzP6 uIRG 0@ \Y @t5A D3*  2 (2:Nu FZlib.socrti.svalues-Xa.cDrodata.rodatacrtstuff.c__CTOR_LIST____DTOR_LIST____EH_FRAME_BEGIN____JCR_LIST____do_global_dtors_auxcompleted.5017dtor_idx.5019frame_dummyobject.5029Zlib.cXS_Compress__Raw__Zlib__inflateScanStream_adler32XS_Compress__Raw__Zlib__inflateScanStream_crc32XS_Compress__Raw__Zlib__inflateScanStream_getLastBufferOffsetXS_Compress__Raw__Zlib__inflateScanStream_getLastBlockOffsetXS_Compress__Raw__Zlib__inflateScanStream_uncompressedBytesXS_Compress__Raw__Zlib__inflateScanStream_compressedBytesXS_Compress__Raw__Zlib__inflateScanStream_inflateCountXS_Compress__Raw__Zlib__inflateScanStream_getEndOffsetXS_Compress__Raw__Zlib__inflateStream_get_BufsizeXS_Compress__Raw__Zlib__inflateStream_total_outXS_Compress__Raw__Zlib__inflateStream_adler32XS_Compress__Raw__Zlib__inflateStream_total_inXS_Compress__Raw__Zlib__inflateStream_dict_adlerXS_Compress__Raw__Zlib__inflateStream_crc32XS_Compress__Raw__Zlib__inflateStream_statusXS_Compress__Raw__Zlib__inflateStream_uncompressedBytesXS_Compress__Raw__Zlib__inflateStream_compressedBytesXS_Compress__Raw__Zlib__inflateStream_inflateCountXS_Compress__Raw__Zlib__deflateStream_total_outXS_Compress__Raw__Zlib__deflateStream_total_inXS_Compress__Raw__Zlib__deflateStream_uncompressedBytesXS_Compress__Raw__Zlib__deflateStream_compressedBytesXS_Compress__Raw__Zlib__deflateStream_adler32XS_Compress__Raw__Zlib__deflateStream_dict_adlerXS_Compress__Raw__Zlib__deflateStream_crc32XS_Compress__Raw__Zlib__deflateStream_statusXS_Compress__Raw__Zlib__deflateStream_get_BufsizeXS_Compress__Raw__Zlib__deflateStream_get_StrategyXS_Compress__Raw__Zlib__deflateStream_get_LevelXS_Compress__Raw__Zlib_ZLIB_VERNUMXS_Compress__Raw__Zlib__inflateStream_msgXS_Compress__Raw__Zlib__deflateStream_msgXS_Compress__Raw__Zlib_zlib_versionGetErrorStringmy_z_errmsgXS_Compress__Raw__Zlib__inflateScanStream_statusPostInitStreamXS_Compress__Raw__Zlib__inflateScanStream__createDeflateStreamXS_Compress__Raw__Zlib__inflateScanStream_resetLastBlockByteXS_Compress__Raw__Zlib__inflateStream_set_AppenddeRefXS_Compress__Raw__Zlib_crc32XS_Compress__Raw__Zlib_adler32XS_Compress__Raw__Zlib__inflateScanStream_scanXS_Compress__Raw__Zlib__inflateScanStream_inflateResetXS_Compress__Raw__Zlib__inflateStream_inflateResetDispHexXS_Compress__Raw__Zlib__deflateStream_DispStreamXS_Compress__Raw__Zlib__inflateScanStream_DispStreamXS_Compress__Raw__Zlib__inflateStream_DispStreamXS_Compress__Raw__Zlib__deflateInitXS_Compress__Raw__Zlib__inflateStream_DESTROYXS_Compress__Raw__Zlib__inflateStream_inflateSyncdeRef_lXS_Compress__Raw__Zlib__inflateStream_inflateXS_Compress__Raw__Zlib__deflateStream_deflateTuneXS_Compress__Raw__Zlib__deflateStream__deflateParamsXS_Compress__Raw__Zlib__deflateStream_flushXS_Compress__Raw__Zlib__deflateStream_deflateXS_Compress__Raw__Zlib__deflateStream_deflateResetXS_Compress__Raw__Zlib__inflateInitXS_Compress__Raw__Zlib_adler32_combineXS_Compress__Raw__Zlib_crc32_combineXS_Compress__Raw__Zlib_zlibCompileFlagsXS_Compress__Raw__Zlib_constantXS_Compress__Raw__Zlib__deflateStream_DESTROYXS_Compress__Raw__Zlib__inflateScanStream_DESTROY.L933.L937.L959.LC0.LC1.LC2.LC3.LC4.LC5.LC6.LC7.LC8.LC9.LC10.LC11.LC12.LC13.LC14.LC15.LC16.LC17.LC18.LC19.LC20.LC21.LC22.LC23.LC24.LC25.LC26.LC27.LC28.LC29.LC30.LC31.LC32.LC33.LC34.LC35.LC36.LC37.LC38.LC39.LC40.LC41.LC42.LC43.LC44.LC46.LC47.LC48.LC49.LC50.LC51.LC52.LC53.LC54.LC55.LC56.LC57.LC58.LC59.LC60.LC61.LC64.LC65.LC66.LC67.LC68.LC69.LC70.LC71.LC72.LC73.LC74.LC75.LC76.LC77.LC78.LC79.LC80.LC81.LC82.LC83.LC84.LC85.LC86.LC87.LC88.LC63.LC62.LC89.LC90.LC91.LC92.LC93.LC94.LC95.LC96.LC97.LC98.LC99.LC100.LC101.LC102.LC103.LC104.LC105.LC106.LC107.LC108.LC109.LC110.LC111.LC112.LC113.LC114.LC115.LC116.LC117.LC118.LC119.LC120.LC121.LC122.LC123.LC124.LC125.LC126.LC127.LC128.LC129.LC130.LC131.LC132.LC133.LC134.LC135.LC136.LC137.LC138.LC139.LC140.LC141.LC142.LC143.LC144.LC145.LC146.LC147.LC148.LC149.LC150.LC151.LC152.LC153.LC154.LC155.LC156.LC157.LC158.LC159.LC160.LC161.LC162.LC163.LC164.LC165.LC166.LC167.LC168.LC169.LC170.LC171.LC172.LC173.LC174.LC175.LC176.LC177.LC178.LC179.LC180.LC181.LC182.LC183.LC184.LC185.LC186.LC187.L869.L870.L871.L872.L873.L874.L875.L876.L877.L878.L879.L880.L881.L882.L883.L888.L889.L890.L891.L892.L893.L910.L911.L912.L913.L914.L915adler32.cadler32_combine_compress.ccrc32.cgf2_matrix_timesgf2_matrix_squarecrc32_combine_get_crc_tabledeflate.cputShortMSBlongest_matchfill_windowflush_pendingdeflate_slowdeflate_fastdeflate_storedconfiguration_tableinfback.clenfix.1915distfix.1916order.1937.L14.L15.L16.L17.L18.L19.L121inffast.cinflate.csyncsearchupdatewindowlenfix.1948distfix.1949order.1977.L61.L62.L63.L64.L65.L66.L67.L68.L69.L70.L71.L72.L73.L74.L75.L76.L77.L78.L79.L80.L81.L82.L83.L84.L85.L86.L87.L88.L272.L90.L91inftrees.clext.1861lbase.1860dext.1863dbase.1862init_blockpqdownheapscan_treesend_treecompress_blockextra_lbitsbase_lengthextra_dbitsbase_distbuild_treebi_flushbi_windupstatic_l_descstatic_d_descstatic_bl_descstatic_ltreebl_orderstatic_dtreeextra_blbitsuncompr.czutil.c__CTOR_END____FRAME_END____JCR_END____do_global_ctors_auxcrtn.s_END___DTOR_END____dso_handle_START__GLOBAL_OFFSET_TABLE_PL_unitcheckav_PROCEDURE_LINKAGE_TABLE_inflateGetDictionaryPerl_xs_version_bootcheckinflate_fastinflatePrimePerl_sv_2iv_flagsPL_stack_base_fini_Jv_RegisterClassesPerl_sv_setivboot_Compress__Raw__Zlibzmemcmpinflate_tablePL_sv_undefPerl_safesysfreedeflateBoundPerl_croak_xs_usagePerl_sv_free2Perl_safesysmallocinflateBackInit_zmemcpyPerl_newSVsvmy_zcfreestrerrordeflateSetDictionaryinflateGetHeaderPerl_sv_setpv_tr_tallyinflateReset2Perl_mg_set_tr_stored_blockdeflateResetKeepPerl_sv_2bool_flags_etext_tr_flush_blockdeflateInit2_PL_curcopPerl_sv_setpvninflateEndcrc32_combine64uncompressPerl_sv_growPL_sv_yesPerl_sv_2uv_flagsdeflate_copyrightPerl_sv_setref_pvPL_sv_noinflateCopyPL_stack_spPerl_sv_pvn_force_flagsdeflatePendingdeflateInit_inflateBackinflateInit__DYNAMICinflateBackEndPerl_newSVivPerl_sv_setnv_lib_versionPerl_call_listcompress2deflateCopydeflatePrimezlibVersionPerl_croakPerl_sv_2mortalPerl_sv_utf8_downgrade_length_codePerl_sv_upgradePL_stack_maxPerl_newSVpvfputsPerl_sv_utf8_upgrade_flags_grow_end_tr_initdeflateEndadler32_combine64compressBoundmy_zcallocinflateUndermineinflateSetDictionaryPL_markstack_ptrPerl_xs_apiversion_bootcheckdeflateSetHeader__deregister_frame_info_basesPerl_sv_setuvPerl_sv_2pv_flagsPL_scopestack_ixinflateInit2___register_frame_info_basesinflate_copyrightPerl_newXSPL_opprintfputcharinflateResetKeepzErrorPerl_sv_derived_from_tr_flush_bits_tr_alignPerl_dowantarrayPerl_sv_2pvbytezmemzero_dist_codePL_compilingPerl_mg_getPerl_stack_growinflateMarkerrno_edatainflateSyncPointPerl_sv_newmortalPerl_newSVpvPerl_get_svPL_curpadmemmovePerl_sv_lenPerl_sv_pvbyten_forceGCC: (GNU) 4.5.2ld: Software Generation Utilities - Solaris Link Editors: 5.11-1.2329.dynamic.eh_frame_hdr.hash.SUNW_ldynsym.dynsym.dynstr.SUNW_version.SUNW_versym.SUNW_dynsymsort.SUNW_reloc.rel.plt.text.init.fini.rodata.rodata.str1.1.rodata.str1.4.got.eh_frame.data.ctors.dtors.jcr.data.rel.ro.local.data.rel.local.bss.symtab.strtab.comment.shstrtab@  ToTTo, D D 4"<ol,l, Jo,,Wo--h (0(0xt B11x04040}`9`9\ YYYYZZ$ 2~~V24488<<DDLL`` <DD D&  D\0X (62074f1b98bc4bd45acd53f898a3431cfb5689a9CACHEQ; PAR.pm