exiftool-vendored.exe 12.80.0 → 12.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/bin/exiftool.exe +0 -0
- package/bin/exiftool_files/Changes +44 -0
- package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
- package/bin/exiftool_files/README +3 -2
- package/bin/exiftool_files/exiftool.pl +36 -14
- package/bin/exiftool_files/lib/Archive/Zip/Archive.pm +399 -65
- package/bin/exiftool_files/lib/Archive/Zip/DirectoryMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/FileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/Member.pm +499 -195
- package/bin/exiftool_files/lib/Archive/Zip/NewFileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/StringMember.pm +2 -2
- package/bin/exiftool_files/lib/Archive/Zip/ZipFileMember.pm +79 -20
- package/bin/exiftool_files/lib/Archive/Zip.pm +179 -29
- package/bin/exiftool_files/lib/AutoLoader.pm +453 -0
- package/bin/exiftool_files/lib/B/Deparse.pm +209 -137
- package/bin/exiftool_files/lib/B.pm +1 -1
- package/bin/exiftool_files/lib/Benchmark.pm +1123 -0
- package/bin/exiftool_files/lib/Class/Struct.pm +2 -2
- package/bin/exiftool_files/lib/Compress/Raw/Bzip2.pm +14 -9
- package/bin/exiftool_files/lib/Compress/Raw/Lzma.pm +982 -0
- package/bin/exiftool_files/lib/Compress/Raw/Zlib.pm +91 -86
- package/bin/exiftool_files/lib/Compress/Zlib.pm +105 -100
- package/bin/exiftool_files/lib/Config.pm +9 -9
- package/bin/exiftool_files/lib/Config_heavy.pl +36 -33
- package/bin/exiftool_files/lib/CryptX.pm +2 -82
- package/bin/exiftool_files/lib/Data/Dumper.pm +2 -2
- package/bin/exiftool_files/lib/Digest/MD5.pm +12 -9
- package/bin/exiftool_files/lib/Digest/Perl/MD5.pm +1 -191
- package/bin/exiftool_files/lib/Digest/base.pm +26 -20
- package/bin/exiftool_files/lib/DynaLoader.pm +7 -4
- package/bin/exiftool_files/lib/Encode.pm +3 -3
- package/bin/exiftool_files/lib/Errno.pm +13 -13
- package/bin/exiftool_files/lib/Exporter/Heavy.pm +2 -2
- package/bin/exiftool_files/lib/Exporter.pm +1 -1
- package/bin/exiftool_files/lib/ExtUtils/Command/MM.pm +323 -0
- package/bin/exiftool_files/lib/ExtUtils/Command.pm +382 -0
- package/bin/exiftool_files/lib/File/Find.pm +1 -1
- package/bin/exiftool_files/lib/File/Glob.pm +1 -8
- package/bin/exiftool_files/lib/File/GlobMapper.pm +2 -2
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Carbon.pm +2 -40
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Cocoa.pm +2 -34
- package/bin/exiftool_files/lib/File/HomeDir/Darwin.pm +2 -28
- package/bin/exiftool_files/lib/File/HomeDir/Driver.pm +2 -35
- package/bin/exiftool_files/lib/File/HomeDir/FreeDesktop.pm +2 -62
- package/bin/exiftool_files/lib/File/HomeDir/MacOS9.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Test.pm +2 -43
- package/bin/exiftool_files/lib/File/HomeDir/Unix.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Windows.pm +2 -69
- package/bin/exiftool_files/lib/File/HomeDir.pm +5 -416
- package/bin/exiftool_files/lib/File/Path.pm +3 -3
- package/bin/exiftool_files/lib/File/Spec/Win32.pm +2 -2
- package/bin/exiftool_files/lib/File/Temp.pm +70 -35
- package/bin/exiftool_files/lib/File/Which.pm +1 -240
- package/bin/exiftool_files/lib/File/stat.pm +3 -2
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Bzip2.pm +16 -17
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Deflate.pm +19 -20
- package/bin/exiftool_files/lib/IO/Compress/Base/Common.pm +5 -5
- package/bin/exiftool_files/lib/IO/Compress/Base.pm +35 -26
- package/bin/exiftool_files/lib/IO/Compress/Brotli.pm +159 -0
- package/bin/exiftool_files/lib/IO/Compress/Bzip2.pm +50 -25
- package/bin/exiftool_files/lib/IO/Compress/Gzip/Constants.pm +6 -6
- package/bin/exiftool_files/lib/IO/Compress/Gzip.pm +58 -32
- package/bin/exiftool_files/lib/IO/Compress/RawDeflate.pm +63 -38
- package/bin/exiftool_files/lib/IO/Compress/Zlib/Extra.pm +20 -20
- package/bin/exiftool_files/lib/IO/Dir.pm +1 -1
- package/bin/exiftool_files/lib/IO/File.pm +1 -1
- package/bin/exiftool_files/lib/IO/Handle.pm +1 -21
- package/bin/exiftool_files/lib/IO/Pipe.pm +1 -1
- package/bin/exiftool_files/lib/IO/Seekable.pm +1 -1
- package/bin/exiftool_files/lib/IO/Select.pm +16 -2
- package/bin/exiftool_files/lib/IO/Socket/INET.pm +14 -9
- package/bin/exiftool_files/lib/IO/Socket/UNIX.pm +17 -1
- package/bin/exiftool_files/lib/IO/Socket.pm +474 -126
- package/bin/exiftool_files/lib/IO/String.pm +425 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Adapter/Inflate.pm +13 -14
- package/bin/exiftool_files/lib/IO/Uncompress/Base.pm +142 -132
- package/bin/exiftool_files/lib/IO/Uncompress/Brotli.pm +119 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Gunzip.pm +43 -37
- package/bin/exiftool_files/lib/IO/Uncompress/RawInflate.pm +49 -43
- package/bin/exiftool_files/lib/IO.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/BuildTagLookup.pm +44 -31
- package/bin/exiftool_files/lib/Image/ExifTool/CanonVRD.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/FujiFilm.pm +20 -7
- package/bin/exiftool_files/lib/Image/ExifTool/GM.pm +543 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Geolocation.pm +332 -149
- package/bin/exiftool_files/lib/Image/ExifTool/Geotag.pm +9 -4
- package/bin/exiftool_files/lib/Image/ExifTool/M2TS.pm +32 -4
- package/bin/exiftool_files/lib/Image/ExifTool/MakerNotes.pm +2 -2
- package/bin/exiftool_files/lib/Image/ExifTool/Microsoft.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Nikon.pm +331 -22
- package/bin/exiftool_files/lib/Image/ExifTool/NikonCustom.pm +55 -1
- package/bin/exiftool_files/lib/Image/ExifTool/Olympus.pm +1 -0
- package/bin/exiftool_files/lib/Image/ExifTool/OpenEXR.pm +21 -3
- package/bin/exiftool_files/lib/Image/ExifTool/PNG.pm +3 -3
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTime.pm +40 -24
- package/bin/exiftool_files/lib/Image/ExifTool/QuickTimeStream.pl +61 -30
- package/bin/exiftool_files/lib/Image/ExifTool/README +2 -0
- package/bin/exiftool_files/lib/Image/ExifTool/Sony.pm +1 -1
- package/bin/exiftool_files/lib/Image/ExifTool/TagLookup.pm +4815 -4775
- package/bin/exiftool_files/lib/Image/ExifTool/TagNames.pod +931 -617
- package/bin/exiftool_files/lib/Image/ExifTool/WriteQuickTime.pl +30 -8
- package/bin/exiftool_files/lib/Image/ExifTool/Writer.pl +10 -4
- package/bin/exiftool_files/lib/Image/ExifTool/XMP.pm +4 -2
- package/bin/exiftool_files/lib/Image/ExifTool.pm +77 -41
- package/bin/exiftool_files/lib/Image/ExifTool.pod +24 -11
- package/bin/exiftool_files/lib/List/Util.pm +97 -8
- package/bin/exiftool_files/lib/MIME/Base64.pm +5 -5
- package/bin/exiftool_files/lib/MIME/Charset/_Compat.pm +106 -0
- package/bin/exiftool_files/lib/MIME/Charset.pm +1303 -0
- package/bin/exiftool_files/lib/Math/BigFloat.pm +444 -27
- package/bin/exiftool_files/lib/Math/BigInt/Calc.pm +296 -313
- package/bin/exiftool_files/lib/Math/BigInt/FastCalc.pm +1 -1
- package/bin/exiftool_files/lib/Math/BigInt/GMP.pm +2 -115
- package/bin/exiftool_files/lib/Math/BigInt/LTM.pm +2 -24
- package/bin/exiftool_files/lib/Math/BigInt/Lib.pm +61 -32
- package/bin/exiftool_files/lib/Math/BigInt.pm +292 -107
- package/bin/exiftool_files/lib/POSIX.pm +1 -1
- package/bin/exiftool_files/lib/PerlIO/scalar.pm +41 -0
- package/bin/exiftool_files/lib/PerlIO.pm +397 -0
- package/bin/exiftool_files/lib/Portable/CPAN.pm +94 -94
- package/bin/exiftool_files/lib/Portable/Config.pm +94 -94
- package/bin/exiftool_files/lib/Portable/FileSpec.pm +180 -180
- package/bin/exiftool_files/lib/Portable/HomeDir.pm +110 -110
- package/bin/exiftool_files/lib/Portable/LoadYaml.pm +430 -430
- package/bin/exiftool_files/lib/Portable/minicpan.pm +55 -55
- package/bin/exiftool_files/lib/Portable.pm +246 -320
- package/bin/exiftool_files/lib/Scalar/Util.pm +9 -4
- package/bin/exiftool_files/lib/Socket.pm +16 -12
- package/bin/exiftool_files/lib/Storable.pm +1444 -1441
- package/bin/exiftool_files/lib/TAP/Base.pm +133 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Base.pm +467 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Color.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/ParallelSession.pm +201 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/Session.pm +205 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File/Session.pm +95 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File.pm +56 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Session.pm +220 -0
- package/bin/exiftool_files/lib/TAP/Harness/Beyond.pod +426 -0
- package/bin/exiftool_files/lib/TAP/Harness/Env.pm +215 -0
- package/bin/exiftool_files/lib/TAP/Harness.pm +1054 -0
- package/bin/exiftool_files/lib/TAP/Object.pm +155 -0
- package/bin/exiftool_files/lib/TAP/Parser/Aggregator.pm +414 -0
- package/bin/exiftool_files/lib/TAP/Parser/Grammar.pm +584 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Array.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Process.pm +378 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Stream.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator.pm +162 -0
- package/bin/exiftool_files/lib/TAP/Parser/IteratorFactory.pm +339 -0
- package/bin/exiftool_files/lib/TAP/Parser/Multiplexer.pm +194 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Bailout.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Comment.pm +60 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Plan.pm +119 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Pragma.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Test.pm +271 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Unknown.pm +48 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Version.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/YAML.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result.pm +297 -0
- package/bin/exiftool_files/lib/TAP/Parser/ResultFactory.pm +183 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Job.pm +127 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Spinner.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler.pm +448 -0
- package/bin/exiftool_files/lib/TAP/Parser/Source.pm +381 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Executable.pm +184 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/File.pm +136 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Handle.pm +124 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Perl.pm +370 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/RawTAP.pm +130 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler.pm +191 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Reader.pm +332 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Writer.pm +254 -0
- package/bin/exiftool_files/lib/TAP/Parser.pm +1931 -0
- package/bin/exiftool_files/lib/Test/Builder/Formatter.pm +107 -0
- package/bin/exiftool_files/lib/Test/Builder/IO/Scalar.pm +659 -0
- package/bin/exiftool_files/lib/Test/Builder/Module.pm +182 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester/Color.pm +51 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester.pm +675 -0
- package/bin/exiftool_files/lib/Test/Builder/TodoDiag.pm +68 -0
- package/bin/exiftool_files/lib/Test/Builder.pm +2653 -0
- package/bin/exiftool_files/lib/Test/Harness.pm +618 -0
- package/bin/exiftool_files/lib/Test/More.pm +1997 -0
- package/bin/exiftool_files/lib/Test/Simple.pm +220 -0
- package/bin/exiftool_files/lib/Test/Tester/Capture.pm +241 -0
- package/bin/exiftool_files/lib/Test/Tester/CaptureRunner.pm +79 -0
- package/bin/exiftool_files/lib/Test/Tester/Delegate.pm +45 -0
- package/bin/exiftool_files/lib/Test/Tester.pm +695 -0
- package/bin/exiftool_files/lib/Test/Tutorial.pod +618 -0
- package/bin/exiftool_files/lib/Test/use/ok.pm +64 -0
- package/bin/exiftool_files/lib/Text/ParseWords.pm +303 -0
- package/bin/exiftool_files/lib/Tie/StdHandle.pm +2 -2
- package/bin/exiftool_files/lib/Time/HiRes.pm +73 -68
- package/bin/exiftool_files/lib/Time/Local.pm +82 -35
- package/bin/exiftool_files/lib/Time/Piece.pm +19 -4
- package/bin/exiftool_files/lib/Time/Seconds.pm +1 -1
- package/bin/exiftool_files/lib/UNIVERSAL.pm +203 -0
- package/bin/exiftool_files/lib/Unicode/GCString.pm +60 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak/Constants.pm +68 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak.pm +248 -0
- package/bin/exiftool_files/lib/Win32/API/Struct.pm +1 -177
- package/bin/exiftool_files/lib/Win32/API/Type.pm +1 -100
- package/bin/exiftool_files/lib/Win32/API.pm +1 -830
- package/bin/exiftool_files/lib/Win32/FindFile.pm +2 -123
- package/bin/exiftool_files/lib/Win32.pm +213 -89
- package/bin/exiftool_files/lib/Win32API/File.pm +1 -1
- package/bin/exiftool_files/lib/auto/B/B.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Bzip2/Bzip2.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/Lzma.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/autosplit.ix +3 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Zlib/Zlib.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/CryptX/CryptX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Cwd/Cwd.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Data/Dumper/Dumper.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/MD5/MD5.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/SHA/SHA.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Encode/Encode.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Fcntl/Fcntl.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/File/Glob/Glob.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/Compress/Brotli/Brotli.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/IO.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/List/Util/Util.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/MIME/Base64/Base64.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/FastCalc/FastCalc.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/GMP/GMP.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/POSIX/POSIX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/PerlIO/scalar/scalar.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Socket/Socket.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Storable/Storable.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/HiRes/HiRes.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/Piece/Piece.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Unicode/LineBreak/LineBreak.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/API/API.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/FindFile/FindFile.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/Win32.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32API/File/File.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/mro/mro.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/re/re.xs.dll +0 -0
- package/bin/exiftool_files/lib/feature.pm +49 -17
- package/bin/exiftool_files/lib/mro.pm +4 -20
- package/bin/exiftool_files/lib/overload.pm +15 -15
- package/bin/exiftool_files/lib/parent.pm +10 -2
- package/bin/exiftool_files/lib/re.pm +91 -33
- package/bin/exiftool_files/lib/warnings.pm +17 -6
- package/bin/exiftool_files/libgcc_s_seh-1.dll +0 -0
- package/bin/exiftool_files/liblzma-5__.dll +0 -0
- package/bin/exiftool_files/libstdc++-6.dll +0 -0
- package/bin/exiftool_files/libwinpthread-1.dll +0 -0
- package/bin/exiftool_files/perl.exe +0 -0
- package/bin/exiftool_files/perl532.dll +0 -0
- package/package.json +7 -5
- package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
- package/bin/exiftool_files/perl530.dll +0 -0
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
package Portable::Config;
|
|
2
|
-
|
|
3
|
-
use 5.008;
|
|
4
|
-
use strict;
|
|
5
|
-
use warnings;
|
|
6
|
-
use Portable::FileSpec;
|
|
7
|
-
|
|
8
|
-
our $VERSION = '1.
|
|
9
|
-
|
|
10
|
-
#####################################################################
|
|
11
|
-
# Constructor
|
|
12
|
-
|
|
13
|
-
sub new {
|
|
14
|
-
my $class = shift;
|
|
15
|
-
my $parent = shift;
|
|
16
|
-
unless ( Portable::_HASH($parent->portable_config) ) {
|
|
17
|
-
die('Missing or invalid config key in portable.perl');
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
# Create the object
|
|
21
|
-
my $self = bless { }, $class;
|
|
22
|
-
my $conf = $parent->portable_config;
|
|
23
|
-
my $root = $parent->dist_root;
|
|
24
|
-
foreach my $key ( sort keys %$conf ) {
|
|
25
|
-
unless (
|
|
26
|
-
defined $conf->{$key}
|
|
27
|
-
and
|
|
28
|
-
length $conf->{$key}
|
|
29
|
-
and not
|
|
30
|
-
$key =~ /^ld|^libpth$/
|
|
31
|
-
) {
|
|
32
|
-
$self->{$key} = $conf->{$key};
|
|
33
|
-
next;
|
|
34
|
-
}
|
|
35
|
-
#join path to directory of portable perl with value from config file
|
|
36
|
-
if ($key eq 'perlpath') {
|
|
37
|
-
$self->{$key} = Portable::FileSpec::catfile($root, split /\//, $conf->{$key});
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
$self->{$key} = Portable::FileSpec::catdir($root, split /\//, $conf->{$key});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
foreach my $key ( grep { /^ld|^libpth$/ } keys %$self ) {
|
|
44
|
-
#special handling of linker config variables and libpth
|
|
45
|
-
next unless defined $self->{$key};
|
|
46
|
-
$self->{$key} =~ s/\$(\w+)/$self->{$1}/g;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return $self;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
sub apply {
|
|
53
|
-
my $self = shift;
|
|
54
|
-
my $parent = shift;
|
|
55
|
-
|
|
56
|
-
# Force all Config entries to load, so that
|
|
57
|
-
# all Config_heavy.pl code has run, and none
|
|
58
|
-
# of our values will be overwritten later.
|
|
59
|
-
require Config;
|
|
60
|
-
my $preload = { %Config::Config };
|
|
61
|
-
|
|
62
|
-
# Shift the tie STORE method out the way
|
|
63
|
-
SCOPE: {
|
|
64
|
-
no warnings;
|
|
65
|
-
*Config::_TEMP = *Config::STORE;
|
|
66
|
-
*Config::STORE = sub {
|
|
67
|
-
$_[0]->{$_[1]} = $_[2];
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
# Write the values to the Config hash
|
|
72
|
-
foreach my $key ( sort keys %$self ) {
|
|
73
|
-
$Config::Config{$key} = $self->{$key};
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
# Restore the STORE method
|
|
77
|
-
SCOPE: {
|
|
78
|
-
no warnings;
|
|
79
|
-
*Config::STORE = delete $Config::{_TEMP};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
# Confirm we got all the paths
|
|
83
|
-
my $volume = quotemeta $parent->dist_volume;
|
|
84
|
-
foreach my $key ( sort keys %Config::Config ) {
|
|
85
|
-
next unless defined $Config::Config{$key};
|
|
86
|
-
next if $Config::Config{$key} =~ /$volume/i;
|
|
87
|
-
next unless $Config::Config{$key} =~ /\b[a-z]\:/i;
|
|
88
|
-
die "Failed to localize \$Config::Config{$key} ($Config::Config{$key})";
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return 1;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
1;
|
|
1
|
+
package Portable::Config;
|
|
2
|
+
|
|
3
|
+
use 5.008;
|
|
4
|
+
use strict;
|
|
5
|
+
use warnings;
|
|
6
|
+
use Portable::FileSpec;
|
|
7
|
+
|
|
8
|
+
our $VERSION = '1.23';
|
|
9
|
+
|
|
10
|
+
#####################################################################
|
|
11
|
+
# Constructor
|
|
12
|
+
|
|
13
|
+
sub new {
|
|
14
|
+
my $class = shift;
|
|
15
|
+
my $parent = shift;
|
|
16
|
+
unless ( Portable::_HASH($parent->portable_config) ) {
|
|
17
|
+
die('Missing or invalid config key in portable.perl');
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
# Create the object
|
|
21
|
+
my $self = bless { }, $class;
|
|
22
|
+
my $conf = $parent->portable_config;
|
|
23
|
+
my $root = $parent->dist_root;
|
|
24
|
+
foreach my $key ( sort keys %$conf ) {
|
|
25
|
+
unless (
|
|
26
|
+
defined $conf->{$key}
|
|
27
|
+
and
|
|
28
|
+
length $conf->{$key}
|
|
29
|
+
and not
|
|
30
|
+
$key =~ /^ld|^libpth$/
|
|
31
|
+
) {
|
|
32
|
+
$self->{$key} = $conf->{$key};
|
|
33
|
+
next;
|
|
34
|
+
}
|
|
35
|
+
#join path to directory of portable perl with value from config file
|
|
36
|
+
if ($key eq 'perlpath') {
|
|
37
|
+
$self->{$key} = Portable::FileSpec::catfile($root, split /\//, $conf->{$key});
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
$self->{$key} = Portable::FileSpec::catdir($root, split /\//, $conf->{$key});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
foreach my $key ( grep { /^ld|^libpth$/ } keys %$self ) {
|
|
44
|
+
#special handling of linker config variables and libpth
|
|
45
|
+
next unless defined $self->{$key};
|
|
46
|
+
$self->{$key} =~ s/\$(\w+)/$self->{$1}/g;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return $self;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
sub apply {
|
|
53
|
+
my $self = shift;
|
|
54
|
+
my $parent = shift;
|
|
55
|
+
|
|
56
|
+
# Force all Config entries to load, so that
|
|
57
|
+
# all Config_heavy.pl code has run, and none
|
|
58
|
+
# of our values will be overwritten later.
|
|
59
|
+
require Config;
|
|
60
|
+
my $preload = { %Config::Config };
|
|
61
|
+
|
|
62
|
+
# Shift the tie STORE method out the way
|
|
63
|
+
SCOPE: {
|
|
64
|
+
no warnings;
|
|
65
|
+
*Config::_TEMP = *Config::STORE;
|
|
66
|
+
*Config::STORE = sub {
|
|
67
|
+
$_[0]->{$_[1]} = $_[2];
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
# Write the values to the Config hash
|
|
72
|
+
foreach my $key ( sort keys %$self ) {
|
|
73
|
+
$Config::Config{$key} = $self->{$key};
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
# Restore the STORE method
|
|
77
|
+
SCOPE: {
|
|
78
|
+
no warnings;
|
|
79
|
+
*Config::STORE = delete $Config::{_TEMP};
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
# Confirm we got all the paths
|
|
83
|
+
my $volume = quotemeta $parent->dist_volume;
|
|
84
|
+
foreach my $key ( sort keys %Config::Config ) {
|
|
85
|
+
next unless defined $Config::Config{$key};
|
|
86
|
+
next if $Config::Config{$key} =~ /$volume/i;
|
|
87
|
+
next unless $Config::Config{$key} =~ /\b[a-z]\:/i;
|
|
88
|
+
die "Failed to localize \$Config::Config{$key} ($Config::Config{$key})";
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
1;
|
|
@@ -1,180 +1,180 @@
|
|
|
1
|
-
package Portable::FileSpec;
|
|
2
|
-
|
|
3
|
-
### UGLY HACK: these functions where completely copied from File::Spec::Win32
|
|
4
|
-
|
|
5
|
-
use 5.008;
|
|
6
|
-
use strict;
|
|
7
|
-
use warnings;
|
|
8
|
-
|
|
9
|
-
our $VERSION = '1.
|
|
10
|
-
|
|
11
|
-
# Some regexes we use for path splitting
|
|
12
|
-
my $DRIVE_RX = '[a-zA-Z]:';
|
|
13
|
-
my $UNC_RX = '(?:\\\\\\\\|//)[^\\\\/]+[\\\\/][^\\\\/]+';
|
|
14
|
-
my $VOL_RX = "(?:$DRIVE_RX|$UNC_RX)";
|
|
15
|
-
|
|
16
|
-
sub splitpath {
|
|
17
|
-
my ($path, $nofile) = @_;
|
|
18
|
-
my ($volume,$directory,$file) = ('','','');
|
|
19
|
-
if ( $nofile ) {
|
|
20
|
-
$path =~
|
|
21
|
-
m{^ ( $VOL_RX ? ) (.*) }sox;
|
|
22
|
-
$volume = $1;
|
|
23
|
-
$directory = $2;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
$path =~
|
|
27
|
-
m{^ ( $VOL_RX ? )
|
|
28
|
-
( (?:.*[\\/](?:\.\.?\Z(?!\n))?)? )
|
|
29
|
-
(.*)
|
|
30
|
-
}sox;
|
|
31
|
-
$volume = $1;
|
|
32
|
-
$directory = $2;
|
|
33
|
-
$file = $3;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return ($volume,$directory,$file);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
sub splitdir {
|
|
40
|
-
my ($directories) = @_ ;
|
|
41
|
-
#
|
|
42
|
-
# split() likes to forget about trailing null fields, so here we
|
|
43
|
-
# check to be sure that there will not be any before handling the
|
|
44
|
-
# simple case.
|
|
45
|
-
#
|
|
46
|
-
if ( $directories !~ m|[\\/]\Z(?!\n)| ) {
|
|
47
|
-
return split( m|[\\/]|, $directories );
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
#
|
|
51
|
-
# since there was a trailing separator, add a file name to the end,
|
|
52
|
-
# then do the split, then replace it with ''.
|
|
53
|
-
#
|
|
54
|
-
my( @directories )= split( m|[\\/]|, "${directories}dummy" ) ;
|
|
55
|
-
$directories[ $#directories ]= '' ;
|
|
56
|
-
return @directories ;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
sub catpath {
|
|
61
|
-
my ($volume,$directory,$file) = @_;
|
|
62
|
-
|
|
63
|
-
# If it's UNC, make sure the glue separator is there, reusing
|
|
64
|
-
# whatever separator is first in the $volume
|
|
65
|
-
my $v;
|
|
66
|
-
$volume .= $v
|
|
67
|
-
if ( (($v) = $volume =~ m@^([\\/])[\\/][^\\/]+[\\/][^\\/]+\Z(?!\n)@s) &&
|
|
68
|
-
$directory =~ m@^[^\\/]@s
|
|
69
|
-
) ;
|
|
70
|
-
|
|
71
|
-
$volume .= $directory ;
|
|
72
|
-
|
|
73
|
-
# If the volume is not just A:, make sure the glue separator is
|
|
74
|
-
# there, reusing whatever separator is first in the $volume if possible.
|
|
75
|
-
if ( $volume !~ m@^[a-zA-Z]:\Z(?!\n)@s &&
|
|
76
|
-
$volume =~ m@[^\\/]\Z(?!\n)@ &&
|
|
77
|
-
$file =~ m@[^\\/]@
|
|
78
|
-
) {
|
|
79
|
-
$volume =~ m@([\\/])@ ;
|
|
80
|
-
my $sep = $1 ? $1 : '\\' ;
|
|
81
|
-
$volume .= $sep ;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
$volume .= $file ;
|
|
85
|
-
|
|
86
|
-
return $volume ;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
sub catdir {
|
|
90
|
-
# Legacy / compatibility support
|
|
91
|
-
return "" unless @_;
|
|
92
|
-
shift, return _canon_cat( "/", @_ ) if $_[0] eq "";
|
|
93
|
-
|
|
94
|
-
# Compatibility with File::Spec <= 3.26:
|
|
95
|
-
# catdir('A:', 'foo') should return 'A:\foo'.
|
|
96
|
-
return _canon_cat( ($_[0].'\\'), @_[1..$#_] ) if $_[0] =~ m{^$DRIVE_RX\z}o;
|
|
97
|
-
|
|
98
|
-
return _canon_cat( @_ );
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
sub catfile {
|
|
102
|
-
# Legacy / compatibility support
|
|
103
|
-
#
|
|
104
|
-
shift, return _canon_cat( "/", @_ )
|
|
105
|
-
if $_[0] eq "";
|
|
106
|
-
|
|
107
|
-
# Compatibility with File::Spec <= 3.26:
|
|
108
|
-
# catfile('A:', 'foo') should return 'A:\foo'.
|
|
109
|
-
return _canon_cat( ($_[0].'\\'), @_[1..$#_] )
|
|
110
|
-
if $_[0] =~ m{^$DRIVE_RX\z}o;
|
|
111
|
-
|
|
112
|
-
return _canon_cat( @_ );
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
sub _canon_cat {
|
|
116
|
-
my ($first, @rest) = @_;
|
|
117
|
-
|
|
118
|
-
my $volume = $first =~ s{ \A ([A-Za-z]:) ([\\/]?) }{}x # drive letter
|
|
119
|
-
? ucfirst( $1 ).( $2 ? "\\" : "" )
|
|
120
|
-
: $first =~ s{ \A (?:\\\\|//) ([^\\/]+)
|
|
121
|
-
(?: [\\/] ([^\\/]+) )?
|
|
122
|
-
[\\/]? }{}xs # UNC volume
|
|
123
|
-
? "\\\\$1".( defined $2 ? "\\$2" : "" )."\\"
|
|
124
|
-
: $first =~ s{ \A [\\/] }{}x # root dir
|
|
125
|
-
? "\\"
|
|
126
|
-
: "";
|
|
127
|
-
my $path = join "\\", $first, @rest;
|
|
128
|
-
|
|
129
|
-
$path =~ tr#\\/#\\\\#s; # xx/yy --> xx\yy & xx\\yy --> xx\yy
|
|
130
|
-
|
|
131
|
-
# xx/././yy --> xx/yy
|
|
132
|
-
$path =~ s{(?:
|
|
133
|
-
(?:\A|\\) # at begin or after a slash
|
|
134
|
-
\.
|
|
135
|
-
(?:\\\.)* # and more
|
|
136
|
-
(?:\\|\z) # at end or followed by slash
|
|
137
|
-
)+ # performance boost -- I do not know why
|
|
138
|
-
}{\\}gx;
|
|
139
|
-
|
|
140
|
-
# XXX I do not know whether more dots are supported by the OS supporting
|
|
141
|
-
# this ... annotation (NetWare or symbian but not MSWin32).
|
|
142
|
-
# Then .... could easily become ../../.. etc:
|
|
143
|
-
# Replace \.\.\. by (\.\.\.+) and substitute with
|
|
144
|
-
# { $1 . ".." . "\\.." x (length($2)-2) }gex
|
|
145
|
-
# ... --> ../..
|
|
146
|
-
$path =~ s{ (\A|\\) # at begin or after a slash
|
|
147
|
-
\.\.\.
|
|
148
|
-
(?=\\|\z) # at end or followed by slash
|
|
149
|
-
}{$1..\\..}gx;
|
|
150
|
-
# xx\yy\..\zz --> xx\zz
|
|
151
|
-
while ( $path =~ s{(?:
|
|
152
|
-
(?:\A|\\) # at begin or after a slash
|
|
153
|
-
[^\\]+ # rip this 'yy' off
|
|
154
|
-
\\\.\.
|
|
155
|
-
(?<!\A\.\.\\\.\.) # do *not* replace ^..\..
|
|
156
|
-
(?<!\\\.\.\\\.\.) # do *not* replace \..\..
|
|
157
|
-
(?:\\|\z) # at end or followed by slash
|
|
158
|
-
)+ # performance boost -- I do not know why
|
|
159
|
-
}{\\}sx ) {}
|
|
160
|
-
|
|
161
|
-
$path =~ s#\A\\##; # \xx --> xx NOTE: this is *not* root
|
|
162
|
-
$path =~ s#\\\z##; # xx\ --> xx
|
|
163
|
-
|
|
164
|
-
if ( $volume =~ m#\\\z# )
|
|
165
|
-
{ # <vol>\.. --> <vol>\
|
|
166
|
-
$path =~ s{ \A # at begin
|
|
167
|
-
\.\.
|
|
168
|
-
(?:\\\.\.)* # and more
|
|
169
|
-
(?:\\|\z) # at end or followed by slash
|
|
170
|
-
}{}x;
|
|
171
|
-
|
|
172
|
-
return $1 # \\HOST\SHARE\ --> \\HOST\SHARE
|
|
173
|
-
if $path eq ""
|
|
174
|
-
and $volume =~ m#\A(\\\\.*)\\\z#s;
|
|
175
|
-
}
|
|
176
|
-
return $path ne "" || $volume ? $volume.$path : ".";
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
1;
|
|
1
|
+
package Portable::FileSpec;
|
|
2
|
+
|
|
3
|
+
### UGLY HACK: these functions where completely copied from File::Spec::Win32
|
|
4
|
+
|
|
5
|
+
use 5.008;
|
|
6
|
+
use strict;
|
|
7
|
+
use warnings;
|
|
8
|
+
|
|
9
|
+
our $VERSION = '1.23';
|
|
10
|
+
|
|
11
|
+
# Some regexes we use for path splitting
|
|
12
|
+
my $DRIVE_RX = '[a-zA-Z]:';
|
|
13
|
+
my $UNC_RX = '(?:\\\\\\\\|//)[^\\\\/]+[\\\\/][^\\\\/]+';
|
|
14
|
+
my $VOL_RX = "(?:$DRIVE_RX|$UNC_RX)";
|
|
15
|
+
|
|
16
|
+
sub splitpath {
|
|
17
|
+
my ($path, $nofile) = @_;
|
|
18
|
+
my ($volume,$directory,$file) = ('','','');
|
|
19
|
+
if ( $nofile ) {
|
|
20
|
+
$path =~
|
|
21
|
+
m{^ ( $VOL_RX ? ) (.*) }sox;
|
|
22
|
+
$volume = $1;
|
|
23
|
+
$directory = $2;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
$path =~
|
|
27
|
+
m{^ ( $VOL_RX ? )
|
|
28
|
+
( (?:.*[\\/](?:\.\.?\Z(?!\n))?)? )
|
|
29
|
+
(.*)
|
|
30
|
+
}sox;
|
|
31
|
+
$volume = $1;
|
|
32
|
+
$directory = $2;
|
|
33
|
+
$file = $3;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return ($volume,$directory,$file);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
sub splitdir {
|
|
40
|
+
my ($directories) = @_ ;
|
|
41
|
+
#
|
|
42
|
+
# split() likes to forget about trailing null fields, so here we
|
|
43
|
+
# check to be sure that there will not be any before handling the
|
|
44
|
+
# simple case.
|
|
45
|
+
#
|
|
46
|
+
if ( $directories !~ m|[\\/]\Z(?!\n)| ) {
|
|
47
|
+
return split( m|[\\/]|, $directories );
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
#
|
|
51
|
+
# since there was a trailing separator, add a file name to the end,
|
|
52
|
+
# then do the split, then replace it with ''.
|
|
53
|
+
#
|
|
54
|
+
my( @directories )= split( m|[\\/]|, "${directories}dummy" ) ;
|
|
55
|
+
$directories[ $#directories ]= '' ;
|
|
56
|
+
return @directories ;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
sub catpath {
|
|
61
|
+
my ($volume,$directory,$file) = @_;
|
|
62
|
+
|
|
63
|
+
# If it's UNC, make sure the glue separator is there, reusing
|
|
64
|
+
# whatever separator is first in the $volume
|
|
65
|
+
my $v;
|
|
66
|
+
$volume .= $v
|
|
67
|
+
if ( (($v) = $volume =~ m@^([\\/])[\\/][^\\/]+[\\/][^\\/]+\Z(?!\n)@s) &&
|
|
68
|
+
$directory =~ m@^[^\\/]@s
|
|
69
|
+
) ;
|
|
70
|
+
|
|
71
|
+
$volume .= $directory ;
|
|
72
|
+
|
|
73
|
+
# If the volume is not just A:, make sure the glue separator is
|
|
74
|
+
# there, reusing whatever separator is first in the $volume if possible.
|
|
75
|
+
if ( $volume !~ m@^[a-zA-Z]:\Z(?!\n)@s &&
|
|
76
|
+
$volume =~ m@[^\\/]\Z(?!\n)@ &&
|
|
77
|
+
$file =~ m@[^\\/]@
|
|
78
|
+
) {
|
|
79
|
+
$volume =~ m@([\\/])@ ;
|
|
80
|
+
my $sep = $1 ? $1 : '\\' ;
|
|
81
|
+
$volume .= $sep ;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
$volume .= $file ;
|
|
85
|
+
|
|
86
|
+
return $volume ;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
sub catdir {
|
|
90
|
+
# Legacy / compatibility support
|
|
91
|
+
return "" unless @_;
|
|
92
|
+
shift, return _canon_cat( "/", @_ ) if $_[0] eq "";
|
|
93
|
+
|
|
94
|
+
# Compatibility with File::Spec <= 3.26:
|
|
95
|
+
# catdir('A:', 'foo') should return 'A:\foo'.
|
|
96
|
+
return _canon_cat( ($_[0].'\\'), @_[1..$#_] ) if $_[0] =~ m{^$DRIVE_RX\z}o;
|
|
97
|
+
|
|
98
|
+
return _canon_cat( @_ );
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
sub catfile {
|
|
102
|
+
# Legacy / compatibility support
|
|
103
|
+
#
|
|
104
|
+
shift, return _canon_cat( "/", @_ )
|
|
105
|
+
if $_[0] eq "";
|
|
106
|
+
|
|
107
|
+
# Compatibility with File::Spec <= 3.26:
|
|
108
|
+
# catfile('A:', 'foo') should return 'A:\foo'.
|
|
109
|
+
return _canon_cat( ($_[0].'\\'), @_[1..$#_] )
|
|
110
|
+
if $_[0] =~ m{^$DRIVE_RX\z}o;
|
|
111
|
+
|
|
112
|
+
return _canon_cat( @_ );
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
sub _canon_cat {
|
|
116
|
+
my ($first, @rest) = @_;
|
|
117
|
+
|
|
118
|
+
my $volume = $first =~ s{ \A ([A-Za-z]:) ([\\/]?) }{}x # drive letter
|
|
119
|
+
? ucfirst( $1 ).( $2 ? "\\" : "" )
|
|
120
|
+
: $first =~ s{ \A (?:\\\\|//) ([^\\/]+)
|
|
121
|
+
(?: [\\/] ([^\\/]+) )?
|
|
122
|
+
[\\/]? }{}xs # UNC volume
|
|
123
|
+
? "\\\\$1".( defined $2 ? "\\$2" : "" )."\\"
|
|
124
|
+
: $first =~ s{ \A [\\/] }{}x # root dir
|
|
125
|
+
? "\\"
|
|
126
|
+
: "";
|
|
127
|
+
my $path = join "\\", $first, @rest;
|
|
128
|
+
|
|
129
|
+
$path =~ tr#\\/#\\\\#s; # xx/yy --> xx\yy & xx\\yy --> xx\yy
|
|
130
|
+
|
|
131
|
+
# xx/././yy --> xx/yy
|
|
132
|
+
$path =~ s{(?:
|
|
133
|
+
(?:\A|\\) # at begin or after a slash
|
|
134
|
+
\.
|
|
135
|
+
(?:\\\.)* # and more
|
|
136
|
+
(?:\\|\z) # at end or followed by slash
|
|
137
|
+
)+ # performance boost -- I do not know why
|
|
138
|
+
}{\\}gx;
|
|
139
|
+
|
|
140
|
+
# XXX I do not know whether more dots are supported by the OS supporting
|
|
141
|
+
# this ... annotation (NetWare or symbian but not MSWin32).
|
|
142
|
+
# Then .... could easily become ../../.. etc:
|
|
143
|
+
# Replace \.\.\. by (\.\.\.+) and substitute with
|
|
144
|
+
# { $1 . ".." . "\\.." x (length($2)-2) }gex
|
|
145
|
+
# ... --> ../..
|
|
146
|
+
$path =~ s{ (\A|\\) # at begin or after a slash
|
|
147
|
+
\.\.\.
|
|
148
|
+
(?=\\|\z) # at end or followed by slash
|
|
149
|
+
}{$1..\\..}gx;
|
|
150
|
+
# xx\yy\..\zz --> xx\zz
|
|
151
|
+
while ( $path =~ s{(?:
|
|
152
|
+
(?:\A|\\) # at begin or after a slash
|
|
153
|
+
[^\\]+ # rip this 'yy' off
|
|
154
|
+
\\\.\.
|
|
155
|
+
(?<!\A\.\.\\\.\.) # do *not* replace ^..\..
|
|
156
|
+
(?<!\\\.\.\\\.\.) # do *not* replace \..\..
|
|
157
|
+
(?:\\|\z) # at end or followed by slash
|
|
158
|
+
)+ # performance boost -- I do not know why
|
|
159
|
+
}{\\}sx ) {}
|
|
160
|
+
|
|
161
|
+
$path =~ s#\A\\##; # \xx --> xx NOTE: this is *not* root
|
|
162
|
+
$path =~ s#\\\z##; # xx\ --> xx
|
|
163
|
+
|
|
164
|
+
if ( $volume =~ m#\\\z# )
|
|
165
|
+
{ # <vol>\.. --> <vol>\
|
|
166
|
+
$path =~ s{ \A # at begin
|
|
167
|
+
\.\.
|
|
168
|
+
(?:\\\.\.)* # and more
|
|
169
|
+
(?:\\|\z) # at end or followed by slash
|
|
170
|
+
}{}x;
|
|
171
|
+
|
|
172
|
+
return $1 # \\HOST\SHARE\ --> \\HOST\SHARE
|
|
173
|
+
if $path eq ""
|
|
174
|
+
and $volume =~ m#\A(\\\\.*)\\\z#s;
|
|
175
|
+
}
|
|
176
|
+
return $path ne "" || $volume ? $volume.$path : ".";
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
1;
|