user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 0/3] some dependency cleanups
@ 2019-01-10  6:59  7% Eric Wong
  2019-01-10  6:59  5% ` [PATCH 3/3] check git version requirements Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-01-10  6:59 UTC (permalink / raw)
  To: meta

Getting rid of Socket6 is on the horizon, at least.

It's a bit sad to drop wheezy support since that's what
I started the project with; but I then again I always had
git installed in $HOME and not /usr, so it probably still
works otherwise *shrug*

Eric Wong (3):
  daemon: make Socket6 optional, note about Net::Socket::IP
  INSTALL: Net::Server is not needed for systemd use
  check git version requirements

 INSTALL                      | 25 +++++++++++++++++--------
 lib/PublicInbox/Daemon.pm    | 19 ++++++++++++++++---
 lib/PublicInbox/SearchIdx.pm |  1 +
 t/altid_v2.t                 |  2 ++
 t/common.perl                | 14 ++++++++++++++
 t/convert-compact.t          |  2 ++
 t/import.t                   |  6 ++++--
 t/init.t                     |  2 ++
 t/mda_filter_rubylang.t      |  2 ++
 t/nntpd.t                    | 11 ++++++++---
 t/psgi_v2.t                  |  2 ++
 t/v1reindex.t                |  2 ++
 t/v2-add-remove-add.t        |  2 ++
 t/v2mda.t                    |  2 ++
 t/v2mirror.t                 |  1 +
 t/v2reindex.t                |  2 ++
 t/v2writable.t               |  1 +
 t/watch_maildir_v2.t         |  2 ++
 18 files changed, 82 insertions(+), 16 deletions(-)

-- 
EW


^ permalink raw reply	[relevance 7%]

* [PATCH 3/3] check git version requirements
  2019-01-10  6:59  7% [PATCH 0/3] some dependency cleanups Eric Wong
@ 2019-01-10  6:59  5% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-01-10  6:59 UTC (permalink / raw)
  To: meta

This allows v1 tests to continue working on git 1.8.0 for
now.  This allows git 2.1.4 packaged with Debian 8 ("jessie")
to run old tests, at least.

I suppose it's safe to drop Debian 7 ("wheezy") due to our
dependency on git 1.8.0 for "merge-base --is-ancestor".

Writing V2 repositories requires git 2.6 for "get-mark"
support, so mask out tests for older gits.
---
 INSTALL                      | 11 +++++++++--
 lib/PublicInbox/SearchIdx.pm |  1 +
 t/altid_v2.t                 |  2 ++
 t/common.perl                | 14 ++++++++++++++
 t/convert-compact.t          |  2 ++
 t/import.t                   |  6 ++++--
 t/init.t                     |  2 ++
 t/mda_filter_rubylang.t      |  2 ++
 t/nntpd.t                    | 11 ++++++++---
 t/psgi_v2.t                  |  2 ++
 t/v1reindex.t                |  2 ++
 t/v2-add-remove-add.t        |  2 ++
 t/v2mda.t                    |  2 ++
 t/v2mirror.t                 |  1 +
 t/v2reindex.t                |  2 ++
 t/v2writable.t               |  1 +
 t/watch_maildir_v2.t         |  2 ++
 17 files changed, 58 insertions(+), 7 deletions(-)

diff --git a/INSTALL b/INSTALL
index ccd9dac..a89c890 100644
--- a/INSTALL
+++ b/INSTALL
@@ -5,6 +5,13 @@ This is for folks who want to setup their own public-inbox instance.
 Clients should use normal git-clone/git-fetch, or NNTP clients
 if they want to import mail into their personal inboxes.
 
+public-inbox is developed on Debian GNU/Linux systems and will
+never depend on packages outside of the "main" component of
+the "stable" distribution, currently Debian 9.x ("stretch")
+
+Most packages are available in other GNU/Linux distributions;
+and FreeBSD support can happen.
+
 TODO: this still needs to be documented better,
 also see the scripts/ and sa_config/ directories in the source tree
 
@@ -14,8 +21,8 @@ Requirements
 public-inbox requires a number of other packages to access its full
 functionality.  The core tools are, of course:
 
-* Git
-* Perl
+* Git (1.8.0+, 2.6+ for writing v2 repositories)
+* Perl 5.8+
 * SQLite (needed for Xapian use)
 
 To accept incoming mail into a public inbox, you'll likely want:
diff --git a/lib/PublicInbox/SearchIdx.pm b/lib/PublicInbox/SearchIdx.pm
index fd48169..cc1ac56 100644
--- a/lib/PublicInbox/SearchIdx.pm
+++ b/lib/PublicInbox/SearchIdx.pm
@@ -646,6 +646,7 @@ sub _git_log {
 				--raw -r --no-abbrev/, $range);
 }
 
+# --is-ancestor requires git 1.8.0+
 sub is_ancestor ($$$) {
 	my ($git, $cur, $tip) = @_;
 	return 0 unless $git->check($cur);
diff --git a/t/altid_v2.t b/t/altid_v2.t
index 87f1452..e91a644 100644
--- a/t/altid_v2.t
+++ b/t/altid_v2.t
@@ -4,6 +4,8 @@ use strict;
 use warnings;
 use Test::More;
 use File::Temp qw/tempdir/;
+require './t/common.perl';
+require_git(2.6);
 foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 	eval "require $mod";
 	plan skip_all => "$mod missing for altid_v2.t" if $@;
diff --git a/t/common.perl b/t/common.perl
index 688e30a..e49a596 100644
--- a/t/common.perl
+++ b/t/common.perl
@@ -39,4 +39,18 @@ sub spawn_listener {
 	$pid;
 }
 
+sub require_git ($;$) {
+	my ($req, $maybe) = @_;
+	my ($req_maj, $req_min) = split(/\./, $req);
+	my ($cur_maj, $cur_min) = (`git --version` =~ /version (\d+)\.(\d+)/);
+
+	my $req_int = ($req_maj << 24) | ($req_min << 16);
+	my $cur_int = ($cur_maj << 24) | ($cur_min << 16);
+	if ($cur_int < $req_int) {
+		return 0 if $maybe;
+		plan skip_all => "git $req+ required, have $git_ver";
+	}
+	1;
+}
+
 1;
diff --git a/t/convert-compact.t b/t/convert-compact.t
index def0343..491486d 100644
--- a/t/convert-compact.t
+++ b/t/convert-compact.t
@@ -5,6 +5,8 @@ use warnings;
 use Test::More;
 use File::Temp qw/tempdir/;
 use PublicInbox::MIME;
+require './t/common.perl';
+require_git(2.6);
 my @mods = qw(DBD::SQLite Search::Xapian);
 foreach my $mod (@mods) {
 	eval "require $mod";
diff --git a/t/import.t b/t/import.t
index eee4744..e773363 100644
--- a/t/import.t
+++ b/t/import.t
@@ -11,6 +11,7 @@ use IO::File;
 use Fcntl qw(:DEFAULT);
 use File::Temp qw/tempdir tempfile/;
 my $dir = tempdir('pi-import-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+require './t/common.perl';
 
 is(system(qw(git init -q --bare), $dir), 0, 'git init successful');
 my $git = PublicInbox::Git->new($dir);
@@ -27,11 +28,12 @@ my $mime = PublicInbox::MIME->create(
 	],
 	body => "hello world\n",
 );
+my $v2 = require_git(2.6, 1);
 
-$im->{want_object_info} = 1 if 'v2';
+$im->{want_object_info} = 1 if $v2;
 like($im->add($mime), qr/\A:\d+\z/, 'added one message');
 
-if ('v2') {
+if ($v2) {
 	my $info = $im->{last_object};
 	like($info->[0], qr/\A[a-f0-9]{40}\z/, 'got last object_id');
 	is($mime->as_string, ${$info->[2]}, 'string matches');
diff --git a/t/init.t b/t/init.t
index 1551a30..86b4eb5 100644
--- a/t/init.t
+++ b/t/init.t
@@ -5,6 +5,7 @@ use warnings;
 use Test::More;
 use PublicInbox::Config;
 use File::Temp qw/tempdir/;
+require './t/common.perl';
 my $tmpdir = tempdir('pi-init-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 use constant pi_init => 'blib/script/public-inbox-init';
 use PublicInbox::Import;
@@ -53,6 +54,7 @@ SKIP: {
 		eval "require $mod";
 		skip "$mod missing for v2", 2 if $@;
 	}
+	require_git(2.6, 1) or skip "git 2.6+ required", 2;
 	local $ENV{PI_DIR} = "$tmpdir/.public-inbox/";
 	my $cfgfile = "$ENV{PI_DIR}/config";
 	my @cmd = (pi_init, '-V2', 'v2list', "$tmpdir/v2list",
diff --git a/t/mda_filter_rubylang.t b/t/mda_filter_rubylang.t
index 583a139..279afaa 100644
--- a/t/mda_filter_rubylang.t
+++ b/t/mda_filter_rubylang.t
@@ -6,6 +6,8 @@ use Test::More;
 use File::Temp qw/tempdir/;
 use PublicInbox::MIME;
 use PublicInbox::Config;
+require './t/common.perl';
+require_git(2.6);
 my @mods = qw(DBD::SQLite Search::Xapian IPC::Run);
 foreach my $mod (@mods) {
 	eval "require $mod";
diff --git a/t/nntpd.t b/t/nntpd.t
index d227b74..6b13f81 100644
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -18,6 +18,10 @@ use Net::NNTP;
 use Sys::Hostname;
 require './t/common.perl';
 
+# FIXME: make easier to test both versions
+my $version = $ENV{PI_VERSION} || 2;
+require_git('2.6') if $version == 2;
+
 my $tmpdir = tempdir('pi-nntpd-XXXXXX', TMPDIR => 1, CLEANUP => 1);
 my $home = "$tmpdir/pi-home";
 my $err = "$tmpdir/stderr.log";
@@ -30,10 +34,11 @@ my $init = 'blib/script/public-inbox-init';
 use_ok 'PublicInbox::Import';
 use_ok 'PublicInbox::Inbox';
 use_ok 'PublicInbox::Git';
-use_ok 'PublicInbox::V2Writable';
+SKIP: {
+	skip "git 2.6+ required for V2Writable", 1 if $version == 1;
+	use_ok 'PublicInbox::V2Writable';
+}
 
-# XXX FIXME: make it easier to test both versions
-my $version = int($ENV{PI_VERSION} || 1);
 my %opts = (
 	LocalAddr => '127.0.0.1',
 	ReuseAddr => 1,
diff --git a/t/psgi_v2.t b/t/psgi_v2.t
index 65448dc..9811249 100644
--- a/t/psgi_v2.t
+++ b/t/psgi_v2.t
@@ -3,6 +3,8 @@
 use strict;
 use warnings;
 use Test::More;
+require './t/common.perl';
+require_git(2.6);
 use File::Temp qw/tempdir/;
 use PublicInbox::MIME;
 use PublicInbox::Config;
diff --git a/t/v1reindex.t b/t/v1reindex.t
index 8be9514..33a36fa 100644
--- a/t/v1reindex.t
+++ b/t/v1reindex.t
@@ -7,6 +7,8 @@ use PublicInbox::MIME;
 use PublicInbox::ContentId qw(content_digest);
 use File::Temp qw/tempdir/;
 use File::Path qw(remove_tree);
+require './t/common.perl';
+require_git(2.6);
 
 foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 	eval "require $mod";
diff --git a/t/v2-add-remove-add.t b/t/v2-add-remove-add.t
index c8d12d3..1b700d7 100644
--- a/t/v2-add-remove-add.t
+++ b/t/v2-add-remove-add.t
@@ -5,6 +5,8 @@ use warnings;
 use Test::More;
 use PublicInbox::MIME;
 use File::Temp qw/tempdir/;
+require './t/common.perl';
+require_git(2.6);
 
 foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 	eval "require $mod";
diff --git a/t/v2mda.t b/t/v2mda.t
index d041ffd..1c90a5b 100644
--- a/t/v2mda.t
+++ b/t/v2mda.t
@@ -7,6 +7,8 @@ use PublicInbox::MIME;
 use File::Temp qw/tempdir/;
 use Fcntl qw(SEEK_SET);
 use Cwd;
+require './t/common.perl';
+require_git(2.6);
 
 my $V = 2;
 foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
diff --git a/t/v2mirror.t b/t/v2mirror.t
index 283b2b2..ef9a540 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -4,6 +4,7 @@ use strict;
 use warnings;
 use Test::More;
 require './t/common.perl';
+require_git(2.6);
 
 # Integration tests for HTTP cloning + mirroring
 foreach my $mod (qw(Plack::Util Plack::Builder Danga::Socket
diff --git a/t/v2reindex.t b/t/v2reindex.t
index 2dda80e..8a3071b 100644
--- a/t/v2reindex.t
+++ b/t/v2reindex.t
@@ -7,6 +7,8 @@ use PublicInbox::MIME;
 use PublicInbox::ContentId qw(content_digest);
 use File::Temp qw/tempdir/;
 use File::Path qw(remove_tree);
+require './t/common.perl';
+require_git(2.6);
 
 foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 	eval "require $mod";
diff --git a/t/v2writable.t b/t/v2writable.t
index c7eeee9..44156fe 100644
--- a/t/v2writable.t
+++ b/t/v2writable.t
@@ -7,6 +7,7 @@ use PublicInbox::MIME;
 use PublicInbox::ContentId qw(content_digest);
 use File::Temp qw/tempdir/;
 require './t/common.perl';
+require_git(2.6);
 foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
 	eval "require $mod";
 	plan skip_all => "$mod missing for nntpd.t" if $@;
diff --git a/t/watch_maildir_v2.t b/t/watch_maildir_v2.t
index 3b5d2b8..5f96891 100644
--- a/t/watch_maildir_v2.t
+++ b/t/watch_maildir_v2.t
@@ -5,6 +5,8 @@ use File::Temp qw/tempdir/;
 use PublicInbox::MIME;
 use Cwd;
 use PublicInbox::Config;
+require './t/common.perl';
+require_git(2.6);
 my @mods = qw(Filesys::Notify::Simple PublicInbox::V2Writable);
 foreach my $mod (@mods) {
 	eval "require $mod";
-- 
EW


^ permalink raw reply related	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-01-10  6:59  7% [PATCH 0/3] some dependency cleanups Eric Wong
2019-01-10  6:59  5% ` [PATCH 3/3] check git version requirements 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).