2 package EximBuild::Options;
6 Copyright (c) 2003-2010, Andrew Dunstan
7 Copyright (c) 2013, Todd Lyons
9 See accompanying License file for license details
13 # common options code for buildfarm scripts, so it stays in sync
19 use vars qw(@option_list);
24 $forcerun $buildconf $keepall $help
25 $quiet $from_source $from_source_clean $testmode
26 $skip_steps $only_steps $override
27 $nosend $nostatus $verbose
32 our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
34 use vars qw($VERSION); $VERSION = 'REL_0.1';
37 @EXPORT = @option_list;
42 $forcerun, $buildconf, $keepall,$help,
43 $quiet, $from_source,$from_source_clean, $testmode,
44 $skip_steps,$only_steps, $overrides,
45 $nosend, $nostatus, $verbose,
48 my (%standard_options);
52 'config=s' => \$buildconf,
53 'from-source=s' => \$from_source,
54 'from-source-clean=s' => \$from_source_clean,
55 'force' => \$forcerun,
56 'keepall' => \$keepall,
57 'verbose:i' => \$verbose,
58 'nostatus' => \$nostatus,
62 'skip-steps=s' => \$skip_steps,
63 'only-steps=s' => \$only_steps,
64 'override=s@' => \$overrides,
67 $buildconf = "build-farm.conf"; # default value
69 # extra options can be used by a wrapper program, such as
70 # the one that will do the global lock and election, and it will
71 # still have acces to what it needs to do to invoke run_build.
75 GetOptions(%standard_options, @_)
76 || die "bad command line";
80 sub standard_option_list
83 foreach my $k ( keys %standard_options )
85 my $vref = $standard_options{$k};
86 next unless defined($$vref);
87 (my $nicekey = $k) =~ s/[=:].*//;
88 push(@result, "--$nicekey");
89 push(@result,$$vref) if $$vref && $k =~ /[:=]/;