diff --git a/contrib/release/debian-packages.sh b/contrib/release/debian-packages.sh --- a/contrib/release/debian-packages.sh +++ b/contrib/release/debian-packages.sh @@ -4,6 +4,14 @@ set -euo pipefail +DEFAULT_DISTROS=() +# Bionic: Ubuntu 18.04 LTS +DEFAULT_DISTROS+=("bionic") +# Eoan: Ubuntu 19.10 +DEFAULT_DISTROS+=("eoan") +# Focal: Ubuntu 20.04 LTS +DEFAULT_DISTROS+=("focal") + DEFAULT_PPA="bitcoin-abc" DPUT_CONFIG_FILE=~/".dput.cf" TOPLEVEL="$(git rev-parse --show-toplevel)" @@ -23,6 +31,8 @@ Note: This script will prompt you to sign with your PGP key. -d, --dry-run Build and sign the packages, but do not push them to the PPA. +-D, --distro Name of the distribution to package for. Can be supplied multiple times. + If supplied at least once, the defaults are ignored. Defaults to: '${DEFAULT_DISTROS[@]}' -h, --help Display this help message. -p, --ppa PPA hostname. Defaults to: '${DEFAULT_PPA}'. If no config file exists at ${DPUT_CONFIG_FILE} then one will be created using '${DEFAULT_PPA}'. Setting this option to a hostname other than @@ -34,6 +44,7 @@ EOF } +DISTROS=() DRY_RUN="false" NUM_EXPECTED_ARGUMENTS=1 PACKAGE_VERSION="" @@ -46,6 +57,11 @@ DRY_RUN="true" shift # shift past argument ;; + -D|--distro) + DISTROS+=("$2") + shift # shift past argument + shift # shift past value + ;; -h|--help) help_message exit 0 @@ -94,6 +110,11 @@ exit 20 fi +# If no distributions are explicitly set, use the defaults +if [ "${#DISTROS[@]}" == 0 ]; then + DISTROS=("${DEFAULT_DISTROS[@]}") +fi + SIGNER_FINGERPRINT=$(grep "$1" "${KEYS_TXT}" | cut -d' ' -f 1) || { echo "Error: Signer '$1' does not match any line in '${KEYS_TXT}'" exit 21 @@ -184,11 +205,7 @@ fi } -# Bionic: Ubuntu 18.04 LTS -package "bionic" -# Eoan: Ubuntu 19.10 -package "eoan" -# Focal: Ubuntu 20.04 LTS -package "focal" - +for DISTRO in "${DISTROS[@]}"; do + package "${DISTRO}" +done popd