Skip to content

Commit

Permalink
scripted-diff: Rename PACKAGE_* variables to CLIENT_*
Browse files Browse the repository at this point in the history
This change ensures consistent use of the `CLIENT_` namespace everywhere
in the repository.

-BEGIN VERIFY SCRIPT-

ren() { sed -i "s/\<$1\>/$2/g" $( git grep -l "$1" ./cmake ./src :\(exclude\)./src/secp256k1 ./test ) ; }

ren PACKAGE_NAME      CLIENT_NAME
ren PACKAGE_VERSION   CLIENT_VERSION_STRING
ren PACKAGE_URL       CLIENT_URL
ren PACKAGE_BUGREPORT CLIENT_BUGREPORT

-END VERIFY SCRIPT-
  • Loading branch information
hebasto committed Oct 28, 2024
1 parent 332655c commit 7071330
Show file tree
Hide file tree
Showing 48 changed files with 115 additions and 115 deletions.
8 changes: 4 additions & 4 deletions cmake/bitcoin-build-config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,16 @@
#cmakedefine HAVE_VM_VM_PARAM_H 1

/* Define to the address where bug reports for this package should be sent. */
#define PACKAGE_BUGREPORT "@CLIENT_BUGREPORT@"
#define CLIENT_BUGREPORT "@CLIENT_BUGREPORT@"

/* Define to the full name of this package. */
#define PACKAGE_NAME "@CLIENT_NAME@"
#define CLIENT_NAME "@CLIENT_NAME@"

/* Define to the home page for this package. */
#define PACKAGE_URL "@PROJECT_HOMEPAGE_URL@"
#define CLIENT_URL "@PROJECT_HOMEPAGE_URL@"

/* Define to the version of this package. */
#define PACKAGE_VERSION "@CLIENT_VERSION_STRING@"
#define CLIENT_VERSION_STRING "@CLIENT_VERSION_STRING@"

/* Define to 1 if strerror_r returns char *. */
#cmakedefine STRERROR_R_CHAR_P 1
Expand Down
4 changes: 2 additions & 2 deletions src/addrdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ bool CBanDB::Write(const banmap_t& banSet)
bool CBanDB::Read(banmap_t& banSet)
{
if (fs::exists(m_banlist_dat)) {
LogPrintf("banlist.dat ignored because it can only be read by " PACKAGE_NAME " version 22.x. Remove %s to silence this warning.\n", fs::quoted(fs::PathToString(m_banlist_dat)));
LogPrintf("banlist.dat ignored because it can only be read by " CLIENT_NAME " version 22.x. Remove %s to silence this warning.\n", fs::quoted(fs::PathToString(m_banlist_dat)));
}
// If the JSON banlist does not exist, then recreate it
if (!fs::exists(m_banlist_json)) {
Expand Down Expand Up @@ -215,7 +215,7 @@ util::Result<std::unique_ptr<AddrMan>> LoadAddrman(const NetGroupManager& netgro
DumpPeerAddresses(args, *addrman);
} catch (const std::exception& e) {
return util::Error{strprintf(_("Invalid or corrupt peers.dat (%s). If you believe this is a bug, please report it to %s. As a workaround, you can move the file (%s) out of the way (rename, move, or delete) to have a new one created on the next start."),
e.what(), PACKAGE_BUGREPORT, fs::quoted(fs::PathToString(path_addr)))};
e.what(), CLIENT_BUGREPORT, fs::quoted(fs::PathToString(path_addr)))};
}
return addrman;
}
Expand Down
2 changes: 1 addition & 1 deletion src/addrman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void AddrManImpl::Unserialize(Stream& s_)
throw InvalidAddrManVersionError(strprintf(
"Unsupported format of addrman database: %u. It is compatible with formats >=%u, "
"but the maximum supported by this version of %s is %u.",
uint8_t{format}, lowest_compatible, PACKAGE_NAME, uint8_t{FILE_FORMAT}));
uint8_t{format}, lowest_compatible, CLIENT_NAME, uint8_t{FILE_FORMAT}));
}

