--- /dev/null
+# Configuration of the Batch EXecutor
+# This is a Perl script, which can set anything in the BEX::Config package
+
+package BEX::Config;
+
+%machines = (
+ 'albireo' => {},
+ 'localhost' => {},
+ 'home' => ['albireo', 'localhost'],
+);
+
+42;
--- /dev/null
+# Batch EXecutor 2.0 -- Configuration
+# (c) 2011 Martin Mares <mj@ucw.cz>
+
+use strict;
+use warnings;
+
+package BEX::Config;
+
+# This file specifies default values, which can be overridden in BEX.cf
+
+# A hash of all known machines and groups
+# 'name' => { } for a machine
+# 'name' => ['a','b','c'] for a group containing specified machines/subgroups
+our %machines = (
+);
+
+# Various utility functions
+
+sub parse_machine_list(@);
+
+sub parse_machine_list(@) {
+ my %set = ();
+ for my $m (@_) {
+ if ($m eq '*') {
+ for my $mm (keys %machines) {
+ if (ref($machines{$mm}) eq 'HASH') {
+ $set{$mm} = 1;
+ }
+ }
+ next;
+ }
+ my $op = 1;
+ if ($m =~ s{^!}{}) { $op = 0; }
+ my $v = $machines{$m};
+ if (!defined $v) {
+ die "Unknown machine or class: $m\n";
+ } elsif (ref($v) eq 'HASH') {
+ $set{$m} = $op;
+ } elsif (ref($v) eq 'ARRAY') {
+ for my $mm (parse_machine_list(@$v)) {
+ $set{$mm} = $op;
+ }
+ }
+ }
+ return sort grep { $set{$_} } keys %set;
+}
+
+require 'BEX.cf';
+
+42;