From 30c58cf4caab89257d8f3f9f14d06b542227cf7a Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Mon, 18 Mar 2019 02:03:42 -0400 Subject: ob-genchanges: set -u and declare local variables --- (limited to 'src/ob-genchanges.sh') diff --git a/src/ob-genchanges.sh b/src/ob-genchanges.sh index 0102805..38603d3 100644 --- a/src/ob-genchanges.sh +++ b/src/ob-genchanges.sh @@ -1,4 +1,4 @@ -# Generates a changes file to describe binary packages and their changes +# Generate a changes file to describe binary packages and their changes # # Copyright (C) 2013 Patrick McDermott # @@ -17,13 +17,16 @@ # You should have received a copy of the GNU General Public License # along with opkbuild. If not, see . -set -e +set -eu write_changes() { - version="${1}" - arch="${2}" - plat="${3}" + local version="${1}" + local arch="${2}" + local plat="${3}" + shift 3 + local pkg= + local desc= printf 'Format: 1.0\n' >&3 @@ -57,6 +60,8 @@ write_changes() write_files_src() { + local file= + printf 'Files:\n' >&3 file="src-${OPK_SOURCE}_${OPK_SOURCE_VERSION}_src_all.opk" printf ' %s %s %s\n' \ @@ -68,6 +73,11 @@ write_files_src() write_files_bin() { + local pkg= + local arch= + local plat= + local file= + printf 'Files:\n' >&3 for pkg in ${OPK_PACKAGES_REDUCED}; do arch="$(ob_get_binary_parameter "${pkg}" 'Architecture')" @@ -85,6 +95,8 @@ write_files_bin() main() { + local changes= + if ! ob_set_text_domain 'opkbuild'; then printf '%s: Error: Failed to load locale messages\n' \ "${0##*/}" >&2 -- cgit v0.9.1