X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=ci%2Fdeps.perl;h=77d95fc8e749071237ea03dec9ff438950393f00;hb=de9648ca847cf032aab6da9cac1217bf9cca9c90;hp=e0fda01191c0be44d61ab876febdb01377607afe;hpb=7e2abe2d068367f2fcdf638a4482c953111df156;p=public-inbox.git
diff --git a/ci/deps.perl b/ci/deps.perl
index e0fda011..77d95fc8 100755
--- a/ci/deps.perl
+++ b/ci/deps.perl
@@ -1,5 +1,5 @@
#!/usr/bin/perl -w
-# Copyright (C) 2019 all contributors
+# Copyright (C) 2019-2020 all contributors
# License: AGPL-3.0+
# Helper script for installing/uninstalling packages for CI use
# Intended for use on non-production chroots or VMs since it
@@ -9,34 +9,33 @@ my $usage = "$0 PKG_FMT PROFILE [PROFILE_MOD]";
my $pkg_fmt = shift;
@ARGV or die $usage, "\n";
+my @test_essential = qw(Test::Simple); # we actually use Test::More
+
# package profiles
my $profiles = {
- # the smallest possible profile
- # TODO: trim this, Plack pulls in Filesys::Notify::Simple,
- # and we don't need that for mda-only installs
+ # the smallest possible profile for testing
+ # TODO: trim URI::Escape from this, maybe
essential => [ qw(
git
perl
- Date::Parse
Devel::Peek
- Email::Simple
- Email::MIME
- Email::MIME::ContentType
+ Digest::SHA
Encode
- Filesys::Notify::Simple
- Plack
+ ExtUtils::MakeMaker
+ IO::Compress::Gzip
URI::Escape
- ) ],
+ ), @test_essential ],
# everything optional for normal use
optional => [ qw(
+ Date::Parse
BSD::Resource
DBD::SQLite
DBI
- IO::Compress::Gzip
Inline::C
Net::Server
- Plack::Middleware::Deflater
+ Plack
+ Plack::Test
Plack::Middleware::ReverseProxy
Search::Xapian
Socket6
@@ -44,11 +43,9 @@ my $profiles = {
xapian-compact
) ],
- # developer stuff
+ # optional developer stuff
devtest => [ qw(
- IPC::Run
- Test::HTTP::Server::Simple
- XML::Feed
+ XML::TreePP
curl
w3m
) ],
@@ -58,6 +55,8 @@ my $profiles = {
my @precious;
if ($^O eq 'freebsd') {
@precious = qw(perl curl Socket6 IO::Compress::Gzip);
+} elsif ($pkg_fmt eq 'rpm') {
+ @precious = qw(perl curl);
}
if (@precious) {
@@ -70,12 +69,7 @@ if (@precious) {
# bare minimum for v2
-$profiles->{v2essential} = [ @{$profiles->{essential}}, qw(
- DBD::SQLite
- DBI
- Search::Xapian
- xapian-compact
-) ];
+$profiles->{v2essential} = [ @{$profiles->{essential}}, qw(DBD::SQLite DBI) ];
# package names which can't be mapped automatically:
my $non_auto = {
@@ -89,22 +83,41 @@ my $non_auto = {
deb => 'perl', # libperl5.XX, but the XX varies
pkg => 'perl5',
},
+ 'Digest::SHA' => {
+ deb => 'perl', # libperl5.XX, but the XX varies
+ pkg => 'perl5',
+ },
'Encode' => {
deb => 'perl', # libperl5.XX, but the XX varies
pkg => 'perl5',
rpm => 'perl-Encode',
},
+ 'ExtUtils::MakeMaker' => {
+ deb => 'perl', # perl-modules-5.xx
+ pkg => 'perl5',
+ rpm => 'perl-ExtUtils-MakeMaker',
+ },
'IO::Compress::Gzip' => {
deb => 'perl', # perl-modules-5.xx
pkg => 'perl5',
- rpm => 'perl-PerlIO-gzip',
+ rpm => 'perl-IO-Compress',
},
'DBD::SQLite' => { deb => 'libdbd-sqlite3-perl' },
+ 'Plack::Test' => {
+ deb => 'libplack-perl',
+ pkg => 'p5-Plack',
+ rpm => 'perl-Plack-Test',
+ },
'URI::Escape' => {
deb => 'liburi-perl',
pkg => 'p5-URI',
rpm => 'perl-URI',
},
+ 'Test::Simple' => {
+ deb => 'perl', # perl-modules-5.XX, but the XX varies
+ pkg => 'perl5',
+ rpm => 'perl-Test-Simple',
+ },
'highlight.pm' => {
deb => 'libhighlight-perl',
pkg => [],
@@ -173,6 +186,11 @@ if ($pkg_fmt eq 'deb') {
root(qw(pkg install -y), @quiet, @pkg_install) if @pkg_install;
root(qw(pkg autoremove -y), @quiet);
# TODO: yum / rpm support
+} elsif ($pkg_fmt eq 'rpm') {
+ my @quiet = $ENV{V} ? () : ('-q');
+ exclude_uninstalled(\@pkg_remove);
+ root(qw(yum remove -y), @quiet, @pkg_remove) if @pkg_remove;
+ root(qw(yum install -y), @quiet, @pkg_install) if @pkg_install;
} else {
die "unsupported package format: $pkg_fmt\n";
}