Skip to content

Commit 5e53c72

Browse files
reqlezerikd
authored andcommitted
db-tool: Remove hardcoded arch + bsd cmd output mod
- un-hardcode arch + bsd cmd output mod
1 parent 979e900 commit 5e53c72

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cardano-db-tool/src/Cardano/DbTool/PrepareSnapshot.hs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import Ouroboros.Network.Block hiding (blockHash)
1818

1919
import Paths_cardano_db_tool (version)
2020

21+
import System.Info (arch, os)
2122
import System.IO (hFlush, stdout)
2223

2324
newtype PrepareSnapshotArgs = PrepareSnapshotArgs
@@ -93,12 +94,16 @@ runPrepareSnapshotAux firstTry args = do
9394
majorStr = case mMajor of
9495
Nothing -> ""
9596
Just majorV -> "schema-" ++ show majorV
97+
cmdStr = "Create a snapshot with:\n"
98+
++ case os of
99+
"freebsd" -> " cardano-db-sync-pgsql-setup"
100+
_otherwise -> " scripts/postgresql-setup.sh"
101+
++ " --create-snapshot db-sync-snapshot-"
96102
putStrLn $ concat
97-
[ "Create a snapshot with:\n"
98-
, " scripts/postgresql-setup.sh --create-snapshot db-sync-snapshot-"
103+
[ cmdStr
99104
, majorStr
100105
, "-block-"
101106
, show bblockNo
102-
, "-x86_64 "
107+
, "-" ++ arch ++ " "
103108
, fp
104109
]

0 commit comments

Comments
 (0)