Document mock mode
[Fedora-Rebuild.git] / bin / rebuildperl
blob2721f489cbcbddcb2d455a09bba3c6c8faef9c5d
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use Fedora::Rebuild;
5 use Config::Tiny;
6 use File::Spec;
8 my $cfgfile = File::Spec->catfile($ENV{HOME}, '.rebuildperlrc');
10 my %config = (
11 all => 'all',
12 done => 'done',
13 failed => 'failed',
14 workdir => 'workdir',
15 repodir => 'testrepo',
16 reporls => [
17 'http://download.englab.brq.redhat.com/pub/fedora/linux/development/rawhide/x86_64/os/' ],
18 architecture => 'x86_64',
19 anonymous => 0,
20 dist => 'rawhide',
21 target => 'rawhide',
22 message => 'Perl mass rebuild',
23 buildrequiresfilter => sub { $_[0] !~ /^\s*perl\(/ },
24 mode => 'koji',
25 threads => 16,
26 loadthreads => 4,
27 selectthreads => 1,
28 failurelimit => 8,
29 ordered => 1,
30 verbosesolver => 1
33 if (-f $cfgfile) {
34 my $cfg = Config::Tiny->new->read($cfgfile);
35 if (! defined $cfg) {
36 print STDERR "Could not parse `" . $cfgfile .
37 "' configuration file: " . $Config::Tiny::errstr . "\n";
38 exit 1;
40 foreach (keys %{$cfg->{_}}) {
41 $config{$_} = $cfg->{_}->{$_};
42 $config{$_} = eval $config{$_} if $_ eq 'buildrequiresfilter';
46 my $builder = Fedora::Rebuild->new(%config);
47 exit !$builder->run;
50 __END__
51 =encoding utf8
53 =head1 NAME
55 rebuild - Rebuilds perl packages from scratch
57 =head1 DESCRIPTION
59 Main goal is to rebuild perl modules packages for Fedora. The rebuild is
60 driven from bottom to top, i.e. from perl interpreter to modules depending on
61 intermediate modules. This way, it's possible to upgrade perl interpreter to
62 incompatible version and to rebuild all modules against the new interpreter.
65 =head1 AUTHOR
67 Petr Písař <ppisar@redhat.com>
69 =head1 COPYING
71 Copyright (C) 2011 Petr Písař <ppisar@redhat.com>
73 This program is free software: you can redistribute it and/or modify
74 it under the terms of the GNU General Public License as published by
75 the Free Software Foundation, either version 3 of the License, or
76 (at your option) any later version.
78 This program is distributed in the hope that it will be useful,
79 but WITHOUT ANY WARRANTY; without even the implied warranty of
80 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
81 GNU General Public License for more details.
83 You should have received a copy of the GNU General Public License
84 along with this program. If not, see <http://www.gnu.org/licenses/>.
86 =cut