summaryrefslogtreecommitdiffstats
path: root/script/perlpkg.pl
blob: 03bdb92fd5a36fea315ef75734d81c9a09ad6dd6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/usr/bin/env perl

use v5.24;

use warnings;
use strict;

use Function::Parameters;
use Log::Any::Adapter;
use Log::Log4perl qw(:easy);

use App::ArchLinux::PackagerTools;

=head1 NAME

perlpkg.pl - Script to support perl packaging on Arch Linux

=head1 SYNOPSIS

  perlpkg.pl [options]

  Options:
    --debug

=head1 DESCRIPTION

TODO

=head1 CONFIGURATION

To configure the script create a file called $XDG_CONFIG_HOME/perlpkg/config.toml.

The configuration file is not yet used/read.

TODO

=head1 SEE ALSO

L<App::ArchLinux::PackagerTools>

=cut

Log::Log4perl->easy_init($ERROR);
if ($ARGV[0] // "" eq "--debug") {
	Log::Log4perl->easy_init($TRACE);
} else {
	Log::Log4perl->easy_init($INFO);
}
Log::Any::Adapter->set('Log4perl');

my $app = App::ArchLinux::PackagerTools->new();

use Data::Dumper;
my $dists = $app->get_distributions_in_repo();
my $dist_names = [map {$_->{dist_name}} $dists->@*];
my $updateable = $app->get_updateable_packages($dist_names);
my $pkgs = $app->add_maintainers($updateable);
my $filtered_pkgs = $app->filter_by_maintainer($pkgs);

print Dumper($filtered_pkgs);

# TODO generate new pacakge pkgbuild
# TODO build
# TODO release