diff options
author | Sven Eden <yamakuzure@gmx.net> | 2014-02-25 19:15:22 +0100 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2014-02-25 19:15:22 +0100 |
commit | 9e724f7824c11527316f822283242260be12c3d7 (patch) | |
tree | b5ed84b6a81d4af0e6df930d27af580cbd944484 | |
parent | Portage.pm: Some comment cleanup and one minor bugfix. (diff) | |
download | ufed-9e724f7824c11527316f822283242260be12c3d7.tar.gz ufed-9e724f7824c11527316f822283242260be12c3d7.tar.bz2 ufed-9e724f7824c11527316f822283242260be12c3d7.zip |
Portage.pm: /etc/portage/make.profile does no longer need to be a symlink and can be a driectory as well now.
-rw-r--r-- | Portage.pm | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -386,22 +386,28 @@ sub _determine_make_conf } -# read /etc/make.profile and /etc/portage/make.profile and -# analyze the complete profile tree using the found parent -# files. Add all found paths to @profiles. +# read /etc/make.profile and /etc/portage/make.profile and analyze the complete +# profile tree using the found parent files. Add all found paths to @profiles. + # No parameters accepted. sub _determine_profiles { - my $mp = readlink "${_EPREFIX}/etc/portage/make.profile"; - defined($mp) - or $mp = readlink "${_EPREFIX}/etc/make.profile"; + my $mp_path = "${_EPREFIX}/etc/portage/make.profile"; + -e $mp_path or $mp_path = "${_EPREFIX}/etc/make.profile"; + + -e $mp_path + or die("make.profile can not be found"); - # make.profile is mandatory and must be a link + my $mp = undef; + (-l $mp_path and $mp = readlink $mp_path) + or (-d $mp_path and $mp = $mp_path); + + # make.profile is mandatory and must be a link or directory defined($mp) - or die "${_EPREFIX}/etc\{,/portage\}/make.profile is not a symlink\n"; + or die "$mp_path is neither symlink nor directory\n"; - # Start with the linked path, it is the deepest profile child. - @_profiles = _norm_path('/etc', $mp); + # Start with the found path, it is the deepest profile child. + @_profiles = -l $mp_path ? _norm_path('/etc', $mp) : $mp; for (my $i = -1; $i >= -@_profiles; $i--) { for(_noncomments("${_profiles[$i]}/parent")) { splice(@_profiles, $i, 0, _norm_path(${_profiles[$i]}, $_)); |