summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2014-02-26 10:48:48 +0100
committerSven Eden <yamakuzure@gmx.net>2014-02-26 10:48:48 +0100
commite495cb7fd8980b2c3dcef28426187c51a1d9de9e (patch)
treeec129b4913fdd855ede926cd3a65bb9311d4e34c /Portage.pm
parentufed.pl.in: Minor updates to the documentation. (diff)
downloadufed-e495cb7fd8980b2c3dcef28426187c51a1d9de9e.tar.gz
ufed-e495cb7fd8980b2c3dcef28426187c51a1d9de9e.tar.bz2
ufed-e495cb7fd8980b2c3dcef28426187c51a1d9de9e.zip
Portage.pm: Determining the make.profile is now secure of make.profile being a file.
Diffstat (limited to 'Portage.pm')
-rw-r--r--Portage.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/Portage.pm b/Portage.pm
index 71cada0..229ebba 100644
--- a/Portage.pm
+++ b/Portage.pm
@@ -400,11 +400,16 @@ sub _determine_profiles
my $mp = undef;
(-l $mp_path and $mp = readlink $mp_path)
- or (-d $mp_path and $mp = $mp_path);
+ or (-d $mp_path and $mp = $mp_path)
+ # Be sure it is not a file either:
+ or (-f $mp_path and die(
+ "\n$mp_path is a file.\n"
+ . " This is an odd setup.\n"
+ . " Please report this incident!\n"));
# make.profile is mandatory and must be a link or directory
defined($mp)
- or die "$mp_path is neither symlink nor directory\n";
+ or die("\n$mp_path is neither symlink nor directory\n");
# Start with the found path, it is the deepest profile child.
@_profiles = -l $mp_path ? _norm_path('/etc', $mp) : $mp;