aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/debian/copyright2
-rw-r--r--contrib/debian/manpages/bitcoin-cli.128
-rw-r--r--contrib/debian/manpages/bitcoin-qt.1186
-rw-r--r--contrib/debian/manpages/bitcoin.conf.566
-rw-r--r--contrib/debian/manpages/bitcoind.1177
-rw-r--r--contrib/devtools/README.md20
-rwxr-xr-xcontrib/devtools/clang-format-diff.py164
-rwxr-xr-xcontrib/devtools/fix-copyright-headers.py69
-rwxr-xr-xcontrib/devtools/security-check.py2
-rwxr-xr-xcontrib/devtools/update-translations.py9
-rw-r--r--contrib/gitian-descriptors/gitian-linux.yml4
-rw-r--r--contrib/gitian-descriptors/gitian-osx-signer.yml3
-rw-r--r--contrib/gitian-descriptors/gitian-osx.yml4
-rw-r--r--contrib/gitian-descriptors/gitian-win-signer.yml2
-rw-r--r--contrib/gitian-descriptors/gitian-win.yml4
15 files changed, 242 insertions, 498 deletions
diff --git a/contrib/debian/copyright b/contrib/debian/copyright
index 83ce560a79..bbaa5b1636 100644
--- a/contrib/debian/copyright
+++ b/contrib/debian/copyright
@@ -5,7 +5,7 @@ Upstream-Contact: Satoshi Nakamoto <satoshin@gmx.com>
Source: https://github.com/bitcoin/bitcoin
Files: *
-Copyright: 2009-2015, Bitcoin Core Developers
+Copyright: 2009-2016, Bitcoin Core Developers
License: Expat
Comment: The Bitcoin Core Developers encompasses the current developers listed on bitcoin.org,
as well as the numerous contributors to the project.
diff --git a/contrib/debian/manpages/bitcoin-cli.1 b/contrib/debian/manpages/bitcoin-cli.1
index 154b458739..16c338dd3e 100644
--- a/contrib/debian/manpages/bitcoin-cli.1
+++ b/contrib/debian/manpages/bitcoin-cli.1
@@ -1,4 +1,4 @@
-.TH BITCOIN-CLI "1" "February 2015" "bitcoin-cli 0.10"
+.TH BITCOIN-CLI "1" "February 2016" "bitcoin-cli 0.12"
.SH NAME
bitcoin-cli \- a remote procedure call client for Bitcoin Core.
.SH SYNOPSIS
@@ -11,31 +11,7 @@ This manual page documents the bitcoin-cli program. bitcoin-cli is an RPC client
.SH OPTIONS
.TP
\fB\-?\fR
-Show the help message.
-.TP
-\fB\-conf=\fR<file>
-Specify configuration file (default: bitcoin.conf).
-.TP
-\fB\-datadir=\fR<dir>
-Specify data directory.
-.TP
-\fB\-testnet\fR
-Connect to a Bitcoin Core instance running in testnet mode.
-.TP
-\fB\-regtest\fR
-Connect to a Bitcoin Core instance running in regtest mode (see documentation for -regtest on bitcoind).
-.TP
-\fB\-rpcuser=\fR<user>
-Username for JSON\-RPC connections.
-.TP
-\fB\-rpcpassword=\fR<pw>
-Password for JSON\-RPC connections.
-.TP
-\fB\-rpcport=\fR<port>
-Listen for JSON\-RPC connections on <port> (default: 8332 or testnet: 18332).
-.TP
-\fB\-rpcconnect=\fR<ip>
-Send commands to node running on <ip> (default: 127.0.0.1).
+Show possible options.
.SH "SEE ALSO"
\fBbitcoind\fP, \fBbitcoin.conf\fP
diff --git a/contrib/debian/manpages/bitcoin-qt.1 b/contrib/debian/manpages/bitcoin-qt.1
index 05eadc94cd..685a282080 100644
--- a/contrib/debian/manpages/bitcoin-qt.1
+++ b/contrib/debian/manpages/bitcoin-qt.1
@@ -1,4 +1,4 @@
-.TH BITCOIN-QT "1" "April 2013" "bitcoin-qt 1"
+.TH BITCOIN-QT "1" "February 2016" "bitcoin-qt 0.12"
.SH NAME
bitcoin-qt \- peer-to-peer network based digital currency
.SH DESCRIPTION
@@ -8,184 +8,6 @@ bitcoin\-qt [command\-line options]
.SH OPTIONS
.TP
\-?
-This help message
-.TP
-\fB\-conf=\fR<file>
-Specify configuration file (default: bitcoin.conf)
-.TP
-\fB\-pid=\fR<file>
-Specify pid file (default: bitcoind.pid)
-.TP
-\fB\-gen\fR
-Generate coins
-.TP
-\fB\-gen\fR=\fI0\fR
-Don't generate coins
-.TP
-\fB\-datadir=\fR<dir>
-Specify data directory
-.TP
-\fB\-dbcache=\fR<n>
-Set database cache size in megabytes (default: 25)
-.TP
-\fB\-timeout=\fR<n>
-Specify connection timeout in milliseconds (default: 5000)
-.TP
-\fB\-proxy=\fR<ip:port>
-Connect through SOCKS5 proxy
-.TP
-\fB\-tor=\fR<ip:port>
-Use proxy to reach tor hidden services (default: same as \fB\-proxy\fR)
-.TP
-\fB\-dns\fR
-Allow DNS lookups for \fB\-addnode\fR, \fB\-seednode\fR and \fB\-connect\fR
-.TP
-\fB\-port=\fR<port>
-Listen for connections on <port> (default: 8333 or testnet: 18333)
-.TP
-\fB\-maxconnections=\fR<n>
-Maintain at most <n> connections to peers (default: 125)
-.TP
-\fB\-addnode=\fR<ip>
-Add a node to connect to and attempt to keep the connection open
-.TP
-\fB\-connect=\fR<ip>
-Connect only to the specified node(s)
-.TP
-\fB\-seednode=\fR<ip>
-Connect to a node to retrieve peer addresses, and disconnect
-.TP
-\fB\-externalip=\fR<ip>
-Specify your own public address
-.TP
-\fB\-onlynet=\fR<net>
-Only connect to nodes in network <net> (IPv4, IPv6 or Tor)
-.TP
-\fB\-discover\fR
-Discover own IP address (default: 1 when listening and no \fB\-externalip\fR)
-.TP
-\fB\-checkpoints\fR
-Only accept block chain matching built\-in checkpoints (default: 1)
-.TP
-\fB\-listen\fR
-Accept connections from outside (default: 1 if no \fB\-proxy\fR or \fB\-connect\fR)
-.TP
-\fB\-bind=\fR<addr>
-Bind to given address and always listen on it. Use [host]:port notation for IPv6
-.TP
-\fB\-dnsseed\fR
-Find peers using DNS lookup (default: 1 unless \fB\-connect\fR)
-.TP
-\fB\-banscore=\fR<n>
-Threshold for disconnecting misbehaving peers (default: 100)
-.TP
-\fB\-bantime=\fR<n>
-Number of seconds to keep misbehaving peers from reconnecting (default: 86400)
-.TP
-\fB\-maxreceivebuffer=\fR<n>
-Maximum per\-connection receive buffer, <n>*1000 bytes (default: 5000)
-.TP
-\fB\-maxsendbuffer=\fR<n>
-Maximum per\-connection send buffer, <n>*1000 bytes (default: 1000)
-.TP
-\fB\-upnp\fR
-Use UPnP to map the listening port (default: 1 when listening)
-.TP
-\fB\-paytxfee=\fR<amt>
-Fee per KB to add to transactions you send
-.TP
-\fB\-server\fR
-Accept command line and JSON\-RPC commands
-.TP
-\fB\-testnet\fR
-Use the test network
-.TP
-\fB\-debug\fR
-Output extra debugging information. Implies all other \fB\-debug\fR* options
-.TP
-\fB\-debugnet\fR
-Output extra network debugging information
-.TP
-\fB\-logtimestamps\fR
-Prepend debug output with timestamp
-.TP
-\fB\-shrinkdebugfile\fR
-Shrink debug.log file on client startup (default: 1 when no \fB\-debug\fR)
-.TP
-\fB\-printtoconsole\fR
-Send trace/debug info to console instead of debug.log file
-.TP
-\fB\-rpcuser=\fR<user>
-Username for JSON\-RPC connections
-.TP
-\fB\-rpcpassword=\fR<pw>
-Password for JSON\-RPC connections
-.TP
-\fB\-rpcport=\fR<port>
-Listen for JSON\-RPC connections on <port> (default: 8332 or testnet: 18332)
-.TP
-\fB\-rpcallowip=\fR<ip>
-Allow JSON\-RPC connections from specified IP address
-.TP
-\fB\-rpcthreads=\fR<n>
-Set the number of threads to service RPC calls (default: 4)
-.TP
-\fB\-blocknotify=\fR<cmd>
-Execute command when the best block changes (%s in cmd is replaced by block hash)
-.TP
-\fB\-walletnotify=\fR<cmd>
-Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)
-.TP
-\fB\-alertnotify=\fR<cmd>
-Execute command when a relevant alert is received (%s in cmd is replaced by message)
-.TP
-\fB\-upgradewallet\fR
-Upgrade wallet to latest format
-.TP
-\fB\-keypool=\fR<n>
-Set key pool size to <n> (default: 100)
-.TP
-\fB\-rescan\fR
-Rescan the block chain for missing wallet transactions
-.TP
-\fB\-salvagewallet\fR
-Attempt to recover private keys from a corrupt wallet.dat
-.TP
-\fB\-checkblocks=\fR<n>
-How many blocks to check at startup (default: 288, 0 = all)
-.TP
-\fB\-checklevel=\fR<n>
-How thorough the block verification is (0\-4, default: 3)
-.TP
-\fB\-txindex\fR
-Maintain a full transaction index (default: 0)
-.TP
-\fB\-loadblock=\fR<file>
-Imports blocks from external blk000??.dat file
-.TP
-\fB\-reindex\fR
-Rebuild block chain index from current blk000??.dat files
-.TP
-\fB\-par=\fR<n>
-Set the number of script verification threads (1\-16, 0=auto, default: 0)
-.SS "Block creation options:"
-.TP
-\fB\-blockminsize=\fR<n>
-Set minimum block size in bytes (default: 0)
-.TP
-\fB\-blockmaxsize=\fR<n>
-Set maximum block size in bytes (default: 250000)
-.HP
-\fB\-blockprioritysize=\fR<n> Set maximum size of high\-priority/low\-fee transactions in bytes (default: 27000)
-.PP
-Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)
-.SS "UI options:"
-.TP
-\fB\-lang=\fR<lang>
-Set language, for example "de_DE" (default: system locale)
-.TP
-\fB\-min\fR
-Start minimized
-.TP
-\fB\-splash\fR
-Show splash screen on startup (default: 1)
+List options.
+.SH "SEE ALSO"
+bitcoind(1)
diff --git a/contrib/debian/manpages/bitcoin.conf.5 b/contrib/debian/manpages/bitcoin.conf.5
index 0cf4d991e3..839dc26c1a 100644
--- a/contrib/debian/manpages/bitcoin.conf.5
+++ b/contrib/debian/manpages/bitcoin.conf.5
@@ -1,75 +1,15 @@
-.TH BITCOIN.CONF "5" "January 2011" "bitcoin.conf 3.19"
+.TH BITCOIN.CONF "5" "February 2016" "bitcoin.conf 0.12"
.SH NAME
bitcoin.conf \- bitcoin configuration file
.SH SYNOPSIS
All command-line options (except for '\-conf') may be specified in a configuration file, and all configuration file options may also be specified on the command line. Command-line options override values set in the configuration file.
.TP
-The configuration file is a list of 'setting=value' pairs, one per line, with optional comments starting with the '#' character.
+The configuration file is a list of 'setting=value' pairs, one per line, with optional comments starting with the '#' character. Please refer to bitcoind(1) for a up to date list of valid options.
.TP
The configuration file is not automatically created; you can create it using your favorite plain-text editor. By default, bitcoind(1) will look for a file named bitcoin.conf(5) in the bitcoin data directory, but both the data directory and the configuration file path may be changed using the '\-datadir' and '\-conf' command-line arguments.
.SH LOCATION
bitcoin.conf should be located in $HOME/.bitcoin
-.SH NETWORK-RELATED SETTINGS
-.TP
-.TP
-\fBtestnet=\fR[\fI'1'\fR|\fI'0'\fR]
-Enable or disable run on the test network instead of the real *bitcoin* network.
-.TP
-\fBproxy=\fR\fI'127.0.0.1:9050'\fR
-Connect via a socks4 proxy.
-.TP
-\fBaddnode=\fR\fI'10.0.0.2:8333'\fR
-Use as many *addnode=* settings as you like to connect to specific peers.
-.TP
-\fBconnect=\fR\fI'10.0.0.1:8333'\fR
-Use as many *connect=* settings as you like to connect ONLY to specific peers.
-.TP
-\fRmaxconnections=\fR\fI'value'\fR
-Maximum number of inbound+outbound connections.
-.SH JSON-RPC OPTIONS
-.TP
-\fBserver=\fR[\fI'1'\fR|\fI'0'\fR]
-Tells *bitcoin* to accept or not accept JSON-RPC commands.
-.TP
-\fBrpcuser=\fR\fI'username'\fR
-You must set *rpcuser* to secure the JSON-RPC api.
-.TP
-\fBrpcpassword=\fR\fI'password'\fR
-You must set *rpcpassword* to secure the JSON-RPC api.
-.TP
-\fBrpcallowip=\fR\fI'192.168.1.*'\fR
-By default, only RPC connections from localhost are allowed. Specify as many *rpcallowip=* settings as you like to allow connections from other hosts (and you may use * as a wildcard character).
-.TP
-\fBrpcport=\fR\fI'8332'\fR
-Listen for RPC connections on this TCP port.
-.TP
-\fBrpcconnect=\fR\fI'127.0.0.1'\fR
-You can use *bitcoin* or *bitcoind(1)* to send commands to *bitcoin*/*bitcoind(1)* running on another host using this option.
-.TP
-.SH MISCELLANEOUS OPTIONS
-.TP
-\fBgen=\fR[\fI'0'\fR|\fI'1'\fR]
-Enable or disable attempt to generate bitcoins.
-.TP
-\fB4way=\fR[\fI'0'\fR|\fI'1'\fR]
-Enable or disable use SSE instructions to try to generate bitcoins faster.
-.TP
-\fBkeypool=\fR\fI'100'\fR
-Pre-generate this many public/private key pairs, so wallet backups will be valid for both prior transactions and several dozen future transactions.
-.TP
-\fBpaytxfee=\fR\fI'0.00'\fR
-Pay an optional transaction fee every time you send bitcoins. Transactions with fees are more likely than free transactions to be included in generated blocks, so may be validated sooner.
-.TP
-\fBallowreceivebyip=\fR\fI'1'\fR
-Allow direct connections for the 'pay via IP address' feature.
-.TP
-.SH USER INTERFACE OPTIONS
-.TP
-\fBmin=\fR[\fI'0'\fR|\fI'1'\fR]
-Enable or disable start bitcoind minimized.
-.TP
-\fBminimizetotray=\fR[\fI'0'\fR|\fI'1'\fR]
-Enable or disable minimize to the system tray.
+
.SH "SEE ALSO"
bitcoind(1)
.SH AUTHOR
diff --git a/contrib/debian/manpages/bitcoind.1 b/contrib/debian/manpages/bitcoind.1
index 5b0f2921aa..5c3e52f441 100644
--- a/contrib/debian/manpages/bitcoind.1
+++ b/contrib/debian/manpages/bitcoind.1
@@ -1,4 +1,4 @@
-.TH BITCOIND "1" "January 2011" "bitcoind 3.19"
+.TH BITCOIND "1" "February 2016" "bitcoind 0.12"
.SH NAME
bitcoind \- peer-to-peer network based digital currency
.SH SYNOPSIS
@@ -6,185 +6,20 @@ bitcoin [options] <command> [params]
.TP
bitcoin [options] help <command> \- Get help for a command
.SH DESCRIPTION
-This manual page documents the bitcoind program. Bitcoin is a peer-to-peer digital currency. Peer-to-peer (P2P) means that there is no central authority to issue new money or keep track of transactions. Instead, these tasks are managed collectively by the nodes of the network. Advantages:
-
-Bitcoins can be sent easily through the Internet, without having to trust middlemen. Transactions are designed to be irreversible. Be safe from instability caused by fractional reserve banking and central banks. The limited inflation of the Bitcoin system’s money supply is distributed evenly (by CPU power) throughout the network, not monopolized by banks.
+This manual page documents the bitcoind program. Bitcoin is an experimental new digital currency that enables instant payments to anyone, anywhere in the world. Bitcoin uses peer-to-peer technology to operate with no central authority: managing transactions and issuing money are carried out collectively by the network. Bitcoin Core is the name of open source software which enables the use of this currency.
.SH OPTIONS
.TP
-\fB\-conf=\fR<file>
-Specify configuration file (default: bitcoin.conf)
-.TP
-\fB\-gen\fR
-Generate coins
-.TP
-\fB\-gen\fR=\fI0\fR
-Don't generate coins
-.TP
-\fB\-min\fR
-Start minimized
-.TP
-\fB\-datadir=\fR<dir>
-Specify data directory
-.TP
-\fB\-proxy=\fR<ip:port>
-Connect through SOCKS5 proxy
-.TP
-\fB\-addnode=\fR<ip>
-Add a node to connect to
-.TP
-\fB\-connect=\fR<ip>
-Connect only to the specified node
-.TP
-\fB\-paytxfee=\fR<amt>
-Fee per KB to add to transactions you send
-.TP
-\fB\-server\fR
-Accept command line and JSON\-RPC commands
-.TP
-\fB\-daemon\fR
-Run in the background as a daemon and accept commands
-.TP
-\fB\-testnet\fR
-Use the test network
-.TP
-\fB\-rpcuser=\fR<user>
-Username for JSON\-RPC connections
-.TP
-\fB\-rpcpassword=\fR<pw>
-Password for JSON\-RPC connections
-.TP
-\fB\-rpcport=\fR<port>
-Listen for JSON\-RPC connections on <port>
-.TP
-\fB\-rpcallowip=\fR<ip>
-Allow JSON\-RPC connections from specified IP address
-.TP
-\fB\-rpcconnect=\fR<ip>
-Send commands to node running on <ip>
-.TP
\-?
-This help message
+List of possible options.
.SH COMMANDS
.TP
-\fBbackupwallet 'destination'\fR
-Safely copies *wallet.dat* to 'destination', which can be a directory or a path with filename.
-.TP
-\fBgetaccount 'bitcoinaddress'\fR
-DEPRECATED. Returns the account associated with the given address.
-.TP
-\fBsetaccount 'bitcoinaddress' ['account']\fR
-DEPRECATED. Sets the ['account'] associated with the given address. ['account'] may be omitted to remove an address from ['account'].
-.TP
-\fBgetaccountaddress 'account'\fR
-DEPRECATED. Returns a new bitcoin address for 'account'.
-.TP
-\fBgetaddressesbyaccount 'account'\fR
-DEPRECATED. Returns the list of addresses associated with the given 'account'.
-.TP
-\fBgetbalance 'account'\fR
-Returns the server's available balance, or the balance for 'account' (accounts are deprecated).
-.TP
-\fBgetblockcount\fR
-Returns the number of blocks in the longest block chain.
-.TP
-\fBgetblocknumber\fR
-Returns the block number of the latest block in the longest block chain.
-.TP
-\fBgetconnectioncount\fR
-Returns the number of connections to other nodes.
-.TP
-\fBgetdifficulty\fR
-Returns the proof-of-work difficulty as a multiple of the minimum difficulty.
-.TP
-\fBgetgenerate\fR
-Returns boolean true if server is trying to generate bitcoins, false otherwise.
-.TP
-\fBsetgenerate 'generate' ['genproclimit']\fR
-Generation is limited to ['genproclimit'] processors, \-1 is unlimited.
-.TP
-\fBgethashespersec\fR
-Returns a recent hashes per second performance measurement while generating.
-.TP
-\fBgetinfo\fR
-Returns an object containing server information.
-.TP
-\fBgetnewaddress 'account'\fR
-Returns a new bitcoin address for receiving payments. If 'account' is specified (deprecated), it is added to the address book so payments received with the address will be credited to 'account'.
-.TP
-\fBgetreceivedbyaccount 'account' ['minconf=1']\fR
-DEPRECATED. Returns the total amount received by addresses associated with 'account' in transactions with at least ['minconf'] confirmations.
-.TP
-\fBgetreceivedbyaddress 'bitcoinaddress' ['minconf=1']\fR
-Returns the total amount received by 'bitcoinaddress' in transactions with at least ['minconf'] confirmations.
-.TP
-\fBgettransaction 'txid'\fR
-Returns information about a specific transaction, given hexadecimal transaction ID.
-.TP
-\fBgetwork 'data'\fR
-If 'data' is specified, tries to solve the block and returns true if it was successful. If 'data' is not specified, returns formatted hash 'data' to work on:
+\fBhelp\fR
+List commands.
- "midstate" : precomputed hash state after hashing the first half of the data.
- "data" : block data.
- "hash1" : formatted hash buffer for second hash.
- "target" : little endian hash target.
.TP
\fBhelp 'command'\fR
-List commands, or get help for a command.
-.TP
-\fBlistaccounts ['minconf=1']\fR
-DEPRECATED. List accounts and their current balances.
- *note: requires bitcoin 0.3.20 or later.
-.TP
-\fBlistreceivedbyaccount ['minconf=1'] ['includeempty=false']\fR
-['minconf'] is the minimum number of confirmations before payments are included. ['includeempty'] whether to include addresses that haven't received any payments. Returns an array of objects containing:
-
- "account" : DEPRECATED. the account of the receiving address.
- "amount" : total amount received by the address.
- "confirmations" : number of confirmations of the most recent transaction included.
-.TP
-\fBlistreceivedbyaddress ['minconf=1'] ['includeempty=false']\fR
-['minconf'] is the minimum number of confirmations before payments are included. ['includeempty'] whether to include addresses that haven't received any payments. Returns an array of objects containing:
-
- "address" : receiving address.
- "account" : DEPRECATED. the account of the receiving address.
- "amount" : total amount received by the address.
- "confirmations" : number of confirmations of the most recent transaction included.
-.TP
-\fBlisttransactions 'account' ['count=10']\fR
-Returns a list of the last ['count'] transactions for 'account' \- for all accounts if 'account' is not specified or is "*". Each entry in the list may contain:
-
- "category" : will be generate, send, receive, or move.
- "amount" : amount of transaction.
- "fee" : Fee (if any) paid (only for send transactions).
- "confirmations" : number of confirmations (only for generate/send/receive).
- "txid" : transaction ID (only for generate/send/receive).
- "otheraccount" : account funds were moved to or from (only for move).
- "message" : message associated with transaction (only for send).
- "to" : message-to associated with transaction (only for send).
-
- *note: requires bitcoin 0.3.20 or later.
-.TP
-\fBmove <'fromaccount'> <'toaccount'> <'amount'> ['minconf=1'] ['comment']\fR
-DEPRECATED. Moves funds between accounts.
-.TP
-\fBsendfrom* <'account'> <'bitcoinaddress'> <'amount'> ['minconf=1'] ['comment'] ['comment-to']\fR
-DEPRECATED. Sends amount from account's balance to 'bitcoinaddress'. This method will fail if there is less than amount bitcoins with ['minconf'] confirmations in the account's balance (unless account is the empty-string-named default account; it behaves like the *sendtoaddress* method). Returns transaction ID on success.
-.TP
-\fBsendtoaddress 'bitcoinaddress' 'amount' ['comment'] ['comment-to']\fR
-Sends amount from the server's available balance to 'bitcoinaddress'. amount is a real and is rounded to the nearest 0.01. Returns transaction id on success.
-.TP
-\fBstop\fR
-Stops the bitcoin server.
-.TP
-\fBvalidateaddress 'bitcoinaddress'\fR
-Checks that 'bitcoinaddress' looks like a proper bitcoin address. Returns an object containing:
-
- "isvalid" : true or false.
- "ismine" : true if the address is in the server's wallet.
- "address" : bitcoinaddress.
-
- *note: ismine and address are only returned if the address is valid.
+Get help for a command.
.SH "SEE ALSO"
bitcoin.conf(5)
diff --git a/contrib/devtools/README.md b/contrib/devtools/README.md
index 1647d3ee3b..fcb2275fc9 100644
--- a/contrib/devtools/README.md
+++ b/contrib/devtools/README.md
@@ -13,20 +13,32 @@ clang-format.py
A script to format cpp source code according to [.clang-format](../../src/.clang-format). This should only be applied to new files or files which are currently not actively developed on. Also, git subtrees are not subject to formatting.
+clang-format-diff.py
+===================
+
+A script to format unified git diffs according to [.clang-format](../../src/.clang-format).
+
+For instance, to format the last commit with 0 lines of context,
+the script should be called from the git root folder as follows.
+
+```
+git diff -U0 HEAD~1.. | ./contrib/devtools/clang-format-diff.py -p1 -i -v
+```
+
fix-copyright-headers.py
========================
Every year newly updated files need to have its copyright headers updated to reflect the current year.
-If you run this script from src/ it will automatically update the year on the copyright header for all
-.cpp and .h files if these have a git commit from the current year.
+If you run this script from the root folder it will automatically update the year on the copyright header for all
+source files if these have a git commit from the current year.
-For example a file changed in 2014 (with 2014 being the current year):
+For example a file changed in 2015 (with 2015 being the current year):
```// Copyright (c) 2009-2013 The Bitcoin Core developers```
would be changed to:
-```// Copyright (c) 2009-2014 The Bitcoin Core developers```
+```// Copyright (c) 2009-2015 The Bitcoin Core developers```
git-subtree-check.sh
====================
diff --git a/contrib/devtools/clang-format-diff.py b/contrib/devtools/clang-format-diff.py
new file mode 100755
index 0000000000..13d2573b9f
--- /dev/null
+++ b/contrib/devtools/clang-format-diff.py
@@ -0,0 +1,164 @@
+#!/usr/bin/env python
+#
+#===- clang-format-diff.py - ClangFormat Diff Reformatter ----*- python -*--===#
+#
+# The LLVM Compiler Infrastructure
+#
+# This file is distributed under the University of Illinois Open Source
+# License.
+#
+# ============================================================
+#
+# University of Illinois/NCSA
+# Open Source License
+#
+# Copyright (c) 2007-2015 University of Illinois at Urbana-Champaign.
+# All rights reserved.
+#
+# Developed by:
+#
+# LLVM Team
+#
+# University of Illinois at Urbana-Champaign
+#
+# http://llvm.org
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy of
+# this software and associated documentation files (the "Software"), to deal with
+# the Software without restriction, including without limitation the rights to
+# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+# of the Software, and to permit persons to whom the Software is furnished to do
+# so, subject to the following conditions:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimers.
+#
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimers in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of the LLVM Team, University of Illinois at
+# Urbana-Champaign, nor the names of its contributors may be used to
+# endorse or promote products derived from this Software without specific
+# prior written permission.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
+# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE
+# SOFTWARE.
+#
+# ============================================================
+#
+#===------------------------------------------------------------------------===#
+
+r"""
+ClangFormat Diff Reformatter
+============================
+
+This script reads input from a unified diff and reformats all the changed
+lines. This is useful to reformat all the lines touched by a specific patch.
+Example usage for git/svn users:
+
+ git diff -U0 HEAD^ | clang-format-diff.py -p1 -i
+ svn diff --diff-cmd=diff -x-U0 | clang-format-diff.py -i
+
+"""
+
+import argparse
+import difflib
+import re
+import string
+import subprocess
+import StringIO
+import sys
+
+
+# Change this to the full path if clang-format is not on the path.
+binary = 'clang-format'
+
+
+def main():
+ parser = argparse.ArgumentParser(description=
+ 'Reformat changed lines in diff. Without -i '
+ 'option just output the diff that would be '
+ 'introduced.')
+ parser.add_argument('-i', action='store_true', default=False,
+ help='apply edits to files instead of displaying a diff')
+ parser.add_argument('-p', metavar='NUM', default=0,
+ help='strip the smallest prefix containing P slashes')
+ parser.add_argument('-regex', metavar='PATTERN', default=None,
+ help='custom pattern selecting file paths to reformat '
+ '(case sensitive, overrides -iregex)')
+ parser.add_argument('-iregex', metavar='PATTERN', default=
+ r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc|js|ts|proto'
+ r'|protodevel|java)',
+ help='custom pattern selecting file paths to reformat '
+ '(case insensitive, overridden by -regex)')
+ parser.add_argument('-sort-includes', action='store_true', default=False,
+ help='let clang-format sort include blocks')
+ parser.add_argument('-v', '--verbose', action='store_true',
+ help='be more verbose, ineffective without -i')
+ args = parser.parse_args()
+
+ # Extract changed lines for each file.
+ filename = None
+ lines_by_file = {}
+ for line in sys.stdin:
+ match = re.search('^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line)
+ if match:
+ filename = match.group(2)
+ if filename == None:
+ continue
+
+ if args.regex is not None:
+ if not re.match('^%s$' % args.regex, filename):
+ continue
+ else:
+ if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
+ continue
+
+ match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
+ if match:
+ start_line = int(match.group(1))
+ line_count = 1
+ if match.group(3):
+ line_count = int(match.group(3))
+ if line_count == 0:
+ continue
+ end_line = start_line + line_count - 1;
+ lines_by_file.setdefault(filename, []).extend(
+ ['-lines', str(start_line) + ':' + str(end_line)])
+
+ # Reformat files containing changes in place.
+ for filename, lines in lines_by_file.iteritems():
+ if args.i and args.verbose:
+ print 'Formatting', filename
+ command = [binary, filename]
+ if args.i:
+ command.append('-i')
+ if args.sort_includes:
+ command.append('-sort-includes')
+ command.extend(lines)
+ command.extend(['-style=file', '-fallback-style=none'])
+ p = subprocess.Popen(command, stdout=subprocess.PIPE,
+ stderr=None, stdin=subprocess.PIPE)
+ stdout, stderr = p.communicate()
+ if p.returncode != 0:
+ sys.exit(p.returncode);
+
+ if not args.i:
+ with open(filename) as f:
+ code = f.readlines()
+ formatted_code = StringIO.StringIO(stdout).readlines()
+ diff = difflib.unified_diff(code, formatted_code,
+ filename, filename,
+ '(before formatting)', '(after formatting)')
+ diff_string = string.join(diff, '')
+ if len(diff_string) > 0:
+ sys.stdout.write(diff_string)
+
+if __name__ == '__main__':
+ main()
diff --git a/contrib/devtools/fix-copyright-headers.py b/contrib/devtools/fix-copyright-headers.py
index 5e84952548..b6414a551f 100755
--- a/contrib/devtools/fix-copyright-headers.py
+++ b/contrib/devtools/fix-copyright-headers.py
@@ -1,53 +1,46 @@
#!/usr/bin/env python
'''
-Run this script inside of src/ and it will look for all the files
-that were changed this year that still have the last year in the
-copyright headers, and it will fix the headers on that file using
-a perl regex one liner.
+Run this script to update all the copyright headers of files
+that were changed this year.
-For example: if it finds something like this and we're in 2014
+For example:
-// Copyright (c) 2009-2013 The Bitcoin Core developers
+// Copyright (c) 2009-2012 The Bitcoin Core developers
it will change it to
-// Copyright (c) 2009-2014 The Bitcoin Core developers
-
-It will do this for all the files in the folder and its children.
-
-Author: @gubatron
+// Copyright (c) 2009-2015 The Bitcoin Core developers
'''
import os
import time
+import re
year = time.gmtime()[0]
-last_year = year - 1
-command = "perl -pi -e 's/%s The Bitcoin/%s The Bitcoin/' %s"
-listFilesCommand = "find . | grep %s"
-
-extensions = [".cpp",".h"]
-
-def getLastGitModifiedDate(filePath):
- gitGetLastCommitDateCommand = "git log " + filePath +" | grep Date | head -n 1"
- p = os.popen(gitGetLastCommitDateCommand)
- result = ""
- for l in p:
- result = l
- break
- result = result.replace("\n","")
- return result
+CMD_GIT_DATE = 'git log --format=@%%at -1 %s | date +"%%Y" -u -f -'
+CMD_REGEX= "perl -pi -e 's/(20\d\d)(?:-20\d\d)? The Bitcoin/$1-%s The Bitcoin/' %s"
+REGEX_CURRENT= re.compile("%s The Bitcoin" % year)
+CMD_LIST_FILES= "find %s | grep %s"
-n=1
-for extension in extensions:
- foundFiles = os.popen(listFilesCommand % extension)
- for filePath in foundFiles:
- filePath = filePath[1:-1]
- if filePath.endswith(extension):
- filePath = os.getcwd() + filePath
- modifiedTime = getLastGitModifiedDate(filePath)
- if len(modifiedTime) > 0 and str(year) in modifiedTime:
- print n,"Last Git Modified: ", modifiedTime, " - ", filePath
- os.popen(command % (last_year,year,filePath))
- n = n + 1
+FOLDERS = ["./qa", "./src"]
+EXTENSIONS = [".cpp",".h", ".py"]
+def get_git_date(file_path):
+ r = os.popen(CMD_GIT_DATE % file_path)
+ for l in r:
+ # Result is one line, so just return
+ return l.replace("\n","")
+ return ""
+n=1
+for folder in FOLDERS:
+ for extension in EXTENSIONS:
+ for file_path in os.popen(CMD_LIST_FILES % (folder, extension)):
+ file_path = os.getcwd() + file_path[1:-1]
+ if file_path.endswith(extension):
+ git_date = get_git_date(file_path)
+ if str(year) == git_date:
+ # Only update if current year is not found
+ if REGEX_CURRENT.search(open(file_path, "r").read()) is None:
+ print n,"Last git edit", git_date, "-", file_path
+ os.popen(CMD_REGEX % (year,file_path))
+ n = n + 1
diff --git a/contrib/devtools/security-check.py b/contrib/devtools/security-check.py
index e96eaa9c38..fe5dc9ad89 100755
--- a/contrib/devtools/security-check.py
+++ b/contrib/devtools/security-check.py
@@ -1,7 +1,7 @@
#!/usr/bin/python2
'''
Perform basic ELF security checks on a series of executables.
-Exit status will be 0 if succesful, and the program will be silent.
+Exit status will be 0 if successful, and the program will be silent.
Otherwise the exit status will be 1 and it will log which executables failed which checks.
Needs `readelf` (for ELF) and `objdump` (for PE).
'''
diff --git a/contrib/devtools/update-translations.py b/contrib/devtools/update-translations.py
index ea209eec7e..2b6e807b47 100755
--- a/contrib/devtools/update-translations.py
+++ b/contrib/devtools/update-translations.py
@@ -72,7 +72,7 @@ def sanitize_string(s):
'''Sanitize string for printing'''
return s.replace('\n',' ')
-def check_format_specifiers(source, translation, errors):
+def check_format_specifiers(source, translation, errors, numerus):
source_f = split_format_specifiers(find_format_specifiers(source))
# assert that no source messages contain both Qt and strprintf format specifiers
# if this fails, go change the source as this is hacky and confusing!
@@ -80,10 +80,13 @@ def check_format_specifiers(source, translation, errors):
try:
translation_f = split_format_specifiers(find_format_specifiers(translation))
except IndexError:
- errors.append("Parse error in translation '%s'" % sanitize_string(translation))
+ errors.append("Parse error in translation for '%s': '%s'" % (sanitize_string(source), sanitize_string(translation)))
return False
else:
if source_f != translation_f:
+ if numerus and source_f == (set(), ['n']) and translation_f == (set(), []) and translation.find('%') == -1:
+ # Allow numerus translations to omit %n specifier (usually when it only has one possible value)
+ return True
errors.append("Mismatch between '%s' and '%s'" % (sanitize_string(source), sanitize_string(translation)))
return False
return True
@@ -150,7 +153,7 @@ def postprocess_translations(reduce_diff_hacks=False):
if translation is None:
continue
errors = []
- valid = check_format_specifiers(source, translation, errors)
+ valid = check_format_specifiers(source, translation, errors, numerus)
for error in errors:
print('%s: %s' % (filename, error))
diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml
index 0c3c439dd9..ee852ff138 100644
--- a/contrib/gitian-descriptors/gitian-linux.yml
+++ b/contrib/gitian-descriptors/gitian-linux.yml
@@ -1,5 +1,5 @@
---
-name: "bitcoin-linux-0.12"
+name: "bitcoin-linux-0.13"
enable_cache: true
suites:
- "trusty"
@@ -15,7 +15,7 @@ packages:
- "faketime"
- "bsdmainutils"
- "binutils-gold"
-reference_datetime: "2015-06-01 00:00:00"
+reference_datetime: "2016-01-01 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin"
diff --git a/contrib/gitian-descriptors/gitian-osx-signer.yml b/contrib/gitian-descriptors/gitian-osx-signer.yml
index aa9494b7ed..4c4e3ff827 100644
--- a/contrib/gitian-descriptors/gitian-osx-signer.yml
+++ b/contrib/gitian-descriptors/gitian-osx-signer.yml
@@ -5,9 +5,8 @@ suites:
architectures:
- "amd64"
packages:
-- "libc6:i386"
- "faketime"
-reference_datetime: "2015-06-01 00:00:00"
+reference_datetime: "2016-01-01 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin-detached-sigs.git"
"dir": "signature"
diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml
index 9ac774c8a0..7e40803a07 100644
--- a/contrib/gitian-descriptors/gitian-osx.yml
+++ b/contrib/gitian-descriptors/gitian-osx.yml
@@ -1,5 +1,5 @@
---
-name: "bitcoin-osx-0.12"
+name: "bitcoin-osx-0.13"
enable_cache: true
suites:
- "trusty"
@@ -18,7 +18,7 @@ packages:
- "libcap-dev"
- "libz-dev"
- "libbz2-dev"
-reference_datetime: "2015-06-01 00:00:00"
+reference_datetime: "2016-01-01 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin"
diff --git a/contrib/gitian-descriptors/gitian-win-signer.yml b/contrib/gitian-descriptors/gitian-win-signer.yml
index a29d7ab472..27c4f01eb4 100644
--- a/contrib/gitian-descriptors/gitian-win-signer.yml
+++ b/contrib/gitian-descriptors/gitian-win-signer.yml
@@ -7,7 +7,7 @@ architectures:
packages:
- "libssl-dev"
- "autoconf"
-reference_datetime: "2015-06-01 00:00:00"
+reference_datetime: "2016-01-01 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin-detached-sigs.git"
"dir": "signature"
diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml
index 6bb482d45f..c8fbe32eee 100644
--- a/contrib/gitian-descriptors/gitian-win.yml
+++ b/contrib/gitian-descriptors/gitian-win.yml
@@ -1,5 +1,5 @@
---
-name: "bitcoin-win-0.12"
+name: "bitcoin-win-0.13"
enable_cache: true
suites:
- "trusty"
@@ -18,7 +18,7 @@ packages:
- "g++-mingw-w64"
- "nsis"
- "zip"
-reference_datetime: "2015-06-01 00:00:00"
+reference_datetime: "2016-01-01 00:00:00"
remotes:
- "url": "https://github.com/bitcoin/bitcoin.git"
"dir": "bitcoin"