s >> nKey;
Expand Down
6 changes: 3 additions & 3 deletions src/bitcoin-cli-res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " PACKAGE_NAME ")"
VALUE "FileVersion", PACKAGE_VERSION
VALUE "FileDescription", "bitcoin-cli (JSON-RPC client for " CLIENT_NAME ")"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-cli"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "bitcoin-cli.exe"
VALUE "ProductName", "bitcoin-cli"
VALUE "ProductVersion", PACKAGE_VERSION
VALUE "ProductVersion", CLIENT_VERSION_STRING
END
END

Expand Down
8 changes: 4 additions & 4 deletions src/bitcoin-cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ static int AppInitRPC(int argc, char* argv[])
return EXIT_FAILURE;
}
if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
std::string strUsage = PACKAGE_NAME " RPC client version " + FormatFullVersion() + "\n";
std::string strUsage = CLIENT_NAME " RPC client version " + FormatFullVersion() + "\n";

if (gArgs.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\n"
"Usage: bitcoin-cli [options] <command> [params] Send command to " PACKAGE_NAME "\n"
"or: bitcoin-cli [options] -named <command> [name=value]... Send command to " PACKAGE_NAME " (with named arguments)\n"
"Usage: bitcoin-cli [options] <command> [params] Send command to " CLIENT_NAME "\n"
"or: bitcoin-cli [options] -named <command> [name=value]... Send command to " CLIENT_NAME " (with named arguments)\n"
"or: bitcoin-cli [options] help List commands\n"
"or: bitcoin-cli [options] help <command> Get help for a command\n";
strUsage += "\n" + gArgs.GetHelpMessage();
Expand Down Expand Up @@ -535,7 +535,7 @@ class NetinfoRequestHandler : public BaseRequestHandler
}

// Generate report header.
std::string result{strprintf("%s client %s%s - server %i%s\n\n", PACKAGE_NAME, FormatFullVersion(), ChainToString(), networkinfo["protocolversion"].getInt<int>(), networkinfo["subversion"].get_str())};
std::string result{strprintf("%s client %s%s - server %i%s\n\n", CLIENT_NAME, FormatFullVersion(), ChainToString(), networkinfo["protocolversion"].getInt<int>(), networkinfo["subversion"].get_str())};

