Revert "Use File::HomeDir instead of M::B's detildefy"
This reverts commit 1308a16a4d3b1d1f9c554c1790567cbf283ab266.
Conflicts:
Changes
lib/Module/Build/Tiny.pm
Leon Timmermans
11 years ago
6 | 6 | use CPAN::Meta; |
7 | 7 | use ExtUtils::BuildRC 0.003 qw/read_config/; |
8 | 8 | use ExtUtils::Config 0.003; |
9 | use ExtUtils::Helpers 0.010 qw/make_executable split_like_shell man1_pagename man3_pagename/; | |
9 | use ExtUtils::Helpers 0.016 qw/make_executable split_like_shell man1_pagename man3_pagename detildefy/; | |
10 | 10 | use ExtUtils::Install qw/pm_to_blib install/; |
11 | 11 | use ExtUtils::InstallPaths 0.002; |
12 | 12 | use File::Basename qw/dirname/; |
13 | use File::HomeDir; | |
14 | 13 | use File::Path qw/mkpath/; |
15 | 14 | use File::Spec::Functions qw/catfile catdir rel2abs abs2rel/; |
16 | 15 | use Getopt::Long qw/GetOptions/; |
32 | 31 | sub get_meta { |
33 | 32 | my ($metafile) = grep { -e $_ } qw/META.json META.yml/ or die "No META information provided\n"; |
34 | 33 | return CPAN::Meta->load_file($metafile); |
35 | } | |
36 | ||
37 | sub detildefy { | |
38 | $_[0] =~ s{ \A ~ ([^/]*) }{ length $1 ? File::HomeDir->users_home($1) : File::HomeDir->my_home }xe; | |
39 | 34 | } |
40 | 35 | |
41 | 36 | sub manify { |
91 | 86 | my @env = defined $ENV{PERL_MB_OPT} ? split_like_shell($ENV{PERL_MB_OPT}) : (); |
92 | 87 | unshift @ARGV, map { @{$_} } grep { defined } $rc_opts->{'*'}, $bpl, $rc_opts->{$action}, \@env; |
93 | 88 | GetOptions(\my %opt, qw/install_base=s install_path=s% installdirs=s destdir=s prefix=s config=s% uninst:1 verbose:1 dry_run:1/); |
94 | detildefy($_) for grep { defined } @opt{qw/install_base destdir prefix/}, values %{ $opt{install_path} }; | |
89 | $_ = detildefy($_) for grep { defined } @opt{qw/install_base destdir prefix/}, values %{ $opt{install_path} }; | |
95 | 90 | @opt{'config', 'meta'} = (ExtUtils::Config->new($opt{config}), get_meta()); |
96 | 91 | $actions{$action}->(%opt, install_paths => ExtUtils::InstallPaths->new(%opt, dist_name => $opt{meta}->name)); |
97 | 92 | } |