6 use System::Introspector::State;
7 use File::Tree::Snapshot;
8 use System::Introspector::Config;
11 'c|config=s' => \my $config_file,
12 's|storage=s' => \my $storage_dir,
13 'H|host=s' => \my $hostname,
14 'allow-empty' => \my $allow_empty,
15 'a|all' => \my $update_all,
16 'g|group=s' => \my @update_groups,
17 'h|help' => sub { pod2usage(0) },
20 die "Requires --all or --group option\n"
21 unless $update_all or @update_groups;
23 my $config = System::Introspector::Config->new(
24 config_file => (defined($config_file)
26 : "$storage_dir/main.conf"),
29 $config->has_group($_) or die "Unknown group '$_'\n"
32 @update_groups = $config->groups
35 for my $group (@update_groups) {
36 my $group_dir = "$storage_dir/$group";
37 print "Group $group at $group_dir\n";
38 my $storage = File::Tree::Snapshot->new(
39 storage_path => $group_dir,
40 allow_empty => $allow_empty,
43 unless $storage->exists;
44 my $state = System::Introspector::State->new(
45 defined($hostname) ? (host => $hostname) : (),
47 config => $config->config_for_group($group),
49 eval { $state->fetch_and_store };
62 system-introspector - Generate System Introspection Data
66 system-introspector --storage <path> [OPTIONS]
70 =head2 -s <path>, --storage <path>
72 Path to storage. Always required.
74 =head2 -H <host>, --host <host>
80 Allow empty commits to storage.