// Report detailed peer connections list sorted by direction and minimum ping time.
if (DetailsRequested() && !m_peers.empty()) {
Expand Down
4 changes: 2 additions & 2 deletions src/bitcoin-tx-res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "FileDescription", "bitcoin-tx (CLI Bitcoin transaction editor utility)"
VALUE "FileVersion", PACKAGE_VERSION
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-tx"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "bitcoin-tx.exe"
VALUE "ProductName", "bitcoin-tx"
VALUE "ProductVersion", PACKAGE_VERSION
VALUE "ProductVersion", CLIENT_VERSION_STRING
END
END

Expand Down
2 changes: 1 addition & 1 deletion src/bitcoin-tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int AppInitRawTx(int argc, char* argv[])

if (argc < 2 || HelpRequested(gArgs) || gArgs.IsArgSet("-version")) {
// First part of help message is specific to this utility
std::string strUsage = PACKAGE_NAME " bitcoin-tx utility version " + FormatFullVersion() + "\n";
std::string strUsage = CLIENT_NAME " bitcoin-tx utility version " + FormatFullVersion() + "\n";

if (gArgs.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo());
Expand Down
4 changes: 2 additions & 2 deletions src/bitcoin-util-res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "FileDescription", "bitcoin-util (CLI Bitcoin utility)"
VALUE "FileVersion", PACKAGE_VERSION
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-util"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "bitcoin-util.exe"
VALUE "ProductName", "bitcoin-util"
VALUE "ProductVersion", PACKAGE_VERSION
VALUE "ProductVersion", CLIENT_VERSION_STRING
END
END

Expand Down
2 changes: 1 addition & 1 deletion src/bitcoin-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int AppInitUtil(ArgsManager& args, int argc, char* argv[])

if (HelpRequested(args) || args.IsArgSet("-version")) {
// First part of help message is specific to this utility
std::string strUsage = PACKAGE_NAME " bitcoin-util utility version " + FormatFullVersion() + "\n";
std::string strUsage = CLIENT_NAME " bitcoin-util utility version " + FormatFullVersion() + "\n";

if (args.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo());
Expand Down
6 changes: 3 additions & 3 deletions src/bitcoin-wallet-res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ BEGIN
BLOCK "040904E4" // U.S. English - multilingual (hex)
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "FileDescription", "bitcoin-wallet (CLI tool for " PACKAGE_NAME " wallets)"
VALUE "FileVersion", PACKAGE_VERSION
VALUE "FileDescription", "bitcoin-wallet (CLI tool for " CLIENT_NAME " wallets)"
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoin-wallet"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "bitcoin-wallet.exe"
VALUE "ProductName", "bitcoin-wallet"
VALUE "ProductVersion", PACKAGE_VERSION
VALUE "ProductVersion", CLIENT_VERSION_STRING
END
END

Expand Down
4 changes: 2 additions & 2 deletions src/bitcoin-wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ static std::optional<int> WalletAppInit(ArgsManager& args, int argc, char* argv[
}
const bool missing_args{argc < 2};
if (missing_args || HelpRequested(args) || args.IsArgSet("-version")) {
std::string strUsage = strprintf("%s bitcoin-wallet version", PACKAGE_NAME) + " " + FormatFullVersion() + "\n";
std::string strUsage = strprintf("%s bitcoin-wallet version", CLIENT_NAME) + " " + FormatFullVersion() + "\n";

if (args.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\n"
"bitcoin-wallet is an offline tool for creating and interacting with " PACKAGE_NAME " wallet files.\n"
"bitcoin-wallet is an offline tool for creating and interacting with " CLIENT_NAME " wallet files.\n"
"By default bitcoin-wallet will act on wallets in the default mainnet wallet directory in the datadir.\n"
"To change the target wallet, use the -datadir, -wallet and -regtest/-signet/-testnet/-testnet4 arguments.\n\n"
"Usage:\n"
Expand Down
4 changes: 2 additions & 2 deletions src/bitcoind-res.rc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ BEGIN
BEGIN
VALUE "CompanyName", "Bitcoin"
VALUE "FileDescription", "bitcoind (Bitcoin node with a JSON-RPC server)"
VALUE "FileVersion", PACKAGE_VERSION
VALUE "FileVersion", CLIENT_VERSION_STRING
VALUE "InternalName", "bitcoind"
VALUE "LegalCopyright", COPYRIGHT_STR
VALUE "LegalTrademarks1", "Distributed under the MIT software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php."
VALUE "OriginalFilename", "bitcoind.exe"
VALUE "ProductName", "bitcoind"
VALUE "ProductVersion", PACKAGE_VERSION
VALUE "ProductVersion", CLIENT_VERSION_STRING
END
END

Expand Down
6 changes: 3 additions & 3 deletions src/bitcoind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ static bool ProcessInitCommands(ArgsManager& args)
{
// Process help and version before taking care about datadir
if (HelpRequested(args) || args.IsArgSet("-version")) {
std::string strUsage = PACKAGE_NAME " version " + FormatFullVersion() + "\n";
std::string strUsage = CLIENT_NAME " version " + FormatFullVersion() + "\n";

if (args.IsArgSet("-version")) {
strUsage += FormatParagraph(LicenseInfo());
} else {
strUsage += "\nUsage: bitcoind [options] Start " PACKAGE_NAME "\n"
strUsage += "\nUsage: bitcoind [options] Start " CLIENT_NAME "\n"
"\n";
strUsage += args.GetHelpMessage();
}
Expand Down Expand Up @@ -195,7 +195,7 @@ static bool AppInit(NodeContext& node)

if (args.GetBoolArg("-daemon", DEFAULT_DAEMON) || args.GetBoolArg("-daemonwait", DEFAULT_DAEMONWAIT)) {
#if HAVE_DECL_FORK
tfm::format(std::cout, PACKAGE_NAME " starting\n");
tfm::format(std::cout, CLIENT_NAME " starting\n");

// Daemonize
switch (fork_daemon(1, 0, daemon_ep)) { // don't chdir (1), do close FDs (0)
Expand Down
4 changes: 2 additions & 2 deletions src/clientversion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const std::string UA_NAME("Satoshi");
#define BUILD_DESC BUILD_GIT_TAG
#define BUILD_SUFFIX ""
#else
#define BUILD_DESC "v" PACKAGE_VERSION
#define BUILD_DESC "v" CLIENT_VERSION_STRING
#if CLIENT_VERSION_IS_RELEASE
#define BUILD_SUFFIX ""
#elif defined(BUILD_GIT_COMMIT)
Expand Down Expand Up @@ -88,7 +88,7 @@ std::string LicenseInfo()
return CopyrightHolders(strprintf(_("Copyright (C) %i-%i").translated, 2009, COPYRIGHT_YEAR) + " ") + "\n" +
"\n" +
strprintf(_("Please contribute if you find %s useful. "
"Visit %s for further information about the software.").translated, PACKAGE_NAME, "<" PACKAGE_URL ">") +
"Visit %s for further information about the software.").translated, CLIENT_NAME, "<" CLIENT_URL ">") +
"\n" +
strprintf(_("The source code is available from %s.").translated, URL_SOURCE_CODE) +
"\n" +
Expand Down
2 changes: 1 addition & 1 deletion src/common/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ bool WriteSettings(const fs::path& path,
SettingsValue out(SettingsValue::VOBJ);
// Add auto-generated warning comment
out.pushKV(SETTINGS_WARN_MSG_KEY, strprintf("This file is automatically generated and updated by %s. Please do not edit this file while the node "
"is running, as any changes might be ignored or overwritten.", PACKAGE_NAME));
"is running, as any changes might be ignored or overwritten.", CLIENT_NAME));
// Push settings values
for (const auto& value : values) {
out.pushKVEnd(value.first, value.second);
Expand Down
6 changes: 3 additions & 3 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ static bool LockDataDirectory(bool probeOnly)
case util::LockResult::ErrorWrite:
return InitError(strprintf(_("Cannot write to data directory '%s'; check permissions."), fs::PathToString(datadir)));
case util::LockResult::ErrorLock:
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), fs::PathToString(datadir), PACKAGE_NAME));
return InitError(strprintf(_("Cannot obtain a lock on data directory %s. %s is probably already running."), fs::PathToString(datadir), CLIENT_NAME));
case util::LockResult::Success: return true;
} // no default case, so the compiler can warn about missing cases
assert(false);
Expand All @@ -1091,11 +1091,11 @@ bool AppInitSanityChecks(const kernel::Context& kernel)
auto result{kernel::SanityChecks(kernel)};
if (!result) {
InitError(util::ErrorString(result));
return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), PACKAGE_NAME));
return InitError(strprintf(_("Initialization sanity check failed. %s is shutting down."), CLIENT_NAME));
}

if (!ECC_InitSanityCheck()) {
return InitError(strprintf(_("Elliptic curve cryptography sanity check failure. %s is shutting down."), PACKAGE_NAME));
return InitError(strprintf(_("Elliptic curve cryptography sanity check failure. %s is shutting down."), CLIENT_NAME));
}

// Probe the data directory lock to give an early error message, if possible
Expand Down
2 changes: 1 addition & 1 deletion src/init/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ void LogPackageVersion()
#else
version_string += " (release build)";
#endif
LogPrintf(PACKAGE_NAME " version %s\n", version_string);
LogPrintf(CLIENT_NAME " version %s\n", version_string);
}
} // namespace init
2 changes: 1 addition & 1 deletion src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3094,7 +3094,7 @@ bool CConnman::BindListenPort(const CService& addrBind, bilingual_str& strError,
if (sock->Bind(reinterpret_cast<struct sockaddr*>(&sockaddr), len) == SOCKET_ERROR) {
int nErr = WSAGetLastError();
if (nErr == WSAEADDRINUSE)
strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToStringAddrPort(), PACKAGE_NAME);
strError = strprintf(_("Unable to bind to %s on this computer. %s is probably already running."), addrBind.ToStringAddrPort(), CLIENT_NAME);
else
strError = strprintf(_("Unable to bind to %s on this computer (bind returned error %s)"), addrBind.ToStringAddrPort(), NetworkErrorString(nErr));
LogPrintLevel(BCLog::NET, BCLog::Level::Error, "%s\n", strError.original);
Expand Down
Loading

0 comments on commit 7071330

Please sign in to comment.