git: a2c0bf6cf806 - main - net-p2p/cardano-db-sync: Fixes for the rc script.

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Fri, 07 Oct 2022 06:58:54 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a2c0bf6cf806f007d4a1dd0065a88aec305f61d5

commit a2c0bf6cf806f007d4a1dd0065a88aec305f61d5
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2022-10-07 06:47:24 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2022-10-07 06:58:49 +0000

    net-p2p/cardano-db-sync: Fixes for the rc script.
    
    - Update Cardano network list
    - More sanity checking in prestart
    
    Reported by:    Boris Polujin <boris@zfs.ninja>
---
 net-p2p/cardano-db-sync/Makefile                 | 2 +-
 net-p2p/cardano-db-sync/files/cardano_db_sync.in | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/net-p2p/cardano-db-sync/Makefile b/net-p2p/cardano-db-sync/Makefile
index 864fed7f97df..27c09df523f9 100644
--- a/net-p2p/cardano-db-sync/Makefile
+++ b/net-p2p/cardano-db-sync/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	cardano-db-sync
 PORTVERSION=	13.0.5
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	net-p2p databases
 
 PATCH_SITES=	https://arrowd.name/:freebsd_compat
diff --git a/net-p2p/cardano-db-sync/files/cardano_db_sync.in b/net-p2p/cardano-db-sync/files/cardano_db_sync.in
index f9f9e976350c..9465443c4703 100644
--- a/net-p2p/cardano-db-sync/files/cardano_db_sync.in
+++ b/net-p2p/cardano-db-sync/files/cardano_db_sync.in
@@ -43,7 +43,7 @@ command=%%PREFIX%%/bin/cardano-db-sync
 
 cardano_deployment_url="https://raw.githubusercontent.com/cardano-bsd-alliance/freebsd-ports-cardano-artifacts/master/cardano-db-sync"
 cardano_config_files="config db-sync-config byron-genesis shelley-genesis alonzo-genesis"
-cardano_networks="mainnet testnet"
+cardano_networks="mainnet preview preprod"
 
 start_cmd="${name}_start"
 start_precmd="${name}_prestart"
@@ -87,6 +87,12 @@ sanity_check()
         echo "Did you setup postgresql database access?"
         exit 1
     fi
+    if [ ! -d `dirname ${cardano_db_sync_cnode_socket}` ]
+    then
+        echo "The directory for the socket file ${cardano_db_sync_cnode_socket} is missing"
+        echo "Cardano-node is not running and/or wrong path specified for /jail/socket/ dir"
+        exit 1
+    fi
     return 0
 }