Commit 0265576e authored by Francesc Guasch's avatar Francesc Guasch
Browse files

Get the user with pure perl

In some environments the USER global may not be set
parent 9964228b
......@@ -965,6 +965,7 @@ sub _search_iso {
}
sub _download($self, $url) {
$url =~ s{(http://.*)//(.*)}{$1/$2};
if ($url =~ m{\*}) {
my @found = $self->_search_url_file($url);
confess "No match for $url" if !scalar @found;
......@@ -1040,7 +1041,8 @@ sub _cache_filename($url) {
$file =~ tr{a-zA-Z0-9_-}{_}c;
$file =~ s/__+/_/g;
my $dir = "/var/tmp/ravada_cache/$ENV{USER}";
my ($user) = getpwuid($>);
my $dir = "/var/tmp/ravada_cache/$user";
make_path($dir) if ! -e $dir;
return "$dir/$file";
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment