| File: | config/auto/ops.pm |
| Coverage: | 100.0% |
| line | stmt | bran | cond | sub | code |
|---|---|---|---|---|---|
| 1 | # Copyright (C) 2001-2003, Parrot Foundation. | ||||
| 2 | |||||
| 3 - 11 | =head1 NAME config/auto/ops.pm - Ops Files =head1 DESCRIPTION Asks the user to select which ops files to include. =cut | ||||
| 12 | |||||
| 13 | package auto::ops; | ||||
| 14 | |||||
| 15 | 2 2 2 | use strict; | |||
| 16 | 2 2 2 | use warnings; | |||
| 17 | |||||
| 18 | 2 2 2 | use base qw(Parrot::Configure::Step); | |||
| 19 | |||||
| 20 | 2 2 2 | use Parrot::Configure::Utils ':auto'; | |||
| 21 | |||||
| 22 | |||||
| 23 | sub _init { | ||||
| 24 | 2 | my $self = shift; | |||
| 25 | 2 | my %data; | |||
| 26 | 2 | $data{description} = q{Which opcode files should be compiled in}; | |||
| 27 | 2 | $data{result} = q{}; | |||
| 28 | 2 | return \%data; | |||
| 29 | } | ||||
| 30 | |||||
| 31 | sub runstep { | ||||
| 32 | 2 | my ( $self, $conf ) = @_; | |||
| 33 | |||||
| 34 | my @ops = ( | ||||
| 35 | sort { | ||||
| 36 | 50 6 24 | if ( $a =~ /core\.ops/ ) { return -1 } | |||
| 37 | 44 2 | if ( $b =~ /core\.ops/ ) { return 1 } | |||
| 38 | 42 | return ( $a cmp $b ) | |||
| 39 | } | ||||
| 40 | 2 | grep { !/vtable\.ops/ } glob "src/ops/*.ops" | |||
| 41 | ); | ||||
| 42 | |||||
| 43 | 2 24 | my $ops = join ' ', grep { !/obscure\.ops/ } @ops; | |||
| 44 | |||||
| 45 | 2 | $ops = $conf->options->get('ops') if defined $conf->options->get('ops'); | |||
| 46 | |||||
| 47 | 2 | $conf->data->set( ops => $ops ); | |||
| 48 | |||||
| 49 | 2 | return 1; | |||
| 50 | } | ||||
| 51 | |||||
| 52 | 1; | ||||
| 53 | |||||
| 54 | # Local Variables: | ||||
| 55 | # mode: cperl | ||||
| 56 | # cperl-indent-level: 4 | ||||
| 57 | # fill-column: 100 | ||||
| 58 | # End: | ||||
| 59 | # vim: expandtab shiftwidth=4: | ||||