Permalink
Browse files

Make –build-as-nobody the default.

Also add a BuildAsNobody: false field to allow packages to override the default setting.
  • Loading branch information...
1 parent db1fd4c commit 661cbc5cc6826f66fd28cd985bc19d45870d8281 @danielj7 danielj7 committed Feb 9, 2012
Showing with 12 additions and 3 deletions.
  1. +1 −0 fink.info.in
  2. +3 −2 perlmod/Fink/Config.pm
  3. +6 −0 perlmod/Fink/PkgVersion.pm
  4. +2 −1 perlmod/Fink/Validation.pm
View
@@ -16,6 +16,7 @@ Essential: yes
Source: @SOURCE@
Source-MD5: @MD5@
NoSetPATH: true
+BuildAsNobody: false
CompileScript: <<
make test PREFIX=%p ARCHITECTURE=%m DISTRIBUTION=@DISTRIBUTION@
./setup.sh %p %m
@@ -216,7 +216,8 @@ Parse the global command-line options for Fink.
my %option_defaults = (
map( { $_ => 0 } qw(dontask interactive verbosity keep_build keep_root
- build_as_nobody maintainermode showversion use_binary) ),
+ maintainermode showversion use_binary) ),
+ map( { $_ => 1 } qw(build_as_nobody) ),
map( { $_ => "" } qw(tests validate) ),
map ( { $_ => [] } qw(include_trees exclude_trees) ),
map( { $_ => -1 } qw(use_binary) ),
@@ -269,7 +270,7 @@ sub parse_options {
[ 'use-binary-dist|b!' => \$opts{use_binary},
'download pre-compiled packages from the binary distribution '
. 'if available' ],
- [ 'build-as-nobody' => \$opts{build_as_nobody}, 'see man page' ],
+ [ 'build-as-nobody|!' => \$opts{build_as_nobody}, 'see man page' ],
[ 'maintainer|m' => sub {set_checking_opts(\%opts, @_);}, 'see man page' ],
[ 'tests:s' => sub {set_checking_opts(\%opts, @_);}, 'see man page' ],
[ 'validate:s' => sub {set_checking_opts(\%opts, @_);}, 'see man page' ],
@@ -5068,6 +5068,12 @@ sub run_script {
# Run the script under the modified environment
my $result;
+ # Don't build as nobody if BuildAsNobody: false
+ my $build_as_nobody = $self->param_boolean("BuildAsNobody");
+ if (not defined $build_as_nobody) {
+ $build_as_nobody = 1;
+ }
+ $nonroot_okay = $nonroot_okay && $build_as_nobody;
{
local %ENV = %{$self->get_env($phase)};
$result = &execute($script, nonroot_okay=>$nonroot_okay);
@@ -64,7 +64,7 @@ our @splitoff_required_fields = map {lc $_}
# All fields that expect a boolean value
our %boolean_fields = map {$_, 1}
(
- qw(builddependsonly essential nosourcedirectory updateconfigguess updatelibtool updatepod noperltests usemaxbuildjobs),
+ qw(builddependsonly essential nosourcedirectory updateconfigguess updatelibtool updatepod noperltests usemaxbuildjobs buildasnobody),
map {"noset".$_} @set_vars
);
@@ -195,6 +195,7 @@ our %valid_fields = map {$_, 1}
'compilescript',
'noperltests',
'usemaxbuildjobs',
+ 'buildasnobody',
# install phase:
'updatepod',
'installscript',

0 comments on commit 661cbc5

Please sign in to comment.