diff options
author | Matt Whitlock <gentoo@mattwhitlock.name> | 2023-10-24 11:43:47 -0400 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2023-10-25 10:37:19 +0200 |
commit | 1494dde4f27b31dd269d646e5ce0298f082c4716 (patch) | |
tree | aa1c78b0ce853912dd895d5faf64300e12716d67 /net-p2p | |
parent | net-p2p/bitcoin-core: switch transitional packages to EAPI=8 (diff) | |
download | gentoo-1494dde4f27b31dd269d646e5ce0298f082c4716.tar.gz gentoo-1494dde4f27b31dd269d646e5ce0298f082c4716.tar.bz2 gentoo-1494dde4f27b31dd269d646e5ce0298f082c4716.zip |
net-p2p/bitcoin-core: add warnings about unlikely USE flag combos
Signed-off-by: Matt Whitlock <gentoo@mattwhitlock.name>
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'net-p2p')
-rw-r--r-- | net-p2p/bitcoin-core/bitcoin-core-25.1.ebuild | 42 |
1 files changed, 38 insertions, 4 deletions
diff --git a/net-p2p/bitcoin-core/bitcoin-core-25.1.ebuild b/net-p2p/bitcoin-core/bitcoin-core-25.1.ebuild index 351ec614e96f..a5818124e34f 100644 --- a/net-p2p/bitcoin-core/bitcoin-core-25.1.ebuild +++ b/net-p2p/bitcoin-core/bitcoin-core-25.1.ebuild @@ -95,6 +95,36 @@ PATCHES=( "${FILESDIR}/init.patch" ) +efmt() { + : ${1:?} ; local l ; while read -r l ; do "${!#}" "${l}" ; done < <(fmt "${@:1:$#-1}") +} + +pkg_pretend() { + if ! use daemon && ! use gui && ! has_version "${CATEGORY}/${PN}[-daemon,-gui(-),-qt5(-)]" ; then + efmt ewarn <<-EOF + You are enabling neither USE="daemon" nor USE="gui". This is a valid + configuration, but you will be unable to run a Bitcoin node using this + installation. + EOF + fi + if use daemon && ! use bitcoin-cli && ! has_version "${CATEGORY}/${PN}[daemon,-bitcoin-cli]" ; then + efmt ewarn <<-EOF + You are enabling USE="daemon" but not USE="bitcoin-cli". This is a valid + configuration, but you will be unable to interact with your bitcoind node + via the command line using this installation. + EOF + fi + if ! use berkdb && ! use sqlite && + { { use daemon && ! has_version "${CATEGORY}/${PN}[daemon,-berkdb,-sqlite]" ; } || + { use gui && ! has_version "${CATEGORY}/${PN}[gui,-berkdb,-sqlite]" ; } ; } + then + efmt ewarn <<-EOF + You are enabling neither USE="berkdb" nor USE="sqlite". This is a valid + configuration, but your Bitcoin node will be unable to open any wallets. + EOF + fi +} + pkg_setup() { use test && python-any-r1_pkg_setup } @@ -209,10 +239,6 @@ src_install() { fi } -efmt() { - : ${1:?} ; local l ; while read -r l ; do "${!#}" "${l}" ; done < <(fmt "${@:1:$#-1}") -} - pkg_preinst() { if use daemon && [[ -d "${EROOT}/var/lib/bitcoin/.bitcoin" ]] ; then if [[ -h "${EROOT}/var/lib/bitcoin/.bitcoin" ]] ; then @@ -254,6 +280,14 @@ pkg_postinst() { - Running bitcoind directly: add that user to the 'tor' user group. EOF fi + + if use bitcoin-cli && use daemon ; then + efmt -su elog <<-EOF + To use bitcoin-cli with the /etc/init.d/bitcoind service: + - Add your user(s) to the 'bitcoin' group. + - Symlink ~/.bitcoin to /var/lib/bitcoind. + EOF + fi } pkg_postrm() { |