Subject: | use file::homedir::my_dist_data |
orlite::mirror stores files in data_dir/.perl/ORLite-Mirror which is not
the canonical path as defined in file::homedir
indeed, vendor name ".perl" should only be used if data_dir is $HOME,
otherwise the vendor should be "Perl". on a xdg compliant desktop, this
means ~/.local/share/Perl/ORLite-Mirror instead of
~/.local/share/.perl/ORLite-Mirror
attached patch is using File::HomeDir::my_dist_data to make sure we use
the standard way as it is defined in the canonical module for this kind
of dir fetching (file::homedir).
Subject: | use-my_dist_data.patch |
Index: lib/ORLite/Mirror.pm
===================================================================
--- lib/ORLite/Mirror.pm (révision 15257)
+++ lib/ORLite/Mirror.pm (copie de travail)
@@ -7,7 +7,7 @@
use File::Spec 0.80 ();
use File::Path 2.04 ();
use File::Remove 1.42 ();
-use File::HomeDir 0.69 ();
+use File::HomeDir 0.95 (); # my_dist_data
use File::ShareDir 1.00 ();
use Params::Util 0.33 ();
use LWP::UserAgent 5.806 ();
@@ -103,18 +103,9 @@
}
# Determine the mirror database directory
- my $dir = File::Spec->catdir(
- File::HomeDir->my_data,
- ($^O eq 'MSWin32' ? 'Perl' : '.perl'),
- 'ORLite-Mirror',
- );
+ my $dir = File::HomeDir->my_dist_data( 'ORLite-Mirror', { create=>1 } );
+ $class->prune($dir) if $params{prune};
- # Create it if needed
- unless ( -e $dir ) {
- my @dirs = File::Path::mkpath( $dir, { verbose => 0 } );
- $class->prune(@dirs) if $params{prune};
- }
-
# Determine the mirror database file
my $file = $params{package} . '.sqlite';
$file =~ s/::/-/g;