Skip to content

Commit

Permalink
One more tweak.
Browse files Browse the repository at this point in the history
  • Loading branch information
akhansen committed Jul 30, 2012
1 parent 4f2be4e commit 0efc553
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion perlmod/Fink/PkgVersion.pm
Expand Up @@ -4002,7 +4002,13 @@ sub phase_build {
}

# switch everything back to root ownership if we were --build-as-nobody
if (Fink::Config::get_option("build_as_nobody") && $self->param_boolean("BuildAsNobody", 1)) {
my $build_as_nobody;
if ($self->has_parent()) {
$build_as_nobody = $self->get_parent()->param_boolean("BuildAsNobody", 1);
} else {
$build_as_nobody = $self->param_boolean("BuildAsNobody", 1);
}
if (Fink::Config::get_option("build_as_nobody") && $build_as_nobody) {
print "Reverting ownership of install dir to root\n";
unless (chowname_hr 'root:admin', $destdir) {
my $error = "Could not revert ownership of install directory to root.";
Expand Down

1 comment on commit 0efc553

@fingolfin
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. BTW, you could slightly simplify the code by using get_family_parent(), which returns the parent if there is one, otherwise self. Indeed, quite some code would benefit from that, I think...

Another thing: no offense intended, but may I suggest using slightly more descriptive commit messages? You and everybody else will be grateful for this in a couple of months, when browsing through the logs and wondering what this commit was about, ultimately being forced to look at its content... :).

E.g. already "One more tweak to BuildAsNobody" would be an improvement :-).

Please sign in to comment.