* [PATCH 5/8] update CI helper scripts for NetBSD and `pkgin'
2023-09-09 12:01 7% [PATCH 0/8] NetBSD-related updates Eric Wong
@ 2023-09-09 12:01 5% ` Eric Wong
0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2023-09-09 12:01 UTC (permalink / raw)
To: meta
---
ci/deps.perl | 24 +++++++++++++++++++++---
ci/profiles.perl | 12 ++++--------
2 files changed, 25 insertions(+), 11 deletions(-)
diff --git a/ci/deps.perl b/ci/deps.perl
index 68b602ef..6bc38735 100755
--- a/ci/deps.perl
+++ b/ci/deps.perl
@@ -67,6 +67,7 @@ my $non_auto = {
},
perl => {
pkg => 'perl5',
+ pkgin => 'perl',
pkg_add => [], # Perl is part of OpenBSD base
},
'Date::Parse' => {
@@ -87,11 +88,13 @@ my $non_auto = {
'Search::Xapian' => {
pkg => [qw(xapian-core p5-Xapian)],
pkg_add => [qw(xapian-core xapian-bindings-perl)],
+ pkgin => [qw(xapian p5-Xapian)],
rpm => 'Search::Xapian', # 3rd-party repo
},
'highlight.pm' => {
deb => 'libhighlight-perl',
pkg => [],
+ pkgin => 'p5-highlight',
rpm => [],
},
@@ -99,6 +102,7 @@ my $non_auto = {
# xapian-delve(1) in public-inbox-cindex(1)
'xapian-tools' => {
pkg => 'xapian-core',
+ pkgin => 'xapian',
rpm => 'xapian-core', # ???
},
@@ -114,21 +118,29 @@ for (qw(Digest::SHA Encode ExtUtils::MakeMaker IO::Compress Test::Simple)) {
$non_auto->{$_} = {
deb => 'perl', # libperl5.XX, but the XX varies
pkg => 'perl5',
+ pkg_add => [], # perl is in the OpenBSD base system
+ pkgin => 'perl',
};
}
+# NetBSD and OpenBSD package names are similar to FreeBSD in most cases
if ($pkg_fmt eq 'pkg_add') {
for my $name (keys %$non_auto) {
my $fbsd_pkg = $non_auto->{$name}->{pkg};
- $fbsd_pkg = [] if ($fbsd_pkg // '') eq 'perl5';
$non_auto->{$name}->{pkg_add} //= $fbsd_pkg if $fbsd_pkg;
}
+} elsif ($pkg_fmt eq 'pkgin') {
+ for my $name (keys %$non_auto) {
+ my $fbsd_pkg = $non_auto->{$name}->{pkg};
+ $non_auto->{$name}->{pkgin} //= $fbsd_pkg if $fbsd_pkg;
+ }
}
my %inst_check = (
pkg => sub { system(qw(pkg info -q), $_[0]) == 0 },
deb => sub { system("dpkg -s $_[0] >/dev/null 2>&1") == 0 },
pkg_add => sub { system(qw(pkg_info -q -e), "$_[0]->=0") == 0 },
+ pkgin => sub { system(qw(pkg_info -q -e), $_[0]) == 0 },
rpm => sub { system("rpm -qs $_[0] >/dev/null 2>&1") == 0 },
);
@@ -139,7 +151,7 @@ my (@pkg_install, @pkg_remove, %all);
for my $ary (values %$profiles) {
$all{$_} = \@pkg_remove for @$ary;
}
-if ($^O =~ /\A(?:free|open)bsd\z/) {
+if ($^O =~ /\A(?:free|net|open)bsd\z/) {
$all{'IO::KQueue'} = \@pkg_remove;
}
$profiles->{all} = [ keys %all ]; # pseudo-profile for all packages
@@ -184,6 +196,12 @@ if ($pkg_fmt eq 'deb') {
root(qw(pkg remove -y), @quiet, @pkg_remove) if @pkg_remove;
root(qw(pkg install -y), @quiet, @pkg_install) if @pkg_install;
root(qw(pkg autoremove -y), @quiet);
+} elsif ($pkg_fmt eq 'pkgin') { # NetBSD
+ my @quiet = $ENV{V} ? ('-'.('V'x$ENV{V})) : ();
+ exclude_uninstalled(\@pkg_remove);
+ root(qw(pkgin -y), @quiet, 'remove', @pkg_remove) if @pkg_remove;
+ root(qw(pkgin -y), @quiet, 'install', @pkg_install) if @pkg_install;
+ root(qw(pkgin -y), @quiet, 'autoremove');
# TODO: yum / rpm support
} elsif ($pkg_fmt eq 'rpm') {
my @quiet = $ENV{V} ? () : ('-q');
@@ -229,7 +247,7 @@ sub pkg2ospkg {
} elsif ($fmt eq 'rpm') {
$pkg =~ s/::/-/g;
return "perl-$pkg"
- } elsif ($fmt =~ /\Apkg(?:_add)?\z/) {
+ } elsif ($fmt =~ /\Apkg(?:_add|in)?\z/) {
$pkg =~ s/::/-/g;
return "p5-$pkg"
} else {
diff --git a/ci/profiles.perl b/ci/profiles.perl
index 3d67143a..5b441790 100755
--- a/ci/profiles.perl
+++ b/ci/profiles.perl
@@ -56,7 +56,8 @@ EOM
}
my $PKG_FMT = do {
if ($ID eq 'freebsd') { 'pkg' }
- # *shrug*, as long as the name doesn't conflict with FreeBSD's
+ # *shrug*, as long as the (Net|Open)BSD names don't conflict w/ FreeBSD
+ elsif ($ID eq 'netbsd') { 'pkgin' }
elsif ($ID eq 'openbsd') { 'pkg_add' }
elsif ($ID =~ m!\A(?:debian|ubuntu)\z!) { 'deb' }
elsif ($ID =~ m!\A(?:centos|redhat|fedora)\z!) { 'rpm' }
@@ -65,7 +66,8 @@ my $PKG_FMT = do {
# these package group names and '-' syntax are passed to ci/deps.perl
my $TASKS = do {
- if ($ID eq 'freebsd') { <<EOM
+ if ($ID =~ /\A(?:free|net|open)bsd\z/) { <<EOM
+all devtest Search::Xapian-
all devtest IO::KQueue-
all devtest IO::KQueue
all devtest Inline::C-
@@ -83,12 +85,6 @@ EOM
v2essential devtest
essential devtest
all Search::Xapian-
-EOM
- } elsif ($ID eq 'openbsd') { <<EOM
-all devtest Inline::C-
-all devtest Inline::C
-all devtest IO::KQueue-
-all devtest IO::KQueue
EOM
} else { die "TODO: support ID=$ID VERSION_ID=$VERSION_ID" }
};
^ permalink raw reply related [relevance 5%]
* [PATCH 0/8] NetBSD-related updates
@ 2023-09-09 12:01 7% Eric Wong
2023-09-09 12:01 5% ` [PATCH 5/8] update CI helper scripts for NetBSD and `pkgin' Eric Wong
0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2023-09-09 12:01 UTC (permalink / raw)
To: meta
It actually packages `p5-highlight' like Debian!
Eric Wong (8):
Makefile.PL: check `getconf NPROCESSORS_ONLN', too
ipc: define _SC_NPROCESSORS_ONLN for NetBSD
ci/run.sh: parameterize BUILD_JOBS TEST_JOBS and TEST_TARGET
ci/profiles: rewrite in Perl
update CI helper scripts for NetBSD and `pkgin'
xap_helper: note __cleanup__ works with C++ exceptions
xap_helper: use _OPENBSD_SOURCE on NetBSD for reallocarray
xap_helper: clamp workers to USHRT_MAX
Makefile.PL | 3 +-
ci/deps.perl | 24 +++++++--
ci/profiles.perl | 93 ++++++++++++++++++++++++++++++++++
ci/profiles.sh | 98 ------------------------------------
ci/run.sh | 14 +++---
lib/PublicInbox/IPC.pm | 16 ++++--
lib/PublicInbox/xap_helper.h | 15 +++++-
7 files changed, 148 insertions(+), 115 deletions(-)
create mode 100755 ci/profiles.perl
delete mode 100755 ci/profiles.sh
^ permalink raw reply [relevance 7%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2023-09-09 12:01 7% [PATCH 0/8] NetBSD-related updates Eric Wong
2023-09-09 12:01 5% ` [PATCH 5/8] update CI helper scripts for NetBSD and `pkgin' Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).