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
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,
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,
66 $buildconf = "build-farm.conf"; # default value
68 # extra options can be used by a wrapper program, such as
69 # the one that will do the global lock and election, and it will
70 # still have acces to what it needs to do to invoke run_build.
74 GetOptions(%standard_options, @_)
75 || die "bad command line";
79 sub standard_option_list
82 foreach my $k ( keys %standard_options )
84 my $vref = $standard_options{$k};
85 next unless defined($$vref);
86 (my $nicekey = $k) =~ s/[=:].*//;
87 push(@result, "--$nicekey");
88 push(@result,$$vref) if $$vref && $k =~ /[:=]/;