[pve-devel] [PATCH pve-client 6/6] Remove the File::HomeDir requirement

Dietmar Maurer dietmar at proxmox.com
Tue Jun 5 12:17:44 CEST 2018


Simply use $ENV{HOME} instead.

Signed-off-by: Dietmar Maurer <dietmar at proxmox.com>
---
 PVE/APIClient/Config.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/APIClient/Config.pm b/PVE/APIClient/Config.pm
index 8a77848..65c555f 100644
--- a/PVE/APIClient/Config.pm
+++ b/PVE/APIClient/Config.pm
@@ -4,7 +4,6 @@ use strict;
 use warnings;
 use JSON;
 
-use File::HomeDir ();
 use PVE::JSONSchema qw(register_standard_option get_standard_option);
 use PVE::SectionConfig;
 use PVE::Tools qw(file_get_contents file_set_contents);
@@ -90,7 +89,11 @@ sub private {
 sub config_filename {
     my ($class) = @_;
 
-    return File::HomeDir::home() . '/.pveclient';
+    my $home = $ENV{HOME};
+
+    die "environment HOME not set\n" if !defined($home);
+
+    return "$home/.pveclient";
 }
 
 sub load {
-- 
2.11.0




More information about the pve-devel mailing list