]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ExtSearchIdx.pm
use rel2abs_collapsed when loading Inbox objects
[public-inbox.git] / lib / PublicInbox / ExtSearchIdx.pm
index 3764612cf149c9281c9b8e3b21603f3c0e859486..c4b429df0cf8b5c8e71642d9e2d677837574d15e 100644 (file)
@@ -63,7 +63,6 @@ sub new {
 
 sub attach_inbox {
        my ($self, $ibx) = @_;
-       $ibx = PublicInbox::InboxWritable->new($ibx);
        my $key = $ibx->eidx_key;
        if (!$ibx->over || !$ibx->mm) {
                warn "W: skipping $key (unindexed)\n";
@@ -73,12 +72,6 @@ sub attach_inbox {
                warn "W: skipping $key (no UIDVALIDITY)\n";
                return;
        }
-       my $ibxdir = File::Spec->canonpath($ibx->{inboxdir});
-       if ($ibxdir ne $ibx->{inboxdir}) {
-               warn "W: `$ibx->{inboxdir}' canonicalized to `$ibxdir'\n";
-               $ibx->{inboxdir} = $ibxdir;
-       }
-       $ibx = PublicInbox::InboxWritable->new($ibx);
        $self->{ibx_map}->{$key} //= do {
                push @{$self->{ibx_list}}, $ibx;
                $ibx;
@@ -532,8 +525,10 @@ sub host_ident () {
        state $retval = hostname . '-' . do {
                my $m; # machine-id(5) is systemd
                if (open(my $fh, '<', '/etc/machine-id')) { $m = <$fh> }
-               # hostid(1) is in GNU coreutils, kern.hostid is FreeBSD
-               chomp($m ||= `hostid` || `sysctl -n kern.hostid`);
+               # (g)hostid(1) is in GNU coreutils, kern.hostid is most BSDs
+               chomp($m ||= `{ sysctl -n kern.hostid ||
+                               hostid || ghostid; } 2>/dev/null`
+                       || "no-machine-id-or-hostid-on-$^O");
                $m;
        };
 }