From eafdf6dea5918688560141e1fb9242ee1c1820fe Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 6 May 2011 20:26:28 +0200 Subject: Fix XDG_{CONFIG,DATA}_HOME handling bug (use File::BaseDir for it). thx mxey --- Build.PL | 1 + Changelog | 5 +++++ README | 1 + bin/raps2 | 2 ++ lib/App/Raps2.pm | 6 +++--- 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Build.PL b/Build.PL index 5f6dfec..b818d5c 100644 --- a/Build.PL +++ b/Build.PL @@ -21,6 +21,7 @@ my $build = Module::Build->new( 'Crypt::CBC' => 0, 'Crypt::Eksblowfish' => 0, 'Crypt::Eksblowfish::Bcrypt' => 0, + 'File::BaseDir' => 0, 'File::Path' => 0, 'File::Slurp' => 0, 'POSIX' => 0, diff --git a/Changelog b/Changelog index 3986936..68f23ee 100644 --- a/Changelog +++ b/Changelog @@ -1,3 +1,8 @@ +git HEAD + + * Fix XDG_CONFIG_HOME / XDG_DATA_HOME handling bug. Adds new dependency + File::BaseDir + raps2 0.1 - Fri May 06 2011 * Eksblowfish crypto diff --git a/README b/README index 7f95dc2..30671a7 100644 --- a/README +++ b/README @@ -9,6 +9,7 @@ Dependencies * perl version 5.10 or newer * Crypt::CBC * Crypt::Eksblowfish + * File::BaseDir * File::Path * File::Slurp diff --git a/bin/raps2 b/bin/raps2 index 51c6a93..2763500 100755 --- a/bin/raps2 +++ b/bin/raps2 @@ -92,6 +92,8 @@ Additional encrypted passwords are stored in F<~/.local/share/raps2/>. =item * Crypt::Eksblowfish +=item * File::BaseDir + =item * File::Path (usually included with perl core) =item * File::Slurp diff --git a/lib/App/Raps2.pm b/lib/App/Raps2.pm index 6710d48..f05f21e 100644 --- a/lib/App/Raps2.pm +++ b/lib/App/Raps2.pm @@ -38,6 +38,7 @@ use base 'Exporter'; use App::Raps2::Password; use App::Raps2::UI; use Carp q(confess); +use File::BaseDir qw(config_home data_home); use File::Path qw(make_path); use File::Slurp qw(slurp write_file); @@ -105,9 +106,8 @@ sub new { my ($obj, %conf) = @_; my $ref = {}; - $ref->{'xdg_conf'} = $ENV{'XDG_CONFIG_HOME'} // "$ENV{HOME}/.config/raps2"; - $ref->{'xdg_data'} = $ENV{'XDG_DATA_HOME'} // - "$ENV{HOME}/.local/share/raps2"; + $ref->{'xdg_conf'} = config_home('raps2'); + $ref->{'xdg_data'} = data_home('raps2'); $ref->{'ui'} = App::Raps2::UI->new(); -- cgit v1.2.3