Skip to content

Commit 098b7ab

Browse files
author
Chris White
committed
Added actual uninstallation targets
1 parent 336a77d commit 098b7ab

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

Makefile.PL

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,35 @@ my $secure_perl_path = get_perl_filename();
2222

2323
sub MY::postamble { # TODO also handle Windows nmake syntax (SET vs. export)
2424
return <<EOT;
25+
26+
# Uninstallation: mimic what the normal "uninstall" target does, but actually
27+
# carry out the actions.
28+
# Note: this may leave empty directories in place, since the packlist only
29+
# includes files.
30+
31+
ACTUALLY_UNINSTALL = "$secure_perl_path" -MExtUtils::Install -e 'uninstall(shift,1)' --
32+
33+
actually_uninstall :: actually_uninstall_from_\$(INSTALLDIRS)dirs
34+
\t\$(NOECHO) \$(NOOP)
35+
36+
actually_uninstall_from_perldirs ::
37+
\t-\$(ACTUALLY_UNINSTALL) "\$(PERL_ARCHLIB)/auto/\$(FULLEXT)/.packlist"
38+
39+
actually_uninstall_from_sitedirs ::
40+
\t-\$(ACTUALLY_UNINSTALL) "\$(SITEARCHEXP)/auto/\$(FULLEXT)/.packlist"
41+
42+
actually_uninstall_from_vendordirs ::
43+
\t-\$(ACTUALLY_UNINSTALL) "\$(VENDORARCHEXP)/auto/\$(FULLEXT)/.packlist"
44+
45+
# Run author tests
2546
authortest:
26-
\tRELEASE_TESTING=1 prove -l xt"
47+
\tRELEASE_TESTING=1 prove -l xt
2748
28-
testhere: # Run the tests from lib rather than blib
49+
# Test without installing: run the tests from lib rather than blib
50+
testhere: actually_uninstall
2951
\t"$secure_perl_path" -Ilib -e 'use Test::Harness "runtests"; runtests \@ARGV;' -- t/*.t
3052
EOT
53+
3154
} #postamble
3255

3356
WriteMakefile(

0 commit comments

Comments
 (0)