File Coverage

File:config/auto/ops.pm
Coverage:100.0%

linestmtbrancondsubcode
1# Copyright (C) 2001-2003, Parrot Foundation.
2# $Id: ops.pm 37201 2009-03-08 12:07:48Z fperrad $
3
4 - 12
=head1 NAME

config/auto/ops.pm - Ops Files

=head1 DESCRIPTION

Asks the user to select which ops files to include.

=cut
13
14package auto::ops;
15
16
2
2
2
use strict;
17
2
2
2
use warnings;
18
19
2
2
2
use base qw(Parrot::Configure::Step);
20
21
2
2
2
use Parrot::Configure::Utils ':auto';
22
23
24sub _init {
25
2
    my $self = shift;
26
2
    my %data;
27
2
    $data{description} = q{Which opcode files should be compiled in};
28
2
    $data{result} = q{};
29
2
    return \%data;
30}
31
32sub runstep {
33
2
    my ( $self, $conf ) = @_;
34
35    my @ops = (
36        sort {
37
50
6
24
            if ( $a =~ /core\.ops/ ) { return -1 }
38
44
2
            if ( $b =~ /core\.ops/ ) { return 1 }
39
42
            return ( $a cmp $b )
40            }
41
2
            grep { !/vtable\.ops/ } glob "src/ops/*.ops"
42    );
43
44
2
24
    my $ops = join ' ', grep { !/obscure\.ops/ } @ops;
45
46
2
    $ops = $conf->options->get('ops') if defined $conf->options->get('ops');
47
48
2
    $conf->data->set( ops => $ops );
49
50
2
    return 1;
51}
52
531;
54
55# Local Variables:
56# mode: cperl
57# cperl-indent-level: 4
58# fill-column: 100
59# End:
60# vim: expandtab shiftwidth=4: