diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-05-06 20:26:28 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-05-06 20:26:28 +0200 |
commit | eafdf6dea5918688560141e1fb9242ee1c1820fe (patch) | |
tree | 0ced151a9107b6f6534b96b62f8e1a67d35cf21d | |
parent | 83363bb2a6902d1caca2b81615f15d08be74d4d7 (diff) |
Fix XDG_{CONFIG,DATA}_HOME handling bug (use File::BaseDir for it). thx mxey
-rw-r--r-- | Build.PL | 1 | ||||
-rw-r--r-- | Changelog | 5 | ||||
-rw-r--r-- | README | 1 | ||||
-rwxr-xr-x | bin/raps2 | 2 | ||||
-rw-r--r-- | lib/App/Raps2.pm | 6 |
5 files changed, 12 insertions, 3 deletions
@@ -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, @@ -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 @@ -9,6 +9,7 @@ Dependencies * perl version 5.10 or newer * Crypt::CBC * Crypt::Eksblowfish + * File::BaseDir * File::Path * File::Slurp @@ -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(); |